double code(double x, double y, double z) {
double t_0 = (x * (y - z)) / y;
double t_1 = x - (z / (y / x));
double tmp;
if (t_0 <= -5e+305) {
tmp = t_1;
} else if (t_0 <= -1e-92) {
tmp = t_0;
} else if (t_0 <= 1e-249) {
tmp = t_1;
} else if (t_0 <= 1e+295) {
tmp = t_0;
} else {
tmp = x - (z * (x / y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * (y - z)) / y
end function
↓
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x * (y - z)) / y
t_1 = x - (z / (y / x))
if (t_0 <= (-5d+305)) then
tmp = t_1
else if (t_0 <= (-1d-92)) then
tmp = t_0
else if (t_0 <= 1d-249) then
tmp = t_1
else if (t_0 <= 1d+295) then
tmp = t_0
else
tmp = x - (z * (x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
return (x * (y - z)) / y;
}
↓
public static double code(double x, double y, double z) {
double t_0 = (x * (y - z)) / y;
double t_1 = x - (z / (y / x));
double tmp;
if (t_0 <= -5e+305) {
tmp = t_1;
} else if (t_0 <= -1e-92) {
tmp = t_0;
} else if (t_0 <= 1e-249) {
tmp = t_1;
} else if (t_0 <= 1e+295) {
tmp = t_0;
} else {
tmp = x - (z * (x / y));
}
return tmp;
}
def code(x, y, z):
return (x * (y - z)) / y
↓
def code(x, y, z):
t_0 = (x * (y - z)) / y
t_1 = x - (z / (y / x))
tmp = 0
if t_0 <= -5e+305:
tmp = t_1
elif t_0 <= -1e-92:
tmp = t_0
elif t_0 <= 1e-249:
tmp = t_1
elif t_0 <= 1e+295:
tmp = t_0
else:
tmp = x - (z * (x / y))
return tmp
function code(x, y, z)
return Float64(Float64(x * Float64(y - z)) / y)
end
if (/.f64 (*.f64 x (-.f64 y z)) y) < -5.00000000000000009e305 or -9.99999999999999988e-93 < (/.f64 (*.f64 x (-.f64 y z)) y) < 1.00000000000000005e-249
Initial program 29.2
\[\frac{x \cdot \left(y - z\right)}{y}
\]
Simplified2.7
\[\leadsto \color{blue}{x - z \cdot \frac{x}{y}}
\]
Proof
(-.f64 x (*.f64 z (/.f64 x y))): 0 points increase in error, 0 points decrease in error
(-.f64 (Rewrite<= *-lft-identity_binary64 (*.f64 1 x)) (*.f64 z (/.f64 x y))): 0 points increase in error, 0 points decrease in error
(-.f64 (*.f64 (Rewrite<= *-inverses_binary64 (/.f64 y y)) x) (*.f64 z (/.f64 x y))): 0 points increase in error, 0 points decrease in error
(-.f64 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 y x) y)) (*.f64 z (/.f64 x y))): 57 points increase in error, 0 points decrease in error
(-.f64 (Rewrite<= associate-*r/_binary64 (*.f64 y (/.f64 x y))) (*.f64 z (/.f64 x y))): 34 points increase in error, 52 points decrease in error
(Rewrite=> distribute-rgt-out--_binary64 (*.f64 (/.f64 x y) (-.f64 y z))): 5 points increase in error, 1 points decrease in error
(Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 x (-.f64 y z)) y)): 74 points increase in error, 72 points decrease in error
Applied egg-rr2.8
\[\leadsto x - \color{blue}{\frac{z}{\frac{y}{x}}}
\]
if -5.00000000000000009e305 < (/.f64 (*.f64 x (-.f64 y z)) y) < -9.99999999999999988e-93 or 1.00000000000000005e-249 < (/.f64 (*.f64 x (-.f64 y z)) y) < 9.9999999999999998e294
Initial program 0.3
\[\frac{x \cdot \left(y - z\right)}{y}
\]
if 9.9999999999999998e294 < (/.f64 (*.f64 x (-.f64 y z)) y)
Initial program 57.8
\[\frac{x \cdot \left(y - z\right)}{y}
\]
Simplified3.3
\[\leadsto \color{blue}{x - z \cdot \frac{x}{y}}
\]
Proof
(-.f64 x (*.f64 z (/.f64 x y))): 0 points increase in error, 0 points decrease in error
(-.f64 (Rewrite<= *-lft-identity_binary64 (*.f64 1 x)) (*.f64 z (/.f64 x y))): 0 points increase in error, 0 points decrease in error
(-.f64 (*.f64 (Rewrite<= *-inverses_binary64 (/.f64 y y)) x) (*.f64 z (/.f64 x y))): 0 points increase in error, 0 points decrease in error
(-.f64 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 y x) y)) (*.f64 z (/.f64 x y))): 57 points increase in error, 0 points decrease in error
(-.f64 (Rewrite<= associate-*r/_binary64 (*.f64 y (/.f64 x y))) (*.f64 z (/.f64 x y))): 34 points increase in error, 52 points decrease in error
(Rewrite=> distribute-rgt-out--_binary64 (*.f64 (/.f64 x y) (-.f64 y z))): 5 points increase in error, 1 points decrease in error
(Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 x (-.f64 y z)) y)): 74 points increase in error, 72 points decrease in error
herbie shell --seed 2022308
(FPCore (x y z)
:name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
:precision binary64
:herbie-target
(if (< z -2.060202331921739e+104) (- x (/ (* z x) y)) (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y))))
(/ (* x (- y z)) y))