
(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 13 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
(let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+240)))
(/ (+ x (/ y t)) (+ x 1.0))
t_1)))
double code(double x, double y, double z, double t) {
double t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+240)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+240)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 5e+240): tmp = (x + (y / t)) / (x + 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(z * t) - x))) / Float64(x + 1.0)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+240)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 5e+240))) tmp = (x + (y / t)) / (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[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+240]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 5 \cdot 10^{+240}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -inf.0 or 5.0000000000000003e240 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 38.1%
*-commutative38.1%
Simplified38.1%
Taylor expanded in z around inf 88.3%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 5.0000000000000003e240Initial program 99.4%
Final simplification97.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (- x (/ x (- (* z t) x))) (+ x 1.0)))
(t_2 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= z -5.5e+24)
t_2
(if (<= z -1.5e-287)
t_1
(if (<= z 3.2e-143)
(/ (+ x (- 1.0 (/ (* y z) x))) (+ x 1.0))
(if (<= z 7.2e-44)
t_1
(if (<= z 2.5e+66)
(/ (+ 1.0 (- x (/ y (/ x z)))) (+ x 1.0))
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 + 1.0);
double tmp;
if (z <= -5.5e+24) {
tmp = t_2;
} else if (z <= -1.5e-287) {
tmp = t_1;
} else if (z <= 3.2e-143) {
tmp = (x + (1.0 - ((y * z) / x))) / (x + 1.0);
} else if (z <= 7.2e-44) {
tmp = t_1;
} else if (z <= 2.5e+66) {
tmp = (1.0 + (x - (y / (x / z)))) / (x + 1.0);
} 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 + 1.0d0)
if (z <= (-5.5d+24)) then
tmp = t_2
else if (z <= (-1.5d-287)) then
tmp = t_1
else if (z <= 3.2d-143) then
tmp = (x + (1.0d0 - ((y * z) / x))) / (x + 1.0d0)
else if (z <= 7.2d-44) then
tmp = t_1
else if (z <= 2.5d+66) then
tmp = (1.0d0 + (x - (y / (x / z)))) / (x + 1.0d0)
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 + 1.0);
double tmp;
if (z <= -5.5e+24) {
tmp = t_2;
} else if (z <= -1.5e-287) {
tmp = t_1;
} else if (z <= 3.2e-143) {
tmp = (x + (1.0 - ((y * z) / x))) / (x + 1.0);
} else if (z <= 7.2e-44) {
tmp = t_1;
} else if (z <= 2.5e+66) {
tmp = (1.0 + (x - (y / (x / z)))) / (x + 1.0);
} 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 + 1.0) tmp = 0 if z <= -5.5e+24: tmp = t_2 elif z <= -1.5e-287: tmp = t_1 elif z <= 3.2e-143: tmp = (x + (1.0 - ((y * z) / x))) / (x + 1.0) elif z <= 7.2e-44: tmp = t_1 elif z <= 2.5e+66: tmp = (1.0 + (x - (y / (x / z)))) / (x + 1.0) 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 / t)) / Float64(x + 1.0)) tmp = 0.0 if (z <= -5.5e+24) tmp = t_2; elseif (z <= -1.5e-287) tmp = t_1; elseif (z <= 3.2e-143) tmp = Float64(Float64(x + Float64(1.0 - Float64(Float64(y * z) / x))) / Float64(x + 1.0)); elseif (z <= 7.2e-44) tmp = t_1; elseif (z <= 2.5e+66) tmp = Float64(Float64(1.0 + Float64(x - Float64(y / Float64(x / z)))) / Float64(x + 1.0)); 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 + 1.0); tmp = 0.0; if (z <= -5.5e+24) tmp = t_2; elseif (z <= -1.5e-287) tmp = t_1; elseif (z <= 3.2e-143) tmp = (x + (1.0 - ((y * z) / x))) / (x + 1.0); elseif (z <= 7.2e-44) tmp = t_1; elseif (z <= 2.5e+66) tmp = (1.0 + (x - (y / (x / z)))) / (x + 1.0); 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 / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.5e+24], t$95$2, If[LessEqual[z, -1.5e-287], t$95$1, If[LessEqual[z, 3.2e-143], N[(N[(x + N[(1.0 - N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e-44], t$95$1, If[LessEqual[z, 2.5e+66], N[(N[(1.0 + N[(x - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 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}}{x + 1}\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+24}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-287}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-143}:\\
\;\;\;\;\frac{x + \left(1 - \frac{y \cdot z}{x}\right)}{x + 1}\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-44}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+66}:\\
\;\;\;\;\frac{1 + \left(x - \frac{y}{\frac{x}{z}}\right)}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -5.5000000000000002e24 or 2.49999999999999996e66 < z Initial program 74.2%
*-commutative74.2%
Simplified74.2%
Taylor expanded in z around inf 87.6%
if -5.5000000000000002e24 < z < -1.49999999999999996e-287 or 3.1999999999999998e-143 < z < 7.1999999999999998e-44Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 84.8%
+-commutative84.8%
Simplified84.8%
if -1.49999999999999996e-287 < z < 3.1999999999999998e-143Initial program 100.0%
*-commutative100.0%
Simplified100.0%
clear-num99.9%
inv-pow99.9%
Applied egg-rr99.9%
unpow-199.9%
*-commutative99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 84.7%
associate-+r+84.7%
mul-1-neg84.7%
unsub-neg84.7%
Simplified84.7%
if 7.1999999999999998e-44 < z < 2.49999999999999996e66Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 85.2%
+-commutative85.2%
mul-1-neg85.2%
unsub-neg85.2%
associate-/l*85.2%
+-commutative85.2%
Simplified85.2%
Final simplification86.0%
(FPCore (x y z t)
:precision binary64
(if (<= x -6.2e-6)
(/ x (+ x 1.0))
(if (<= x 3.6e-236)
(/ y (* t (+ x 1.0)))
(if (<= x 6.8e-82)
(- x (/ (/ x t) z))
(if (<= x 1.6e-69)
1.0
(if (<= x 9.2e-28)
x
(if (<= x 4200.0) (* (/ z x) (/ (- y) x)) 1.0)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.2e-6) {
tmp = x / (x + 1.0);
} else if (x <= 3.6e-236) {
tmp = y / (t * (x + 1.0));
} else if (x <= 6.8e-82) {
tmp = x - ((x / t) / z);
} else if (x <= 1.6e-69) {
tmp = 1.0;
} else if (x <= 9.2e-28) {
tmp = x;
} else if (x <= 4200.0) {
tmp = (z / x) * (-y / 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 (x <= (-6.2d-6)) then
tmp = x / (x + 1.0d0)
else if (x <= 3.6d-236) then
tmp = y / (t * (x + 1.0d0))
else if (x <= 6.8d-82) then
tmp = x - ((x / t) / z)
else if (x <= 1.6d-69) then
tmp = 1.0d0
else if (x <= 9.2d-28) then
tmp = x
else if (x <= 4200.0d0) then
tmp = (z / x) * (-y / 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 (x <= -6.2e-6) {
tmp = x / (x + 1.0);
} else if (x <= 3.6e-236) {
tmp = y / (t * (x + 1.0));
} else if (x <= 6.8e-82) {
tmp = x - ((x / t) / z);
} else if (x <= 1.6e-69) {
tmp = 1.0;
} else if (x <= 9.2e-28) {
tmp = x;
} else if (x <= 4200.0) {
tmp = (z / x) * (-y / x);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -6.2e-6: tmp = x / (x + 1.0) elif x <= 3.6e-236: tmp = y / (t * (x + 1.0)) elif x <= 6.8e-82: tmp = x - ((x / t) / z) elif x <= 1.6e-69: tmp = 1.0 elif x <= 9.2e-28: tmp = x elif x <= 4200.0: tmp = (z / x) * (-y / x) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -6.2e-6) tmp = Float64(x / Float64(x + 1.0)); elseif (x <= 3.6e-236) tmp = Float64(y / Float64(t * Float64(x + 1.0))); elseif (x <= 6.8e-82) tmp = Float64(x - Float64(Float64(x / t) / z)); elseif (x <= 1.6e-69) tmp = 1.0; elseif (x <= 9.2e-28) tmp = x; elseif (x <= 4200.0) tmp = Float64(Float64(z / x) * Float64(Float64(-y) / x)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -6.2e-6) tmp = x / (x + 1.0); elseif (x <= 3.6e-236) tmp = y / (t * (x + 1.0)); elseif (x <= 6.8e-82) tmp = x - ((x / t) / z); elseif (x <= 1.6e-69) tmp = 1.0; elseif (x <= 9.2e-28) tmp = x; elseif (x <= 4200.0) tmp = (z / x) * (-y / x); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.2e-6], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.6e-236], N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.8e-82], N[(x - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.6e-69], 1.0, If[LessEqual[x, 9.2e-28], x, If[LessEqual[x, 4200.0], N[(N[(z / x), $MachinePrecision] * N[((-y) / x), $MachinePrecision]), $MachinePrecision], 1.0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{-236}:\\
\;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-82}:\\
\;\;\;\;x - \frac{\frac{x}{t}}{z}\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-69}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{-28}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4200:\\
\;\;\;\;\frac{z}{x} \cdot \frac{-y}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -6.1999999999999999e-6Initial program 90.8%
*-commutative90.8%
Simplified90.8%
Taylor expanded in t around inf 87.5%
+-commutative87.5%
Simplified87.5%
if -6.1999999999999999e-6 < x < 3.60000000000000008e-236Initial program 86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in y around inf 55.3%
associate-/l*59.2%
*-commutative59.2%
+-commutative59.2%
Simplified59.2%
Taylor expanded in t around inf 54.7%
if 3.60000000000000008e-236 < x < 6.7999999999999995e-82Initial program 96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in t around inf 75.2%
Taylor expanded in y around 0 46.9%
Taylor expanded in x around 0 46.8%
*-commutative46.8%
sub-neg46.8%
distribute-rgt-in46.8%
distribute-lft-neg-in46.8%
unsub-neg46.8%
*-lft-identity46.8%
associate-*l/46.9%
*-lft-identity46.9%
associate-/r*46.9%
Simplified46.9%
if 6.7999999999999995e-82 < x < 1.59999999999999999e-69 or 4200 < x Initial program 88.0%
*-commutative88.0%
Simplified88.0%
Taylor expanded in z around inf 68.9%
Taylor expanded in x around inf 87.8%
if 1.59999999999999999e-69 < x < 9.19999999999999942e-28Initial program 100.0%
*-commutative100.0%
Simplified100.0%
clear-num99.6%
inv-pow99.6%
Applied egg-rr99.6%
unpow-199.6%
*-commutative99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around inf 52.4%
Taylor expanded in x around 0 52.6%
if 9.19999999999999942e-28 < x < 4200Initial program 89.6%
*-commutative89.6%
Simplified89.6%
Taylor expanded in x around -inf 59.8%
mul-1-neg59.8%
unsub-neg59.8%
distribute-rgt-out--59.8%
unpow259.8%
times-frac59.8%
Simplified59.8%
Taylor expanded in y around inf 59.8%
Taylor expanded in z around inf 40.2%
unpow240.2%
associate-*r/40.2%
*-commutative40.2%
neg-mul-140.2%
distribute-rgt-neg-in40.2%
times-frac40.2%
Simplified40.2%
Final simplification69.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ y (* t (+ x 1.0)))))
(if (<= x -6.2e-6)
(/ x (+ x 1.0))
(if (<= x 3.6e-236)
t_1
(if (<= x 1.76e-99)
(- x (/ (/ x t) z))
(if (<= x 3e-69)
1.0
(if (<= x 1.05e-25) x (if (<= x 1.3) t_1 1.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = y / (t * (x + 1.0));
double tmp;
if (x <= -6.2e-6) {
tmp = x / (x + 1.0);
} else if (x <= 3.6e-236) {
tmp = t_1;
} else if (x <= 1.76e-99) {
tmp = x - ((x / t) / z);
} else if (x <= 3e-69) {
tmp = 1.0;
} else if (x <= 1.05e-25) {
tmp = x;
} else if (x <= 1.3) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = y / (t * (x + 1.0d0))
if (x <= (-6.2d-6)) then
tmp = x / (x + 1.0d0)
else if (x <= 3.6d-236) then
tmp = t_1
else if (x <= 1.76d-99) then
tmp = x - ((x / t) / z)
else if (x <= 3d-69) then
tmp = 1.0d0
else if (x <= 1.05d-25) then
tmp = x
else if (x <= 1.3d0) then
tmp = t_1
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y / (t * (x + 1.0));
double tmp;
if (x <= -6.2e-6) {
tmp = x / (x + 1.0);
} else if (x <= 3.6e-236) {
tmp = t_1;
} else if (x <= 1.76e-99) {
tmp = x - ((x / t) / z);
} else if (x <= 3e-69) {
tmp = 1.0;
} else if (x <= 1.05e-25) {
tmp = x;
} else if (x <= 1.3) {
tmp = t_1;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = y / (t * (x + 1.0)) tmp = 0 if x <= -6.2e-6: tmp = x / (x + 1.0) elif x <= 3.6e-236: tmp = t_1 elif x <= 1.76e-99: tmp = x - ((x / t) / z) elif x <= 3e-69: tmp = 1.0 elif x <= 1.05e-25: tmp = x elif x <= 1.3: tmp = t_1 else: tmp = 1.0 return tmp
function code(x, y, z, t) t_1 = Float64(y / Float64(t * Float64(x + 1.0))) tmp = 0.0 if (x <= -6.2e-6) tmp = Float64(x / Float64(x + 1.0)); elseif (x <= 3.6e-236) tmp = t_1; elseif (x <= 1.76e-99) tmp = Float64(x - Float64(Float64(x / t) / z)); elseif (x <= 3e-69) tmp = 1.0; elseif (x <= 1.05e-25) tmp = x; elseif (x <= 1.3) tmp = t_1; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y / (t * (x + 1.0)); tmp = 0.0; if (x <= -6.2e-6) tmp = x / (x + 1.0); elseif (x <= 3.6e-236) tmp = t_1; elseif (x <= 1.76e-99) tmp = x - ((x / t) / z); elseif (x <= 3e-69) tmp = 1.0; elseif (x <= 1.05e-25) tmp = x; elseif (x <= 1.3) tmp = t_1; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.2e-6], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.6e-236], t$95$1, If[LessEqual[x, 1.76e-99], N[(x - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3e-69], 1.0, If[LessEqual[x, 1.05e-25], x, If[LessEqual[x, 1.3], t$95$1, 1.0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{t \cdot \left(x + 1\right)}\\
\mathbf{if}\;x \leq -6.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{-236}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.76 \cdot 10^{-99}:\\
\;\;\;\;x - \frac{\frac{x}{t}}{z}\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-69}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-25}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.3:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -6.1999999999999999e-6Initial program 90.8%
*-commutative90.8%
Simplified90.8%
Taylor expanded in t around inf 87.5%
+-commutative87.5%
Simplified87.5%
if -6.1999999999999999e-6 < x < 3.60000000000000008e-236 or 1.05000000000000001e-25 < x < 1.30000000000000004Initial program 86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in y around inf 54.8%
associate-/l*59.4%
*-commutative59.4%
+-commutative59.4%
Simplified59.4%
Taylor expanded in t around inf 54.2%
if 3.60000000000000008e-236 < x < 1.75999999999999991e-99Initial program 96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in t around inf 75.2%
Taylor expanded in y around 0 46.9%
Taylor expanded in x around 0 46.8%
*-commutative46.8%
sub-neg46.8%
distribute-rgt-in46.8%
distribute-lft-neg-in46.8%
unsub-neg46.8%
*-lft-identity46.8%
associate-*l/46.9%
*-lft-identity46.9%
associate-/r*46.9%
Simplified46.9%
if 1.75999999999999991e-99 < x < 2.99999999999999989e-69 or 1.30000000000000004 < x Initial program 88.2%
*-commutative88.2%
Simplified88.2%
Taylor expanded in z around inf 67.8%
Taylor expanded in x around inf 86.6%
if 2.99999999999999989e-69 < x < 1.05000000000000001e-25Initial program 100.0%
*-commutative100.0%
Simplified100.0%
clear-num99.7%
inv-pow99.7%
Applied egg-rr99.7%
unpow-199.7%
*-commutative99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 46.9%
Taylor expanded in x around 0 47.0%
Final simplification69.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- 1.0 (* (/ z x) (/ y x)))))
(if (<= x -8.5e-72)
t_1
(if (<= x 3.6e-236)
(/ y t)
(if (<= x 4.5e-134)
(- x (/ (/ x t) z))
(if (<= x 3.3e-102)
(* z (/ y (- (* z t) x)))
(if (<= x 7.2e-41) 1.0 t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - ((z / x) * (y / x));
double tmp;
if (x <= -8.5e-72) {
tmp = t_1;
} else if (x <= 3.6e-236) {
tmp = y / t;
} else if (x <= 4.5e-134) {
tmp = x - ((x / t) / z);
} else if (x <= 3.3e-102) {
tmp = z * (y / ((z * t) - x));
} else if (x <= 7.2e-41) {
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 = 1.0d0 - ((z / x) * (y / x))
if (x <= (-8.5d-72)) then
tmp = t_1
else if (x <= 3.6d-236) then
tmp = y / t
else if (x <= 4.5d-134) then
tmp = x - ((x / t) / z)
else if (x <= 3.3d-102) then
tmp = z * (y / ((z * t) - x))
else if (x <= 7.2d-41) 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 = 1.0 - ((z / x) * (y / x));
double tmp;
if (x <= -8.5e-72) {
tmp = t_1;
} else if (x <= 3.6e-236) {
tmp = y / t;
} else if (x <= 4.5e-134) {
tmp = x - ((x / t) / z);
} else if (x <= 3.3e-102) {
tmp = z * (y / ((z * t) - x));
} else if (x <= 7.2e-41) {
tmp = 1.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 - ((z / x) * (y / x)) tmp = 0 if x <= -8.5e-72: tmp = t_1 elif x <= 3.6e-236: tmp = y / t elif x <= 4.5e-134: tmp = x - ((x / t) / z) elif x <= 3.3e-102: tmp = z * (y / ((z * t) - x)) elif x <= 7.2e-41: tmp = 1.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 - Float64(Float64(z / x) * Float64(y / x))) tmp = 0.0 if (x <= -8.5e-72) tmp = t_1; elseif (x <= 3.6e-236) tmp = Float64(y / t); elseif (x <= 4.5e-134) tmp = Float64(x - Float64(Float64(x / t) / z)); elseif (x <= 3.3e-102) tmp = Float64(z * Float64(y / Float64(Float64(z * t) - x))); elseif (x <= 7.2e-41) tmp = 1.0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 - ((z / x) * (y / x)); tmp = 0.0; if (x <= -8.5e-72) tmp = t_1; elseif (x <= 3.6e-236) tmp = y / t; elseif (x <= 4.5e-134) tmp = x - ((x / t) / z); elseif (x <= 3.3e-102) tmp = z * (y / ((z * t) - x)); elseif (x <= 7.2e-41) tmp = 1.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(N[(z / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.5e-72], t$95$1, If[LessEqual[x, 3.6e-236], N[(y / t), $MachinePrecision], If[LessEqual[x, 4.5e-134], N[(x - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.3e-102], N[(z * N[(y / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.2e-41], 1.0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \frac{z}{x} \cdot \frac{y}{x}\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{-72}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{-236}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-134}:\\
\;\;\;\;x - \frac{\frac{x}{t}}{z}\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-102}:\\
\;\;\;\;z \cdot \frac{y}{z \cdot t - x}\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{-41}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -8.50000000000000008e-72 or 7.2e-41 < x Initial program 89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in x around -inf 67.5%
mul-1-neg67.5%
unsub-neg67.5%
distribute-rgt-out--67.6%
unpow267.6%
times-frac71.1%
Simplified71.1%
Taylor expanded in y around inf 79.6%
if -8.50000000000000008e-72 < x < 3.60000000000000008e-236Initial program 85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in y around inf 58.0%
associate-/l*62.5%
*-commutative62.5%
+-commutative62.5%
Simplified62.5%
Taylor expanded in x around 0 60.0%
if 3.60000000000000008e-236 < x < 4.5000000000000005e-134Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around inf 73.2%
Taylor expanded in y around 0 53.4%
Taylor expanded in x around 0 53.4%
*-commutative53.4%
sub-neg53.4%
distribute-rgt-in53.4%
distribute-lft-neg-in53.4%
unsub-neg53.4%
*-lft-identity53.4%
associate-*l/53.4%
*-lft-identity53.4%
associate-/r*53.5%
Simplified53.5%
if 4.5000000000000005e-134 < x < 3.3e-102Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 86.0%
times-frac86.0%
+-commutative86.0%
Simplified86.0%
Taylor expanded in x around 0 86.0%
if 3.3e-102 < x < 7.2e-41Initial program 92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in z around inf 40.6%
Taylor expanded in x around inf 46.6%
Final simplification70.3%
(FPCore (x y z t)
:precision binary64
(if (<= x -4.5e-6)
(/ x (+ x 1.0))
(if (<= x 1.15e-236)
(/ y (* t (+ x 1.0)))
(if (<= x 2.2e-133)
(- x (/ (/ x t) z))
(if (<= x 6.5e-104)
(* z (/ y (- (* z t) x)))
(if (<= x 1.4e-88) x 1.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.5e-6) {
tmp = x / (x + 1.0);
} else if (x <= 1.15e-236) {
tmp = y / (t * (x + 1.0));
} else if (x <= 2.2e-133) {
tmp = x - ((x / t) / z);
} else if (x <= 6.5e-104) {
tmp = z * (y / ((z * t) - x));
} else if (x <= 1.4e-88) {
tmp = 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 (x <= (-4.5d-6)) then
tmp = x / (x + 1.0d0)
else if (x <= 1.15d-236) then
tmp = y / (t * (x + 1.0d0))
else if (x <= 2.2d-133) then
tmp = x - ((x / t) / z)
else if (x <= 6.5d-104) then
tmp = z * (y / ((z * t) - x))
else if (x <= 1.4d-88) then
tmp = 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 (x <= -4.5e-6) {
tmp = x / (x + 1.0);
} else if (x <= 1.15e-236) {
tmp = y / (t * (x + 1.0));
} else if (x <= 2.2e-133) {
tmp = x - ((x / t) / z);
} else if (x <= 6.5e-104) {
tmp = z * (y / ((z * t) - x));
} else if (x <= 1.4e-88) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.5e-6: tmp = x / (x + 1.0) elif x <= 1.15e-236: tmp = y / (t * (x + 1.0)) elif x <= 2.2e-133: tmp = x - ((x / t) / z) elif x <= 6.5e-104: tmp = z * (y / ((z * t) - x)) elif x <= 1.4e-88: tmp = x else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.5e-6) tmp = Float64(x / Float64(x + 1.0)); elseif (x <= 1.15e-236) tmp = Float64(y / Float64(t * Float64(x + 1.0))); elseif (x <= 2.2e-133) tmp = Float64(x - Float64(Float64(x / t) / z)); elseif (x <= 6.5e-104) tmp = Float64(z * Float64(y / Float64(Float64(z * t) - x))); elseif (x <= 1.4e-88) tmp = x; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4.5e-6) tmp = x / (x + 1.0); elseif (x <= 1.15e-236) tmp = y / (t * (x + 1.0)); elseif (x <= 2.2e-133) tmp = x - ((x / t) / z); elseif (x <= 6.5e-104) tmp = z * (y / ((z * t) - x)); elseif (x <= 1.4e-88) tmp = x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.5e-6], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.15e-236], N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.2e-133], N[(x - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.5e-104], N[(z * N[(y / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.4e-88], x, 1.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{-6}:\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-236}:\\
\;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-133}:\\
\;\;\;\;x - \frac{\frac{x}{t}}{z}\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-104}:\\
\;\;\;\;z \cdot \frac{y}{z \cdot t - x}\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-88}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -4.50000000000000011e-6Initial program 90.8%
*-commutative90.8%
Simplified90.8%
Taylor expanded in t around inf 87.5%
+-commutative87.5%
Simplified87.5%
if -4.50000000000000011e-6 < x < 1.15000000000000003e-236Initial program 86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in y around inf 55.3%
associate-/l*59.2%
*-commutative59.2%
+-commutative59.2%
Simplified59.2%
Taylor expanded in t around inf 54.7%
if 1.15000000000000003e-236 < x < 2.2000000000000001e-133Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around inf 73.2%
Taylor expanded in y around 0 53.4%
Taylor expanded in x around 0 53.4%
*-commutative53.4%
sub-neg53.4%
distribute-rgt-in53.4%
distribute-lft-neg-in53.4%
unsub-neg53.4%
*-lft-identity53.4%
associate-*l/53.4%
*-lft-identity53.4%
associate-/r*53.5%
Simplified53.5%
if 2.2000000000000001e-133 < x < 6.49999999999999991e-104Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 86.0%
times-frac86.0%
+-commutative86.0%
Simplified86.0%
Taylor expanded in x around 0 86.0%
if 6.49999999999999991e-104 < x < 1.39999999999999988e-88Initial program 0.0%
*-commutative0.0%
Simplified0.0%
clear-num0.0%
inv-pow0.0%
Applied egg-rr0.0%
unpow-10.0%
*-commutative0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in x around 0 100.0%
if 1.39999999999999988e-88 < x Initial program 89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in z around inf 64.9%
Taylor expanded in x around inf 74.0%
Final simplification69.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.5e-17) (not (<= z 3.8e+60))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (+ 1.0 (- x (/ y (/ x z)))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.5e-17) || !(z <= 3.8e+60)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (1.0 + (x - (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 <= (-5.5d-17)) .or. (.not. (z <= 3.8d+60))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = (1.0d0 + (x - (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 <= -5.5e-17) || !(z <= 3.8e+60)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (1.0 + (x - (y / (x / z)))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.5e-17) or not (z <= 3.8e+60): tmp = (x + (y / t)) / (x + 1.0) else: tmp = (1.0 + (x - (y / (x / z)))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.5e-17) || !(z <= 3.8e+60)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(1.0 + Float64(x - 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 <= -5.5e-17) || ~((z <= 3.8e+60))) tmp = (x + (y / t)) / (x + 1.0); else tmp = (1.0 + (x - (y / (x / z)))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.5e-17], N[Not[LessEqual[z, 3.8e+60]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - 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 -5.5 \cdot 10^{-17} \lor \neg \left(z \leq 3.8 \cdot 10^{+60}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - \frac{y}{\frac{x}{z}}\right)}{x + 1}\\
\end{array}
\end{array}
if z < -5.50000000000000001e-17 or 3.80000000000000009e60 < z Initial program 76.7%
*-commutative76.7%
Simplified76.7%
Taylor expanded in z around inf 87.1%
if -5.50000000000000001e-17 < z < 3.80000000000000009e60Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 77.6%
+-commutative77.6%
mul-1-neg77.6%
unsub-neg77.6%
associate-/l*77.6%
+-commutative77.6%
Simplified77.6%
Final simplification81.8%
(FPCore (x y z t)
:precision binary64
(if (<= x -3.6e-26)
(/ x (+ x 1.0))
(if (<= x 3.6e-236)
(/ y t)
(if (<= x 6.6e-74)
(- x (/ (/ x t) z))
(if (<= x 1.66e-68)
1.0
(if (<= x 1.05e-25) x (if (<= x 1.3) (/ y t) 1.0)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.6e-26) {
tmp = x / (x + 1.0);
} else if (x <= 3.6e-236) {
tmp = y / t;
} else if (x <= 6.6e-74) {
tmp = x - ((x / t) / z);
} else if (x <= 1.66e-68) {
tmp = 1.0;
} else if (x <= 1.05e-25) {
tmp = x;
} else if (x <= 1.3) {
tmp = y / t;
} 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 (x <= (-3.6d-26)) then
tmp = x / (x + 1.0d0)
else if (x <= 3.6d-236) then
tmp = y / t
else if (x <= 6.6d-74) then
tmp = x - ((x / t) / z)
else if (x <= 1.66d-68) then
tmp = 1.0d0
else if (x <= 1.05d-25) then
tmp = x
else if (x <= 1.3d0) then
tmp = y / t
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 (x <= -3.6e-26) {
tmp = x / (x + 1.0);
} else if (x <= 3.6e-236) {
tmp = y / t;
} else if (x <= 6.6e-74) {
tmp = x - ((x / t) / z);
} else if (x <= 1.66e-68) {
tmp = 1.0;
} else if (x <= 1.05e-25) {
tmp = x;
} else if (x <= 1.3) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.6e-26: tmp = x / (x + 1.0) elif x <= 3.6e-236: tmp = y / t elif x <= 6.6e-74: tmp = x - ((x / t) / z) elif x <= 1.66e-68: tmp = 1.0 elif x <= 1.05e-25: tmp = x elif x <= 1.3: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.6e-26) tmp = Float64(x / Float64(x + 1.0)); elseif (x <= 3.6e-236) tmp = Float64(y / t); elseif (x <= 6.6e-74) tmp = Float64(x - Float64(Float64(x / t) / z)); elseif (x <= 1.66e-68) tmp = 1.0; elseif (x <= 1.05e-25) tmp = x; elseif (x <= 1.3) tmp = Float64(y / t); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -3.6e-26) tmp = x / (x + 1.0); elseif (x <= 3.6e-236) tmp = y / t; elseif (x <= 6.6e-74) tmp = x - ((x / t) / z); elseif (x <= 1.66e-68) tmp = 1.0; elseif (x <= 1.05e-25) tmp = x; elseif (x <= 1.3) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.6e-26], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.6e-236], N[(y / t), $MachinePrecision], If[LessEqual[x, 6.6e-74], N[(x - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.66e-68], 1.0, If[LessEqual[x, 1.05e-25], x, If[LessEqual[x, 1.3], N[(y / t), $MachinePrecision], 1.0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{-26}:\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{-236}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{-74}:\\
\;\;\;\;x - \frac{\frac{x}{t}}{z}\\
\mathbf{elif}\;x \leq 1.66 \cdot 10^{-68}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-25}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.3:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -3.6000000000000001e-26Initial program 91.3%
*-commutative91.3%
Simplified91.3%
Taylor expanded in t around inf 83.9%
+-commutative83.9%
Simplified83.9%
if -3.6000000000000001e-26 < x < 3.60000000000000008e-236 or 1.05000000000000001e-25 < x < 1.30000000000000004Initial program 85.7%
*-commutative85.7%
Simplified85.7%
Taylor expanded in y around inf 53.8%
associate-/l*58.7%
*-commutative58.7%
+-commutative58.7%
Simplified58.7%
Taylor expanded in x around 0 55.5%
if 3.60000000000000008e-236 < x < 6.59999999999999992e-74Initial program 96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in t around inf 75.2%
Taylor expanded in y around 0 46.9%
Taylor expanded in x around 0 46.8%
*-commutative46.8%
sub-neg46.8%
distribute-rgt-in46.8%
distribute-lft-neg-in46.8%
unsub-neg46.8%
*-lft-identity46.8%
associate-*l/46.9%
*-lft-identity46.9%
associate-/r*46.9%
Simplified46.9%
if 6.59999999999999992e-74 < x < 1.6600000000000001e-68 or 1.30000000000000004 < x Initial program 88.2%
*-commutative88.2%
Simplified88.2%
Taylor expanded in z around inf 67.8%
Taylor expanded in x around inf 86.6%
if 1.6600000000000001e-68 < x < 1.05000000000000001e-25Initial program 100.0%
*-commutative100.0%
Simplified100.0%
clear-num99.7%
inv-pow99.7%
Applied egg-rr99.7%
unpow-199.7%
*-commutative99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 46.9%
Taylor expanded in x around 0 47.0%
Final simplification69.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.25e-167) (not (<= z 6.6e-108))) (/ (+ x (/ y t)) (+ x 1.0)) 1.0))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.25e-167) || !(z <= 6.6e-108)) {
tmp = (x + (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 <= (-1.25d-167)) .or. (.not. (z <= 6.6d-108))) then
tmp = (x + (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 <= -1.25e-167) || !(z <= 6.6e-108)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.25e-167) or not (z <= 6.6e-108): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.25e-167) || !(z <= 6.6e-108)) tmp = Float64(Float64(x + Float64(y / 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 <= -1.25e-167) || ~((z <= 6.6e-108))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.25e-167], N[Not[LessEqual[z, 6.6e-108]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-167} \lor \neg \left(z \leq 6.6 \cdot 10^{-108}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if z < -1.25000000000000005e-167 or 6.6000000000000004e-108 < z Initial program 85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in z around inf 78.3%
if -1.25000000000000005e-167 < z < 6.6000000000000004e-108Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 38.9%
Taylor expanded in x around inf 70.8%
Final simplification76.1%
(FPCore (x y z t)
:precision binary64
(if (<= x -4e-71)
1.0
(if (<= x 1.02e-158)
(/ y t)
(if (<= x 1e-133) x (if (<= x 8.2e-83) (/ y t) 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4e-71) {
tmp = 1.0;
} else if (x <= 1.02e-158) {
tmp = y / t;
} else if (x <= 1e-133) {
tmp = x;
} else if (x <= 8.2e-83) {
tmp = y / t;
} 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 (x <= (-4d-71)) then
tmp = 1.0d0
else if (x <= 1.02d-158) then
tmp = y / t
else if (x <= 1d-133) then
tmp = x
else if (x <= 8.2d-83) then
tmp = y / t
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 (x <= -4e-71) {
tmp = 1.0;
} else if (x <= 1.02e-158) {
tmp = y / t;
} else if (x <= 1e-133) {
tmp = x;
} else if (x <= 8.2e-83) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4e-71: tmp = 1.0 elif x <= 1.02e-158: tmp = y / t elif x <= 1e-133: tmp = x elif x <= 8.2e-83: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4e-71) tmp = 1.0; elseif (x <= 1.02e-158) tmp = Float64(y / t); elseif (x <= 1e-133) tmp = x; elseif (x <= 8.2e-83) tmp = Float64(y / t); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4e-71) tmp = 1.0; elseif (x <= 1.02e-158) tmp = y / t; elseif (x <= 1e-133) tmp = x; elseif (x <= 8.2e-83) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4e-71], 1.0, If[LessEqual[x, 1.02e-158], N[(y / t), $MachinePrecision], If[LessEqual[x, 1e-133], x, If[LessEqual[x, 8.2e-83], N[(y / t), $MachinePrecision], 1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{-71}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.02 \cdot 10^{-158}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{elif}\;x \leq 10^{-133}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-83}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -3.9999999999999997e-71 or 8.1999999999999999e-83 < x Initial program 90.0%
*-commutative90.0%
Simplified90.0%
Taylor expanded in z around inf 65.5%
Taylor expanded in x around inf 75.7%
if -3.9999999999999997e-71 < x < 1.0199999999999999e-158 or 1.0000000000000001e-133 < x < 8.1999999999999999e-83Initial program 87.8%
*-commutative87.8%
Simplified87.8%
Taylor expanded in y around inf 56.4%
associate-/l*59.9%
*-commutative59.9%
+-commutative59.9%
Simplified59.9%
Taylor expanded in x around 0 55.9%
if 1.0199999999999999e-158 < x < 1.0000000000000001e-133Initial program 99.7%
*-commutative99.7%
Simplified99.7%
clear-num99.7%
inv-pow99.7%
Applied egg-rr99.7%
unpow-199.7%
*-commutative99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 67.8%
Taylor expanded in x around 0 67.8%
Final simplification68.5%
(FPCore (x y z t)
:precision binary64
(if (<= x -2.4e-33)
(/ x (+ x 1.0))
(if (<= x 8e-156)
(/ y t)
(if (<= x 2.7e-133) x (if (<= x 7.4e-79) (/ y t) 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.4e-33) {
tmp = x / (x + 1.0);
} else if (x <= 8e-156) {
tmp = y / t;
} else if (x <= 2.7e-133) {
tmp = x;
} else if (x <= 7.4e-79) {
tmp = y / t;
} 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 (x <= (-2.4d-33)) then
tmp = x / (x + 1.0d0)
else if (x <= 8d-156) then
tmp = y / t
else if (x <= 2.7d-133) then
tmp = x
else if (x <= 7.4d-79) then
tmp = y / t
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 (x <= -2.4e-33) {
tmp = x / (x + 1.0);
} else if (x <= 8e-156) {
tmp = y / t;
} else if (x <= 2.7e-133) {
tmp = x;
} else if (x <= 7.4e-79) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.4e-33: tmp = x / (x + 1.0) elif x <= 8e-156: tmp = y / t elif x <= 2.7e-133: tmp = x elif x <= 7.4e-79: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.4e-33) tmp = Float64(x / Float64(x + 1.0)); elseif (x <= 8e-156) tmp = Float64(y / t); elseif (x <= 2.7e-133) tmp = x; elseif (x <= 7.4e-79) tmp = Float64(y / t); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.4e-33) tmp = x / (x + 1.0); elseif (x <= 8e-156) tmp = y / t; elseif (x <= 2.7e-133) tmp = x; elseif (x <= 7.4e-79) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.4e-33], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e-156], N[(y / t), $MachinePrecision], If[LessEqual[x, 2.7e-133], x, If[LessEqual[x, 7.4e-79], N[(y / t), $MachinePrecision], 1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{-33}:\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-156}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-133}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7.4 \cdot 10^{-79}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -2.4e-33Initial program 91.3%
*-commutative91.3%
Simplified91.3%
Taylor expanded in t around inf 83.9%
+-commutative83.9%
Simplified83.9%
if -2.4e-33 < x < 8.00000000000000032e-156 or 2.6999999999999999e-133 < x < 7.40000000000000035e-79Initial program 87.6%
*-commutative87.6%
Simplified87.6%
Taylor expanded in y around inf 53.6%
associate-/l*56.9%
*-commutative56.9%
+-commutative56.9%
Simplified56.9%
Taylor expanded in x around 0 53.1%
if 8.00000000000000032e-156 < x < 2.6999999999999999e-133Initial program 99.7%
*-commutative99.7%
Simplified99.7%
clear-num99.7%
inv-pow99.7%
Applied egg-rr99.7%
unpow-199.7%
*-commutative99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 67.8%
Taylor expanded in x around 0 67.8%
if 7.40000000000000035e-79 < x Initial program 89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in z around inf 64.9%
Taylor expanded in x around inf 74.0%
Final simplification68.5%
(FPCore (x y z t) :precision binary64 (if (<= x -1.05e-248) 1.0 (if (<= x 1.5e-84) x 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.05e-248) {
tmp = 1.0;
} else if (x <= 1.5e-84) {
tmp = 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 (x <= (-1.05d-248)) then
tmp = 1.0d0
else if (x <= 1.5d-84) then
tmp = 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 (x <= -1.05e-248) {
tmp = 1.0;
} else if (x <= 1.5e-84) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.05e-248: tmp = 1.0 elif x <= 1.5e-84: tmp = x else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.05e-248) tmp = 1.0; elseif (x <= 1.5e-84) tmp = x; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.05e-248) tmp = 1.0; elseif (x <= 1.5e-84) tmp = x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.05e-248], 1.0, If[LessEqual[x, 1.5e-84], x, 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-248}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-84}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.05e-248 or 1.5000000000000001e-84 < x Initial program 88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in z around inf 64.5%
Taylor expanded in x around inf 63.2%
if -1.05e-248 < x < 1.5000000000000001e-84Initial program 92.7%
*-commutative92.7%
Simplified92.7%
clear-num92.6%
inv-pow92.6%
Applied egg-rr92.6%
unpow-192.6%
*-commutative92.6%
*-commutative92.6%
Simplified92.6%
Taylor expanded in x around inf 29.6%
Taylor expanded in x around 0 29.7%
Final simplification56.0%
(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 89.6%
*-commutative89.6%
Simplified89.6%
Taylor expanded in z around inf 66.8%
Taylor expanded in x around inf 51.9%
Final simplification51.9%
(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 2023199
(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)))