
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.95e-20) (not (<= z 5.1e-23))) (/ (+ x (/ y (- t (/ x z)))) (+ x 1.0)) (/ (+ x (/ (- (* z y) x) (- (* z t) x))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.95e-20) || !(z <= 5.1e-23)) {
tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
} else {
tmp = (x + (((z * y) - x) / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.95d-20)) .or. (.not. (z <= 5.1d-23))) then
tmp = (x + (y / (t - (x / z)))) / (x + 1.0d0)
else
tmp = (x + (((z * y) - x) / ((z * t) - x))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.95e-20) || !(z <= 5.1e-23)) {
tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
} else {
tmp = (x + (((z * y) - x) / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.95e-20) or not (z <= 5.1e-23): tmp = (x + (y / (t - (x / z)))) / (x + 1.0) else: tmp = (x + (((z * y) - x) / ((z * t) - x))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.95e-20) || !(z <= 5.1e-23)) tmp = Float64(Float64(x + Float64(y / Float64(t - Float64(x / z)))) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(Float64(Float64(z * y) - x) / Float64(Float64(z * t) - x))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.95e-20) || ~((z <= 5.1e-23))) tmp = (x + (y / (t - (x / z)))) / (x + 1.0); else tmp = (x + (((z * y) - x) / ((z * t) - x))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.95e-20], N[Not[LessEqual[z, 5.1e-23]], $MachinePrecision]], N[(N[(x + N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(N[(N[(z * y), $MachinePrecision] - x), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{-20} \lor \neg \left(z \leq 5.1 \cdot 10^{-23}\right):\\
\;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{z \cdot y - x}{z \cdot t - x}}{x + 1}\\
\end{array}
\end{array}
if z < -1.95000000000000004e-20 or 5.10000000000000011e-23 < z Initial program 86.0%
*-commutative86.0%
Simplified86.0%
Taylor expanded in y around inf 83.7%
associate-/l*91.7%
Simplified91.7%
Taylor expanded in t around 0 97.6%
mul-1-neg97.6%
unsub-neg97.6%
Simplified97.6%
if -1.95000000000000004e-20 < z < 5.10000000000000011e-23Initial program 99.7%
Final simplification98.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= z -8.4e+49)
t_1
(if (<= z -2.4e-269)
(/ y (+ t (* x (+ t (/ -1.0 z)))))
(if (<= z 1.35e-143)
1.0
(if (<= z 5.6e-78)
t_1
(if (<= z 5.8e-78)
1.0
(if (<= z 1.12e-45) (/ (- x (/ y (/ x z))) (+ x 1.0)) t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (z <= -8.4e+49) {
tmp = t_1;
} else if (z <= -2.4e-269) {
tmp = y / (t + (x * (t + (-1.0 / z))));
} else if (z <= 1.35e-143) {
tmp = 1.0;
} else if (z <= 5.6e-78) {
tmp = t_1;
} else if (z <= 5.8e-78) {
tmp = 1.0;
} else if (z <= 1.12e-45) {
tmp = (x - (y / (x / z))) / (x + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
if (z <= (-8.4d+49)) then
tmp = t_1
else if (z <= (-2.4d-269)) then
tmp = y / (t + (x * (t + ((-1.0d0) / z))))
else if (z <= 1.35d-143) then
tmp = 1.0d0
else if (z <= 5.6d-78) then
tmp = t_1
else if (z <= 5.8d-78) then
tmp = 1.0d0
else if (z <= 1.12d-45) then
tmp = (x - (y / (x / z))) / (x + 1.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (z <= -8.4e+49) {
tmp = t_1;
} else if (z <= -2.4e-269) {
tmp = y / (t + (x * (t + (-1.0 / z))));
} else if (z <= 1.35e-143) {
tmp = 1.0;
} else if (z <= 5.6e-78) {
tmp = t_1;
} else if (z <= 5.8e-78) {
tmp = 1.0;
} else if (z <= 1.12e-45) {
tmp = (x - (y / (x / z))) / (x + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if z <= -8.4e+49: tmp = t_1 elif z <= -2.4e-269: tmp = y / (t + (x * (t + (-1.0 / z)))) elif z <= 1.35e-143: tmp = 1.0 elif z <= 5.6e-78: tmp = t_1 elif z <= 5.8e-78: tmp = 1.0 elif z <= 1.12e-45: tmp = (x - (y / (x / z))) / (x + 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (z <= -8.4e+49) tmp = t_1; elseif (z <= -2.4e-269) tmp = Float64(y / Float64(t + Float64(x * Float64(t + Float64(-1.0 / z))))); elseif (z <= 1.35e-143) tmp = 1.0; elseif (z <= 5.6e-78) tmp = t_1; elseif (z <= 5.8e-78) tmp = 1.0; elseif (z <= 1.12e-45) tmp = Float64(Float64(x - Float64(y / Float64(x / z))) / Float64(x + 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (z <= -8.4e+49) tmp = t_1; elseif (z <= -2.4e-269) tmp = y / (t + (x * (t + (-1.0 / z)))); elseif (z <= 1.35e-143) tmp = 1.0; elseif (z <= 5.6e-78) tmp = t_1; elseif (z <= 5.8e-78) tmp = 1.0; elseif (z <= 1.12e-45) tmp = (x - (y / (x / z))) / (x + 1.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.4e+49], t$95$1, If[LessEqual[z, -2.4e-269], N[(y / N[(t + N[(x * N[(t + N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e-143], 1.0, If[LessEqual[z, 5.6e-78], t$95$1, If[LessEqual[z, 5.8e-78], 1.0, If[LessEqual[z, 1.12e-45], N[(N[(x - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;z \leq -8.4 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-269}:\\
\;\;\;\;\frac{y}{t + x \cdot \left(t + \frac{-1}{z}\right)}\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-143}:\\
\;\;\;\;1\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{-78}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-78}:\\
\;\;\;\;1\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-45}:\\
\;\;\;\;\frac{x - \frac{y}{\frac{x}{z}}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -8.40000000000000043e49 or 1.35000000000000005e-143 < z < 5.60000000000000047e-78 or 1.1199999999999999e-45 < z Initial program 87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in z around inf 91.8%
if -8.40000000000000043e49 < z < -2.4000000000000001e-269Initial program 95.4%
*-commutative95.4%
Simplified95.4%
Taylor expanded in y around inf 65.3%
associate-/l*66.9%
Simplified66.9%
Taylor expanded in y around inf 55.9%
associate-/l*57.6%
*-commutative57.6%
+-commutative57.6%
Simplified57.6%
Taylor expanded in x around 0 58.8%
if -2.4000000000000001e-269 < z < 1.35000000000000005e-143 or 5.60000000000000047e-78 < z < 5.8000000000000001e-78Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 26.4%
associate-/l*26.4%
Simplified26.4%
Taylor expanded in t around 0 26.5%
mul-1-neg26.5%
unsub-neg26.5%
Simplified26.5%
Taylor expanded in x around inf 66.7%
if 5.8000000000000001e-78 < z < 1.1199999999999999e-45Initial program 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in y around inf 88.0%
associate-/l*88.2%
Simplified88.2%
Taylor expanded in t around 0 88.0%
+-commutative88.0%
mul-1-neg88.0%
unsub-neg88.0%
associate-/l*88.2%
+-commutative88.2%
Simplified88.2%
Final simplification78.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (- x (/ x (- (* z t) x))) (+ x 1.0)))
(t_2 (/ (+ x (/ y (- t (/ x z)))) (+ x 1.0))))
(if (<= z -3e-195)
t_2
(if (<= z -2.15e-239)
t_1
(if (<= z -2.75e-266)
t_2
(if (<= z 7.2e-267)
(/ (+ x (- 1.0 (/ y (/ x z)))) (+ x 1.0))
(if (<= z 1.38e-142) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x - (x / ((z * t) - x))) / (x + 1.0);
double t_2 = (x + (y / (t - (x / z)))) / (x + 1.0);
double tmp;
if (z <= -3e-195) {
tmp = t_2;
} else if (z <= -2.15e-239) {
tmp = t_1;
} else if (z <= -2.75e-266) {
tmp = t_2;
} else if (z <= 7.2e-267) {
tmp = (x + (1.0 - (y / (x / z)))) / (x + 1.0);
} else if (z <= 1.38e-142) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x - (x / ((z * t) - x))) / (x + 1.0d0)
t_2 = (x + (y / (t - (x / z)))) / (x + 1.0d0)
if (z <= (-3d-195)) then
tmp = t_2
else if (z <= (-2.15d-239)) then
tmp = t_1
else if (z <= (-2.75d-266)) then
tmp = t_2
else if (z <= 7.2d-267) then
tmp = (x + (1.0d0 - (y / (x / z)))) / (x + 1.0d0)
else if (z <= 1.38d-142) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x - (x / ((z * t) - x))) / (x + 1.0);
double t_2 = (x + (y / (t - (x / z)))) / (x + 1.0);
double tmp;
if (z <= -3e-195) {
tmp = t_2;
} else if (z <= -2.15e-239) {
tmp = t_1;
} else if (z <= -2.75e-266) {
tmp = t_2;
} else if (z <= 7.2e-267) {
tmp = (x + (1.0 - (y / (x / z)))) / (x + 1.0);
} else if (z <= 1.38e-142) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - (x / ((z * t) - x))) / (x + 1.0) t_2 = (x + (y / (t - (x / z)))) / (x + 1.0) tmp = 0 if z <= -3e-195: tmp = t_2 elif z <= -2.15e-239: tmp = t_1 elif z <= -2.75e-266: tmp = t_2 elif z <= 7.2e-267: tmp = (x + (1.0 - (y / (x / z)))) / (x + 1.0) elif z <= 1.38e-142: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - Float64(x / Float64(Float64(z * t) - x))) / Float64(x + 1.0)) t_2 = Float64(Float64(x + Float64(y / Float64(t - Float64(x / z)))) / Float64(x + 1.0)) tmp = 0.0 if (z <= -3e-195) tmp = t_2; elseif (z <= -2.15e-239) tmp = t_1; elseif (z <= -2.75e-266) tmp = t_2; elseif (z <= 7.2e-267) tmp = Float64(Float64(x + Float64(1.0 - Float64(y / Float64(x / z)))) / Float64(x + 1.0)); elseif (z <= 1.38e-142) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - (x / ((z * t) - x))) / (x + 1.0); t_2 = (x + (y / (t - (x / z)))) / (x + 1.0); tmp = 0.0; if (z <= -3e-195) tmp = t_2; elseif (z <= -2.15e-239) tmp = t_1; elseif (z <= -2.75e-266) tmp = t_2; elseif (z <= 7.2e-267) tmp = (x + (1.0 - (y / (x / z)))) / (x + 1.0); elseif (z <= 1.38e-142) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - N[(x / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3e-195], t$95$2, If[LessEqual[z, -2.15e-239], t$95$1, If[LessEqual[z, -2.75e-266], t$95$2, If[LessEqual[z, 7.2e-267], N[(N[(x + N[(1.0 - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.38e-142], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\
t_2 := \frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\
\mathbf{if}\;z \leq -3 \cdot 10^{-195}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.15 \cdot 10^{-239}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.75 \cdot 10^{-266}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-267}:\\
\;\;\;\;\frac{x + \left(1 - \frac{y}{\frac{x}{z}}\right)}{x + 1}\\
\mathbf{elif}\;z \leq 1.38 \cdot 10^{-142}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -3e-195 or -2.15e-239 < z < -2.75000000000000013e-266 or 1.37999999999999998e-142 < z Initial program 90.5%
*-commutative90.5%
Simplified90.5%
Taylor expanded in y around inf 80.5%
associate-/l*85.9%
Simplified85.9%
Taylor expanded in t around 0 89.9%
mul-1-neg89.9%
unsub-neg89.9%
Simplified89.9%
if -3e-195 < z < -2.15e-239 or 7.2000000000000002e-267 < z < 1.37999999999999998e-142Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 77.7%
+-commutative77.7%
Simplified77.7%
if -2.75000000000000013e-266 < z < 7.2000000000000002e-267Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 87.9%
+-commutative87.9%
+-commutative87.9%
associate-+l+87.9%
+-commutative87.9%
mul-1-neg87.9%
unsub-neg87.9%
associate-/l*87.9%
+-commutative87.9%
Simplified87.9%
Final simplification88.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (/ z (- (* z t) x)))))
(if (<= y -1.7e-170)
t_1
(if (<= y 1.02e-141)
(/ x (+ x 1.0))
(if (<= y 6.6e-59)
(/ y (* t (+ x 1.0)))
(if (<= y 3.2e-14) 1.0 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (z / ((z * t) - x));
double tmp;
if (y <= -1.7e-170) {
tmp = t_1;
} else if (y <= 1.02e-141) {
tmp = x / (x + 1.0);
} else if (y <= 6.6e-59) {
tmp = y / (t * (x + 1.0));
} else if (y <= 3.2e-14) {
tmp = 1.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = y * (z / ((z * t) - x))
if (y <= (-1.7d-170)) then
tmp = t_1
else if (y <= 1.02d-141) then
tmp = x / (x + 1.0d0)
else if (y <= 6.6d-59) then
tmp = y / (t * (x + 1.0d0))
else if (y <= 3.2d-14) then
tmp = 1.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (z / ((z * t) - x));
double tmp;
if (y <= -1.7e-170) {
tmp = t_1;
} else if (y <= 1.02e-141) {
tmp = x / (x + 1.0);
} else if (y <= 6.6e-59) {
tmp = y / (t * (x + 1.0));
} else if (y <= 3.2e-14) {
tmp = 1.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (z / ((z * t) - x)) tmp = 0 if y <= -1.7e-170: tmp = t_1 elif y <= 1.02e-141: tmp = x / (x + 1.0) elif y <= 6.6e-59: tmp = y / (t * (x + 1.0)) elif y <= 3.2e-14: tmp = 1.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(z / Float64(Float64(z * t) - x))) tmp = 0.0 if (y <= -1.7e-170) tmp = t_1; elseif (y <= 1.02e-141) tmp = Float64(x / Float64(x + 1.0)); elseif (y <= 6.6e-59) tmp = Float64(y / Float64(t * Float64(x + 1.0))); elseif (y <= 3.2e-14) tmp = 1.0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (z / ((z * t) - x)); tmp = 0.0; if (y <= -1.7e-170) tmp = t_1; elseif (y <= 1.02e-141) tmp = x / (x + 1.0); elseif (y <= 6.6e-59) tmp = y / (t * (x + 1.0)); elseif (y <= 3.2e-14) tmp = 1.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(z / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.7e-170], t$95$1, If[LessEqual[y, 1.02e-141], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.6e-59], N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e-14], 1.0, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{z \cdot t - x}\\
\mathbf{if}\;y \leq -1.7 \cdot 10^{-170}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{-141}:\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{-59}:\\
\;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-14}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.70000000000000006e-170 or 3.2000000000000002e-14 < y Initial program 88.2%
*-commutative88.2%
Simplified88.2%
Taylor expanded in y around inf 61.7%
*-commutative61.7%
*-commutative61.7%
times-frac68.0%
+-commutative68.0%
*-commutative68.0%
Simplified68.0%
Taylor expanded in x around 0 65.1%
if -1.70000000000000006e-170 < y < 1.02e-141Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 49.6%
+-commutative49.6%
Simplified49.6%
if 1.02e-141 < y < 6.59999999999999964e-59Initial program 94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in y around inf 57.6%
*-commutative57.6%
*-commutative57.6%
times-frac57.4%
+-commutative57.4%
*-commutative57.4%
Simplified57.4%
Taylor expanded in z around inf 63.0%
if 6.59999999999999964e-59 < y < 3.2000000000000002e-14Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 35.4%
associate-/l*35.4%
Simplified35.4%
Taylor expanded in t around 0 35.4%
mul-1-neg35.4%
unsub-neg35.4%
Simplified35.4%
Taylor expanded in x around inf 61.6%
Final simplification60.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.1e-144) (not (<= z 2.15e-54))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (+ x (- 1.0 (/ y (/ x z)))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.1e-144) || !(z <= 2.15e-54)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + (1.0 - (y / (x / z)))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-2.1d-144)) .or. (.not. (z <= 2.15d-54))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = (x + (1.0d0 - (y / (x / z)))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.1e-144) || !(z <= 2.15e-54)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + (1.0 - (y / (x / z)))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.1e-144) or not (z <= 2.15e-54): tmp = (x + (y / t)) / (x + 1.0) else: tmp = (x + (1.0 - (y / (x / z)))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.1e-144) || !(z <= 2.15e-54)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(1.0 - Float64(y / Float64(x / z)))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.1e-144) || ~((z <= 2.15e-54))) tmp = (x + (y / t)) / (x + 1.0); else tmp = (x + (1.0 - (y / (x / z)))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.1e-144], N[Not[LessEqual[z, 2.15e-54]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(1.0 - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-144} \lor \neg \left(z \leq 2.15 \cdot 10^{-54}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \left(1 - \frac{y}{\frac{x}{z}}\right)}{x + 1}\\
\end{array}
\end{array}
if z < -2.1000000000000001e-144 or 2.15e-54 < z Initial program 88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in z around inf 85.6%
if -2.1000000000000001e-144 < z < 2.15e-54Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 65.7%
+-commutative65.7%
+-commutative65.7%
associate-+l+65.7%
+-commutative65.7%
mul-1-neg65.7%
unsub-neg65.7%
associate-/l*65.8%
+-commutative65.8%
Simplified65.8%
Final simplification78.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.75e-266) (not (<= z 4.5e-150))) (/ (+ x (/ y (- t (/ x z)))) (+ x 1.0)) (/ (+ x (- 1.0 (/ y (/ x z)))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.75e-266) || !(z <= 4.5e-150)) {
tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
} else {
tmp = (x + (1.0 - (y / (x / z)))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-2.75d-266)) .or. (.not. (z <= 4.5d-150))) then
tmp = (x + (y / (t - (x / z)))) / (x + 1.0d0)
else
tmp = (x + (1.0d0 - (y / (x / z)))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.75e-266) || !(z <= 4.5e-150)) {
tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
} else {
tmp = (x + (1.0 - (y / (x / z)))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.75e-266) or not (z <= 4.5e-150): tmp = (x + (y / (t - (x / z)))) / (x + 1.0) else: tmp = (x + (1.0 - (y / (x / z)))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.75e-266) || !(z <= 4.5e-150)) tmp = Float64(Float64(x + Float64(y / Float64(t - Float64(x / z)))) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(1.0 - Float64(y / Float64(x / z)))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.75e-266) || ~((z <= 4.5e-150))) tmp = (x + (y / (t - (x / z)))) / (x + 1.0); else tmp = (x + (1.0 - (y / (x / z)))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.75e-266], N[Not[LessEqual[z, 4.5e-150]], $MachinePrecision]], N[(N[(x + N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(1.0 - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.75 \cdot 10^{-266} \lor \neg \left(z \leq 4.5 \cdot 10^{-150}\right):\\
\;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \left(1 - \frac{y}{\frac{x}{z}}\right)}{x + 1}\\
\end{array}
\end{array}
if z < -2.75000000000000013e-266 or 4.5000000000000002e-150 < z Initial program 90.9%
*-commutative90.9%
Simplified90.9%
Taylor expanded in y around inf 77.7%
associate-/l*82.9%
Simplified82.9%
Taylor expanded in t around 0 86.7%
mul-1-neg86.7%
unsub-neg86.7%
Simplified86.7%
if -2.75000000000000013e-266 < z < 4.5000000000000002e-150Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 76.9%
+-commutative76.9%
+-commutative76.9%
associate-+l+76.9%
+-commutative76.9%
mul-1-neg76.9%
unsub-neg76.9%
associate-/l*76.9%
+-commutative76.9%
Simplified76.9%
Final simplification84.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= z -3.85e-59)
t_1
(if (<= z -2.75e-266)
(* y (/ z (- (* z t) x)))
(if (<= z 1e-150) 1.0 t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (z <= -3.85e-59) {
tmp = t_1;
} else if (z <= -2.75e-266) {
tmp = y * (z / ((z * t) - x));
} else if (z <= 1e-150) {
tmp = 1.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
if (z <= (-3.85d-59)) then
tmp = t_1
else if (z <= (-2.75d-266)) then
tmp = y * (z / ((z * t) - x))
else if (z <= 1d-150) then
tmp = 1.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (z <= -3.85e-59) {
tmp = t_1;
} else if (z <= -2.75e-266) {
tmp = y * (z / ((z * t) - x));
} else if (z <= 1e-150) {
tmp = 1.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if z <= -3.85e-59: tmp = t_1 elif z <= -2.75e-266: tmp = y * (z / ((z * t) - x)) elif z <= 1e-150: tmp = 1.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (z <= -3.85e-59) tmp = t_1; elseif (z <= -2.75e-266) tmp = Float64(y * Float64(z / Float64(Float64(z * t) - x))); elseif (z <= 1e-150) tmp = 1.0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (z <= -3.85e-59) tmp = t_1; elseif (z <= -2.75e-266) tmp = y * (z / ((z * t) - x)); elseif (z <= 1e-150) tmp = 1.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.85e-59], t$95$1, If[LessEqual[z, -2.75e-266], N[(y * N[(z / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e-150], 1.0, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;z \leq -3.85 \cdot 10^{-59}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.75 \cdot 10^{-266}:\\
\;\;\;\;y \cdot \frac{z}{z \cdot t - x}\\
\mathbf{elif}\;z \leq 10^{-150}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -3.85e-59 or 1.00000000000000001e-150 < z Initial program 88.1%
*-commutative88.1%
Simplified88.1%
Taylor expanded in z around inf 85.8%
if -3.85e-59 < z < -2.75000000000000013e-266Initial program 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in y around inf 55.8%
*-commutative55.8%
*-commutative55.8%
times-frac55.8%
+-commutative55.8%
*-commutative55.8%
Simplified55.8%
Taylor expanded in x around 0 53.8%
if -2.75000000000000013e-266 < z < 1.00000000000000001e-150Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 26.8%
associate-/l*26.8%
Simplified26.8%
Taylor expanded in t around 0 26.8%
mul-1-neg26.8%
unsub-neg26.8%
Simplified26.8%
Taylor expanded in x around inf 66.0%
Final simplification75.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= z -1.32e+47)
t_1
(if (<= z -2.75e-266)
(/ y (+ t (* x (+ t (/ -1.0 z)))))
(if (<= z 1.5e-151) 1.0 t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (z <= -1.32e+47) {
tmp = t_1;
} else if (z <= -2.75e-266) {
tmp = y / (t + (x * (t + (-1.0 / z))));
} else if (z <= 1.5e-151) {
tmp = 1.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
if (z <= (-1.32d+47)) then
tmp = t_1
else if (z <= (-2.75d-266)) then
tmp = y / (t + (x * (t + ((-1.0d0) / z))))
else if (z <= 1.5d-151) then
tmp = 1.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (z <= -1.32e+47) {
tmp = t_1;
} else if (z <= -2.75e-266) {
tmp = y / (t + (x * (t + (-1.0 / z))));
} else if (z <= 1.5e-151) {
tmp = 1.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if z <= -1.32e+47: tmp = t_1 elif z <= -2.75e-266: tmp = y / (t + (x * (t + (-1.0 / z)))) elif z <= 1.5e-151: tmp = 1.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (z <= -1.32e+47) tmp = t_1; elseif (z <= -2.75e-266) tmp = Float64(y / Float64(t + Float64(x * Float64(t + Float64(-1.0 / z))))); elseif (z <= 1.5e-151) tmp = 1.0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (z <= -1.32e+47) tmp = t_1; elseif (z <= -2.75e-266) tmp = y / (t + (x * (t + (-1.0 / z)))); elseif (z <= 1.5e-151) tmp = 1.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.32e+47], t$95$1, If[LessEqual[z, -2.75e-266], N[(y / N[(t + N[(x * N[(t + N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e-151], 1.0, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;z \leq -1.32 \cdot 10^{+47}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.75 \cdot 10^{-266}:\\
\;\;\;\;\frac{y}{t + x \cdot \left(t + \frac{-1}{z}\right)}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-151}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.31999999999999992e47 or 1.5e-151 < z Initial program 88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in z around inf 88.1%
if -1.31999999999999992e47 < z < -2.75000000000000013e-266Initial program 95.4%
*-commutative95.4%
Simplified95.4%
Taylor expanded in y around inf 65.3%
associate-/l*66.9%
Simplified66.9%
Taylor expanded in y around inf 55.9%
associate-/l*57.6%
*-commutative57.6%
+-commutative57.6%
Simplified57.6%
Taylor expanded in x around 0 58.8%
if -2.75000000000000013e-266 < z < 1.5e-151Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 26.8%
associate-/l*26.8%
Simplified26.8%
Taylor expanded in t around 0 26.8%
mul-1-neg26.8%
unsub-neg26.8%
Simplified26.8%
Taylor expanded in x around inf 66.0%
Final simplification76.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= z -1.32e+47)
t_1
(if (<= z -2.75e-266)
(/ (/ y (- t (/ x z))) (+ x 1.0))
(if (<= z 1.25e-146) 1.0 t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (z <= -1.32e+47) {
tmp = t_1;
} else if (z <= -2.75e-266) {
tmp = (y / (t - (x / z))) / (x + 1.0);
} else if (z <= 1.25e-146) {
tmp = 1.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
if (z <= (-1.32d+47)) then
tmp = t_1
else if (z <= (-2.75d-266)) then
tmp = (y / (t - (x / z))) / (x + 1.0d0)
else if (z <= 1.25d-146) then
tmp = 1.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (z <= -1.32e+47) {
tmp = t_1;
} else if (z <= -2.75e-266) {
tmp = (y / (t - (x / z))) / (x + 1.0);
} else if (z <= 1.25e-146) {
tmp = 1.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if z <= -1.32e+47: tmp = t_1 elif z <= -2.75e-266: tmp = (y / (t - (x / z))) / (x + 1.0) elif z <= 1.25e-146: tmp = 1.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (z <= -1.32e+47) tmp = t_1; elseif (z <= -2.75e-266) tmp = Float64(Float64(y / Float64(t - Float64(x / z))) / Float64(x + 1.0)); elseif (z <= 1.25e-146) tmp = 1.0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (z <= -1.32e+47) tmp = t_1; elseif (z <= -2.75e-266) tmp = (y / (t - (x / z))) / (x + 1.0); elseif (z <= 1.25e-146) tmp = 1.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.32e+47], t$95$1, If[LessEqual[z, -2.75e-266], N[(N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e-146], 1.0, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;z \leq -1.32 \cdot 10^{+47}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.75 \cdot 10^{-266}:\\
\;\;\;\;\frac{\frac{y}{t - \frac{x}{z}}}{x + 1}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-146}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.31999999999999992e47 or 1.24999999999999989e-146 < z Initial program 88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in z around inf 88.1%
if -1.31999999999999992e47 < z < -2.75000000000000013e-266Initial program 95.4%
*-commutative95.4%
Simplified95.4%
Taylor expanded in y around inf 65.3%
associate-/l*66.9%
Simplified66.9%
Taylor expanded in t around 0 69.7%
mul-1-neg69.7%
unsub-neg69.7%
Simplified69.7%
Taylor expanded in y around inf 60.4%
if -2.75000000000000013e-266 < z < 1.24999999999999989e-146Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 26.8%
associate-/l*26.8%
Simplified26.8%
Taylor expanded in t around 0 26.8%
mul-1-neg26.8%
unsub-neg26.8%
Simplified26.8%
Taylor expanded in x around inf 66.0%
Final simplification76.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4e-144) (not (<= z 5.3e-34))) (/ y (* t (+ x 1.0))) 1.0))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4e-144) || !(z <= 5.3e-34)) {
tmp = y / (t * (x + 1.0));
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-4d-144)) .or. (.not. (z <= 5.3d-34))) then
tmp = y / (t * (x + 1.0d0))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4e-144) || !(z <= 5.3e-34)) {
tmp = y / (t * (x + 1.0));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4e-144) or not (z <= 5.3e-34): tmp = y / (t * (x + 1.0)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4e-144) || !(z <= 5.3e-34)) tmp = Float64(y / Float64(t * Float64(x + 1.0))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4e-144) || ~((z <= 5.3e-34))) tmp = y / (t * (x + 1.0)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4e-144], N[Not[LessEqual[z, 5.3e-34]], $MachinePrecision]], N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-144} \lor \neg \left(z \leq 5.3 \cdot 10^{-34}\right):\\
\;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if z < -3.9999999999999998e-144 or 5.2999999999999997e-34 < z Initial program 88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in y around inf 53.0%
*-commutative53.0%
*-commutative53.0%
times-frac59.0%
+-commutative59.0%
*-commutative59.0%
Simplified59.0%
Taylor expanded in z around inf 56.8%
if -3.9999999999999998e-144 < z < 5.2999999999999997e-34Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 45.8%
associate-/l*45.8%
Simplified45.8%
Taylor expanded in t around 0 45.9%
mul-1-neg45.9%
unsub-neg45.9%
Simplified45.9%
Taylor expanded in x around inf 48.0%
Final simplification53.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -8.2e-53) (not (<= z 2.85e-33))) (+ x (* x x)) 1.0))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8.2e-53) || !(z <= 2.85e-33)) {
tmp = x + (x * x);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-8.2d-53)) .or. (.not. (z <= 2.85d-33))) then
tmp = x + (x * x)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8.2e-53) || !(z <= 2.85e-33)) {
tmp = x + (x * x);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -8.2e-53) or not (z <= 2.85e-33): tmp = x + (x * x) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -8.2e-53) || !(z <= 2.85e-33)) tmp = Float64(x + Float64(x * x)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -8.2e-53) || ~((z <= 2.85e-33))) tmp = x + (x * x); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -8.2e-53], N[Not[LessEqual[z, 2.85e-33]], $MachinePrecision]], N[(x + N[(x * x), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{-53} \lor \neg \left(z \leq 2.85 \cdot 10^{-33}\right):\\
\;\;\;\;x + x \cdot x\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if z < -8.2000000000000001e-53 or 2.85000000000000013e-33 < z Initial program 86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in t around inf 34.1%
+-commutative34.1%
Simplified34.1%
Taylor expanded in x around 0 32.4%
+-commutative32.4%
mul-1-neg32.4%
unsub-neg32.4%
unpow232.4%
Simplified32.4%
cancel-sign-sub-inv32.4%
add-sqr-sqrt13.3%
sqrt-unprod32.4%
sqr-neg32.4%
sqrt-prod19.1%
add-sqr-sqrt32.4%
Applied egg-rr32.4%
if -8.2000000000000001e-53 < z < 2.85000000000000013e-33Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 50.4%
associate-/l*50.6%
Simplified50.6%
Taylor expanded in t around 0 50.6%
mul-1-neg50.6%
unsub-neg50.6%
Simplified50.6%
Taylor expanded in x around inf 42.2%
Final simplification37.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.6e-51) (not (<= z 2.25e-53))) (/ x (+ x 1.0)) 1.0))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.6e-51) || !(z <= 2.25e-53)) {
tmp = x / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-3.6d-51)) .or. (.not. (z <= 2.25d-53))) then
tmp = x / (x + 1.0d0)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.6e-51) || !(z <= 2.25e-53)) {
tmp = x / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.6e-51) or not (z <= 2.25e-53): tmp = x / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.6e-51) || !(z <= 2.25e-53)) tmp = Float64(x / Float64(x + 1.0)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.6e-51) || ~((z <= 2.25e-53))) tmp = x / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.6e-51], N[Not[LessEqual[z, 2.25e-53]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{-51} \lor \neg \left(z \leq 2.25 \cdot 10^{-53}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if z < -3.6e-51 or 2.24999999999999992e-53 < z Initial program 86.5%
*-commutative86.5%
Simplified86.5%
Taylor expanded in t around inf 34.8%
+-commutative34.8%
Simplified34.8%
if -3.6e-51 < z < 2.24999999999999992e-53Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 50.0%
associate-/l*50.1%
Simplified50.1%
Taylor expanded in t around 0 50.2%
mul-1-neg50.2%
unsub-neg50.2%
Simplified50.2%
Taylor expanded in x around inf 41.7%
Final simplification38.0%
(FPCore (x y z t) :precision binary64 (if (<= z -6.2e-52) x (if (<= z 1.15e-26) 1.0 x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.2e-52) {
tmp = x;
} else if (z <= 1.15e-26) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-6.2d-52)) then
tmp = x
else if (z <= 1.15d-26) then
tmp = 1.0d0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.2e-52) {
tmp = x;
} else if (z <= 1.15e-26) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6.2e-52: tmp = x elif z <= 1.15e-26: tmp = 1.0 else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6.2e-52) tmp = x; elseif (z <= 1.15e-26) tmp = 1.0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -6.2e-52) tmp = x; elseif (z <= 1.15e-26) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6.2e-52], x, If[LessEqual[z, 1.15e-26], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-52}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-26}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -6.1999999999999998e-52 or 1.15000000000000004e-26 < z Initial program 86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in t around inf 34.1%
+-commutative34.1%
Simplified34.1%
Taylor expanded in x around 0 32.4%
if -6.1999999999999998e-52 < z < 1.15000000000000004e-26Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 50.4%
associate-/l*50.6%
Simplified50.6%
Taylor expanded in t around 0 50.6%
mul-1-neg50.6%
unsub-neg50.6%
Simplified50.6%
Taylor expanded in x around inf 42.2%
Final simplification37.1%
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
return 1.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 92.6%
*-commutative92.6%
Simplified92.6%
Taylor expanded in y around inf 68.0%
associate-/l*72.2%
Simplified72.2%
Taylor expanded in t around 0 75.2%
mul-1-neg75.2%
unsub-neg75.2%
Simplified75.2%
Taylor expanded in x around inf 22.7%
Final simplification22.7%
(FPCore (x y z t) :precision binary64 (/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0);
}
def code(x, y, z, t): return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(y / Float64(t - Float64(x / z))) - Float64(x / Float64(Float64(t * z) - x)))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \left(\frac{y}{t - \frac{x}{z}} - \frac{x}{t \cdot z - x}\right)}{x + 1}
\end{array}
herbie shell --seed 2023278
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))