
(FPCore (x y z) :precision binary64 (/ (+ x y) (- 1.0 (/ y z))))
double code(double x, double y, double z) {
return (x + y) / (1.0 - (y / z));
}
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) / (1.0d0 - (y / z))
end function
public static double code(double x, double y, double z) {
return (x + y) / (1.0 - (y / z));
}
def code(x, y, z): return (x + y) / (1.0 - (y / z))
function code(x, y, z) return Float64(Float64(x + y) / Float64(1.0 - Float64(y / z))) end
function tmp = code(x, y, z) tmp = (x + y) / (1.0 - (y / z)); end
code[x_, y_, z_] := N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y}{1 - \frac{y}{z}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (+ x y) (- 1.0 (/ y z))))
double code(double x, double y, double z) {
return (x + y) / (1.0 - (y / z));
}
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) / (1.0d0 - (y / z))
end function
public static double code(double x, double y, double z) {
return (x + y) / (1.0 - (y / z));
}
def code(x, y, z): return (x + y) / (1.0 - (y / z))
function code(x, y, z) return Float64(Float64(x + y) / Float64(1.0 - Float64(y / z))) end
function tmp = code(x, y, z) tmp = (x + y) / (1.0 - (y / z)); end
code[x_, y_, z_] := N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y}{1 - \frac{y}{z}}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))) (t_1 (/ (+ x y) t_0)))
(if (or (<= t_1 -2e-278) (not (<= t_1 0.0)))
(+ (/ y t_0) (/ x t_0))
(/ z (/ y (- (+ x y)))))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = (x + y) / t_0;
double tmp;
if ((t_1 <= -2e-278) || !(t_1 <= 0.0)) {
tmp = (y / t_0) + (x / t_0);
} else {
tmp = z / (y / -(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
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - (y / z)
t_1 = (x + y) / t_0
if ((t_1 <= (-2d-278)) .or. (.not. (t_1 <= 0.0d0))) then
tmp = (y / t_0) + (x / t_0)
else
tmp = z / (y / -(x + y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = (x + y) / t_0;
double tmp;
if ((t_1 <= -2e-278) || !(t_1 <= 0.0)) {
tmp = (y / t_0) + (x / t_0);
} else {
tmp = z / (y / -(x + y));
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) t_1 = (x + y) / t_0 tmp = 0 if (t_1 <= -2e-278) or not (t_1 <= 0.0): tmp = (y / t_0) + (x / t_0) else: tmp = z / (y / -(x + y)) return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) t_1 = Float64(Float64(x + y) / t_0) tmp = 0.0 if ((t_1 <= -2e-278) || !(t_1 <= 0.0)) tmp = Float64(Float64(y / t_0) + Float64(x / t_0)); else tmp = Float64(z / Float64(y / Float64(-Float64(x + y)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); t_1 = (x + y) / t_0; tmp = 0.0; if ((t_1 <= -2e-278) || ~((t_1 <= 0.0))) tmp = (y / t_0) + (x / t_0); else tmp = z / (y / -(x + y)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e-278], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(y / t$95$0), $MachinePrecision] + N[(x / t$95$0), $MachinePrecision]), $MachinePrecision], N[(z / N[(y / (-N[(x + y), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
t_1 := \frac{x + y}{t\_0}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-278} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;\frac{y}{t\_0} + \frac{x}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{y}{-\left(x + y\right)}}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -1.99999999999999988e-278 or 0.0 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) Initial program 99.8%
Taylor expanded in x around 0 99.8%
+-commutative99.8%
Simplified99.8%
if -1.99999999999999988e-278 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < 0.0Initial program 12.1%
Taylor expanded in z around 0 95.3%
mul-1-neg95.3%
associate-/l*100.0%
distribute-rgt-neg-in100.0%
distribute-neg-frac2100.0%
+-commutative100.0%
Simplified100.0%
associate-*r/95.3%
distribute-frac-neg295.3%
add-sqr-sqrt53.7%
sqrt-unprod23.7%
sqr-neg23.7%
sqrt-unprod2.0%
add-sqr-sqrt5.4%
associate-*r/5.4%
clear-num5.4%
un-div-inv5.4%
add-sqr-sqrt2.0%
sqrt-unprod28.3%
sqr-neg28.3%
sqrt-unprod58.2%
add-sqr-sqrt100.0%
Applied egg-rr100.0%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))) (t_1 (/ x t_0)) (t_2 (/ y t_0)))
(if (<= y -1.3e+197)
(- z)
(if (<= y -2.7e+41)
t_2
(if (<= y -2.5e-146)
t_1
(if (<= y -8.5e-197)
(+ x y)
(if (<= y -1.35e-259)
t_1
(if (<= y 1.3e+32)
(+ x y)
(if (<= y 2.15e+61) t_2 (if (<= y 1.05e+65) t_1 (- z)))))))))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = x / t_0;
double t_2 = y / t_0;
double tmp;
if (y <= -1.3e+197) {
tmp = -z;
} else if (y <= -2.7e+41) {
tmp = t_2;
} else if (y <= -2.5e-146) {
tmp = t_1;
} else if (y <= -8.5e-197) {
tmp = x + y;
} else if (y <= -1.35e-259) {
tmp = t_1;
} else if (y <= 1.3e+32) {
tmp = x + y;
} else if (y <= 2.15e+61) {
tmp = t_2;
} else if (y <= 1.05e+65) {
tmp = t_1;
} else {
tmp = -z;
}
return tmp;
}
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) :: t_2
real(8) :: tmp
t_0 = 1.0d0 - (y / z)
t_1 = x / t_0
t_2 = y / t_0
if (y <= (-1.3d+197)) then
tmp = -z
else if (y <= (-2.7d+41)) then
tmp = t_2
else if (y <= (-2.5d-146)) then
tmp = t_1
else if (y <= (-8.5d-197)) then
tmp = x + y
else if (y <= (-1.35d-259)) then
tmp = t_1
else if (y <= 1.3d+32) then
tmp = x + y
else if (y <= 2.15d+61) then
tmp = t_2
else if (y <= 1.05d+65) then
tmp = t_1
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = x / t_0;
double t_2 = y / t_0;
double tmp;
if (y <= -1.3e+197) {
tmp = -z;
} else if (y <= -2.7e+41) {
tmp = t_2;
} else if (y <= -2.5e-146) {
tmp = t_1;
} else if (y <= -8.5e-197) {
tmp = x + y;
} else if (y <= -1.35e-259) {
tmp = t_1;
} else if (y <= 1.3e+32) {
tmp = x + y;
} else if (y <= 2.15e+61) {
tmp = t_2;
} else if (y <= 1.05e+65) {
tmp = t_1;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) t_1 = x / t_0 t_2 = y / t_0 tmp = 0 if y <= -1.3e+197: tmp = -z elif y <= -2.7e+41: tmp = t_2 elif y <= -2.5e-146: tmp = t_1 elif y <= -8.5e-197: tmp = x + y elif y <= -1.35e-259: tmp = t_1 elif y <= 1.3e+32: tmp = x + y elif y <= 2.15e+61: tmp = t_2 elif y <= 1.05e+65: tmp = t_1 else: tmp = -z return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) t_1 = Float64(x / t_0) t_2 = Float64(y / t_0) tmp = 0.0 if (y <= -1.3e+197) tmp = Float64(-z); elseif (y <= -2.7e+41) tmp = t_2; elseif (y <= -2.5e-146) tmp = t_1; elseif (y <= -8.5e-197) tmp = Float64(x + y); elseif (y <= -1.35e-259) tmp = t_1; elseif (y <= 1.3e+32) tmp = Float64(x + y); elseif (y <= 2.15e+61) tmp = t_2; elseif (y <= 1.05e+65) tmp = t_1; else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); t_1 = x / t_0; t_2 = y / t_0; tmp = 0.0; if (y <= -1.3e+197) tmp = -z; elseif (y <= -2.7e+41) tmp = t_2; elseif (y <= -2.5e-146) tmp = t_1; elseif (y <= -8.5e-197) tmp = x + y; elseif (y <= -1.35e-259) tmp = t_1; elseif (y <= 1.3e+32) tmp = x + y; elseif (y <= 2.15e+61) tmp = t_2; elseif (y <= 1.05e+65) tmp = t_1; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(y / t$95$0), $MachinePrecision]}, If[LessEqual[y, -1.3e+197], (-z), If[LessEqual[y, -2.7e+41], t$95$2, If[LessEqual[y, -2.5e-146], t$95$1, If[LessEqual[y, -8.5e-197], N[(x + y), $MachinePrecision], If[LessEqual[y, -1.35e-259], t$95$1, If[LessEqual[y, 1.3e+32], N[(x + y), $MachinePrecision], If[LessEqual[y, 2.15e+61], t$95$2, If[LessEqual[y, 1.05e+65], t$95$1, (-z)]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
t_1 := \frac{x}{t\_0}\\
t_2 := \frac{y}{t\_0}\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{+197}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -2.7 \cdot 10^{+41}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -8.5 \cdot 10^{-197}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-259}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+32}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{+61}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -1.29999999999999994e197 or 1.04999999999999996e65 < y Initial program 64.0%
Taylor expanded in y around inf 74.0%
mul-1-neg74.0%
Simplified74.0%
if -1.29999999999999994e197 < y < -2.7e41 or 1.3000000000000001e32 < y < 2.1500000000000001e61Initial program 89.2%
Taylor expanded in x around 0 68.6%
if -2.7e41 < y < -2.49999999999999979e-146 or -8.5e-197 < y < -1.34999999999999992e-259 or 2.1500000000000001e61 < y < 1.04999999999999996e65Initial program 98.4%
Taylor expanded in x around inf 79.4%
if -2.49999999999999979e-146 < y < -8.5e-197 or -1.34999999999999992e-259 < y < 1.3000000000000001e32Initial program 99.9%
Taylor expanded in z around inf 83.9%
+-commutative83.9%
Simplified83.9%
Final simplification77.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (* z (+ x y)) (- y))))
(if (<= z -1.5e+32)
(+ x y)
(if (<= z -1.5e-289)
t_0
(if (<= z 1.12e-199)
(/ z (/ y (- (+ x y))))
(if (<= z 1.06e-45)
t_0
(if (<= z 1.45e+79)
(+ x y)
(if (<= z 6.2e+112)
(* z (/ (+ x y) (- y)))
(* (+ x y) (+ 1.0 (/ y z)))))))))))
double code(double x, double y, double z) {
double t_0 = (z * (x + y)) / -y;
double tmp;
if (z <= -1.5e+32) {
tmp = x + y;
} else if (z <= -1.5e-289) {
tmp = t_0;
} else if (z <= 1.12e-199) {
tmp = z / (y / -(x + y));
} else if (z <= 1.06e-45) {
tmp = t_0;
} else if (z <= 1.45e+79) {
tmp = x + y;
} else if (z <= 6.2e+112) {
tmp = z * ((x + y) / -y);
} else {
tmp = (x + y) * (1.0 + (y / z));
}
return tmp;
}
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) :: tmp
t_0 = (z * (x + y)) / -y
if (z <= (-1.5d+32)) then
tmp = x + y
else if (z <= (-1.5d-289)) then
tmp = t_0
else if (z <= 1.12d-199) then
tmp = z / (y / -(x + y))
else if (z <= 1.06d-45) then
tmp = t_0
else if (z <= 1.45d+79) then
tmp = x + y
else if (z <= 6.2d+112) then
tmp = z * ((x + y) / -y)
else
tmp = (x + y) * (1.0d0 + (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (z * (x + y)) / -y;
double tmp;
if (z <= -1.5e+32) {
tmp = x + y;
} else if (z <= -1.5e-289) {
tmp = t_0;
} else if (z <= 1.12e-199) {
tmp = z / (y / -(x + y));
} else if (z <= 1.06e-45) {
tmp = t_0;
} else if (z <= 1.45e+79) {
tmp = x + y;
} else if (z <= 6.2e+112) {
tmp = z * ((x + y) / -y);
} else {
tmp = (x + y) * (1.0 + (y / z));
}
return tmp;
}
def code(x, y, z): t_0 = (z * (x + y)) / -y tmp = 0 if z <= -1.5e+32: tmp = x + y elif z <= -1.5e-289: tmp = t_0 elif z <= 1.12e-199: tmp = z / (y / -(x + y)) elif z <= 1.06e-45: tmp = t_0 elif z <= 1.45e+79: tmp = x + y elif z <= 6.2e+112: tmp = z * ((x + y) / -y) else: tmp = (x + y) * (1.0 + (y / z)) return tmp
function code(x, y, z) t_0 = Float64(Float64(z * Float64(x + y)) / Float64(-y)) tmp = 0.0 if (z <= -1.5e+32) tmp = Float64(x + y); elseif (z <= -1.5e-289) tmp = t_0; elseif (z <= 1.12e-199) tmp = Float64(z / Float64(y / Float64(-Float64(x + y)))); elseif (z <= 1.06e-45) tmp = t_0; elseif (z <= 1.45e+79) tmp = Float64(x + y); elseif (z <= 6.2e+112) tmp = Float64(z * Float64(Float64(x + y) / Float64(-y))); else tmp = Float64(Float64(x + y) * Float64(1.0 + Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z * (x + y)) / -y; tmp = 0.0; if (z <= -1.5e+32) tmp = x + y; elseif (z <= -1.5e-289) tmp = t_0; elseif (z <= 1.12e-199) tmp = z / (y / -(x + y)); elseif (z <= 1.06e-45) tmp = t_0; elseif (z <= 1.45e+79) tmp = x + y; elseif (z <= 6.2e+112) tmp = z * ((x + y) / -y); else tmp = (x + y) * (1.0 + (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] / (-y)), $MachinePrecision]}, If[LessEqual[z, -1.5e+32], N[(x + y), $MachinePrecision], If[LessEqual[z, -1.5e-289], t$95$0, If[LessEqual[z, 1.12e-199], N[(z / N[(y / (-N[(x + y), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.06e-45], t$95$0, If[LessEqual[z, 1.45e+79], N[(x + y), $MachinePrecision], If[LessEqual[z, 6.2e+112], N[(z * N[(N[(x + y), $MachinePrecision] / (-y)), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] * N[(1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{z \cdot \left(x + y\right)}{-y}\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+32}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-289}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-199}:\\
\;\;\;\;\frac{z}{\frac{y}{-\left(x + y\right)}}\\
\mathbf{elif}\;z \leq 1.06 \cdot 10^{-45}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+79}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+112}:\\
\;\;\;\;z \cdot \frac{x + y}{-y}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\
\end{array}
\end{array}
if z < -1.5e32 or 1.06000000000000004e-45 < z < 1.44999999999999996e79Initial program 99.9%
Taylor expanded in z around inf 80.3%
+-commutative80.3%
Simplified80.3%
if -1.5e32 < z < -1.4999999999999999e-289 or 1.12000000000000003e-199 < z < 1.06000000000000004e-45Initial program 79.7%
Taylor expanded in z around 0 78.7%
mul-1-neg78.7%
+-commutative78.7%
Simplified78.7%
if -1.4999999999999999e-289 < z < 1.12000000000000003e-199Initial program 58.1%
Taylor expanded in z around 0 77.1%
mul-1-neg77.1%
associate-/l*91.1%
distribute-rgt-neg-in91.1%
distribute-neg-frac291.1%
+-commutative91.1%
Simplified91.1%
associate-*r/77.1%
distribute-frac-neg277.1%
add-sqr-sqrt36.9%
sqrt-unprod21.9%
sqr-neg21.9%
sqrt-unprod3.1%
add-sqr-sqrt6.1%
associate-*r/5.7%
clear-num5.7%
un-div-inv5.7%
add-sqr-sqrt2.8%
sqrt-unprod27.0%
sqr-neg27.0%
sqrt-unprod44.7%
add-sqr-sqrt91.2%
Applied egg-rr91.2%
if 1.44999999999999996e79 < z < 6.19999999999999965e112Initial program 99.8%
Taylor expanded in z around 0 17.9%
mul-1-neg17.9%
associate-/l*86.3%
distribute-rgt-neg-in86.3%
distribute-neg-frac286.3%
+-commutative86.3%
Simplified86.3%
if 6.19999999999999965e112 < z Initial program 99.9%
Taylor expanded in z around inf 74.0%
associate-+r+74.0%
*-rgt-identity74.0%
*-commutative74.0%
associate-/l*89.1%
distribute-lft-in89.1%
+-commutative89.1%
Simplified89.1%
Final simplification82.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (* z (+ x y)) (- y))))
(if (<= z -9e+30)
(+ x y)
(if (<= z -1.4e-289)
t_0
(if (<= z 4.8e-199)
(/ z (/ y (- (+ x y))))
(if (<= z 8.2e-39)
t_0
(if (or (<= z 2.15e+83) (not (<= z 6.2e+112)))
(+ x y)
(* z (/ (+ x y) (- y))))))))))
double code(double x, double y, double z) {
double t_0 = (z * (x + y)) / -y;
double tmp;
if (z <= -9e+30) {
tmp = x + y;
} else if (z <= -1.4e-289) {
tmp = t_0;
} else if (z <= 4.8e-199) {
tmp = z / (y / -(x + y));
} else if (z <= 8.2e-39) {
tmp = t_0;
} else if ((z <= 2.15e+83) || !(z <= 6.2e+112)) {
tmp = x + y;
} else {
tmp = z * ((x + y) / -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
real(8) :: t_0
real(8) :: tmp
t_0 = (z * (x + y)) / -y
if (z <= (-9d+30)) then
tmp = x + y
else if (z <= (-1.4d-289)) then
tmp = t_0
else if (z <= 4.8d-199) then
tmp = z / (y / -(x + y))
else if (z <= 8.2d-39) then
tmp = t_0
else if ((z <= 2.15d+83) .or. (.not. (z <= 6.2d+112))) then
tmp = x + y
else
tmp = z * ((x + y) / -y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (z * (x + y)) / -y;
double tmp;
if (z <= -9e+30) {
tmp = x + y;
} else if (z <= -1.4e-289) {
tmp = t_0;
} else if (z <= 4.8e-199) {
tmp = z / (y / -(x + y));
} else if (z <= 8.2e-39) {
tmp = t_0;
} else if ((z <= 2.15e+83) || !(z <= 6.2e+112)) {
tmp = x + y;
} else {
tmp = z * ((x + y) / -y);
}
return tmp;
}
def code(x, y, z): t_0 = (z * (x + y)) / -y tmp = 0 if z <= -9e+30: tmp = x + y elif z <= -1.4e-289: tmp = t_0 elif z <= 4.8e-199: tmp = z / (y / -(x + y)) elif z <= 8.2e-39: tmp = t_0 elif (z <= 2.15e+83) or not (z <= 6.2e+112): tmp = x + y else: tmp = z * ((x + y) / -y) return tmp
function code(x, y, z) t_0 = Float64(Float64(z * Float64(x + y)) / Float64(-y)) tmp = 0.0 if (z <= -9e+30) tmp = Float64(x + y); elseif (z <= -1.4e-289) tmp = t_0; elseif (z <= 4.8e-199) tmp = Float64(z / Float64(y / Float64(-Float64(x + y)))); elseif (z <= 8.2e-39) tmp = t_0; elseif ((z <= 2.15e+83) || !(z <= 6.2e+112)) tmp = Float64(x + y); else tmp = Float64(z * Float64(Float64(x + y) / Float64(-y))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z * (x + y)) / -y; tmp = 0.0; if (z <= -9e+30) tmp = x + y; elseif (z <= -1.4e-289) tmp = t_0; elseif (z <= 4.8e-199) tmp = z / (y / -(x + y)); elseif (z <= 8.2e-39) tmp = t_0; elseif ((z <= 2.15e+83) || ~((z <= 6.2e+112))) tmp = x + y; else tmp = z * ((x + y) / -y); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] / (-y)), $MachinePrecision]}, If[LessEqual[z, -9e+30], N[(x + y), $MachinePrecision], If[LessEqual[z, -1.4e-289], t$95$0, If[LessEqual[z, 4.8e-199], N[(z / N[(y / (-N[(x + y), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e-39], t$95$0, If[Or[LessEqual[z, 2.15e+83], N[Not[LessEqual[z, 6.2e+112]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(z * N[(N[(x + y), $MachinePrecision] / (-y)), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{z \cdot \left(x + y\right)}{-y}\\
\mathbf{if}\;z \leq -9 \cdot 10^{+30}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-289}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-199}:\\
\;\;\;\;\frac{z}{\frac{y}{-\left(x + y\right)}}\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-39}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{+83} \lor \neg \left(z \leq 6.2 \cdot 10^{+112}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x + y}{-y}\\
\end{array}
\end{array}
if z < -8.9999999999999999e30 or 8.2e-39 < z < 2.15e83 or 6.19999999999999965e112 < z Initial program 99.9%
Taylor expanded in z around inf 83.3%
+-commutative83.3%
Simplified83.3%
if -8.9999999999999999e30 < z < -1.39999999999999993e-289 or 4.79999999999999991e-199 < z < 8.2e-39Initial program 79.7%
Taylor expanded in z around 0 78.7%
mul-1-neg78.7%
+-commutative78.7%
Simplified78.7%
if -1.39999999999999993e-289 < z < 4.79999999999999991e-199Initial program 58.1%
Taylor expanded in z around 0 77.1%
mul-1-neg77.1%
associate-/l*91.1%
distribute-rgt-neg-in91.1%
distribute-neg-frac291.1%
+-commutative91.1%
Simplified91.1%
associate-*r/77.1%
distribute-frac-neg277.1%
add-sqr-sqrt36.9%
sqrt-unprod21.9%
sqr-neg21.9%
sqrt-unprod3.1%
add-sqr-sqrt6.1%
associate-*r/5.7%
clear-num5.7%
un-div-inv5.7%
add-sqr-sqrt2.8%
sqrt-unprod27.0%
sqr-neg27.0%
sqrt-unprod44.7%
add-sqr-sqrt91.2%
Applied egg-rr91.2%
if 2.15e83 < z < 6.19999999999999965e112Initial program 99.8%
Taylor expanded in z around 0 17.9%
mul-1-neg17.9%
associate-/l*86.3%
distribute-rgt-neg-in86.3%
distribute-neg-frac286.3%
+-commutative86.3%
Simplified86.3%
Final simplification82.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ z (/ y (- (+ x y))))) (t_1 (/ (* z (+ x y)) (- y))))
(if (<= z -3.1e+31)
(+ x y)
(if (<= z -1.75e-287)
t_1
(if (<= z 1e-198)
t_0
(if (<= z 2.35e-39)
t_1
(if (or (<= z 2.15e+83) (not (<= z 6.2e+112))) (+ x y) t_0)))))))
double code(double x, double y, double z) {
double t_0 = z / (y / -(x + y));
double t_1 = (z * (x + y)) / -y;
double tmp;
if (z <= -3.1e+31) {
tmp = x + y;
} else if (z <= -1.75e-287) {
tmp = t_1;
} else if (z <= 1e-198) {
tmp = t_0;
} else if (z <= 2.35e-39) {
tmp = t_1;
} else if ((z <= 2.15e+83) || !(z <= 6.2e+112)) {
tmp = x + y;
} else {
tmp = t_0;
}
return tmp;
}
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 = z / (y / -(x + y))
t_1 = (z * (x + y)) / -y
if (z <= (-3.1d+31)) then
tmp = x + y
else if (z <= (-1.75d-287)) then
tmp = t_1
else if (z <= 1d-198) then
tmp = t_0
else if (z <= 2.35d-39) then
tmp = t_1
else if ((z <= 2.15d+83) .or. (.not. (z <= 6.2d+112))) then
tmp = x + y
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z / (y / -(x + y));
double t_1 = (z * (x + y)) / -y;
double tmp;
if (z <= -3.1e+31) {
tmp = x + y;
} else if (z <= -1.75e-287) {
tmp = t_1;
} else if (z <= 1e-198) {
tmp = t_0;
} else if (z <= 2.35e-39) {
tmp = t_1;
} else if ((z <= 2.15e+83) || !(z <= 6.2e+112)) {
tmp = x + y;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z / (y / -(x + y)) t_1 = (z * (x + y)) / -y tmp = 0 if z <= -3.1e+31: tmp = x + y elif z <= -1.75e-287: tmp = t_1 elif z <= 1e-198: tmp = t_0 elif z <= 2.35e-39: tmp = t_1 elif (z <= 2.15e+83) or not (z <= 6.2e+112): tmp = x + y else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z / Float64(y / Float64(-Float64(x + y)))) t_1 = Float64(Float64(z * Float64(x + y)) / Float64(-y)) tmp = 0.0 if (z <= -3.1e+31) tmp = Float64(x + y); elseif (z <= -1.75e-287) tmp = t_1; elseif (z <= 1e-198) tmp = t_0; elseif (z <= 2.35e-39) tmp = t_1; elseif ((z <= 2.15e+83) || !(z <= 6.2e+112)) tmp = Float64(x + y); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z / (y / -(x + y)); t_1 = (z * (x + y)) / -y; tmp = 0.0; if (z <= -3.1e+31) tmp = x + y; elseif (z <= -1.75e-287) tmp = t_1; elseif (z <= 1e-198) tmp = t_0; elseif (z <= 2.35e-39) tmp = t_1; elseif ((z <= 2.15e+83) || ~((z <= 6.2e+112))) tmp = x + y; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z / N[(y / (-N[(x + y), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] / (-y)), $MachinePrecision]}, If[LessEqual[z, -3.1e+31], N[(x + y), $MachinePrecision], If[LessEqual[z, -1.75e-287], t$95$1, If[LessEqual[z, 1e-198], t$95$0, If[LessEqual[z, 2.35e-39], t$95$1, If[Or[LessEqual[z, 2.15e+83], N[Not[LessEqual[z, 6.2e+112]], $MachinePrecision]], N[(x + y), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{z}{\frac{y}{-\left(x + y\right)}}\\
t_1 := \frac{z \cdot \left(x + y\right)}{-y}\\
\mathbf{if}\;z \leq -3.1 \cdot 10^{+31}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{-287}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 10^{-198}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{+83} \lor \neg \left(z \leq 6.2 \cdot 10^{+112}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -3.1000000000000002e31 or 2.3500000000000001e-39 < z < 2.15e83 or 6.19999999999999965e112 < z Initial program 99.9%
Taylor expanded in z around inf 83.3%
+-commutative83.3%
Simplified83.3%
if -3.1000000000000002e31 < z < -1.75e-287 or 9.9999999999999991e-199 < z < 2.3500000000000001e-39Initial program 79.7%
Taylor expanded in z around 0 78.7%
mul-1-neg78.7%
+-commutative78.7%
Simplified78.7%
if -1.75e-287 < z < 9.9999999999999991e-199 or 2.15e83 < z < 6.19999999999999965e112Initial program 65.8%
Taylor expanded in z around 0 66.2%
mul-1-neg66.2%
associate-/l*90.2%
distribute-rgt-neg-in90.2%
distribute-neg-frac290.2%
+-commutative90.2%
Simplified90.2%
associate-*r/66.2%
distribute-frac-neg266.2%
add-sqr-sqrt30.2%
sqrt-unprod17.9%
sqr-neg17.9%
sqrt-unprod2.6%
add-sqr-sqrt5.1%
associate-*r/4.9%
clear-num4.9%
un-div-inv4.9%
add-sqr-sqrt2.5%
sqrt-unprod22.4%
sqr-neg22.4%
sqrt-unprod39.1%
add-sqr-sqrt90.2%
Applied egg-rr90.2%
Final simplification82.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (+ x y) (- 1.0 (/ y z)))))
(if (or (<= t_0 -2e-278) (not (<= t_0 2e-271)))
t_0
(/ z (/ y (- (+ x y)))))))
double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -2e-278) || !(t_0 <= 2e-271)) {
tmp = t_0;
} else {
tmp = z / (y / -(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
real(8) :: t_0
real(8) :: tmp
t_0 = (x + y) / (1.0d0 - (y / z))
if ((t_0 <= (-2d-278)) .or. (.not. (t_0 <= 2d-271))) then
tmp = t_0
else
tmp = z / (y / -(x + y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -2e-278) || !(t_0 <= 2e-271)) {
tmp = t_0;
} else {
tmp = z / (y / -(x + y));
}
return tmp;
}
def code(x, y, z): t_0 = (x + y) / (1.0 - (y / z)) tmp = 0 if (t_0 <= -2e-278) or not (t_0 <= 2e-271): tmp = t_0 else: tmp = z / (y / -(x + y)) return tmp
function code(x, y, z) t_0 = Float64(Float64(x + y) / Float64(1.0 - Float64(y / z))) tmp = 0.0 if ((t_0 <= -2e-278) || !(t_0 <= 2e-271)) tmp = t_0; else tmp = Float64(z / Float64(y / Float64(-Float64(x + y)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x + y) / (1.0 - (y / z)); tmp = 0.0; if ((t_0 <= -2e-278) || ~((t_0 <= 2e-271))) tmp = t_0; else tmp = z / (y / -(x + y)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -2e-278], N[Not[LessEqual[t$95$0, 2e-271]], $MachinePrecision]], t$95$0, N[(z / N[(y / (-N[(x + y), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-278} \lor \neg \left(t\_0 \leq 2 \cdot 10^{-271}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{y}{-\left(x + y\right)}}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -1.99999999999999988e-278 or 1.99999999999999993e-271 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) Initial program 99.8%
if -1.99999999999999988e-278 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < 1.99999999999999993e-271Initial program 21.3%
Taylor expanded in z around 0 86.4%
mul-1-neg86.4%
associate-/l*99.9%
distribute-rgt-neg-in99.9%
distribute-neg-frac299.9%
+-commutative99.9%
Simplified99.9%
associate-*r/86.4%
distribute-frac-neg286.4%
add-sqr-sqrt48.3%
sqrt-unprod22.1%
sqr-neg22.1%
sqrt-unprod2.7%
add-sqr-sqrt6.0%
associate-*r/5.8%
clear-num5.8%
un-div-inv5.8%
add-sqr-sqrt2.6%
sqrt-unprod26.1%
sqr-neg26.1%
sqrt-unprod54.7%
add-sqr-sqrt100.0%
Applied egg-rr100.0%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(if (or (<= z -1.8e+32)
(not (or (<= z 1.06e-41) (and (not (<= z 1.6e+83)) (<= z 6.2e+112)))))
(+ x y)
(/ z (/ y (- (+ x y))))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.8e+32) || !((z <= 1.06e-41) || (!(z <= 1.6e+83) && (z <= 6.2e+112)))) {
tmp = x + y;
} else {
tmp = z / (y / -(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
real(8) :: tmp
if ((z <= (-1.8d+32)) .or. (.not. (z <= 1.06d-41) .or. (.not. (z <= 1.6d+83)) .and. (z <= 6.2d+112))) then
tmp = x + y
else
tmp = z / (y / -(x + y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.8e+32) || !((z <= 1.06e-41) || (!(z <= 1.6e+83) && (z <= 6.2e+112)))) {
tmp = x + y;
} else {
tmp = z / (y / -(x + y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.8e+32) or not ((z <= 1.06e-41) or (not (z <= 1.6e+83) and (z <= 6.2e+112))): tmp = x + y else: tmp = z / (y / -(x + y)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.8e+32) || !((z <= 1.06e-41) || (!(z <= 1.6e+83) && (z <= 6.2e+112)))) tmp = Float64(x + y); else tmp = Float64(z / Float64(y / Float64(-Float64(x + y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.8e+32) || ~(((z <= 1.06e-41) || (~((z <= 1.6e+83)) && (z <= 6.2e+112))))) tmp = x + y; else tmp = z / (y / -(x + y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.8e+32], N[Not[Or[LessEqual[z, 1.06e-41], And[N[Not[LessEqual[z, 1.6e+83]], $MachinePrecision], LessEqual[z, 6.2e+112]]]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(z / N[(y / (-N[(x + y), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+32} \lor \neg \left(z \leq 1.06 \cdot 10^{-41} \lor \neg \left(z \leq 1.6 \cdot 10^{+83}\right) \land z \leq 6.2 \cdot 10^{+112}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{y}{-\left(x + y\right)}}\\
\end{array}
\end{array}
if z < -1.7999999999999998e32 or 1.06e-41 < z < 1.5999999999999999e83 or 6.19999999999999965e112 < z Initial program 99.9%
Taylor expanded in z around inf 83.3%
+-commutative83.3%
Simplified83.3%
if -1.7999999999999998e32 < z < 1.06e-41 or 1.5999999999999999e83 < z < 6.19999999999999965e112Initial program 75.4%
Taylor expanded in z around 0 74.8%
mul-1-neg74.8%
associate-/l*76.8%
distribute-rgt-neg-in76.8%
distribute-neg-frac276.8%
+-commutative76.8%
Simplified76.8%
associate-*r/74.8%
distribute-frac-neg274.8%
add-sqr-sqrt33.8%
sqrt-unprod23.3%
sqr-neg23.3%
sqrt-unprod2.0%
add-sqr-sqrt3.5%
associate-*r/3.3%
clear-num3.3%
un-div-inv3.3%
add-sqr-sqrt1.8%
sqrt-unprod24.0%
sqr-neg24.0%
sqrt-unprod35.8%
add-sqr-sqrt76.9%
Applied egg-rr76.9%
Final simplification80.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ x (- 1.0 (/ y z)))))
(if (<= y -1.3e+71)
(- z)
(if (<= y -1.12e-147)
t_0
(if (<= y -8.8e-197)
(+ x y)
(if (<= y -2.4e-257) t_0 (if (<= y 4.8e+35) (+ x y) (- z))))))))
double code(double x, double y, double z) {
double t_0 = x / (1.0 - (y / z));
double tmp;
if (y <= -1.3e+71) {
tmp = -z;
} else if (y <= -1.12e-147) {
tmp = t_0;
} else if (y <= -8.8e-197) {
tmp = x + y;
} else if (y <= -2.4e-257) {
tmp = t_0;
} else if (y <= 4.8e+35) {
tmp = x + y;
} else {
tmp = -z;
}
return tmp;
}
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) :: tmp
t_0 = x / (1.0d0 - (y / z))
if (y <= (-1.3d+71)) then
tmp = -z
else if (y <= (-1.12d-147)) then
tmp = t_0
else if (y <= (-8.8d-197)) then
tmp = x + y
else if (y <= (-2.4d-257)) then
tmp = t_0
else if (y <= 4.8d+35) then
tmp = x + y
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x / (1.0 - (y / z));
double tmp;
if (y <= -1.3e+71) {
tmp = -z;
} else if (y <= -1.12e-147) {
tmp = t_0;
} else if (y <= -8.8e-197) {
tmp = x + y;
} else if (y <= -2.4e-257) {
tmp = t_0;
} else if (y <= 4.8e+35) {
tmp = x + y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): t_0 = x / (1.0 - (y / z)) tmp = 0 if y <= -1.3e+71: tmp = -z elif y <= -1.12e-147: tmp = t_0 elif y <= -8.8e-197: tmp = x + y elif y <= -2.4e-257: tmp = t_0 elif y <= 4.8e+35: tmp = x + y else: tmp = -z return tmp
function code(x, y, z) t_0 = Float64(x / Float64(1.0 - Float64(y / z))) tmp = 0.0 if (y <= -1.3e+71) tmp = Float64(-z); elseif (y <= -1.12e-147) tmp = t_0; elseif (y <= -8.8e-197) tmp = Float64(x + y); elseif (y <= -2.4e-257) tmp = t_0; elseif (y <= 4.8e+35) tmp = Float64(x + y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x / (1.0 - (y / z)); tmp = 0.0; if (y <= -1.3e+71) tmp = -z; elseif (y <= -1.12e-147) tmp = t_0; elseif (y <= -8.8e-197) tmp = x + y; elseif (y <= -2.4e-257) tmp = t_0; elseif (y <= 4.8e+35) tmp = x + y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.3e+71], (-z), If[LessEqual[y, -1.12e-147], t$95$0, If[LessEqual[y, -8.8e-197], N[(x + y), $MachinePrecision], If[LessEqual[y, -2.4e-257], t$95$0, If[LessEqual[y, 4.8e+35], N[(x + y), $MachinePrecision], (-z)]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{1 - \frac{y}{z}}\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{+71}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -1.12 \cdot 10^{-147}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -8.8 \cdot 10^{-197}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq -2.4 \cdot 10^{-257}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+35}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -1.29999999999999996e71 or 4.80000000000000029e35 < y Initial program 72.4%
Taylor expanded in y around inf 65.2%
mul-1-neg65.2%
Simplified65.2%
if -1.29999999999999996e71 < y < -1.12e-147 or -8.8000000000000001e-197 < y < -2.40000000000000017e-257Initial program 98.5%
Taylor expanded in x around inf 75.6%
if -1.12e-147 < y < -8.8000000000000001e-197 or -2.40000000000000017e-257 < y < 4.80000000000000029e35Initial program 99.9%
Taylor expanded in z around inf 84.1%
+-commutative84.1%
Simplified84.1%
Final simplification73.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -5.2e+72) (not (<= y 4e+35))) (- z) (+ x y)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -5.2e+72) || !(y <= 4e+35)) {
tmp = -z;
} else {
tmp = 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
real(8) :: tmp
if ((y <= (-5.2d+72)) .or. (.not. (y <= 4d+35))) then
tmp = -z
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -5.2e+72) || !(y <= 4e+35)) {
tmp = -z;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -5.2e+72) or not (y <= 4e+35): tmp = -z else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -5.2e+72) || !(y <= 4e+35)) tmp = Float64(-z); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -5.2e+72) || ~((y <= 4e+35))) tmp = -z; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -5.2e+72], N[Not[LessEqual[y, 4e+35]], $MachinePrecision]], (-z), N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{+72} \lor \neg \left(y \leq 4 \cdot 10^{+35}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -5.19999999999999963e72 or 3.9999999999999999e35 < y Initial program 72.4%
Taylor expanded in y around inf 65.2%
mul-1-neg65.2%
Simplified65.2%
if -5.19999999999999963e72 < y < 3.9999999999999999e35Initial program 99.2%
Taylor expanded in z around inf 71.3%
+-commutative71.3%
Simplified71.3%
Final simplification68.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -3.2e+18) (not (<= y 0.000155))) (- z) x))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.2e+18) || !(y <= 0.000155)) {
tmp = -z;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-3.2d+18)) .or. (.not. (y <= 0.000155d0))) then
tmp = -z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -3.2e+18) || !(y <= 0.000155)) {
tmp = -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3.2e+18) or not (y <= 0.000155): tmp = -z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3.2e+18) || !(y <= 0.000155)) tmp = Float64(-z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -3.2e+18) || ~((y <= 0.000155))) tmp = -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3.2e+18], N[Not[LessEqual[y, 0.000155]], $MachinePrecision]], (-z), x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{+18} \lor \neg \left(y \leq 0.000155\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -3.2e18 or 1.55e-4 < y Initial program 76.4%
Taylor expanded in y around inf 59.4%
mul-1-neg59.4%
Simplified59.4%
if -3.2e18 < y < 1.55e-4Initial program 99.9%
Taylor expanded in y around 0 57.6%
Final simplification58.5%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 88.1%
Taylor expanded in y around 0 33.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ (+ y x) (- y)) z)))
(if (< y -3.7429310762689856e+171)
t_0
(if (< y 3.5534662456086734e+168) (/ (+ x y) (- 1.0 (/ y z))) t_0))))
double code(double x, double y, double z) {
double t_0 = ((y + x) / -y) * z;
double tmp;
if (y < -3.7429310762689856e+171) {
tmp = t_0;
} else if (y < 3.5534662456086734e+168) {
tmp = (x + y) / (1.0 - (y / z));
} else {
tmp = t_0;
}
return tmp;
}
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) :: tmp
t_0 = ((y + x) / -y) * z
if (y < (-3.7429310762689856d+171)) then
tmp = t_0
else if (y < 3.5534662456086734d+168) then
tmp = (x + y) / (1.0d0 - (y / z))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((y + x) / -y) * z;
double tmp;
if (y < -3.7429310762689856e+171) {
tmp = t_0;
} else if (y < 3.5534662456086734e+168) {
tmp = (x + y) / (1.0 - (y / z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((y + x) / -y) * z tmp = 0 if y < -3.7429310762689856e+171: tmp = t_0 elif y < 3.5534662456086734e+168: tmp = (x + y) / (1.0 - (y / z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(y + x) / Float64(-y)) * z) tmp = 0.0 if (y < -3.7429310762689856e+171) tmp = t_0; elseif (y < 3.5534662456086734e+168) tmp = Float64(Float64(x + y) / Float64(1.0 - Float64(y / z))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((y + x) / -y) * z; tmp = 0.0; if (y < -3.7429310762689856e+171) tmp = t_0; elseif (y < 3.5534662456086734e+168) tmp = (x + y) / (1.0 - (y / z)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y + x), $MachinePrecision] / (-y)), $MachinePrecision] * z), $MachinePrecision]}, If[Less[y, -3.7429310762689856e+171], t$95$0, If[Less[y, 3.5534662456086734e+168], N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y + x}{-y} \cdot z\\
\mathbf{if}\;y < -3.7429310762689856 \cdot 10^{+171}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y < 3.5534662456086734 \cdot 10^{+168}:\\
\;\;\;\;\frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
herbie shell --seed 2024101
(FPCore (x y z)
:name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, A"
:precision binary64
:alt
(if (< y -3.7429310762689856e+171) (* (/ (+ y x) (- y)) z) (if (< y 3.5534662456086734e+168) (/ (+ x y) (- 1.0 (/ y z))) (* (/ (+ y x) (- y)) z)))
(/ (+ x y) (- 1.0 (/ y z))))