
(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 (or (<= t_0 -4e-230) (not (<= t_0 0.0)))
t_0
(- (* z (- (/ z y))) (+ z (/ z (/ y x)))))))
double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -4e-230) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = (z * -(z / y)) - (z + (z / (y / 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) :: t_0
real(8) :: tmp
t_0 = (x + y) / (1.0d0 - (y / z))
if ((t_0 <= (-4d-230)) .or. (.not. (t_0 <= 0.0d0))) then
tmp = t_0
else
tmp = (z * -(z / y)) - (z + (z / (y / x)))
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 <= -4e-230) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = (z * -(z / y)) - (z + (z / (y / x)));
}
return tmp;
}
def code(x, y, z): t_0 = (x + y) / (1.0 - (y / z)) tmp = 0 if (t_0 <= -4e-230) or not (t_0 <= 0.0): tmp = t_0 else: tmp = (z * -(z / y)) - (z + (z / (y / x))) 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 <= -4e-230) || !(t_0 <= 0.0)) tmp = t_0; else tmp = Float64(Float64(z * Float64(-Float64(z / y))) - Float64(z + Float64(z / Float64(y / x)))); 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 <= -4e-230) || ~((t_0 <= 0.0))) tmp = t_0; else tmp = (z * -(z / y)) - (z + (z / (y / x))); 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, -4e-230], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], t$95$0, N[(N[(z * (-N[(z / y), $MachinePrecision])), $MachinePrecision] - N[(z + N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{if}\;t_0 \leq -4 \cdot 10^{-230} \lor \neg \left(t_0 \leq 0\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-\frac{z}{y}\right) - \left(z + \frac{z}{\frac{y}{x}}\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < -4.00000000000000019e-230 or 0.0 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) Initial program 99.9%
if -4.00000000000000019e-230 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < 0.0Initial program 20.8%
clear-num20.8%
associate-/r/20.8%
Applied egg-rr20.8%
Taylor expanded in y around inf 99.9%
mul-1-neg99.9%
unsub-neg99.9%
neg-mul-199.9%
associate-/l*100.0%
unpow2100.0%
associate-*r/100.0%
Simplified100.0%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (+ x y) (- 1.0 (/ y z)))))
(if (or (<= t_0 -4e-230) (not (<= t_0 0.0)))
t_0
(- (/ (* z (- (- x) 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 <= -4e-230) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = ((z * (-x - 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 <= (-4d-230)) .or. (.not. (t_0 <= 0.0d0))) then
tmp = t_0
else
tmp = ((z * (-x - 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 <= -4e-230) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = ((z * (-x - z)) / y) - z;
}
return tmp;
}
def code(x, y, z): t_0 = (x + y) / (1.0 - (y / z)) tmp = 0 if (t_0 <= -4e-230) or not (t_0 <= 0.0): tmp = t_0 else: tmp = ((z * (-x - 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 <= -4e-230) || !(t_0 <= 0.0)) tmp = t_0; else tmp = Float64(Float64(Float64(z * Float64(Float64(-x) - 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 <= -4e-230) || ~((t_0 <= 0.0))) tmp = t_0; else tmp = ((z * (-x - 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[Or[LessEqual[t$95$0, -4e-230], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], t$95$0, N[(N[(N[(z * N[((-x) - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] - z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{if}\;t_0 \leq -4 \cdot 10^{-230} \lor \neg \left(t_0 \leq 0\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(\left(-x\right) - z\right)}{y} - z\\
\end{array}
\end{array}
if (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < -4.00000000000000019e-230 or 0.0 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) Initial program 99.9%
if -4.00000000000000019e-230 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < 0.0Initial program 20.8%
Taylor expanded in y around inf 99.9%
sub-neg99.9%
mul-1-neg99.9%
unsub-neg99.9%
associate-+l-99.9%
mul-1-neg99.9%
distribute-frac-neg99.9%
mul-1-neg99.9%
div-sub99.9%
sub-neg99.9%
mul-1-neg99.9%
remove-double-neg99.9%
unpow299.9%
distribute-lft-out99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (let* ((t_0 (/ (+ x y) (- 1.0 (/ y z))))) (if (or (<= t_0 -2e-252) (not (<= t_0 0.0))) 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-252) || !(t_0 <= 0.0)) {
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-252)) .or. (.not. (t_0 <= 0.0d0))) 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-252) || !(t_0 <= 0.0)) {
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-252) or not (t_0 <= 0.0): 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-252) || !(t_0 <= 0.0)) tmp = t_0; else tmp = Float64(Float64(z * Float64(Float64(-y) - 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-252) || ~((t_0 <= 0.0))) 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-252], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], t$95$0, N[(N[(z * N[((-y) - x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{if}\;t_0 \leq -2 \cdot 10^{-252} \lor \neg \left(t_0 \leq 0\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(\left(-y\right) - x\right)}{y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < -1.99999999999999989e-252 or 0.0 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) Initial program 99.8%
if -1.99999999999999989e-252 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < 0.0Initial program 8.8%
Taylor expanded in z around 0 99.8%
associate-*r/99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.8%
mul-1-neg99.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (+ x y) (- (/ z y)))))
(if (<= y -4.4e+160)
(- z)
(if (<= y -1.85e-61)
t_0
(if (<= y 96000000.0)
(+ x y)
(if (<= y 1.2e+92)
t_0
(if (<= y 5.2e+109)
(+ x y)
(if (<= y 1.5e+143) (* (* x z) (/ 1.0 (- y))) (- z)))))))))
double code(double x, double y, double z) {
double t_0 = (x + y) * -(z / y);
double tmp;
if (y <= -4.4e+160) {
tmp = -z;
} else if (y <= -1.85e-61) {
tmp = t_0;
} else if (y <= 96000000.0) {
tmp = x + y;
} else if (y <= 1.2e+92) {
tmp = t_0;
} else if (y <= 5.2e+109) {
tmp = x + y;
} else if (y <= 1.5e+143) {
tmp = (x * z) * (1.0 / -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 + y) * -(z / y)
if (y <= (-4.4d+160)) then
tmp = -z
else if (y <= (-1.85d-61)) then
tmp = t_0
else if (y <= 96000000.0d0) then
tmp = x + y
else if (y <= 1.2d+92) then
tmp = t_0
else if (y <= 5.2d+109) then
tmp = x + y
else if (y <= 1.5d+143) then
tmp = (x * z) * (1.0d0 / -y)
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x + y) * -(z / y);
double tmp;
if (y <= -4.4e+160) {
tmp = -z;
} else if (y <= -1.85e-61) {
tmp = t_0;
} else if (y <= 96000000.0) {
tmp = x + y;
} else if (y <= 1.2e+92) {
tmp = t_0;
} else if (y <= 5.2e+109) {
tmp = x + y;
} else if (y <= 1.5e+143) {
tmp = (x * z) * (1.0 / -y);
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): t_0 = (x + y) * -(z / y) tmp = 0 if y <= -4.4e+160: tmp = -z elif y <= -1.85e-61: tmp = t_0 elif y <= 96000000.0: tmp = x + y elif y <= 1.2e+92: tmp = t_0 elif y <= 5.2e+109: tmp = x + y elif y <= 1.5e+143: tmp = (x * z) * (1.0 / -y) else: tmp = -z return tmp
function code(x, y, z) t_0 = Float64(Float64(x + y) * Float64(-Float64(z / y))) tmp = 0.0 if (y <= -4.4e+160) tmp = Float64(-z); elseif (y <= -1.85e-61) tmp = t_0; elseif (y <= 96000000.0) tmp = Float64(x + y); elseif (y <= 1.2e+92) tmp = t_0; elseif (y <= 5.2e+109) tmp = Float64(x + y); elseif (y <= 1.5e+143) tmp = Float64(Float64(x * z) * Float64(1.0 / Float64(-y))); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x + y) * -(z / y); tmp = 0.0; if (y <= -4.4e+160) tmp = -z; elseif (y <= -1.85e-61) tmp = t_0; elseif (y <= 96000000.0) tmp = x + y; elseif (y <= 1.2e+92) tmp = t_0; elseif (y <= 5.2e+109) tmp = x + y; elseif (y <= 1.5e+143) tmp = (x * z) * (1.0 / -y); else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x + y), $MachinePrecision] * (-N[(z / y), $MachinePrecision])), $MachinePrecision]}, If[LessEqual[y, -4.4e+160], (-z), If[LessEqual[y, -1.85e-61], t$95$0, If[LessEqual[y, 96000000.0], N[(x + y), $MachinePrecision], If[LessEqual[y, 1.2e+92], t$95$0, If[LessEqual[y, 5.2e+109], N[(x + y), $MachinePrecision], If[LessEqual[y, 1.5e+143], N[(N[(x * z), $MachinePrecision] * N[(1.0 / (-y)), $MachinePrecision]), $MachinePrecision], (-z)]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x + y\right) \cdot \left(-\frac{z}{y}\right)\\
\mathbf{if}\;y \leq -4.4 \cdot 10^{+160}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -1.85 \cdot 10^{-61}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 96000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+92}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+109}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+143}:\\
\;\;\;\;\left(x \cdot z\right) \cdot \frac{1}{-y}\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -4.39999999999999984e160 or 1.5e143 < y Initial program 68.6%
Taylor expanded in y around inf 78.6%
mul-1-neg78.6%
Simplified78.6%
if -4.39999999999999984e160 < y < -1.85e-61 or 9.6e7 < y < 1.20000000000000002e92Initial program 94.3%
clear-num94.1%
associate-/r/94.1%
Applied egg-rr94.1%
Taylor expanded in y around inf 66.1%
associate-*r/66.1%
neg-mul-166.1%
Simplified66.1%
if -1.85e-61 < y < 9.6e7 or 1.20000000000000002e92 < y < 5.1999999999999997e109Initial program 100.0%
Taylor expanded in z around inf 85.0%
if 5.1999999999999997e109 < y < 1.5e143Initial program 42.6%
Taylor expanded in x around inf 23.0%
Taylor expanded in y around inf 70.7%
associate-*r/70.7%
associate-*r*70.7%
mul-1-neg70.7%
Simplified70.7%
frac-2neg70.7%
div-inv71.0%
distribute-lft-neg-out71.0%
remove-double-neg71.0%
*-commutative71.0%
Applied egg-rr71.0%
Final simplification77.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ x (- 1.0 (/ y z)))))
(if (<= y -3.1e+33)
(- z)
(if (<= y -4.5e-77)
t_0
(if (<= y 16000000.0)
(+ x y)
(if (<= y 7.2e+41)
t_0
(if (<= y 2.5e+125)
(+ x y)
(if (<= y 1.5e+143) (/ (- z) (/ y x)) (- z)))))))))
double code(double x, double y, double z) {
double t_0 = x / (1.0 - (y / z));
double tmp;
if (y <= -3.1e+33) {
tmp = -z;
} else if (y <= -4.5e-77) {
tmp = t_0;
} else if (y <= 16000000.0) {
tmp = x + y;
} else if (y <= 7.2e+41) {
tmp = t_0;
} else if (y <= 2.5e+125) {
tmp = x + y;
} else if (y <= 1.5e+143) {
tmp = -z / (y / x);
} 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 <= (-3.1d+33)) then
tmp = -z
else if (y <= (-4.5d-77)) then
tmp = t_0
else if (y <= 16000000.0d0) then
tmp = x + y
else if (y <= 7.2d+41) then
tmp = t_0
else if (y <= 2.5d+125) then
tmp = x + y
else if (y <= 1.5d+143) then
tmp = -z / (y / x)
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 <= -3.1e+33) {
tmp = -z;
} else if (y <= -4.5e-77) {
tmp = t_0;
} else if (y <= 16000000.0) {
tmp = x + y;
} else if (y <= 7.2e+41) {
tmp = t_0;
} else if (y <= 2.5e+125) {
tmp = x + y;
} else if (y <= 1.5e+143) {
tmp = -z / (y / x);
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): t_0 = x / (1.0 - (y / z)) tmp = 0 if y <= -3.1e+33: tmp = -z elif y <= -4.5e-77: tmp = t_0 elif y <= 16000000.0: tmp = x + y elif y <= 7.2e+41: tmp = t_0 elif y <= 2.5e+125: tmp = x + y elif y <= 1.5e+143: tmp = -z / (y / x) 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 <= -3.1e+33) tmp = Float64(-z); elseif (y <= -4.5e-77) tmp = t_0; elseif (y <= 16000000.0) tmp = Float64(x + y); elseif (y <= 7.2e+41) tmp = t_0; elseif (y <= 2.5e+125) tmp = Float64(x + y); elseif (y <= 1.5e+143) tmp = Float64(Float64(-z) / Float64(y / x)); 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 <= -3.1e+33) tmp = -z; elseif (y <= -4.5e-77) tmp = t_0; elseif (y <= 16000000.0) tmp = x + y; elseif (y <= 7.2e+41) tmp = t_0; elseif (y <= 2.5e+125) tmp = x + y; elseif (y <= 1.5e+143) tmp = -z / (y / x); 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, -3.1e+33], (-z), If[LessEqual[y, -4.5e-77], t$95$0, If[LessEqual[y, 16000000.0], N[(x + y), $MachinePrecision], If[LessEqual[y, 7.2e+41], t$95$0, If[LessEqual[y, 2.5e+125], N[(x + y), $MachinePrecision], If[LessEqual[y, 1.5e+143], N[((-z) / N[(y / x), $MachinePrecision]), $MachinePrecision], (-z)]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{1 - \frac{y}{z}}\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{+33}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{-77}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 16000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+41}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+125}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+143}:\\
\;\;\;\;\frac{-z}{\frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -3.1e33 or 1.5e143 < y Initial program 75.2%
Taylor expanded in y around inf 67.2%
mul-1-neg67.2%
Simplified67.2%
if -3.1e33 < y < -4.5000000000000001e-77 or 1.6e7 < y < 7.20000000000000051e41Initial program 97.4%
Taylor expanded in x around inf 58.1%
if -4.5000000000000001e-77 < y < 1.6e7 or 7.20000000000000051e41 < y < 2.49999999999999981e125Initial program 99.9%
Taylor expanded in z around inf 82.6%
if 2.49999999999999981e125 < y < 1.5e143Initial program 18.0%
Taylor expanded in x around inf 18.0%
Taylor expanded in y around inf 86.1%
mul-1-neg86.1%
associate-/l*86.3%
distribute-neg-frac86.3%
Simplified86.3%
Final simplification73.1%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.25e-61) (not (<= y 1.8e-35))) (- (- z) (* x (/ z y))) (* (+ x y) (+ 1.0 (/ y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.25e-61) || !(y <= 1.8e-35)) {
tmp = -z - (x * (z / 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) :: tmp
if ((y <= (-2.25d-61)) .or. (.not. (y <= 1.8d-35))) then
tmp = -z - (x * (z / 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 tmp;
if ((y <= -2.25e-61) || !(y <= 1.8e-35)) {
tmp = -z - (x * (z / y));
} else {
tmp = (x + y) * (1.0 + (y / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.25e-61) or not (y <= 1.8e-35): tmp = -z - (x * (z / y)) else: tmp = (x + y) * (1.0 + (y / z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.25e-61) || !(y <= 1.8e-35)) tmp = Float64(Float64(-z) - Float64(x * Float64(z / y))); else tmp = Float64(Float64(x + y) * Float64(1.0 + Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2.25e-61) || ~((y <= 1.8e-35))) tmp = -z - (x * (z / y)); else tmp = (x + y) * (1.0 + (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.25e-61], N[Not[LessEqual[y, 1.8e-35]], $MachinePrecision]], N[((-z) - N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] * N[(1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.25 \cdot 10^{-61} \lor \neg \left(y \leq 1.8 \cdot 10^{-35}\right):\\
\;\;\;\;\left(-z\right) - x \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\
\end{array}
\end{array}
if y < -2.25e-61 or 1.80000000000000009e-35 < y Initial program 80.1%
Taylor expanded in z around 0 63.9%
associate-*r/63.9%
+-commutative63.9%
*-commutative63.9%
associate-*r*63.9%
mul-1-neg63.9%
+-commutative63.9%
Simplified63.9%
Taylor expanded in y around 0 73.1%
mul-1-neg73.1%
unsub-neg73.1%
mul-1-neg73.1%
*-commutative73.1%
associate-*r/73.3%
Simplified73.3%
if -2.25e-61 < y < 1.80000000000000009e-35Initial program 100.0%
Taylor expanded in z around inf 86.7%
associate-/l*80.2%
+-commutative80.2%
associate-/r/86.6%
+-commutative86.6%
*-lft-identity86.6%
distribute-rgt-in86.6%
+-commutative86.6%
+-commutative86.6%
Simplified86.6%
Final simplification78.7%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.3e-61) (not (<= y 2200000.0))) (- (- z) (* x (/ z y))) (+ x y)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.3e-61) || !(y <= 2200000.0)) {
tmp = -z - (x * (z / y));
} 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 <= (-2.3d-61)) .or. (.not. (y <= 2200000.0d0))) then
tmp = -z - (x * (z / y))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -2.3e-61) || !(y <= 2200000.0)) {
tmp = -z - (x * (z / y));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.3e-61) or not (y <= 2200000.0): tmp = -z - (x * (z / y)) else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.3e-61) || !(y <= 2200000.0)) tmp = Float64(Float64(-z) - Float64(x * Float64(z / y))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2.3e-61) || ~((y <= 2200000.0))) tmp = -z - (x * (z / y)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.3e-61], N[Not[LessEqual[y, 2200000.0]], $MachinePrecision]], N[((-z) - N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{-61} \lor \neg \left(y \leq 2200000\right):\\
\;\;\;\;\left(-z\right) - x \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -2.29999999999999992e-61 or 2.2e6 < y Initial program 79.3%
Taylor expanded in z around 0 64.4%
associate-*r/64.4%
+-commutative64.4%
*-commutative64.4%
associate-*r*64.4%
mul-1-neg64.4%
+-commutative64.4%
Simplified64.4%
Taylor expanded in y around 0 74.0%
mul-1-neg74.0%
unsub-neg74.0%
mul-1-neg74.0%
*-commutative74.0%
associate-*r/74.2%
Simplified74.2%
if -2.29999999999999992e-61 < y < 2.2e6Initial program 100.0%
Taylor expanded in z around inf 84.5%
Final simplification78.6%
(FPCore (x y z)
:precision binary64
(if (<= y -1.8e+32)
(- z)
(if (<= y -9e-37)
(* x (- (/ z y)))
(if (<= y -2.7e-61) (- z) (if (<= y 95000000.0) (+ x y) (- z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.8e+32) {
tmp = -z;
} else if (y <= -9e-37) {
tmp = x * -(z / y);
} else if (y <= -2.7e-61) {
tmp = -z;
} else if (y <= 95000000.0) {
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) :: tmp
if (y <= (-1.8d+32)) then
tmp = -z
else if (y <= (-9d-37)) then
tmp = x * -(z / y)
else if (y <= (-2.7d-61)) then
tmp = -z
else if (y <= 95000000.0d0) then
tmp = x + y
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.8e+32) {
tmp = -z;
} else if (y <= -9e-37) {
tmp = x * -(z / y);
} else if (y <= -2.7e-61) {
tmp = -z;
} else if (y <= 95000000.0) {
tmp = x + y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.8e+32: tmp = -z elif y <= -9e-37: tmp = x * -(z / y) elif y <= -2.7e-61: tmp = -z elif y <= 95000000.0: tmp = x + y else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.8e+32) tmp = Float64(-z); elseif (y <= -9e-37) tmp = Float64(x * Float64(-Float64(z / y))); elseif (y <= -2.7e-61) tmp = Float64(-z); elseif (y <= 95000000.0) tmp = Float64(x + y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.8e+32) tmp = -z; elseif (y <= -9e-37) tmp = x * -(z / y); elseif (y <= -2.7e-61) tmp = -z; elseif (y <= 95000000.0) tmp = x + y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.8e+32], (-z), If[LessEqual[y, -9e-37], N[(x * (-N[(z / y), $MachinePrecision])), $MachinePrecision], If[LessEqual[y, -2.7e-61], (-z), If[LessEqual[y, 95000000.0], N[(x + y), $MachinePrecision], (-z)]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+32}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -9 \cdot 10^{-37}:\\
\;\;\;\;x \cdot \left(-\frac{z}{y}\right)\\
\mathbf{elif}\;y \leq -2.7 \cdot 10^{-61}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 95000000:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -1.7999999999999998e32 or -9.00000000000000081e-37 < y < -2.69999999999999993e-61 or 9.5e7 < y Initial program 76.3%
Taylor expanded in y around inf 59.8%
mul-1-neg59.8%
Simplified59.8%
if -1.7999999999999998e32 < y < -9.00000000000000081e-37Initial program 99.7%
Taylor expanded in x around inf 59.7%
Taylor expanded in y around inf 54.0%
associate-*r/54.0%
associate-*r*54.0%
mul-1-neg54.0%
Simplified54.0%
Taylor expanded in z around 0 54.0%
mul-1-neg54.0%
associate-*l/54.1%
*-commutative54.1%
distribute-rgt-neg-in54.1%
distribute-frac-neg54.1%
Simplified54.1%
if -2.69999999999999993e-61 < y < 9.5e7Initial program 100.0%
Taylor expanded in z around inf 84.5%
Final simplification69.9%
(FPCore (x y z)
:precision binary64
(if (<= y -3.8e+37)
(- z)
(if (<= y -1.6e-38)
(/ (- z) (/ y x))
(if (<= y -2.7e-61) (- z) (if (<= y 150000000.0) (+ x y) (- z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -3.8e+37) {
tmp = -z;
} else if (y <= -1.6e-38) {
tmp = -z / (y / x);
} else if (y <= -2.7e-61) {
tmp = -z;
} else if (y <= 150000000.0) {
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) :: tmp
if (y <= (-3.8d+37)) then
tmp = -z
else if (y <= (-1.6d-38)) then
tmp = -z / (y / x)
else if (y <= (-2.7d-61)) then
tmp = -z
else if (y <= 150000000.0d0) then
tmp = x + 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+37) {
tmp = -z;
} else if (y <= -1.6e-38) {
tmp = -z / (y / x);
} else if (y <= -2.7e-61) {
tmp = -z;
} else if (y <= 150000000.0) {
tmp = x + y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -3.8e+37: tmp = -z elif y <= -1.6e-38: tmp = -z / (y / x) elif y <= -2.7e-61: tmp = -z elif y <= 150000000.0: tmp = x + y else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -3.8e+37) tmp = Float64(-z); elseif (y <= -1.6e-38) tmp = Float64(Float64(-z) / Float64(y / x)); elseif (y <= -2.7e-61) tmp = Float64(-z); elseif (y <= 150000000.0) tmp = Float64(x + y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -3.8e+37) tmp = -z; elseif (y <= -1.6e-38) tmp = -z / (y / x); elseif (y <= -2.7e-61) tmp = -z; elseif (y <= 150000000.0) tmp = x + y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -3.8e+37], (-z), If[LessEqual[y, -1.6e-38], N[((-z) / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.7e-61], (-z), If[LessEqual[y, 150000000.0], N[(x + y), $MachinePrecision], (-z)]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{+37}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -1.6 \cdot 10^{-38}:\\
\;\;\;\;\frac{-z}{\frac{y}{x}}\\
\mathbf{elif}\;y \leq -2.7 \cdot 10^{-61}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 150000000:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -3.7999999999999999e37 or -1.59999999999999989e-38 < y < -2.69999999999999993e-61 or 1.5e8 < y Initial program 76.1%
Taylor expanded in y around inf 60.3%
mul-1-neg60.3%
Simplified60.3%
if -3.7999999999999999e37 < y < -1.59999999999999989e-38Initial program 99.7%
Taylor expanded in x around inf 56.9%
Taylor expanded in y around inf 51.4%
mul-1-neg51.4%
associate-/l*51.7%
distribute-neg-frac51.7%
Simplified51.7%
if -2.69999999999999993e-61 < y < 1.5e8Initial program 100.0%
Taylor expanded in z around inf 84.5%
Final simplification69.9%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- 1.0 (/ y z)))) (if (or (<= x -1.46e-37) (not (<= x 1.4e-32))) (/ x t_0) (/ y t_0))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double tmp;
if ((x <= -1.46e-37) || !(x <= 1.4e-32)) {
tmp = x / t_0;
} else {
tmp = y / 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 = 1.0d0 - (y / z)
if ((x <= (-1.46d-37)) .or. (.not. (x <= 1.4d-32))) then
tmp = x / t_0
else
tmp = y / t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double tmp;
if ((x <= -1.46e-37) || !(x <= 1.4e-32)) {
tmp = x / t_0;
} else {
tmp = y / t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) tmp = 0 if (x <= -1.46e-37) or not (x <= 1.4e-32): tmp = x / t_0 else: tmp = y / t_0 return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) tmp = 0.0 if ((x <= -1.46e-37) || !(x <= 1.4e-32)) tmp = Float64(x / t_0); else tmp = Float64(y / t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); tmp = 0.0; if ((x <= -1.46e-37) || ~((x <= 1.4e-32))) tmp = x / t_0; else tmp = y / t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -1.46e-37], N[Not[LessEqual[x, 1.4e-32]], $MachinePrecision]], N[(x / t$95$0), $MachinePrecision], N[(y / t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
\mathbf{if}\;x \leq -1.46 \cdot 10^{-37} \lor \neg \left(x \leq 1.4 \cdot 10^{-32}\right):\\
\;\;\;\;\frac{x}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t_0}\\
\end{array}
\end{array}
if x < -1.46e-37 or 1.3999999999999999e-32 < x Initial program 86.7%
Taylor expanded in x around inf 69.5%
if -1.46e-37 < x < 1.3999999999999999e-32Initial program 90.2%
Taylor expanded in x around 0 76.0%
Final simplification72.2%
(FPCore (x y z) :precision binary64 (if (<= y -1.32e-61) (- z) (if (<= y 70000000.0) (+ x y) (- z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.32e-61) {
tmp = -z;
} else if (y <= 70000000.0) {
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) :: tmp
if (y <= (-1.32d-61)) then
tmp = -z
else if (y <= 70000000.0d0) then
tmp = x + y
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.32e-61) {
tmp = -z;
} else if (y <= 70000000.0) {
tmp = x + y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.32e-61: tmp = -z elif y <= 70000000.0: tmp = x + y else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.32e-61) tmp = Float64(-z); elseif (y <= 70000000.0) tmp = Float64(x + y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.32e-61) tmp = -z; elseif (y <= 70000000.0) tmp = x + y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.32e-61], (-z), If[LessEqual[y, 70000000.0], N[(x + y), $MachinePrecision], (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.32 \cdot 10^{-61}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 70000000:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -1.32000000000000002e-61 or 7e7 < y Initial program 79.3%
Taylor expanded in y around inf 55.8%
mul-1-neg55.8%
Simplified55.8%
if -1.32000000000000002e-61 < y < 7e7Initial program 100.0%
Taylor expanded in z around inf 84.5%
Final simplification68.1%
(FPCore (x y z) :precision binary64 (if (<= y -1.9e-61) (- z) (if (<= y 1.4e-33) x (- z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.9e-61) {
tmp = -z;
} else if (y <= 1.4e-33) {
tmp = x;
} 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 <= (-1.9d-61)) then
tmp = -z
else if (y <= 1.4d-33) then
tmp = x
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.9e-61) {
tmp = -z;
} else if (y <= 1.4e-33) {
tmp = x;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.9e-61: tmp = -z elif y <= 1.4e-33: tmp = x else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.9e-61) tmp = Float64(-z); elseif (y <= 1.4e-33) tmp = x; else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.9e-61) tmp = -z; elseif (y <= 1.4e-33) tmp = x; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.9e-61], (-z), If[LessEqual[y, 1.4e-33], x, (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{-61}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-33}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -1.8999999999999999e-61 or 1.4e-33 < y Initial program 80.0%
Taylor expanded in y around inf 55.4%
mul-1-neg55.4%
Simplified55.4%
if -1.8999999999999999e-61 < y < 1.4e-33Initial program 100.0%
Taylor expanded in y around 0 69.5%
Final simplification61.1%
(FPCore (x y z) :precision binary64 (if (<= x -1.5e-102) x (if (<= x 1.06e-148) y x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.5e-102) {
tmp = x;
} else if (x <= 1.06e-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 <= (-1.5d-102)) then
tmp = x
else if (x <= 1.06d-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 <= -1.5e-102) {
tmp = x;
} else if (x <= 1.06e-148) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.5e-102: tmp = x elif x <= 1.06e-148: tmp = y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.5e-102) tmp = x; elseif (x <= 1.06e-148) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.5e-102) tmp = x; elseif (x <= 1.06e-148) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.5e-102], x, If[LessEqual[x, 1.06e-148], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{-102}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.06 \cdot 10^{-148}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.5e-102 or 1.06000000000000003e-148 < x Initial program 87.6%
Taylor expanded in y around 0 43.5%
if -1.5e-102 < x < 1.06000000000000003e-148Initial program 89.4%
Taylor expanded in x around 0 82.9%
Taylor expanded in y around 0 45.6%
Final simplification44.1%
(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.9%
Final simplification33.9%
(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 2023252
(FPCore (x y z)
:name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, A"
:precision binary64
:herbie-target
(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))))