
(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 14 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 (/ (+ x y) (- 1.0 (/ y z)))))
(if (<= t_0 -1e-192)
t_0
(if (<= t_0 0.0) (* z (/ (- (- x) y) y)) (/ (+ x y) (/ (- z y) z))))))
double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if (t_0 <= -1e-192) {
tmp = t_0;
} else if (t_0 <= 0.0) {
tmp = z * ((-x - y) / y);
} else {
tmp = (x + y) / ((z - 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 = (x + y) / (1.0d0 - (y / z))
if (t_0 <= (-1d-192)) then
tmp = t_0
else if (t_0 <= 0.0d0) then
tmp = z * ((-x - y) / y)
else
tmp = (x + y) / ((z - y) / z)
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 <= -1e-192) {
tmp = t_0;
} else if (t_0 <= 0.0) {
tmp = z * ((-x - y) / y);
} else {
tmp = (x + y) / ((z - y) / z);
}
return tmp;
}
def code(x, y, z): t_0 = (x + y) / (1.0 - (y / z)) tmp = 0 if t_0 <= -1e-192: tmp = t_0 elif t_0 <= 0.0: tmp = z * ((-x - y) / y) else: tmp = (x + y) / ((z - y) / z) 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 <= -1e-192) tmp = t_0; elseif (t_0 <= 0.0) tmp = Float64(z * Float64(Float64(Float64(-x) - y) / y)); else tmp = Float64(Float64(x + y) / Float64(Float64(z - y) / z)); 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 <= -1e-192) tmp = t_0; elseif (t_0 <= 0.0) tmp = z * ((-x - y) / y); else tmp = (x + y) / ((z - y) / z); 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[LessEqual[t$95$0, -1e-192], t$95$0, If[LessEqual[t$95$0, 0.0], N[(z * N[(N[((-x) - y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] / N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-192}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;z \cdot \frac{\left(-x\right) - y}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y}{\frac{z - y}{z}}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -1.0000000000000001e-192Initial program 99.9%
if -1.0000000000000001e-192 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < 0.0Initial program 22.4%
Taylor expanded in z around 0 88.2%
*-commutative88.2%
associate-/l*93.0%
associate-*r*93.0%
associate-*l/93.0%
*-commutative93.0%
neg-mul-193.0%
distribute-neg-in93.0%
unsub-neg93.0%
Simplified93.0%
if 0.0 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) Initial program 99.9%
Taylor expanded in z around 0 99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (/ z (- y)))))
(if (<= y -3.3e+44)
(- z)
(if (<= y -0.36)
x
(if (<= y -7.2e-17)
t_0
(if (<= y -1.05e-21)
(+ x y)
(if (<= y -4.4e-60)
t_0
(if (<= y -2.8e-60)
(- z)
(if (<= y 9e+105)
(+ x y)
(if (<= y 4.4e+156) (/ (* x (- z)) y) (- z)))))))))))
double code(double x, double y, double z) {
double t_0 = x * (z / -y);
double tmp;
if (y <= -3.3e+44) {
tmp = -z;
} else if (y <= -0.36) {
tmp = x;
} else if (y <= -7.2e-17) {
tmp = t_0;
} else if (y <= -1.05e-21) {
tmp = x + y;
} else if (y <= -4.4e-60) {
tmp = t_0;
} else if (y <= -2.8e-60) {
tmp = -z;
} else if (y <= 9e+105) {
tmp = x + y;
} else if (y <= 4.4e+156) {
tmp = (x * -z) / 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 * (z / -y)
if (y <= (-3.3d+44)) then
tmp = -z
else if (y <= (-0.36d0)) then
tmp = x
else if (y <= (-7.2d-17)) then
tmp = t_0
else if (y <= (-1.05d-21)) then
tmp = x + y
else if (y <= (-4.4d-60)) then
tmp = t_0
else if (y <= (-2.8d-60)) then
tmp = -z
else if (y <= 9d+105) then
tmp = x + y
else if (y <= 4.4d+156) then
tmp = (x * -z) / y
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (z / -y);
double tmp;
if (y <= -3.3e+44) {
tmp = -z;
} else if (y <= -0.36) {
tmp = x;
} else if (y <= -7.2e-17) {
tmp = t_0;
} else if (y <= -1.05e-21) {
tmp = x + y;
} else if (y <= -4.4e-60) {
tmp = t_0;
} else if (y <= -2.8e-60) {
tmp = -z;
} else if (y <= 9e+105) {
tmp = x + y;
} else if (y <= 4.4e+156) {
tmp = (x * -z) / y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z / -y) tmp = 0 if y <= -3.3e+44: tmp = -z elif y <= -0.36: tmp = x elif y <= -7.2e-17: tmp = t_0 elif y <= -1.05e-21: tmp = x + y elif y <= -4.4e-60: tmp = t_0 elif y <= -2.8e-60: tmp = -z elif y <= 9e+105: tmp = x + y elif y <= 4.4e+156: tmp = (x * -z) / y else: tmp = -z return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z / Float64(-y))) tmp = 0.0 if (y <= -3.3e+44) tmp = Float64(-z); elseif (y <= -0.36) tmp = x; elseif (y <= -7.2e-17) tmp = t_0; elseif (y <= -1.05e-21) tmp = Float64(x + y); elseif (y <= -4.4e-60) tmp = t_0; elseif (y <= -2.8e-60) tmp = Float64(-z); elseif (y <= 9e+105) tmp = Float64(x + y); elseif (y <= 4.4e+156) tmp = Float64(Float64(x * Float64(-z)) / y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (z / -y); tmp = 0.0; if (y <= -3.3e+44) tmp = -z; elseif (y <= -0.36) tmp = x; elseif (y <= -7.2e-17) tmp = t_0; elseif (y <= -1.05e-21) tmp = x + y; elseif (y <= -4.4e-60) tmp = t_0; elseif (y <= -2.8e-60) tmp = -z; elseif (y <= 9e+105) tmp = x + y; elseif (y <= 4.4e+156) tmp = (x * -z) / y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z / (-y)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.3e+44], (-z), If[LessEqual[y, -0.36], x, If[LessEqual[y, -7.2e-17], t$95$0, If[LessEqual[y, -1.05e-21], N[(x + y), $MachinePrecision], If[LessEqual[y, -4.4e-60], t$95$0, If[LessEqual[y, -2.8e-60], (-z), If[LessEqual[y, 9e+105], N[(x + y), $MachinePrecision], If[LessEqual[y, 4.4e+156], N[(N[(x * (-z)), $MachinePrecision] / y), $MachinePrecision], (-z)]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{z}{-y}\\
\mathbf{if}\;y \leq -3.3 \cdot 10^{+44}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -0.36:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -7.2 \cdot 10^{-17}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{-21}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq -4.4 \cdot 10^{-60}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{-60}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+105}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{+156}:\\
\;\;\;\;\frac{x \cdot \left(-z\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -3.30000000000000013e44 or -4.3999999999999998e-60 < y < -2.8000000000000002e-60 or 4.40000000000000008e156 < y Initial program 70.0%
Taylor expanded in y around inf 74.9%
mul-1-neg74.9%
Simplified74.9%
if -3.30000000000000013e44 < y < -0.35999999999999999Initial program 88.7%
Taylor expanded in y around 0 64.1%
if -0.35999999999999999 < y < -7.1999999999999999e-17 or -1.05000000000000006e-21 < y < -4.3999999999999998e-60Initial program 99.9%
Taylor expanded in x around inf 68.0%
Taylor expanded in y around inf 55.0%
mul-1-neg55.0%
associate-*r/55.2%
distribute-rgt-neg-in55.2%
Simplified55.2%
if -7.1999999999999999e-17 < y < -1.05000000000000006e-21 or -2.8000000000000002e-60 < y < 9.0000000000000002e105Initial program 98.5%
Taylor expanded in z around inf 77.3%
+-commutative77.3%
Simplified77.3%
if 9.0000000000000002e105 < y < 4.40000000000000008e156Initial program 86.0%
Taylor expanded in z around 0 86.0%
Taylor expanded in x around inf 72.7%
associate-/l*58.9%
Simplified58.9%
Taylor expanded in z around 0 72.7%
Simplified72.7%
Final simplification74.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (/ z (- y)))))
(if (<= y -4.6e+44)
(- z)
(if (<= y -0.0022)
x
(if (<= y -1e-16)
t_0
(if (<= y -2.1e-22)
(+ x y)
(if (<= y -3e-60)
t_0
(if (<= y -2.8e-60)
(- z)
(if (<= y 1.4e+91)
(+ x y)
(if (<= y 4.4e+156) (* z (/ x (- y))) (- z)))))))))))
double code(double x, double y, double z) {
double t_0 = x * (z / -y);
double tmp;
if (y <= -4.6e+44) {
tmp = -z;
} else if (y <= -0.0022) {
tmp = x;
} else if (y <= -1e-16) {
tmp = t_0;
} else if (y <= -2.1e-22) {
tmp = x + y;
} else if (y <= -3e-60) {
tmp = t_0;
} else if (y <= -2.8e-60) {
tmp = -z;
} else if (y <= 1.4e+91) {
tmp = x + y;
} else if (y <= 4.4e+156) {
tmp = z * (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 * (z / -y)
if (y <= (-4.6d+44)) then
tmp = -z
else if (y <= (-0.0022d0)) then
tmp = x
else if (y <= (-1d-16)) then
tmp = t_0
else if (y <= (-2.1d-22)) then
tmp = x + y
else if (y <= (-3d-60)) then
tmp = t_0
else if (y <= (-2.8d-60)) then
tmp = -z
else if (y <= 1.4d+91) then
tmp = x + y
else if (y <= 4.4d+156) then
tmp = z * (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 * (z / -y);
double tmp;
if (y <= -4.6e+44) {
tmp = -z;
} else if (y <= -0.0022) {
tmp = x;
} else if (y <= -1e-16) {
tmp = t_0;
} else if (y <= -2.1e-22) {
tmp = x + y;
} else if (y <= -3e-60) {
tmp = t_0;
} else if (y <= -2.8e-60) {
tmp = -z;
} else if (y <= 1.4e+91) {
tmp = x + y;
} else if (y <= 4.4e+156) {
tmp = z * (x / -y);
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z / -y) tmp = 0 if y <= -4.6e+44: tmp = -z elif y <= -0.0022: tmp = x elif y <= -1e-16: tmp = t_0 elif y <= -2.1e-22: tmp = x + y elif y <= -3e-60: tmp = t_0 elif y <= -2.8e-60: tmp = -z elif y <= 1.4e+91: tmp = x + y elif y <= 4.4e+156: tmp = z * (x / -y) else: tmp = -z return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z / Float64(-y))) tmp = 0.0 if (y <= -4.6e+44) tmp = Float64(-z); elseif (y <= -0.0022) tmp = x; elseif (y <= -1e-16) tmp = t_0; elseif (y <= -2.1e-22) tmp = Float64(x + y); elseif (y <= -3e-60) tmp = t_0; elseif (y <= -2.8e-60) tmp = Float64(-z); elseif (y <= 1.4e+91) tmp = Float64(x + y); elseif (y <= 4.4e+156) tmp = Float64(z * Float64(x / Float64(-y))); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (z / -y); tmp = 0.0; if (y <= -4.6e+44) tmp = -z; elseif (y <= -0.0022) tmp = x; elseif (y <= -1e-16) tmp = t_0; elseif (y <= -2.1e-22) tmp = x + y; elseif (y <= -3e-60) tmp = t_0; elseif (y <= -2.8e-60) tmp = -z; elseif (y <= 1.4e+91) tmp = x + y; elseif (y <= 4.4e+156) tmp = z * (x / -y); else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z / (-y)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.6e+44], (-z), If[LessEqual[y, -0.0022], x, If[LessEqual[y, -1e-16], t$95$0, If[LessEqual[y, -2.1e-22], N[(x + y), $MachinePrecision], If[LessEqual[y, -3e-60], t$95$0, If[LessEqual[y, -2.8e-60], (-z), If[LessEqual[y, 1.4e+91], N[(x + y), $MachinePrecision], If[LessEqual[y, 4.4e+156], N[(z * N[(x / (-y)), $MachinePrecision]), $MachinePrecision], (-z)]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{z}{-y}\\
\mathbf{if}\;y \leq -4.6 \cdot 10^{+44}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -0.0022:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-16}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-22}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq -3 \cdot 10^{-60}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{-60}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+91}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{+156}:\\
\;\;\;\;z \cdot \frac{x}{-y}\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -4.60000000000000009e44 or -3.00000000000000019e-60 < y < -2.8000000000000002e-60 or 4.40000000000000008e156 < y Initial program 70.0%
Taylor expanded in y around inf 74.9%
mul-1-neg74.9%
Simplified74.9%
if -4.60000000000000009e44 < y < -0.00220000000000000013Initial program 88.7%
Taylor expanded in y around 0 64.1%
if -0.00220000000000000013 < y < -9.9999999999999998e-17 or -2.10000000000000008e-22 < y < -3.00000000000000019e-60Initial program 99.9%
Taylor expanded in x around inf 68.0%
Taylor expanded in y around inf 55.0%
mul-1-neg55.0%
associate-*r/55.2%
distribute-rgt-neg-in55.2%
Simplified55.2%
if -9.9999999999999998e-17 < y < -2.10000000000000008e-22 or -2.8000000000000002e-60 < y < 1.3999999999999999e91Initial program 98.5%
Taylor expanded in z around inf 77.3%
+-commutative77.3%
Simplified77.3%
if 1.3999999999999999e91 < y < 4.40000000000000008e156Initial program 86.0%
Taylor expanded in z around 0 100.0%
*-commutative100.0%
associate-/l*99.8%
associate-*r*99.8%
associate-*l/99.8%
*-commutative99.8%
neg-mul-199.8%
distribute-neg-in99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around inf 72.5%
Simplified72.5%
Final simplification74.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (/ z (- y)))))
(if (<= y -2.7e+45)
(- z)
(if (<= y -11.6)
x
(if (<= y -1e-16)
t_0
(if (<= y -2.1e-22)
(+ x y)
(if (<= y -2.9e-60)
t_0
(if (or (<= y -2.8e-60) (not (<= y 1.3e+27)))
(- z)
(+ x y)))))))))
double code(double x, double y, double z) {
double t_0 = x * (z / -y);
double tmp;
if (y <= -2.7e+45) {
tmp = -z;
} else if (y <= -11.6) {
tmp = x;
} else if (y <= -1e-16) {
tmp = t_0;
} else if (y <= -2.1e-22) {
tmp = x + y;
} else if (y <= -2.9e-60) {
tmp = t_0;
} else if ((y <= -2.8e-60) || !(y <= 1.3e+27)) {
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) :: t_0
real(8) :: tmp
t_0 = x * (z / -y)
if (y <= (-2.7d+45)) then
tmp = -z
else if (y <= (-11.6d0)) then
tmp = x
else if (y <= (-1d-16)) then
tmp = t_0
else if (y <= (-2.1d-22)) then
tmp = x + y
else if (y <= (-2.9d-60)) then
tmp = t_0
else if ((y <= (-2.8d-60)) .or. (.not. (y <= 1.3d+27))) then
tmp = -z
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (z / -y);
double tmp;
if (y <= -2.7e+45) {
tmp = -z;
} else if (y <= -11.6) {
tmp = x;
} else if (y <= -1e-16) {
tmp = t_0;
} else if (y <= -2.1e-22) {
tmp = x + y;
} else if (y <= -2.9e-60) {
tmp = t_0;
} else if ((y <= -2.8e-60) || !(y <= 1.3e+27)) {
tmp = -z;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z / -y) tmp = 0 if y <= -2.7e+45: tmp = -z elif y <= -11.6: tmp = x elif y <= -1e-16: tmp = t_0 elif y <= -2.1e-22: tmp = x + y elif y <= -2.9e-60: tmp = t_0 elif (y <= -2.8e-60) or not (y <= 1.3e+27): tmp = -z else: tmp = x + y return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z / Float64(-y))) tmp = 0.0 if (y <= -2.7e+45) tmp = Float64(-z); elseif (y <= -11.6) tmp = x; elseif (y <= -1e-16) tmp = t_0; elseif (y <= -2.1e-22) tmp = Float64(x + y); elseif (y <= -2.9e-60) tmp = t_0; elseif ((y <= -2.8e-60) || !(y <= 1.3e+27)) tmp = Float64(-z); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (z / -y); tmp = 0.0; if (y <= -2.7e+45) tmp = -z; elseif (y <= -11.6) tmp = x; elseif (y <= -1e-16) tmp = t_0; elseif (y <= -2.1e-22) tmp = x + y; elseif (y <= -2.9e-60) tmp = t_0; elseif ((y <= -2.8e-60) || ~((y <= 1.3e+27))) tmp = -z; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z / (-y)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.7e+45], (-z), If[LessEqual[y, -11.6], x, If[LessEqual[y, -1e-16], t$95$0, If[LessEqual[y, -2.1e-22], N[(x + y), $MachinePrecision], If[LessEqual[y, -2.9e-60], t$95$0, If[Or[LessEqual[y, -2.8e-60], N[Not[LessEqual[y, 1.3e+27]], $MachinePrecision]], (-z), N[(x + y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{z}{-y}\\
\mathbf{if}\;y \leq -2.7 \cdot 10^{+45}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -11.6:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-16}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-22}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq -2.9 \cdot 10^{-60}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{-60} \lor \neg \left(y \leq 1.3 \cdot 10^{+27}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -2.69999999999999984e45 or -2.8999999999999999e-60 < y < -2.8000000000000002e-60 or 1.30000000000000004e27 < y Initial program 73.1%
Taylor expanded in y around inf 66.7%
mul-1-neg66.7%
Simplified66.7%
if -2.69999999999999984e45 < y < -11.5999999999999996Initial program 88.7%
Taylor expanded in y around 0 64.1%
if -11.5999999999999996 < y < -9.9999999999999998e-17 or -2.10000000000000008e-22 < y < -2.8999999999999999e-60Initial program 99.9%
Taylor expanded in x around inf 68.0%
Taylor expanded in y around inf 55.0%
mul-1-neg55.0%
associate-*r/55.2%
distribute-rgt-neg-in55.2%
Simplified55.2%
if -9.9999999999999998e-17 < y < -2.10000000000000008e-22 or -2.8000000000000002e-60 < y < 1.30000000000000004e27Initial program 99.2%
Taylor expanded in z around inf 79.2%
+-commutative79.2%
Simplified79.2%
Final simplification72.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ y (- 1.0 (/ y z)))))
(if (<= y -6.4e+109)
(- z)
(if (<= y 1e-43)
(* x (/ z (- z y)))
(if (<= y 3.4e-15)
t_0
(if (<= y 3.5e+60)
(/ z (/ (- z y) x))
(if (<= y 3.8e+113)
t_0
(if (<= y 1.2e+114) (* x (/ z (- y))) (- z)))))))))
double code(double x, double y, double z) {
double t_0 = y / (1.0 - (y / z));
double tmp;
if (y <= -6.4e+109) {
tmp = -z;
} else if (y <= 1e-43) {
tmp = x * (z / (z - y));
} else if (y <= 3.4e-15) {
tmp = t_0;
} else if (y <= 3.5e+60) {
tmp = z / ((z - y) / x);
} else if (y <= 3.8e+113) {
tmp = t_0;
} else if (y <= 1.2e+114) {
tmp = x * (z / -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 = y / (1.0d0 - (y / z))
if (y <= (-6.4d+109)) then
tmp = -z
else if (y <= 1d-43) then
tmp = x * (z / (z - y))
else if (y <= 3.4d-15) then
tmp = t_0
else if (y <= 3.5d+60) then
tmp = z / ((z - y) / x)
else if (y <= 3.8d+113) then
tmp = t_0
else if (y <= 1.2d+114) then
tmp = x * (z / -y)
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y / (1.0 - (y / z));
double tmp;
if (y <= -6.4e+109) {
tmp = -z;
} else if (y <= 1e-43) {
tmp = x * (z / (z - y));
} else if (y <= 3.4e-15) {
tmp = t_0;
} else if (y <= 3.5e+60) {
tmp = z / ((z - y) / x);
} else if (y <= 3.8e+113) {
tmp = t_0;
} else if (y <= 1.2e+114) {
tmp = x * (z / -y);
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): t_0 = y / (1.0 - (y / z)) tmp = 0 if y <= -6.4e+109: tmp = -z elif y <= 1e-43: tmp = x * (z / (z - y)) elif y <= 3.4e-15: tmp = t_0 elif y <= 3.5e+60: tmp = z / ((z - y) / x) elif y <= 3.8e+113: tmp = t_0 elif y <= 1.2e+114: tmp = x * (z / -y) else: tmp = -z return tmp
function code(x, y, z) t_0 = Float64(y / Float64(1.0 - Float64(y / z))) tmp = 0.0 if (y <= -6.4e+109) tmp = Float64(-z); elseif (y <= 1e-43) tmp = Float64(x * Float64(z / Float64(z - y))); elseif (y <= 3.4e-15) tmp = t_0; elseif (y <= 3.5e+60) tmp = Float64(z / Float64(Float64(z - y) / x)); elseif (y <= 3.8e+113) tmp = t_0; elseif (y <= 1.2e+114) tmp = Float64(x * Float64(z / Float64(-y))); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y / (1.0 - (y / z)); tmp = 0.0; if (y <= -6.4e+109) tmp = -z; elseif (y <= 1e-43) tmp = x * (z / (z - y)); elseif (y <= 3.4e-15) tmp = t_0; elseif (y <= 3.5e+60) tmp = z / ((z - y) / x); elseif (y <= 3.8e+113) tmp = t_0; elseif (y <= 1.2e+114) tmp = x * (z / -y); else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.4e+109], (-z), If[LessEqual[y, 1e-43], N[(x * N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e-15], t$95$0, If[LessEqual[y, 3.5e+60], N[(z / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e+113], t$95$0, If[LessEqual[y, 1.2e+114], N[(x * N[(z / (-y)), $MachinePrecision]), $MachinePrecision], (-z)]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{1 - \frac{y}{z}}\\
\mathbf{if}\;y \leq -6.4 \cdot 10^{+109}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 10^{-43}:\\
\;\;\;\;x \cdot \frac{z}{z - y}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-15}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+60}:\\
\;\;\;\;\frac{z}{\frac{z - y}{x}}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+113}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+114}:\\
\;\;\;\;x \cdot \frac{z}{-y}\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -6.4000000000000002e109 or 1.2e114 < y Initial program 70.0%
Taylor expanded in y around inf 75.6%
mul-1-neg75.6%
Simplified75.6%
if -6.4000000000000002e109 < y < 1.00000000000000008e-43Initial program 96.8%
Taylor expanded in z around 0 96.8%
Taylor expanded in x around inf 59.9%
associate-/l*79.8%
Simplified79.8%
if 1.00000000000000008e-43 < y < 3.4e-15 or 3.5000000000000002e60 < y < 3.8000000000000003e113Initial program 99.7%
Taylor expanded in x around 0 91.0%
if 3.4e-15 < y < 3.5000000000000002e60Initial program 84.0%
Taylor expanded in x around inf 43.9%
Taylor expanded in z around 0 43.9%
associate-/r/59.7%
add-sqr-sqrt25.5%
associate-*r*25.5%
Applied egg-rr25.5%
associate-*l*25.5%
clear-num25.5%
add-sqr-sqrt59.6%
associate-*l/59.6%
*-un-lft-identity59.6%
Applied egg-rr59.6%
if 3.8000000000000003e113 < y < 1.2e114Initial program 100.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in y around inf 100.0%
mul-1-neg100.0%
associate-*r/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Final simplification78.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ y (- 1.0 (/ y z)))) (t_1 (* x (/ z (- z y)))))
(if (<= y -1.2e+116)
(- z)
(if (<= y 7.4e-44)
t_1
(if (<= y 6.5e-15)
t_0
(if (<= y 4e+58)
t_1
(if (<= y 3.8e+113)
t_0
(if (<= y 1.45e+114) (* x (/ z (- y))) (- z)))))))))
double code(double x, double y, double z) {
double t_0 = y / (1.0 - (y / z));
double t_1 = x * (z / (z - y));
double tmp;
if (y <= -1.2e+116) {
tmp = -z;
} else if (y <= 7.4e-44) {
tmp = t_1;
} else if (y <= 6.5e-15) {
tmp = t_0;
} else if (y <= 4e+58) {
tmp = t_1;
} else if (y <= 3.8e+113) {
tmp = t_0;
} else if (y <= 1.45e+114) {
tmp = x * (z / -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) :: t_1
real(8) :: tmp
t_0 = y / (1.0d0 - (y / z))
t_1 = x * (z / (z - y))
if (y <= (-1.2d+116)) then
tmp = -z
else if (y <= 7.4d-44) then
tmp = t_1
else if (y <= 6.5d-15) then
tmp = t_0
else if (y <= 4d+58) then
tmp = t_1
else if (y <= 3.8d+113) then
tmp = t_0
else if (y <= 1.45d+114) then
tmp = x * (z / -y)
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y / (1.0 - (y / z));
double t_1 = x * (z / (z - y));
double tmp;
if (y <= -1.2e+116) {
tmp = -z;
} else if (y <= 7.4e-44) {
tmp = t_1;
} else if (y <= 6.5e-15) {
tmp = t_0;
} else if (y <= 4e+58) {
tmp = t_1;
} else if (y <= 3.8e+113) {
tmp = t_0;
} else if (y <= 1.45e+114) {
tmp = x * (z / -y);
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): t_0 = y / (1.0 - (y / z)) t_1 = x * (z / (z - y)) tmp = 0 if y <= -1.2e+116: tmp = -z elif y <= 7.4e-44: tmp = t_1 elif y <= 6.5e-15: tmp = t_0 elif y <= 4e+58: tmp = t_1 elif y <= 3.8e+113: tmp = t_0 elif y <= 1.45e+114: tmp = x * (z / -y) else: tmp = -z return tmp
function code(x, y, z) t_0 = Float64(y / Float64(1.0 - Float64(y / z))) t_1 = Float64(x * Float64(z / Float64(z - y))) tmp = 0.0 if (y <= -1.2e+116) tmp = Float64(-z); elseif (y <= 7.4e-44) tmp = t_1; elseif (y <= 6.5e-15) tmp = t_0; elseif (y <= 4e+58) tmp = t_1; elseif (y <= 3.8e+113) tmp = t_0; elseif (y <= 1.45e+114) tmp = Float64(x * Float64(z / Float64(-y))); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y / (1.0 - (y / z)); t_1 = x * (z / (z - y)); tmp = 0.0; if (y <= -1.2e+116) tmp = -z; elseif (y <= 7.4e-44) tmp = t_1; elseif (y <= 6.5e-15) tmp = t_0; elseif (y <= 4e+58) tmp = t_1; elseif (y <= 3.8e+113) tmp = t_0; elseif (y <= 1.45e+114) tmp = x * (z / -y); else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.2e+116], (-z), If[LessEqual[y, 7.4e-44], t$95$1, If[LessEqual[y, 6.5e-15], t$95$0, If[LessEqual[y, 4e+58], t$95$1, If[LessEqual[y, 3.8e+113], t$95$0, If[LessEqual[y, 1.45e+114], N[(x * N[(z / (-y)), $MachinePrecision]), $MachinePrecision], (-z)]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{1 - \frac{y}{z}}\\
t_1 := x \cdot \frac{z}{z - y}\\
\mathbf{if}\;y \leq -1.2 \cdot 10^{+116}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-15}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+113}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+114}:\\
\;\;\;\;x \cdot \frac{z}{-y}\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -1.2e116 or 1.45e114 < y Initial program 70.0%
Taylor expanded in y around inf 75.6%
mul-1-neg75.6%
Simplified75.6%
if -1.2e116 < y < 7.4e-44 or 6.49999999999999991e-15 < y < 3.99999999999999978e58Initial program 95.9%
Taylor expanded in z around 0 95.9%
Taylor expanded in x around inf 59.3%
associate-/l*78.2%
Simplified78.2%
if 7.4e-44 < y < 6.49999999999999991e-15 or 3.99999999999999978e58 < y < 3.8000000000000003e113Initial program 99.7%
Taylor expanded in x around 0 91.0%
if 3.8000000000000003e113 < y < 1.45e114Initial program 100.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in y around inf 100.0%
mul-1-neg100.0%
associate-*r/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Final simplification78.1%
(FPCore (x y z) :precision binary64 (let* ((t_0 (/ (+ x y) (- 1.0 (/ y z))))) (if (or (<= t_0 -1e-192) (not (<= t_0 0.0))) t_0 (* z (/ (- (- x) y) y)))))
double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -1e-192) || !(t_0 <= 0.0)) {
tmp = t_0;
} 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 = (x + y) / (1.0d0 - (y / z))
if ((t_0 <= (-1d-192)) .or. (.not. (t_0 <= 0.0d0))) then
tmp = t_0
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 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -1e-192) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = z * ((-x - y) / y);
}
return tmp;
}
def code(x, y, z): t_0 = (x + y) / (1.0 - (y / z)) tmp = 0 if (t_0 <= -1e-192) or not (t_0 <= 0.0): tmp = t_0 else: tmp = z * ((-x - y) / 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 <= -1e-192) || !(t_0 <= 0.0)) tmp = t_0; else tmp = Float64(z * Float64(Float64(Float64(-x) - y) / 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 <= -1e-192) || ~((t_0 <= 0.0))) tmp = t_0; else tmp = z * ((-x - y) / 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, -1e-192], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], t$95$0, N[(z * N[(N[((-x) - y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-192} \lor \neg \left(t\_0 \leq 0\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{\left(-x\right) - y}{y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -1.0000000000000001e-192 or 0.0 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) Initial program 99.9%
if -1.0000000000000001e-192 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < 0.0Initial program 22.4%
Taylor expanded in z around 0 88.2%
*-commutative88.2%
associate-/l*93.0%
associate-*r*93.0%
associate-*l/93.0%
*-commutative93.0%
neg-mul-193.0%
distribute-neg-in93.0%
unsub-neg93.0%
Simplified93.0%
Final simplification98.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (/ (- (- x) y) y))))
(if (<= y -1.2e+44)
t_0
(if (<= y -2.4e-153)
(* x (/ z (- z y)))
(if (<= y -1.05e-188)
(+ x y)
(if (<= y 8.5e-44)
(/ x (/ (- z y) z))
(if (<= y 1.02e-14) (/ y (- 1.0 (/ y z))) t_0)))))))
double code(double x, double y, double z) {
double t_0 = z * ((-x - y) / y);
double tmp;
if (y <= -1.2e+44) {
tmp = t_0;
} else if (y <= -2.4e-153) {
tmp = x * (z / (z - y));
} else if (y <= -1.05e-188) {
tmp = x + y;
} else if (y <= 8.5e-44) {
tmp = x / ((z - y) / z);
} else if (y <= 1.02e-14) {
tmp = 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 = z * ((-x - y) / y)
if (y <= (-1.2d+44)) then
tmp = t_0
else if (y <= (-2.4d-153)) then
tmp = x * (z / (z - y))
else if (y <= (-1.05d-188)) then
tmp = x + y
else if (y <= 8.5d-44) then
tmp = x / ((z - y) / z)
else if (y <= 1.02d-14) then
tmp = 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 = z * ((-x - y) / y);
double tmp;
if (y <= -1.2e+44) {
tmp = t_0;
} else if (y <= -2.4e-153) {
tmp = x * (z / (z - y));
} else if (y <= -1.05e-188) {
tmp = x + y;
} else if (y <= 8.5e-44) {
tmp = x / ((z - y) / z);
} else if (y <= 1.02e-14) {
tmp = y / (1.0 - (y / z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * ((-x - y) / y) tmp = 0 if y <= -1.2e+44: tmp = t_0 elif y <= -2.4e-153: tmp = x * (z / (z - y)) elif y <= -1.05e-188: tmp = x + y elif y <= 8.5e-44: tmp = x / ((z - y) / z) elif y <= 1.02e-14: tmp = y / (1.0 - (y / z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(Float64(-x) - y) / y)) tmp = 0.0 if (y <= -1.2e+44) tmp = t_0; elseif (y <= -2.4e-153) tmp = Float64(x * Float64(z / Float64(z - y))); elseif (y <= -1.05e-188) tmp = Float64(x + y); elseif (y <= 8.5e-44) tmp = Float64(x / Float64(Float64(z - y) / z)); elseif (y <= 1.02e-14) tmp = Float64(y / Float64(1.0 - Float64(y / z))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * ((-x - y) / y); tmp = 0.0; if (y <= -1.2e+44) tmp = t_0; elseif (y <= -2.4e-153) tmp = x * (z / (z - y)); elseif (y <= -1.05e-188) tmp = x + y; elseif (y <= 8.5e-44) tmp = x / ((z - y) / z); elseif (y <= 1.02e-14) tmp = y / (1.0 - (y / z)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[((-x) - y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.2e+44], t$95$0, If[LessEqual[y, -2.4e-153], N[(x * N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.05e-188], N[(x + y), $MachinePrecision], If[LessEqual[y, 8.5e-44], N[(x / N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.02e-14], N[(y / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \frac{\left(-x\right) - y}{y}\\
\mathbf{if}\;y \leq -1.2 \cdot 10^{+44}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -2.4 \cdot 10^{-153}:\\
\;\;\;\;x \cdot \frac{z}{z - y}\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{-188}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-44}:\\
\;\;\;\;\frac{x}{\frac{z - y}{z}}\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{-14}:\\
\;\;\;\;\frac{y}{1 - \frac{y}{z}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1.20000000000000007e44 or 1.02e-14 < y Initial program 73.5%
Taylor expanded in z around 0 59.6%
*-commutative59.6%
associate-/l*80.7%
associate-*r*80.7%
associate-*l/80.7%
*-commutative80.7%
neg-mul-180.7%
distribute-neg-in80.7%
unsub-neg80.7%
Simplified80.7%
if -1.20000000000000007e44 < y < -2.4000000000000002e-153Initial program 98.0%
Taylor expanded in z around 0 98.0%
Taylor expanded in x around inf 63.6%
associate-/l*81.2%
Simplified81.2%
if -2.4000000000000002e-153 < y < -1.05e-188Initial program 100.0%
Taylor expanded in z around inf 100.0%
+-commutative100.0%
Simplified100.0%
if -1.05e-188 < y < 8.5000000000000002e-44Initial program 99.9%
Taylor expanded in x around inf 83.9%
Taylor expanded in z around 0 83.9%
if 8.5000000000000002e-44 < y < 1.02e-14Initial program 100.0%
Taylor expanded in x around 0 100.0%
Final simplification82.6%
(FPCore (x y z)
:precision binary64
(if (<= y -3.8e+43)
(- z)
(if (<= y -26.0)
x
(if (<= y -3.5e-43) y (if (<= y 1e-49) x (if (<= y 3.5e-14) y (- z)))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -3.8e+43) {
tmp = -z;
} else if (y <= -26.0) {
tmp = x;
} else if (y <= -3.5e-43) {
tmp = y;
} else if (y <= 1e-49) {
tmp = x;
} else if (y <= 3.5e-14) {
tmp = 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) :: tmp
if (y <= (-3.8d+43)) then
tmp = -z
else if (y <= (-26.0d0)) then
tmp = x
else if (y <= (-3.5d-43)) then
tmp = y
else if (y <= 1d-49) then
tmp = x
else if (y <= 3.5d-14) then
tmp = y
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -3.8e+43) {
tmp = -z;
} else if (y <= -26.0) {
tmp = x;
} else if (y <= -3.5e-43) {
tmp = y;
} else if (y <= 1e-49) {
tmp = x;
} else if (y <= 3.5e-14) {
tmp = y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -3.8e+43: tmp = -z elif y <= -26.0: tmp = x elif y <= -3.5e-43: tmp = y elif y <= 1e-49: tmp = x elif y <= 3.5e-14: tmp = y else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -3.8e+43) tmp = Float64(-z); elseif (y <= -26.0) tmp = x; elseif (y <= -3.5e-43) tmp = y; elseif (y <= 1e-49) tmp = x; elseif (y <= 3.5e-14) tmp = y; else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -3.8e+43) tmp = -z; elseif (y <= -26.0) tmp = x; elseif (y <= -3.5e-43) tmp = y; elseif (y <= 1e-49) tmp = x; elseif (y <= 3.5e-14) tmp = y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -3.8e+43], (-z), If[LessEqual[y, -26.0], x, If[LessEqual[y, -3.5e-43], y, If[LessEqual[y, 1e-49], x, If[LessEqual[y, 3.5e-14], y, (-z)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{+43}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -26:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{-43}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 10^{-49}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-14}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -3.80000000000000008e43 or 3.5000000000000002e-14 < y Initial program 73.2%
Taylor expanded in y around inf 64.5%
mul-1-neg64.5%
Simplified64.5%
if -3.80000000000000008e43 < y < -26 or -3.49999999999999997e-43 < y < 9.99999999999999936e-50Initial program 99.2%
Taylor expanded in y around 0 68.5%
if -26 < y < -3.49999999999999997e-43 or 9.99999999999999936e-50 < y < 3.5000000000000002e-14Initial program 100.0%
Taylor expanded in x around 0 54.4%
Taylor expanded in y around 0 45.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (/ z (- z y)))))
(if (<= y -1.15e+109)
(- z)
(if (<= y 5.2e-87)
t_0
(if (<= y 2e-13) (+ x y) (if (<= y 4.8e+53) t_0 (- z)))))))
double code(double x, double y, double z) {
double t_0 = x * (z / (z - y));
double tmp;
if (y <= -1.15e+109) {
tmp = -z;
} else if (y <= 5.2e-87) {
tmp = t_0;
} else if (y <= 2e-13) {
tmp = x + y;
} else if (y <= 4.8e+53) {
tmp = t_0;
} 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 * (z / (z - y))
if (y <= (-1.15d+109)) then
tmp = -z
else if (y <= 5.2d-87) then
tmp = t_0
else if (y <= 2d-13) then
tmp = x + y
else if (y <= 4.8d+53) then
tmp = t_0
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (z / (z - y));
double tmp;
if (y <= -1.15e+109) {
tmp = -z;
} else if (y <= 5.2e-87) {
tmp = t_0;
} else if (y <= 2e-13) {
tmp = x + y;
} else if (y <= 4.8e+53) {
tmp = t_0;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z / (z - y)) tmp = 0 if y <= -1.15e+109: tmp = -z elif y <= 5.2e-87: tmp = t_0 elif y <= 2e-13: tmp = x + y elif y <= 4.8e+53: tmp = t_0 else: tmp = -z return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z / Float64(z - y))) tmp = 0.0 if (y <= -1.15e+109) tmp = Float64(-z); elseif (y <= 5.2e-87) tmp = t_0; elseif (y <= 2e-13) tmp = Float64(x + y); elseif (y <= 4.8e+53) tmp = t_0; else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (z / (z - y)); tmp = 0.0; if (y <= -1.15e+109) tmp = -z; elseif (y <= 5.2e-87) tmp = t_0; elseif (y <= 2e-13) tmp = x + y; elseif (y <= 4.8e+53) tmp = t_0; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.15e+109], (-z), If[LessEqual[y, 5.2e-87], t$95$0, If[LessEqual[y, 2e-13], N[(x + y), $MachinePrecision], If[LessEqual[y, 4.8e+53], t$95$0, (-z)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{z}{z - y}\\
\mathbf{if}\;y \leq -1.15 \cdot 10^{+109}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-87}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-13}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+53}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -1.15000000000000005e109 or 4.8e53 < y Initial program 72.9%
Taylor expanded in y around inf 71.7%
mul-1-neg71.7%
Simplified71.7%
if -1.15000000000000005e109 < y < 5.20000000000000005e-87 or 2.0000000000000001e-13 < y < 4.8e53Initial program 95.6%
Taylor expanded in z around 0 95.6%
Taylor expanded in x around inf 60.3%
associate-/l*79.3%
Simplified79.3%
if 5.20000000000000005e-87 < y < 2.0000000000000001e-13Initial program 100.0%
Taylor expanded in z around inf 68.2%
+-commutative68.2%
Simplified68.2%
Final simplification75.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -3.6e+73) (not (<= y 2.05e+28))) (- z) (+ x y)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.6e+73) || !(y <= 2.05e+28)) {
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 <= (-3.6d+73)) .or. (.not. (y <= 2.05d+28))) 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 <= -3.6e+73) || !(y <= 2.05e+28)) {
tmp = -z;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3.6e+73) or not (y <= 2.05e+28): tmp = -z else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3.6e+73) || !(y <= 2.05e+28)) tmp = Float64(-z); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -3.6e+73) || ~((y <= 2.05e+28))) tmp = -z; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3.6e+73], N[Not[LessEqual[y, 2.05e+28]], $MachinePrecision]], (-z), N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{+73} \lor \neg \left(y \leq 2.05 \cdot 10^{+28}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -3.5999999999999999e73 or 2.0499999999999999e28 < y Initial program 72.4%
Taylor expanded in y around inf 66.7%
mul-1-neg66.7%
Simplified66.7%
if -3.5999999999999999e73 < y < 2.0499999999999999e28Initial program 98.7%
Taylor expanded in z around inf 72.6%
+-commutative72.6%
Simplified72.6%
Final simplification70.1%
(FPCore (x y z) :precision binary64 (if (<= x -2.5e-63) x (if (<= x 7.6e-148) y x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.5e-63) {
tmp = x;
} else if (x <= 7.6e-148) {
tmp = y;
} 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 (x <= (-2.5d-63)) then
tmp = x
else if (x <= 7.6d-148) then
tmp = y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2.5e-63) {
tmp = x;
} else if (x <= 7.6e-148) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.5e-63: tmp = x elif x <= 7.6e-148: tmp = y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.5e-63) tmp = x; elseif (x <= 7.6e-148) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.5e-63) tmp = x; elseif (x <= 7.6e-148) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.5e-63], x, If[LessEqual[x, 7.6e-148], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{-63}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{-148}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.5000000000000001e-63 or 7.60000000000000028e-148 < x Initial program 89.3%
Taylor expanded in y around 0 49.0%
if -2.5000000000000001e-63 < x < 7.60000000000000028e-148Initial program 84.4%
Taylor expanded in x around 0 70.4%
Taylor expanded in y around 0 36.4%
(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 87.8%
Taylor expanded in y around 0 37.8%
(FPCore (x y z) :precision binary64 1.0)
double code(double x, double y, double z) {
return 1.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0
end function
public static double code(double x, double y, double z) {
return 1.0;
}
def code(x, y, z): return 1.0
function code(x, y, z) return 1.0 end
function tmp = code(x, y, z) tmp = 1.0; end
code[x_, y_, z_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 87.8%
Taylor expanded in z around 0 39.4%
*-commutative39.4%
associate-/l*49.1%
associate-*r*49.1%
associate-*l/49.1%
*-commutative49.1%
neg-mul-149.1%
distribute-neg-in49.1%
unsub-neg49.1%
Simplified49.1%
Applied egg-rr3.6%
Taylor expanded in x around 0 4.0%
(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 2024105
(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))))