Calcoli approssimati con R:
```
# Caricando il file:
source("http://macosa.dima.unige.it/r.R")
# basta fare:
x <- c(3.1, 3.2); y <- c(4.6, 4.7)
z <- approssima(x,y, "*"); z
[1] min   [2] max
[1] 14.26     15.04
w <- c(5.4,5.5)
approssima(z,w, "*")
[1] min   [2] max
[1] 77.004    82.720
approssima2(z,w, "*")
[1] centro   [2] raggio
[1] 79.862       2.858
# Che posso arrotondare a 80±3

# Senza caricare il file:
x1 <- 3.1; x2 <- 3.2; y1 <- 4.6; y2 <- 4.7
p1 <- min(x1*y1,x1*y2,x2*y1,x2*y2)
p2 <- max(x1*y1,x1*y2,x2*y1,x2*y2)
c(p1,p2); p2-p1
[1] 14.26 15.04
[1] 0.78
x1 <- p1; x2 <- p2; y1 <- 5.4; y2 <- 5.5
p1 <- min(x1*y1,x1*y2,x2*y1,x2*y2)
p2 <- max(x1*y1,x1*y2,x2*y1,x2*y2)
c(p1,p2); p2-p1
[1] 77.004 82.720
[1] 5.716
# ovvero:
x1 <- 3.1; x2 <- 3.2; y1 <- 4.6; y2 <- 4.7
C <- function(x,y) x*y   # per un'altra operazione cambio solo questo
Op <- c(C(x1,y1),C(x1,y2),C(x2,y1),C(x2,y2)); m <- min(Op); M <- max(Op)
c(m, M, M-m);  c(m+(M-m)/2, (M-m)/2)
[1] 14.26 15.04   0.78
[1] 14.65  0.39
x1 <- m; x2 <- M; y1 <- 5.4; y2 <- 5.5
Op <- c(C(x1,y1),C(x1,y2),C(x2,y1),C(x2,y2)); m <- min(Op); M <- max(Op)
c(m, M, M-m);  c(m+(M-m)/2, (M-m)/2)
[1] 77.004 82.720  5.716
[1] 79.862  2.858  # 80 ± 3, che va da 77 a 83
# ovvero:
xx <- c(3.1,3.2); yy <- c(4.6,4.7)
pr1 <- min(xx[1]*yy[1],xx[1]*yy[2],xx[2]*yy[1],xx[2]*yy[2])
pr2 <- max(xx[1]*yy[1],xx[1]*yy[2],xx[2]*yy[1],xx[2]*yy[2])
xx <- c(pr1,pr2); yy <- c(5.4,5.5)
pr1 <- min(xx[1]*yy[1],xx[1]*yy[2],xx[2]*yy[1],xx[2]*yy[2])
pr2 <- max(xx[1]*yy[1],xx[1]*yy[2],xx[2]*yy[1],xx[2]*yy[2])
c(pr1,pr2)
[1] 77.004 82.720```