
(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 -1e-236) (not (<= t_0 0.0))) t_0 (/ z (/ y (- (- y) x))))))
double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -1e-236) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = z / (y / (-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 <= (-1d-236)) .or. (.not. (t_0 <= 0.0d0))) then
tmp = t_0
else
tmp = z / (y / (-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 <= -1e-236) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = z / (y / (-y - x));
}
return tmp;
}
def code(x, y, z): t_0 = (x + y) / (1.0 - (y / z)) tmp = 0 if (t_0 <= -1e-236) or not (t_0 <= 0.0): tmp = t_0 else: tmp = z / (y / (-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 <= -1e-236) || !(t_0 <= 0.0)) tmp = t_0; else tmp = Float64(z / Float64(y / Float64(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 <= -1e-236) || ~((t_0 <= 0.0))) tmp = t_0; else tmp = z / (y / (-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, -1e-236], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], t$95$0, N[(z / N[(y / N[((-y) - x), $MachinePrecision]), $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^{-236} \lor \neg \left(t\_0 \leq 0\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{y}{\left(-y\right) - x}}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -1e-236 or -0.0 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) Initial program 99.9%
if -1e-236 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -0.0Initial program 11.6%
Taylor expanded in z around 0 95.0%
mul-1-neg95.0%
associate-/l*99.9%
distribute-rgt-neg-in99.9%
distribute-neg-frac299.9%
+-commutative99.9%
Simplified99.9%
associate-*r/95.0%
distribute-frac-neg295.0%
add-sqr-sqrt43.3%
sqrt-unprod14.6%
sqr-neg14.6%
sqrt-unprod2.6%
add-sqr-sqrt4.7%
associate-*r/4.7%
clear-num4.7%
un-div-inv4.7%
add-sqr-sqrt2.6%
sqrt-unprod16.7%
sqr-neg16.7%
sqrt-unprod45.4%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ x (- 1.0 (/ y z)))))
(if (<= y -4.1e+152)
(- z)
(if (<= y -1.02e+101)
(+ x y)
(if (<= y -3.65e+77)
(- z)
(if (<= y -1.32e-90)
t_0
(if (<= y 2.3e-72) (+ x y) (if (<= y 5e+44) t_0 (- z)))))))))
double code(double x, double y, double z) {
double t_0 = x / (1.0 - (y / z));
double tmp;
if (y <= -4.1e+152) {
tmp = -z;
} else if (y <= -1.02e+101) {
tmp = x + y;
} else if (y <= -3.65e+77) {
tmp = -z;
} else if (y <= -1.32e-90) {
tmp = t_0;
} else if (y <= 2.3e-72) {
tmp = x + y;
} else if (y <= 5e+44) {
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 / (1.0d0 - (y / z))
if (y <= (-4.1d+152)) then
tmp = -z
else if (y <= (-1.02d+101)) then
tmp = x + y
else if (y <= (-3.65d+77)) then
tmp = -z
else if (y <= (-1.32d-90)) then
tmp = t_0
else if (y <= 2.3d-72) then
tmp = x + y
else if (y <= 5d+44) 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 / (1.0 - (y / z));
double tmp;
if (y <= -4.1e+152) {
tmp = -z;
} else if (y <= -1.02e+101) {
tmp = x + y;
} else if (y <= -3.65e+77) {
tmp = -z;
} else if (y <= -1.32e-90) {
tmp = t_0;
} else if (y <= 2.3e-72) {
tmp = x + y;
} else if (y <= 5e+44) {
tmp = t_0;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): t_0 = x / (1.0 - (y / z)) tmp = 0 if y <= -4.1e+152: tmp = -z elif y <= -1.02e+101: tmp = x + y elif y <= -3.65e+77: tmp = -z elif y <= -1.32e-90: tmp = t_0 elif y <= 2.3e-72: tmp = x + y elif y <= 5e+44: tmp = t_0 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 <= -4.1e+152) tmp = Float64(-z); elseif (y <= -1.02e+101) tmp = Float64(x + y); elseif (y <= -3.65e+77) tmp = Float64(-z); elseif (y <= -1.32e-90) tmp = t_0; elseif (y <= 2.3e-72) tmp = Float64(x + y); elseif (y <= 5e+44) tmp = t_0; 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 <= -4.1e+152) tmp = -z; elseif (y <= -1.02e+101) tmp = x + y; elseif (y <= -3.65e+77) tmp = -z; elseif (y <= -1.32e-90) tmp = t_0; elseif (y <= 2.3e-72) tmp = x + y; elseif (y <= 5e+44) tmp = t_0; 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, -4.1e+152], (-z), If[LessEqual[y, -1.02e+101], N[(x + y), $MachinePrecision], If[LessEqual[y, -3.65e+77], (-z), If[LessEqual[y, -1.32e-90], t$95$0, If[LessEqual[y, 2.3e-72], N[(x + y), $MachinePrecision], If[LessEqual[y, 5e+44], t$95$0, (-z)]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{1 - \frac{y}{z}}\\
\mathbf{if}\;y \leq -4.1 \cdot 10^{+152}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -1.02 \cdot 10^{+101}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq -3.65 \cdot 10^{+77}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -1.32 \cdot 10^{-90}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-72}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+44}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -4.0999999999999998e152 or -1.02000000000000002e101 < y < -3.65000000000000012e77 or 4.9999999999999996e44 < y Initial program 72.4%
Taylor expanded in y around inf 75.6%
mul-1-neg75.6%
Simplified75.6%
if -4.0999999999999998e152 < y < -1.02000000000000002e101 or -1.32000000000000005e-90 < y < 2.29999999999999995e-72Initial program 99.1%
Taylor expanded in z around inf 82.6%
+-commutative82.6%
Simplified82.6%
if -3.65000000000000012e77 < y < -1.32000000000000005e-90 or 2.29999999999999995e-72 < y < 4.9999999999999996e44Initial program 97.3%
Taylor expanded in x around inf 74.1%
Final simplification78.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))))
(if (<= y -1.02e+150)
(/ z (/ y (- (- y) x)))
(if (<= y -3.6e+77)
(/ y t_0)
(if (<= y -5.3e-116)
(/ x t_0)
(if (<= y 1.22e-57)
(* (+ x y) (+ 1.0 (/ y z)))
(* z (/ (+ x y) (- y)))))))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double tmp;
if (y <= -1.02e+150) {
tmp = z / (y / (-y - x));
} else if (y <= -3.6e+77) {
tmp = y / t_0;
} else if (y <= -5.3e-116) {
tmp = x / t_0;
} else if (y <= 1.22e-57) {
tmp = (x + y) * (1.0 + (y / z));
} 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 = 1.0d0 - (y / z)
if (y <= (-1.02d+150)) then
tmp = z / (y / (-y - x))
else if (y <= (-3.6d+77)) then
tmp = y / t_0
else if (y <= (-5.3d-116)) then
tmp = x / t_0
else if (y <= 1.22d-57) then
tmp = (x + y) * (1.0d0 + (y / z))
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 = 1.0 - (y / z);
double tmp;
if (y <= -1.02e+150) {
tmp = z / (y / (-y - x));
} else if (y <= -3.6e+77) {
tmp = y / t_0;
} else if (y <= -5.3e-116) {
tmp = x / t_0;
} else if (y <= 1.22e-57) {
tmp = (x + y) * (1.0 + (y / z));
} else {
tmp = z * ((x + y) / -y);
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) tmp = 0 if y <= -1.02e+150: tmp = z / (y / (-y - x)) elif y <= -3.6e+77: tmp = y / t_0 elif y <= -5.3e-116: tmp = x / t_0 elif y <= 1.22e-57: tmp = (x + y) * (1.0 + (y / z)) else: tmp = z * ((x + y) / -y) return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) tmp = 0.0 if (y <= -1.02e+150) tmp = Float64(z / Float64(y / Float64(Float64(-y) - x))); elseif (y <= -3.6e+77) tmp = Float64(y / t_0); elseif (y <= -5.3e-116) tmp = Float64(x / t_0); elseif (y <= 1.22e-57) tmp = Float64(Float64(x + y) * Float64(1.0 + Float64(y / z))); else tmp = Float64(z * Float64(Float64(x + y) / Float64(-y))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); tmp = 0.0; if (y <= -1.02e+150) tmp = z / (y / (-y - x)); elseif (y <= -3.6e+77) tmp = y / t_0; elseif (y <= -5.3e-116) tmp = x / t_0; elseif (y <= 1.22e-57) tmp = (x + y) * (1.0 + (y / z)); else tmp = z * ((x + y) / -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.02e+150], N[(z / N[(y / N[((-y) - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.6e+77], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, -5.3e-116], N[(x / t$95$0), $MachinePrecision], If[LessEqual[y, 1.22e-57], N[(N[(x + y), $MachinePrecision] * N[(1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(x + y), $MachinePrecision] / (-y)), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
\mathbf{if}\;y \leq -1.02 \cdot 10^{+150}:\\
\;\;\;\;\frac{z}{\frac{y}{\left(-y\right) - x}}\\
\mathbf{elif}\;y \leq -3.6 \cdot 10^{+77}:\\
\;\;\;\;\frac{y}{t\_0}\\
\mathbf{elif}\;y \leq -5.3 \cdot 10^{-116}:\\
\;\;\;\;\frac{x}{t\_0}\\
\mathbf{elif}\;y \leq 1.22 \cdot 10^{-57}:\\
\;\;\;\;\left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x + y}{-y}\\
\end{array}
\end{array}
if y < -1.0199999999999999e150Initial program 62.8%
Taylor expanded in z around 0 71.9%
mul-1-neg71.9%
associate-/l*88.6%
distribute-rgt-neg-in88.6%
distribute-neg-frac288.6%
+-commutative88.6%
Simplified88.6%
associate-*r/71.9%
distribute-frac-neg271.9%
add-sqr-sqrt0.0%
sqrt-unprod3.4%
sqr-neg3.4%
sqrt-unprod2.9%
add-sqr-sqrt2.9%
associate-*r/3.0%
clear-num3.0%
un-div-inv3.0%
add-sqr-sqrt3.0%
sqrt-unprod3.9%
sqr-neg3.9%
sqrt-unprod0.0%
add-sqr-sqrt88.6%
Applied egg-rr88.6%
if -1.0199999999999999e150 < y < -3.5999999999999998e77Initial program 89.3%
Taylor expanded in x around 0 73.3%
if -3.5999999999999998e77 < y < -5.3e-116Initial program 95.6%
Taylor expanded in x around inf 78.1%
if -5.3e-116 < y < 1.2200000000000001e-57Initial program 100.0%
Taylor expanded in z around inf 87.0%
associate-+r+87.0%
*-rgt-identity87.0%
*-commutative87.0%
associate-/l*87.5%
distribute-lft-in87.5%
+-commutative87.5%
Simplified87.5%
if 1.2200000000000001e-57 < y Initial program 82.9%
Taylor expanded in z around 0 73.1%
mul-1-neg73.1%
associate-/l*83.0%
distribute-rgt-neg-in83.0%
distribute-neg-frac283.0%
+-commutative83.0%
Simplified83.0%
Final simplification84.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))) (t_1 (/ z (/ y (- (- y) x)))))
(if (<= y -5.8e+149)
t_1
(if (<= y -3.7e+77)
(/ y t_0)
(if (<= y -1.95e-89) (/ x t_0) (if (<= y 1.7e-56) (+ x y) t_1))))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double t_1 = z / (y / (-y - x));
double tmp;
if (y <= -5.8e+149) {
tmp = t_1;
} else if (y <= -3.7e+77) {
tmp = y / t_0;
} else if (y <= -1.95e-89) {
tmp = x / t_0;
} else if (y <= 1.7e-56) {
tmp = x + y;
} 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) :: tmp
t_0 = 1.0d0 - (y / z)
t_1 = z / (y / (-y - x))
if (y <= (-5.8d+149)) then
tmp = t_1
else if (y <= (-3.7d+77)) then
tmp = y / t_0
else if (y <= (-1.95d-89)) then
tmp = x / t_0
else if (y <= 1.7d-56) then
tmp = x + y
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 / (y / (-y - x));
double tmp;
if (y <= -5.8e+149) {
tmp = t_1;
} else if (y <= -3.7e+77) {
tmp = y / t_0;
} else if (y <= -1.95e-89) {
tmp = x / t_0;
} else if (y <= 1.7e-56) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) t_1 = z / (y / (-y - x)) tmp = 0 if y <= -5.8e+149: tmp = t_1 elif y <= -3.7e+77: tmp = y / t_0 elif y <= -1.95e-89: tmp = x / t_0 elif y <= 1.7e-56: tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) t_1 = Float64(z / Float64(y / Float64(Float64(-y) - x))) tmp = 0.0 if (y <= -5.8e+149) tmp = t_1; elseif (y <= -3.7e+77) tmp = Float64(y / t_0); elseif (y <= -1.95e-89) tmp = Float64(x / t_0); elseif (y <= 1.7e-56) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); t_1 = z / (y / (-y - x)); tmp = 0.0; if (y <= -5.8e+149) tmp = t_1; elseif (y <= -3.7e+77) tmp = y / t_0; elseif (y <= -1.95e-89) tmp = x / t_0; elseif (y <= 1.7e-56) tmp = x + y; 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[(y / N[((-y) - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.8e+149], t$95$1, If[LessEqual[y, -3.7e+77], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, -1.95e-89], N[(x / t$95$0), $MachinePrecision], If[LessEqual[y, 1.7e-56], N[(x + y), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
t_1 := \frac{z}{\frac{y}{\left(-y\right) - x}}\\
\mathbf{if}\;y \leq -5.8 \cdot 10^{+149}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.7 \cdot 10^{+77}:\\
\;\;\;\;\frac{y}{t\_0}\\
\mathbf{elif}\;y \leq -1.95 \cdot 10^{-89}:\\
\;\;\;\;\frac{x}{t\_0}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-56}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.8000000000000004e149 or 1.69999999999999991e-56 < y Initial program 76.6%
Taylor expanded in z around 0 72.8%
mul-1-neg72.8%
associate-/l*84.7%
distribute-rgt-neg-in84.7%
distribute-neg-frac284.7%
+-commutative84.7%
Simplified84.7%
associate-*r/72.8%
distribute-frac-neg272.8%
add-sqr-sqrt49.9%
sqrt-unprod34.4%
sqr-neg34.4%
sqrt-unprod0.9%
add-sqr-sqrt2.6%
associate-*r/2.7%
clear-num2.7%
un-div-inv2.7%
add-sqr-sqrt0.9%
sqrt-unprod34.9%
sqr-neg34.9%
sqrt-unprod56.5%
add-sqr-sqrt84.7%
Applied egg-rr84.7%
if -5.8000000000000004e149 < y < -3.69999999999999995e77Initial program 89.3%
Taylor expanded in x around 0 73.3%
if -3.69999999999999995e77 < y < -1.94999999999999989e-89Initial program 94.1%
Taylor expanded in x around inf 82.0%
if -1.94999999999999989e-89 < y < 1.69999999999999991e-56Initial program 99.9%
Taylor expanded in z around inf 85.6%
+-commutative85.6%
Simplified85.6%
Final simplification84.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))))
(if (<= y -1.75e+150)
(/ z (/ y (- (- y) x)))
(if (<= y -7.3e+77)
(/ y t_0)
(if (<= y -5e-92)
(/ x t_0)
(if (<= y 3.8e-59) (+ x y) (* z (/ (+ x y) (- y)))))))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double tmp;
if (y <= -1.75e+150) {
tmp = z / (y / (-y - x));
} else if (y <= -7.3e+77) {
tmp = y / t_0;
} else if (y <= -5e-92) {
tmp = x / t_0;
} else if (y <= 3.8e-59) {
tmp = x + y;
} else {
tmp = z * ((x + y) / -y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - (y / z)
if (y <= (-1.75d+150)) then
tmp = z / (y / (-y - x))
else if (y <= (-7.3d+77)) then
tmp = y / t_0
else if (y <= (-5d-92)) then
tmp = x / t_0
else if (y <= 3.8d-59) then
tmp = x + y
else
tmp = z * ((x + y) / -y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double tmp;
if (y <= -1.75e+150) {
tmp = z / (y / (-y - x));
} else if (y <= -7.3e+77) {
tmp = y / t_0;
} else if (y <= -5e-92) {
tmp = x / t_0;
} else if (y <= 3.8e-59) {
tmp = x + y;
} else {
tmp = z * ((x + y) / -y);
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) tmp = 0 if y <= -1.75e+150: tmp = z / (y / (-y - x)) elif y <= -7.3e+77: tmp = y / t_0 elif y <= -5e-92: tmp = x / t_0 elif y <= 3.8e-59: tmp = x + y else: tmp = z * ((x + y) / -y) return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) tmp = 0.0 if (y <= -1.75e+150) tmp = Float64(z / Float64(y / Float64(Float64(-y) - x))); elseif (y <= -7.3e+77) tmp = Float64(y / t_0); elseif (y <= -5e-92) tmp = Float64(x / t_0); elseif (y <= 3.8e-59) tmp = Float64(x + y); else tmp = Float64(z * Float64(Float64(x + y) / Float64(-y))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); tmp = 0.0; if (y <= -1.75e+150) tmp = z / (y / (-y - x)); elseif (y <= -7.3e+77) tmp = y / t_0; elseif (y <= -5e-92) tmp = x / t_0; elseif (y <= 3.8e-59) tmp = x + y; else tmp = z * ((x + y) / -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.75e+150], N[(z / N[(y / N[((-y) - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7.3e+77], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, -5e-92], N[(x / t$95$0), $MachinePrecision], If[LessEqual[y, 3.8e-59], N[(x + y), $MachinePrecision], N[(z * N[(N[(x + y), $MachinePrecision] / (-y)), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
\mathbf{if}\;y \leq -1.75 \cdot 10^{+150}:\\
\;\;\;\;\frac{z}{\frac{y}{\left(-y\right) - x}}\\
\mathbf{elif}\;y \leq -7.3 \cdot 10^{+77}:\\
\;\;\;\;\frac{y}{t\_0}\\
\mathbf{elif}\;y \leq -5 \cdot 10^{-92}:\\
\;\;\;\;\frac{x}{t\_0}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-59}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x + y}{-y}\\
\end{array}
\end{array}
if y < -1.74999999999999992e150Initial program 62.8%
Taylor expanded in z around 0 71.9%
mul-1-neg71.9%
associate-/l*88.6%
distribute-rgt-neg-in88.6%
distribute-neg-frac288.6%
+-commutative88.6%
Simplified88.6%
associate-*r/71.9%
distribute-frac-neg271.9%
add-sqr-sqrt0.0%
sqrt-unprod3.4%
sqr-neg3.4%
sqrt-unprod2.9%
add-sqr-sqrt2.9%
associate-*r/3.0%
clear-num3.0%
un-div-inv3.0%
add-sqr-sqrt3.0%
sqrt-unprod3.9%
sqr-neg3.9%
sqrt-unprod0.0%
add-sqr-sqrt88.6%
Applied egg-rr88.6%
if -1.74999999999999992e150 < y < -7.30000000000000025e77Initial program 89.3%
Taylor expanded in x around 0 73.3%
if -7.30000000000000025e77 < y < -5.00000000000000011e-92Initial program 94.1%
Taylor expanded in x around inf 82.0%
if -5.00000000000000011e-92 < y < 3.79999999999999983e-59Initial program 99.9%
Taylor expanded in z around inf 85.6%
+-commutative85.6%
Simplified85.6%
if 3.79999999999999983e-59 < y Initial program 82.9%
Taylor expanded in z around 0 73.1%
mul-1-neg73.1%
associate-/l*83.0%
distribute-rgt-neg-in83.0%
distribute-neg-frac283.0%
+-commutative83.0%
Simplified83.0%
Final simplification84.1%
(FPCore (x y z)
:precision binary64
(if (<= y -4.2e+152)
(- z)
(if (<= y 0.19)
(+ x y)
(if (<= y 1.7e+35)
(/ z (/ y (- x)))
(if (<= y 3.35e+44) (+ x y) (- z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -4.2e+152) {
tmp = -z;
} else if (y <= 0.19) {
tmp = x + y;
} else if (y <= 1.7e+35) {
tmp = z / (y / -x);
} else if (y <= 3.35e+44) {
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 <= (-4.2d+152)) then
tmp = -z
else if (y <= 0.19d0) then
tmp = x + y
else if (y <= 1.7d+35) then
tmp = z / (y / -x)
else if (y <= 3.35d+44) 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 <= -4.2e+152) {
tmp = -z;
} else if (y <= 0.19) {
tmp = x + y;
} else if (y <= 1.7e+35) {
tmp = z / (y / -x);
} else if (y <= 3.35e+44) {
tmp = x + y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -4.2e+152: tmp = -z elif y <= 0.19: tmp = x + y elif y <= 1.7e+35: tmp = z / (y / -x) elif y <= 3.35e+44: tmp = x + y else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -4.2e+152) tmp = Float64(-z); elseif (y <= 0.19) tmp = Float64(x + y); elseif (y <= 1.7e+35) tmp = Float64(z / Float64(y / Float64(-x))); elseif (y <= 3.35e+44) tmp = Float64(x + y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -4.2e+152) tmp = -z; elseif (y <= 0.19) tmp = x + y; elseif (y <= 1.7e+35) tmp = z / (y / -x); elseif (y <= 3.35e+44) tmp = x + y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -4.2e+152], (-z), If[LessEqual[y, 0.19], N[(x + y), $MachinePrecision], If[LessEqual[y, 1.7e+35], N[(z / N[(y / (-x)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.35e+44], N[(x + y), $MachinePrecision], (-z)]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+152}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 0.19:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+35}:\\
\;\;\;\;\frac{z}{\frac{y}{-x}}\\
\mathbf{elif}\;y \leq 3.35 \cdot 10^{+44}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -4.2000000000000003e152 or 3.35000000000000018e44 < y Initial program 71.4%
Taylor expanded in y around inf 76.8%
mul-1-neg76.8%
Simplified76.8%
if -4.2000000000000003e152 < y < 0.19 or 1.7000000000000001e35 < y < 3.35000000000000018e44Initial program 98.0%
Taylor expanded in z around inf 75.9%
+-commutative75.9%
Simplified75.9%
if 0.19 < y < 1.7000000000000001e35Initial program 99.6%
Taylor expanded in z around 0 93.0%
mul-1-neg93.0%
associate-/l*92.8%
distribute-rgt-neg-in92.8%
distribute-neg-frac292.8%
+-commutative92.8%
Simplified92.8%
associate-*r/93.0%
distribute-frac-neg293.0%
add-sqr-sqrt92.6%
sqrt-unprod93.0%
sqr-neg93.0%
sqrt-unprod0.0%
add-sqr-sqrt1.4%
associate-*r/1.4%
clear-num1.4%
un-div-inv1.4%
add-sqr-sqrt0.0%
sqrt-unprod93.2%
sqr-neg93.2%
sqrt-unprod92.4%
add-sqr-sqrt93.2%
Applied egg-rr93.2%
Taylor expanded in y around 0 65.8%
Final simplification76.0%
(FPCore (x y z)
:precision binary64
(if (<= y -4.1e+152)
(- z)
(if (<= y 0.0035)
(+ x y)
(if (<= y 4e+35) (* x (/ z (- y))) (if (<= y 1.7e+46) (+ x y) (- z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -4.1e+152) {
tmp = -z;
} else if (y <= 0.0035) {
tmp = x + y;
} else if (y <= 4e+35) {
tmp = x * (z / -y);
} else if (y <= 1.7e+46) {
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 <= (-4.1d+152)) then
tmp = -z
else if (y <= 0.0035d0) then
tmp = x + y
else if (y <= 4d+35) then
tmp = x * (z / -y)
else if (y <= 1.7d+46) 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 <= -4.1e+152) {
tmp = -z;
} else if (y <= 0.0035) {
tmp = x + y;
} else if (y <= 4e+35) {
tmp = x * (z / -y);
} else if (y <= 1.7e+46) {
tmp = x + y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -4.1e+152: tmp = -z elif y <= 0.0035: tmp = x + y elif y <= 4e+35: tmp = x * (z / -y) elif y <= 1.7e+46: tmp = x + y else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -4.1e+152) tmp = Float64(-z); elseif (y <= 0.0035) tmp = Float64(x + y); elseif (y <= 4e+35) tmp = Float64(x * Float64(z / Float64(-y))); elseif (y <= 1.7e+46) tmp = Float64(x + y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -4.1e+152) tmp = -z; elseif (y <= 0.0035) tmp = x + y; elseif (y <= 4e+35) tmp = x * (z / -y); elseif (y <= 1.7e+46) tmp = x + y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -4.1e+152], (-z), If[LessEqual[y, 0.0035], N[(x + y), $MachinePrecision], If[LessEqual[y, 4e+35], N[(x * N[(z / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e+46], N[(x + y), $MachinePrecision], (-z)]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{+152}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 0.0035:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+35}:\\
\;\;\;\;x \cdot \frac{z}{-y}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+46}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -4.0999999999999998e152 or 1.6999999999999999e46 < y Initial program 71.4%
Taylor expanded in y around inf 76.8%
mul-1-neg76.8%
Simplified76.8%
if -4.0999999999999998e152 < y < 0.00350000000000000007 or 3.9999999999999999e35 < y < 1.6999999999999999e46Initial program 98.0%
Taylor expanded in z around inf 75.9%
+-commutative75.9%
Simplified75.9%
if 0.00350000000000000007 < y < 3.9999999999999999e35Initial program 99.6%
Taylor expanded in z around 0 93.0%
mul-1-neg93.0%
associate-/l*92.8%
distribute-rgt-neg-in92.8%
distribute-neg-frac292.8%
+-commutative92.8%
Simplified92.8%
Taylor expanded in y around 0 65.4%
associate-*r/65.4%
neg-mul-165.4%
Simplified65.4%
Taylor expanded in z around 0 65.6%
mul-1-neg65.6%
associate-*r/66.1%
distribute-rgt-neg-in66.1%
distribute-frac-neg266.1%
Simplified66.1%
Final simplification76.0%
(FPCore (x y z)
:precision binary64
(if (<= y -1.9e+130)
(- z)
(if (<= y -1.95e+101)
y
(if (or (<= y -3.6e+77) (not (<= y 2.02e-10))) (- z) x))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.9e+130) {
tmp = -z;
} else if (y <= -1.95e+101) {
tmp = y;
} else if ((y <= -3.6e+77) || !(y <= 2.02e-10)) {
tmp = -z;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-1.9d+130)) then
tmp = -z
else if (y <= (-1.95d+101)) then
tmp = y
else if ((y <= (-3.6d+77)) .or. (.not. (y <= 2.02d-10))) then
tmp = -z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.9e+130) {
tmp = -z;
} else if (y <= -1.95e+101) {
tmp = y;
} else if ((y <= -3.6e+77) || !(y <= 2.02e-10)) {
tmp = -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.9e+130: tmp = -z elif y <= -1.95e+101: tmp = y elif (y <= -3.6e+77) or not (y <= 2.02e-10): tmp = -z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.9e+130) tmp = Float64(-z); elseif (y <= -1.95e+101) tmp = y; elseif ((y <= -3.6e+77) || !(y <= 2.02e-10)) tmp = Float64(-z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.9e+130) tmp = -z; elseif (y <= -1.95e+101) tmp = y; elseif ((y <= -3.6e+77) || ~((y <= 2.02e-10))) tmp = -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.9e+130], (-z), If[LessEqual[y, -1.95e+101], y, If[Or[LessEqual[y, -3.6e+77], N[Not[LessEqual[y, 2.02e-10]], $MachinePrecision]], (-z), x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+130}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -1.95 \cdot 10^{+101}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq -3.6 \cdot 10^{+77} \lor \neg \left(y \leq 2.02 \cdot 10^{-10}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.9000000000000001e130 or -1.95e101 < y < -3.5999999999999998e77 or 2.02e-10 < y Initial program 76.0%
Taylor expanded in y around inf 70.1%
mul-1-neg70.1%
Simplified70.1%
if -1.9000000000000001e130 < y < -1.95e101Initial program 88.2%
Taylor expanded in x around 0 63.8%
Taylor expanded in y around 0 64.3%
if -3.5999999999999998e77 < y < 2.02e-10Initial program 99.2%
Taylor expanded in y around 0 65.4%
Final simplification67.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (/ y z))))
(if (<= y -3.35e+159)
(- z)
(if (<= y -3.6e+77) (/ y t_0) (if (<= y 1.35e+41) (/ x t_0) (- z))))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double tmp;
if (y <= -3.35e+159) {
tmp = -z;
} else if (y <= -3.6e+77) {
tmp = y / t_0;
} else if (y <= 1.35e+41) {
tmp = x / 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 = 1.0d0 - (y / z)
if (y <= (-3.35d+159)) then
tmp = -z
else if (y <= (-3.6d+77)) then
tmp = y / t_0
else if (y <= 1.35d+41) then
tmp = x / t_0
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double tmp;
if (y <= -3.35e+159) {
tmp = -z;
} else if (y <= -3.6e+77) {
tmp = y / t_0;
} else if (y <= 1.35e+41) {
tmp = x / t_0;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) tmp = 0 if y <= -3.35e+159: tmp = -z elif y <= -3.6e+77: tmp = y / t_0 elif y <= 1.35e+41: tmp = x / t_0 else: tmp = -z return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) tmp = 0.0 if (y <= -3.35e+159) tmp = Float64(-z); elseif (y <= -3.6e+77) tmp = Float64(y / t_0); elseif (y <= 1.35e+41) tmp = Float64(x / t_0); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); tmp = 0.0; if (y <= -3.35e+159) tmp = -z; elseif (y <= -3.6e+77) tmp = y / t_0; elseif (y <= 1.35e+41) tmp = x / t_0; else tmp = -z; 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.35e+159], (-z), If[LessEqual[y, -3.6e+77], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, 1.35e+41], N[(x / t$95$0), $MachinePrecision], (-z)]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
\mathbf{if}\;y \leq -3.35 \cdot 10^{+159}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -3.6 \cdot 10^{+77}:\\
\;\;\;\;\frac{y}{t\_0}\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+41}:\\
\;\;\;\;\frac{x}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -3.35000000000000009e159 or 1.35e41 < y Initial program 71.1%
Taylor expanded in y around inf 76.6%
mul-1-neg76.6%
Simplified76.6%
if -3.35000000000000009e159 < y < -3.5999999999999998e77Initial program 90.8%
Taylor expanded in x around 0 72.4%
if -3.5999999999999998e77 < y < 1.35e41Initial program 99.2%
Taylor expanded in x around inf 78.7%
Final simplification77.4%
(FPCore (x y z) :precision binary64 (if (or (<= y -4.1e+152) (not (<= y 1.66e+28))) (- z) (+ x y)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4.1e+152) || !(y <= 1.66e+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 <= (-4.1d+152)) .or. (.not. (y <= 1.66d+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 <= -4.1e+152) || !(y <= 1.66e+28)) {
tmp = -z;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4.1e+152) or not (y <= 1.66e+28): tmp = -z else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4.1e+152) || !(y <= 1.66e+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 <= -4.1e+152) || ~((y <= 1.66e+28))) tmp = -z; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4.1e+152], N[Not[LessEqual[y, 1.66e+28]], $MachinePrecision]], (-z), N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{+152} \lor \neg \left(y \leq 1.66 \cdot 10^{+28}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -4.0999999999999998e152 or 1.6599999999999999e28 < y Initial program 73.0%
Taylor expanded in y around inf 74.5%
mul-1-neg74.5%
Simplified74.5%
if -4.0999999999999998e152 < y < 1.6599999999999999e28Initial program 98.0%
Taylor expanded in z around inf 74.3%
+-commutative74.3%
Simplified74.3%
Final simplification74.4%
(FPCore (x y z) :precision binary64 (if (<= x -4.2e-200) x (if (<= x 1.9e-160) y x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.2e-200) {
tmp = x;
} else if (x <= 1.9e-160) {
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 <= (-4.2d-200)) then
tmp = x
else if (x <= 1.9d-160) 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 <= -4.2e-200) {
tmp = x;
} else if (x <= 1.9e-160) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.2e-200: tmp = x elif x <= 1.9e-160: tmp = y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.2e-200) tmp = x; elseif (x <= 1.9e-160) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.2e-200) tmp = x; elseif (x <= 1.9e-160) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.2e-200], x, If[LessEqual[x, 1.9e-160], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{-200}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-160}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.1999999999999998e-200 or 1.8999999999999999e-160 < x Initial program 87.5%
Taylor expanded in y around 0 42.7%
if -4.1999999999999998e-200 < x < 1.8999999999999999e-160Initial program 88.8%
Taylor expanded in x around 0 79.4%
Taylor expanded in y around 0 41.7%
Final simplification42.5%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 87.8%
Taylor expanded in y around 0 35.8%
Final simplification35.8%
(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 2024059
(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))))