
(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 12 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 -5e-272) (not (<= t_0 0.0))) t_0 (- (- z) (/ (* x z) y)))))
double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -5e-272) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = -z - ((x * z) / 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 <= (-5d-272)) .or. (.not. (t_0 <= 0.0d0))) then
tmp = t_0
else
tmp = -z - ((x * z) / 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 <= -5e-272) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = -z - ((x * z) / y);
}
return tmp;
}
def code(x, y, z): t_0 = (x + y) / (1.0 - (y / z)) tmp = 0 if (t_0 <= -5e-272) or not (t_0 <= 0.0): tmp = t_0 else: tmp = -z - ((x * z) / 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 <= -5e-272) || !(t_0 <= 0.0)) tmp = t_0; else tmp = Float64(Float64(-z) - Float64(Float64(x * z) / 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 <= -5e-272) || ~((t_0 <= 0.0))) tmp = t_0; else tmp = -z - ((x * z) / 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, -5e-272], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], t$95$0, N[((-z) - N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-272} \lor \neg \left(t\_0 \leq 0\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) - \frac{x \cdot z}{y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -4.99999999999999982e-272 or -0.0 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) Initial program 99.8%
if -4.99999999999999982e-272 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -0.0Initial program 13.3%
Taylor expanded in y around inf 100.0%
associate--l+100.0%
associate-*r/100.0%
div-sub100.0%
remove-double-neg100.0%
mul-1-neg100.0%
neg-mul-1100.0%
distribute-lft-out--100.0%
mul-1-neg100.0%
distribute-neg-frac100.0%
unsub-neg100.0%
mul-1-neg100.0%
cancel-sign-sub-inv100.0%
metadata-eval100.0%
*-lft-identity100.0%
+-commutative100.0%
unpow2100.0%
distribute-rgt-out100.0%
Simplified100.0%
Taylor expanded in z around 0 100.0%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))) (t_1 (/ y t_0)) (t_2 (/ x t_0)))
(if (<= y -2.6e+236)
(- z)
(if (<= y -5.5e+64)
(/ (* z (+ x y)) (- y))
(if (<= y -1.35e-14)
t_1
(if (<= y -2.8e-96)
t_2
(if (<= y -1.55e-147) (+ x y) (if (<= y 2.1e+22) t_2 t_1))))))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = y / t_0;
double t_2 = x / t_0;
double tmp;
if (y <= -2.6e+236) {
tmp = -z;
} else if (y <= -5.5e+64) {
tmp = (z * (x + y)) / -y;
} else if (y <= -1.35e-14) {
tmp = t_1;
} else if (y <= -2.8e-96) {
tmp = t_2;
} else if (y <= -1.55e-147) {
tmp = x + y;
} else if (y <= 2.1e+22) {
tmp = t_2;
} else {
tmp = t_1;
}
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 = y / t_0
t_2 = x / t_0
if (y <= (-2.6d+236)) then
tmp = -z
else if (y <= (-5.5d+64)) then
tmp = (z * (x + y)) / -y
else if (y <= (-1.35d-14)) then
tmp = t_1
else if (y <= (-2.8d-96)) then
tmp = t_2
else if (y <= (-1.55d-147)) then
tmp = x + y
else if (y <= 2.1d+22) then
tmp = t_2
else
tmp = t_1
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 = y / t_0;
double t_2 = x / t_0;
double tmp;
if (y <= -2.6e+236) {
tmp = -z;
} else if (y <= -5.5e+64) {
tmp = (z * (x + y)) / -y;
} else if (y <= -1.35e-14) {
tmp = t_1;
} else if (y <= -2.8e-96) {
tmp = t_2;
} else if (y <= -1.55e-147) {
tmp = x + y;
} else if (y <= 2.1e+22) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) t_1 = y / t_0 t_2 = x / t_0 tmp = 0 if y <= -2.6e+236: tmp = -z elif y <= -5.5e+64: tmp = (z * (x + y)) / -y elif y <= -1.35e-14: tmp = t_1 elif y <= -2.8e-96: tmp = t_2 elif y <= -1.55e-147: tmp = x + y elif y <= 2.1e+22: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) t_1 = Float64(y / t_0) t_2 = Float64(x / t_0) tmp = 0.0 if (y <= -2.6e+236) tmp = Float64(-z); elseif (y <= -5.5e+64) tmp = Float64(Float64(z * Float64(x + y)) / Float64(-y)); elseif (y <= -1.35e-14) tmp = t_1; elseif (y <= -2.8e-96) tmp = t_2; elseif (y <= -1.55e-147) tmp = Float64(x + y); elseif (y <= 2.1e+22) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); t_1 = y / t_0; t_2 = x / t_0; tmp = 0.0; if (y <= -2.6e+236) tmp = -z; elseif (y <= -5.5e+64) tmp = (z * (x + y)) / -y; elseif (y <= -1.35e-14) tmp = t_1; elseif (y <= -2.8e-96) tmp = t_2; elseif (y <= -1.55e-147) tmp = x + y; elseif (y <= 2.1e+22) tmp = t_2; else tmp = t_1; 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[(y / t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(x / t$95$0), $MachinePrecision]}, If[LessEqual[y, -2.6e+236], (-z), If[LessEqual[y, -5.5e+64], N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] / (-y)), $MachinePrecision], If[LessEqual[y, -1.35e-14], t$95$1, If[LessEqual[y, -2.8e-96], t$95$2, If[LessEqual[y, -1.55e-147], N[(x + y), $MachinePrecision], If[LessEqual[y, 2.1e+22], t$95$2, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
t_1 := \frac{y}{t\_0}\\
t_2 := \frac{x}{t\_0}\\
\mathbf{if}\;y \leq -2.6 \cdot 10^{+236}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -5.5 \cdot 10^{+64}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right)}{-y}\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{-96}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.55 \cdot 10^{-147}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{+22}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.6e236Initial program 57.0%
Taylor expanded in y around inf 88.6%
mul-1-neg88.6%
Simplified88.6%
if -2.6e236 < y < -5.4999999999999996e64Initial program 67.6%
Taylor expanded in z around 0 82.5%
mul-1-neg82.5%
+-commutative82.5%
Simplified82.5%
if -5.4999999999999996e64 < y < -1.3499999999999999e-14 or 2.0999999999999998e22 < y Initial program 84.5%
Taylor expanded in x around 0 66.8%
if -1.3499999999999999e-14 < y < -2.80000000000000015e-96 or -1.5500000000000001e-147 < y < 2.0999999999999998e22Initial program 99.9%
Taylor expanded in x around inf 84.9%
if -2.80000000000000015e-96 < y < -1.5500000000000001e-147Initial program 100.0%
Taylor expanded in z around inf 86.6%
+-commutative86.6%
Simplified86.6%
Final simplification79.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))) (t_1 (* (- z) (/ (+ x y) y))) (t_2 (/ x t_0)))
(if (<= y -2.2e+62)
t_1
(if (<= y -4.4e-15)
(/ y t_0)
(if (<= y -1.8e-92)
t_2
(if (<= y -1.14e-147) (+ x y) (if (<= y 340.0) t_2 t_1)))))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = -z * ((x + y) / y);
double t_2 = x / t_0;
double tmp;
if (y <= -2.2e+62) {
tmp = t_1;
} else if (y <= -4.4e-15) {
tmp = y / t_0;
} else if (y <= -1.8e-92) {
tmp = t_2;
} else if (y <= -1.14e-147) {
tmp = x + y;
} else if (y <= 340.0) {
tmp = t_2;
} else {
tmp = t_1;
}
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 = -z * ((x + y) / y)
t_2 = x / t_0
if (y <= (-2.2d+62)) then
tmp = t_1
else if (y <= (-4.4d-15)) then
tmp = y / t_0
else if (y <= (-1.8d-92)) then
tmp = t_2
else if (y <= (-1.14d-147)) then
tmp = x + y
else if (y <= 340.0d0) then
tmp = t_2
else
tmp = t_1
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 = -z * ((x + y) / y);
double t_2 = x / t_0;
double tmp;
if (y <= -2.2e+62) {
tmp = t_1;
} else if (y <= -4.4e-15) {
tmp = y / t_0;
} else if (y <= -1.8e-92) {
tmp = t_2;
} else if (y <= -1.14e-147) {
tmp = x + y;
} else if (y <= 340.0) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) t_1 = -z * ((x + y) / y) t_2 = x / t_0 tmp = 0 if y <= -2.2e+62: tmp = t_1 elif y <= -4.4e-15: tmp = y / t_0 elif y <= -1.8e-92: tmp = t_2 elif y <= -1.14e-147: tmp = x + y elif y <= 340.0: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) t_1 = Float64(Float64(-z) * Float64(Float64(x + y) / y)) t_2 = Float64(x / t_0) tmp = 0.0 if (y <= -2.2e+62) tmp = t_1; elseif (y <= -4.4e-15) tmp = Float64(y / t_0); elseif (y <= -1.8e-92) tmp = t_2; elseif (y <= -1.14e-147) tmp = Float64(x + y); elseif (y <= 340.0) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); t_1 = -z * ((x + y) / y); t_2 = x / t_0; tmp = 0.0; if (y <= -2.2e+62) tmp = t_1; elseif (y <= -4.4e-15) tmp = y / t_0; elseif (y <= -1.8e-92) tmp = t_2; elseif (y <= -1.14e-147) tmp = x + y; elseif (y <= 340.0) tmp = t_2; else tmp = t_1; 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[((-z) * N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / t$95$0), $MachinePrecision]}, If[LessEqual[y, -2.2e+62], t$95$1, If[LessEqual[y, -4.4e-15], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, -1.8e-92], t$95$2, If[LessEqual[y, -1.14e-147], N[(x + y), $MachinePrecision], If[LessEqual[y, 340.0], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
t_1 := \left(-z\right) \cdot \frac{x + y}{y}\\
t_2 := \frac{x}{t\_0}\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -4.4 \cdot 10^{-15}:\\
\;\;\;\;\frac{y}{t\_0}\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{-92}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.14 \cdot 10^{-147}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 340:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.20000000000000015e62 or 340 < y Initial program 72.6%
Taylor expanded in z around 0 65.7%
mul-1-neg65.7%
associate-/l*77.9%
distribute-rgt-neg-in77.9%
distribute-neg-frac277.9%
+-commutative77.9%
Simplified77.9%
if -2.20000000000000015e62 < y < -4.39999999999999971e-15Initial program 99.7%
Taylor expanded in x around 0 72.8%
if -4.39999999999999971e-15 < y < -1.80000000000000008e-92 or -1.14e-147 < y < 340Initial program 99.9%
Taylor expanded in x around inf 85.2%
if -1.80000000000000008e-92 < y < -1.14e-147Initial program 99.8%
Taylor expanded in z around inf 79.4%
+-commutative79.4%
Simplified79.4%
Final simplification80.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))))
(if (<= y -1.4e+62)
(* (- z) (/ (+ x y) y))
(if (<= y -4.3e-14)
(/ y t_0)
(if (<= y -9.5e-94)
(* x (/ -1.0 (+ (/ y z) -1.0)))
(if (<= y -1.24e-147)
(+ x y)
(if (<= y 2500.0) (/ x t_0) (* z (- -1.0 (/ x y))))))))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double tmp;
if (y <= -1.4e+62) {
tmp = -z * ((x + y) / y);
} else if (y <= -4.3e-14) {
tmp = y / t_0;
} else if (y <= -9.5e-94) {
tmp = x * (-1.0 / ((y / z) + -1.0));
} else if (y <= -1.24e-147) {
tmp = x + y;
} else if (y <= 2500.0) {
tmp = x / t_0;
} else {
tmp = z * (-1.0 - (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 = 1.0d0 - (y / z)
if (y <= (-1.4d+62)) then
tmp = -z * ((x + y) / y)
else if (y <= (-4.3d-14)) then
tmp = y / t_0
else if (y <= (-9.5d-94)) then
tmp = x * ((-1.0d0) / ((y / z) + (-1.0d0)))
else if (y <= (-1.24d-147)) then
tmp = x + y
else if (y <= 2500.0d0) then
tmp = x / t_0
else
tmp = z * ((-1.0d0) - (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 tmp;
if (y <= -1.4e+62) {
tmp = -z * ((x + y) / y);
} else if (y <= -4.3e-14) {
tmp = y / t_0;
} else if (y <= -9.5e-94) {
tmp = x * (-1.0 / ((y / z) + -1.0));
} else if (y <= -1.24e-147) {
tmp = x + y;
} else if (y <= 2500.0) {
tmp = x / t_0;
} else {
tmp = z * (-1.0 - (x / y));
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) tmp = 0 if y <= -1.4e+62: tmp = -z * ((x + y) / y) elif y <= -4.3e-14: tmp = y / t_0 elif y <= -9.5e-94: tmp = x * (-1.0 / ((y / z) + -1.0)) elif y <= -1.24e-147: tmp = x + y elif y <= 2500.0: tmp = x / t_0 else: tmp = z * (-1.0 - (x / y)) return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) tmp = 0.0 if (y <= -1.4e+62) tmp = Float64(Float64(-z) * Float64(Float64(x + y) / y)); elseif (y <= -4.3e-14) tmp = Float64(y / t_0); elseif (y <= -9.5e-94) tmp = Float64(x * Float64(-1.0 / Float64(Float64(y / z) + -1.0))); elseif (y <= -1.24e-147) tmp = Float64(x + y); elseif (y <= 2500.0) tmp = Float64(x / t_0); else tmp = Float64(z * Float64(-1.0 - Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); tmp = 0.0; if (y <= -1.4e+62) tmp = -z * ((x + y) / y); elseif (y <= -4.3e-14) tmp = y / t_0; elseif (y <= -9.5e-94) tmp = x * (-1.0 / ((y / z) + -1.0)); elseif (y <= -1.24e-147) tmp = x + y; elseif (y <= 2500.0) tmp = x / t_0; else tmp = z * (-1.0 - (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+62], N[((-z) * N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.3e-14], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, -9.5e-94], N[(x * N[(-1.0 / N[(N[(y / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.24e-147], N[(x + y), $MachinePrecision], If[LessEqual[y, 2500.0], N[(x / t$95$0), $MachinePrecision], N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+62}:\\
\;\;\;\;\left(-z\right) \cdot \frac{x + y}{y}\\
\mathbf{elif}\;y \leq -4.3 \cdot 10^{-14}:\\
\;\;\;\;\frac{y}{t\_0}\\
\mathbf{elif}\;y \leq -9.5 \cdot 10^{-94}:\\
\;\;\;\;x \cdot \frac{-1}{\frac{y}{z} + -1}\\
\mathbf{elif}\;y \leq -1.24 \cdot 10^{-147}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 2500:\\
\;\;\;\;\frac{x}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\
\end{array}
\end{array}
if y < -1.40000000000000007e62Initial program 63.9%
Taylor expanded in z around 0 73.6%
mul-1-neg73.6%
associate-/l*89.0%
distribute-rgt-neg-in89.0%
distribute-neg-frac289.0%
+-commutative89.0%
Simplified89.0%
if -1.40000000000000007e62 < y < -4.29999999999999998e-14Initial program 99.7%
Taylor expanded in x around 0 72.8%
if -4.29999999999999998e-14 < y < -9.4999999999999997e-94Initial program 99.6%
Taylor expanded in x around inf 69.5%
div-inv69.5%
*-commutative69.5%
frac-2neg69.5%
metadata-eval69.5%
sub-neg69.5%
distribute-neg-in69.5%
metadata-eval69.5%
distribute-neg-frac69.5%
distribute-frac-neg269.5%
frac-2neg69.5%
Applied egg-rr69.5%
if -9.4999999999999997e-94 < y < -1.2400000000000001e-147Initial program 99.8%
Taylor expanded in z around inf 79.4%
+-commutative79.4%
Simplified79.4%
if -1.2400000000000001e-147 < y < 2500Initial program 99.9%
Taylor expanded in x around inf 87.0%
if 2500 < y Initial program 80.6%
Taylor expanded in y around inf 60.9%
associate--l+60.9%
associate-*r/60.9%
div-sub60.9%
remove-double-neg60.9%
mul-1-neg60.9%
neg-mul-160.9%
distribute-lft-out--60.9%
mul-1-neg60.9%
distribute-neg-frac60.9%
unsub-neg60.9%
mul-1-neg60.9%
cancel-sign-sub-inv60.9%
metadata-eval60.9%
*-lft-identity60.9%
+-commutative60.9%
unpow260.9%
distribute-rgt-out61.1%
Simplified61.1%
Taylor expanded in z around 0 67.7%
associate-*r*67.7%
mul-1-neg67.7%
Simplified67.7%
Final simplification80.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))) (t_1 (/ x t_0)))
(if (<= y -1.8e+63)
(* (- z) (/ (+ x y) y))
(if (<= y -3.5e-12)
(/ y t_0)
(if (<= y -1.36e-92)
t_1
(if (<= y -1.22e-147)
(+ x y)
(if (<= y 700.0) t_1 (* z (- -1.0 (/ x y))))))))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = x / t_0;
double tmp;
if (y <= -1.8e+63) {
tmp = -z * ((x + y) / y);
} else if (y <= -3.5e-12) {
tmp = y / t_0;
} else if (y <= -1.36e-92) {
tmp = t_1;
} else if (y <= -1.22e-147) {
tmp = x + y;
} else if (y <= 700.0) {
tmp = t_1;
} else {
tmp = z * (-1.0 - (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 / t_0
if (y <= (-1.8d+63)) then
tmp = -z * ((x + y) / y)
else if (y <= (-3.5d-12)) then
tmp = y / t_0
else if (y <= (-1.36d-92)) then
tmp = t_1
else if (y <= (-1.22d-147)) then
tmp = x + y
else if (y <= 700.0d0) then
tmp = t_1
else
tmp = z * ((-1.0d0) - (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 / t_0;
double tmp;
if (y <= -1.8e+63) {
tmp = -z * ((x + y) / y);
} else if (y <= -3.5e-12) {
tmp = y / t_0;
} else if (y <= -1.36e-92) {
tmp = t_1;
} else if (y <= -1.22e-147) {
tmp = x + y;
} else if (y <= 700.0) {
tmp = t_1;
} else {
tmp = z * (-1.0 - (x / y));
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) t_1 = x / t_0 tmp = 0 if y <= -1.8e+63: tmp = -z * ((x + y) / y) elif y <= -3.5e-12: tmp = y / t_0 elif y <= -1.36e-92: tmp = t_1 elif y <= -1.22e-147: tmp = x + y elif y <= 700.0: tmp = t_1 else: tmp = z * (-1.0 - (x / y)) return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) t_1 = Float64(x / t_0) tmp = 0.0 if (y <= -1.8e+63) tmp = Float64(Float64(-z) * Float64(Float64(x + y) / y)); elseif (y <= -3.5e-12) tmp = Float64(y / t_0); elseif (y <= -1.36e-92) tmp = t_1; elseif (y <= -1.22e-147) tmp = Float64(x + y); elseif (y <= 700.0) tmp = t_1; else tmp = Float64(z * Float64(-1.0 - Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); t_1 = x / t_0; tmp = 0.0; if (y <= -1.8e+63) tmp = -z * ((x + y) / y); elseif (y <= -3.5e-12) tmp = y / t_0; elseif (y <= -1.36e-92) tmp = t_1; elseif (y <= -1.22e-147) tmp = x + y; elseif (y <= 700.0) tmp = t_1; else tmp = z * (-1.0 - (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[(x / t$95$0), $MachinePrecision]}, If[LessEqual[y, -1.8e+63], N[((-z) * N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.5e-12], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, -1.36e-92], t$95$1, If[LessEqual[y, -1.22e-147], N[(x + y), $MachinePrecision], If[LessEqual[y, 700.0], t$95$1, N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
t_1 := \frac{x}{t\_0}\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{+63}:\\
\;\;\;\;\left(-z\right) \cdot \frac{x + y}{y}\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{y}{t\_0}\\
\mathbf{elif}\;y \leq -1.36 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.22 \cdot 10^{-147}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 700:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\
\end{array}
\end{array}
if y < -1.79999999999999999e63Initial program 63.9%
Taylor expanded in z around 0 73.6%
mul-1-neg73.6%
associate-/l*89.0%
distribute-rgt-neg-in89.0%
distribute-neg-frac289.0%
+-commutative89.0%
Simplified89.0%
if -1.79999999999999999e63 < y < -3.5e-12Initial program 99.7%
Taylor expanded in x around 0 72.8%
if -3.5e-12 < y < -1.36e-92 or -1.21999999999999995e-147 < y < 700Initial program 99.9%
Taylor expanded in x around inf 85.2%
if -1.36e-92 < y < -1.21999999999999995e-147Initial program 99.8%
Taylor expanded in z around inf 79.4%
+-commutative79.4%
Simplified79.4%
if 700 < y Initial program 80.6%
Taylor expanded in y around inf 60.9%
associate--l+60.9%
associate-*r/60.9%
div-sub60.9%
remove-double-neg60.9%
mul-1-neg60.9%
neg-mul-160.9%
distribute-lft-out--60.9%
mul-1-neg60.9%
distribute-neg-frac60.9%
unsub-neg60.9%
mul-1-neg60.9%
cancel-sign-sub-inv60.9%
metadata-eval60.9%
*-lft-identity60.9%
+-commutative60.9%
unpow260.9%
distribute-rgt-out61.1%
Simplified61.1%
Taylor expanded in z around 0 67.7%
associate-*r*67.7%
mul-1-neg67.7%
Simplified67.7%
Final simplification80.7%
(FPCore (x y z)
:precision binary64
(if (<= y -1.25e+52)
(- z)
(if (<= y -4.2e-148)
(+ x y)
(if (<= y -1.3e-177)
(* (/ z y) (- x))
(if (<= y 5.8e+69) (+ x y) (- z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.25e+52) {
tmp = -z;
} else if (y <= -4.2e-148) {
tmp = x + y;
} else if (y <= -1.3e-177) {
tmp = (z / y) * -x;
} else if (y <= 5.8e+69) {
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.25d+52)) then
tmp = -z
else if (y <= (-4.2d-148)) then
tmp = x + y
else if (y <= (-1.3d-177)) then
tmp = (z / y) * -x
else if (y <= 5.8d+69) 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.25e+52) {
tmp = -z;
} else if (y <= -4.2e-148) {
tmp = x + y;
} else if (y <= -1.3e-177) {
tmp = (z / y) * -x;
} else if (y <= 5.8e+69) {
tmp = x + y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.25e+52: tmp = -z elif y <= -4.2e-148: tmp = x + y elif y <= -1.3e-177: tmp = (z / y) * -x elif y <= 5.8e+69: tmp = x + y else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.25e+52) tmp = Float64(-z); elseif (y <= -4.2e-148) tmp = Float64(x + y); elseif (y <= -1.3e-177) tmp = Float64(Float64(z / y) * Float64(-x)); elseif (y <= 5.8e+69) 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.25e+52) tmp = -z; elseif (y <= -4.2e-148) tmp = x + y; elseif (y <= -1.3e-177) tmp = (z / y) * -x; elseif (y <= 5.8e+69) tmp = x + y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.25e+52], (-z), If[LessEqual[y, -4.2e-148], N[(x + y), $MachinePrecision], If[LessEqual[y, -1.3e-177], N[(N[(z / y), $MachinePrecision] * (-x)), $MachinePrecision], If[LessEqual[y, 5.8e+69], N[(x + y), $MachinePrecision], (-z)]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+52}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{-148}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq -1.3 \cdot 10^{-177}:\\
\;\;\;\;\frac{z}{y} \cdot \left(-x\right)\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{+69}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -1.25e52 or 5.7999999999999997e69 < y Initial program 70.1%
Taylor expanded in y around inf 67.1%
mul-1-neg67.1%
Simplified67.1%
if -1.25e52 < y < -4.2e-148 or -1.3e-177 < y < 5.7999999999999997e69Initial program 99.2%
Taylor expanded in z around inf 73.9%
+-commutative73.9%
Simplified73.9%
if -4.2e-148 < y < -1.3e-177Initial program 99.8%
Taylor expanded in x around inf 99.8%
Taylor expanded in y around inf 80.1%
mul-1-neg80.1%
associate-/l*80.1%
distribute-rgt-neg-in80.1%
distribute-neg-frac280.1%
Simplified80.1%
Final simplification71.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))))
(if (<= y -3.3e+64)
(- z)
(if (or (<= y -8.5e-6) (not (<= y 4.2e+22))) (/ y t_0) (/ x t_0)))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double tmp;
if (y <= -3.3e+64) {
tmp = -z;
} else if ((y <= -8.5e-6) || !(y <= 4.2e+22)) {
tmp = y / t_0;
} else {
tmp = x / 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 (y <= (-3.3d+64)) then
tmp = -z
else if ((y <= (-8.5d-6)) .or. (.not. (y <= 4.2d+22))) then
tmp = y / t_0
else
tmp = x / 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 (y <= -3.3e+64) {
tmp = -z;
} else if ((y <= -8.5e-6) || !(y <= 4.2e+22)) {
tmp = y / t_0;
} else {
tmp = x / t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) tmp = 0 if y <= -3.3e+64: tmp = -z elif (y <= -8.5e-6) or not (y <= 4.2e+22): tmp = y / t_0 else: tmp = x / t_0 return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) tmp = 0.0 if (y <= -3.3e+64) tmp = Float64(-z); elseif ((y <= -8.5e-6) || !(y <= 4.2e+22)) tmp = Float64(y / t_0); else tmp = Float64(x / t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); tmp = 0.0; if (y <= -3.3e+64) tmp = -z; elseif ((y <= -8.5e-6) || ~((y <= 4.2e+22))) tmp = y / t_0; else tmp = x / t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.3e+64], (-z), If[Or[LessEqual[y, -8.5e-6], N[Not[LessEqual[y, 4.2e+22]], $MachinePrecision]], N[(y / t$95$0), $MachinePrecision], N[(x / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
\mathbf{if}\;y \leq -3.3 \cdot 10^{+64}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -8.5 \cdot 10^{-6} \lor \neg \left(y \leq 4.2 \cdot 10^{+22}\right):\\
\;\;\;\;\frac{y}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t\_0}\\
\end{array}
\end{array}
if y < -3.29999999999999988e64Initial program 63.9%
Taylor expanded in y around inf 70.8%
mul-1-neg70.8%
Simplified70.8%
if -3.29999999999999988e64 < y < -8.4999999999999999e-6 or 4.1999999999999996e22 < y Initial program 83.6%
Taylor expanded in x around 0 67.6%
if -8.4999999999999999e-6 < y < 4.1999999999999996e22Initial program 99.9%
Taylor expanded in x around inf 81.6%
Final simplification75.1%
(FPCore (x y z) :precision binary64 (if (or (<= y -6.4e+22) (not (<= y 5.6e+22))) (- z) (/ x (- 1.0 (/ y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -6.4e+22) || !(y <= 5.6e+22)) {
tmp = -z;
} else {
tmp = x / (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 <= (-6.4d+22)) .or. (.not. (y <= 5.6d+22))) then
tmp = -z
else
tmp = x / (1.0d0 - (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -6.4e+22) || !(y <= 5.6e+22)) {
tmp = -z;
} else {
tmp = x / (1.0 - (y / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -6.4e+22) or not (y <= 5.6e+22): tmp = -z else: tmp = x / (1.0 - (y / z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -6.4e+22) || !(y <= 5.6e+22)) tmp = Float64(-z); else tmp = Float64(x / Float64(1.0 - Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -6.4e+22) || ~((y <= 5.6e+22))) tmp = -z; else tmp = x / (1.0 - (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -6.4e+22], N[Not[LessEqual[y, 5.6e+22]], $MachinePrecision]], (-z), N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.4 \cdot 10^{+22} \lor \neg \left(y \leq 5.6 \cdot 10^{+22}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 - \frac{y}{z}}\\
\end{array}
\end{array}
if y < -6.4e22 or 5.6e22 < y Initial program 74.1%
Taylor expanded in y around inf 62.9%
mul-1-neg62.9%
Simplified62.9%
if -6.4e22 < y < 5.6e22Initial program 99.9%
Taylor expanded in x around inf 80.1%
Final simplification71.5%
(FPCore (x y z) :precision binary64 (if (<= y -1.9e+45) (- z) (if (<= y -4.7e-118) y (if (<= y 21000.0) x (- z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.9e+45) {
tmp = -z;
} else if (y <= -4.7e-118) {
tmp = y;
} else if (y <= 21000.0) {
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+45)) then
tmp = -z
else if (y <= (-4.7d-118)) then
tmp = y
else if (y <= 21000.0d0) 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+45) {
tmp = -z;
} else if (y <= -4.7e-118) {
tmp = y;
} else if (y <= 21000.0) {
tmp = x;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.9e+45: tmp = -z elif y <= -4.7e-118: tmp = y elif y <= 21000.0: tmp = x else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.9e+45) tmp = Float64(-z); elseif (y <= -4.7e-118) tmp = y; elseif (y <= 21000.0) tmp = x; else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.9e+45) tmp = -z; elseif (y <= -4.7e-118) tmp = y; elseif (y <= 21000.0) tmp = x; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.9e+45], (-z), If[LessEqual[y, -4.7e-118], y, If[LessEqual[y, 21000.0], x, (-z)]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+45}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -4.7 \cdot 10^{-118}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 21000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -1.9000000000000001e45 or 21000 < y Initial program 73.5%
Taylor expanded in y around inf 63.4%
mul-1-neg63.4%
Simplified63.4%
if -1.9000000000000001e45 < y < -4.69999999999999991e-118Initial program 99.7%
Taylor expanded in x around 0 54.7%
Taylor expanded in y around 0 41.2%
if -4.69999999999999991e-118 < y < 21000Initial program 99.9%
Taylor expanded in y around 0 72.4%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.55e+52) (not (<= y 5.9e+69))) (- z) (+ x y)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.55e+52) || !(y <= 5.9e+69)) {
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 <= (-1.55d+52)) .or. (.not. (y <= 5.9d+69))) 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 <= -1.55e+52) || !(y <= 5.9e+69)) {
tmp = -z;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.55e+52) or not (y <= 5.9e+69): tmp = -z else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.55e+52) || !(y <= 5.9e+69)) tmp = Float64(-z); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.55e+52) || ~((y <= 5.9e+69))) tmp = -z; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.55e+52], N[Not[LessEqual[y, 5.9e+69]], $MachinePrecision]], (-z), N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{+52} \lor \neg \left(y \leq 5.9 \cdot 10^{+69}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -1.55e52 or 5.90000000000000004e69 < y Initial program 70.1%
Taylor expanded in y around inf 67.1%
mul-1-neg67.1%
Simplified67.1%
if -1.55e52 < y < 5.90000000000000004e69Initial program 99.3%
Taylor expanded in z around inf 71.3%
+-commutative71.3%
Simplified71.3%
Final simplification69.5%
(FPCore (x y z) :precision binary64 (if (<= y -3.8e-118) y (if (<= y 1.16e+42) x y)))
double code(double x, double y, double z) {
double tmp;
if (y <= -3.8e-118) {
tmp = y;
} else if (y <= 1.16e+42) {
tmp = x;
} else {
tmp = 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.8d-118)) then
tmp = y
else if (y <= 1.16d+42) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -3.8e-118) {
tmp = y;
} else if (y <= 1.16e+42) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -3.8e-118: tmp = y elif y <= 1.16e+42: tmp = x else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -3.8e-118) tmp = y; elseif (y <= 1.16e+42) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -3.8e-118) tmp = y; elseif (y <= 1.16e+42) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -3.8e-118], y, If[LessEqual[y, 1.16e+42], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{-118}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 1.16 \cdot 10^{+42}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -3.8000000000000001e-118 or 1.15999999999999995e42 < y Initial program 78.0%
Taylor expanded in x around 0 58.8%
Taylor expanded in y around 0 22.6%
if -3.8000000000000001e-118 < y < 1.15999999999999995e42Initial program 99.1%
Taylor expanded in y around 0 69.0%
(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.0%
Taylor expanded in y around 0 34.4%
(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 2024097
(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))))