
(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 1e+212)))
(/ (+ 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 <= 1e+212)) {
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 <= 1e+212)) {
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 <= 1e+212): 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 <= 1e+212)) 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 <= 1e+212))) 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, 1e+212]], $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 10^{+212}\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 9.9999999999999991e211 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 23.9%
*-commutative23.9%
Simplified23.9%
Taylor expanded in z around inf 79.2%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 9.9999999999999991e211Initial program 99.0%
Final simplification96.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x))
(t_2 (/ (+ x (/ (* y z) t_1)) (+ x 1.0)))
(t_3 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= z -4.4e+127)
t_3
(if (<= z -1.35e-105)
t_2
(if (<= z 8.5e-182)
(/ (- x (/ x t_1)) (+ x 1.0))
(if (<= z 3e+190) t_2 t_3))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + ((y * z) / t_1)) / (x + 1.0);
double t_3 = (x + (y / t)) / (x + 1.0);
double tmp;
if (z <= -4.4e+127) {
tmp = t_3;
} else if (z <= -1.35e-105) {
tmp = t_2;
} else if (z <= 8.5e-182) {
tmp = (x - (x / t_1)) / (x + 1.0);
} else if (z <= 3e+190) {
tmp = t_2;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = (z * t) - x
t_2 = (x + ((y * z) / t_1)) / (x + 1.0d0)
t_3 = (x + (y / t)) / (x + 1.0d0)
if (z <= (-4.4d+127)) then
tmp = t_3
else if (z <= (-1.35d-105)) then
tmp = t_2
else if (z <= 8.5d-182) then
tmp = (x - (x / t_1)) / (x + 1.0d0)
else if (z <= 3d+190) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + ((y * z) / t_1)) / (x + 1.0);
double t_3 = (x + (y / t)) / (x + 1.0);
double tmp;
if (z <= -4.4e+127) {
tmp = t_3;
} else if (z <= -1.35e-105) {
tmp = t_2;
} else if (z <= 8.5e-182) {
tmp = (x - (x / t_1)) / (x + 1.0);
} else if (z <= 3e+190) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * t) - x t_2 = (x + ((y * z) / t_1)) / (x + 1.0) t_3 = (x + (y / t)) / (x + 1.0) tmp = 0 if z <= -4.4e+127: tmp = t_3 elif z <= -1.35e-105: tmp = t_2 elif z <= 8.5e-182: tmp = (x - (x / t_1)) / (x + 1.0) elif z <= 3e+190: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t_1)) / Float64(x + 1.0)) t_3 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (z <= -4.4e+127) tmp = t_3; elseif (z <= -1.35e-105) tmp = t_2; elseif (z <= 8.5e-182) tmp = Float64(Float64(x - Float64(x / t_1)) / Float64(x + 1.0)); elseif (z <= 3e+190) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * t) - x; t_2 = (x + ((y * z) / t_1)) / (x + 1.0); t_3 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (z <= -4.4e+127) tmp = t_3; elseif (z <= -1.35e-105) tmp = t_2; elseif (z <= 8.5e-182) tmp = (x - (x / t_1)) / (x + 1.0); elseif (z <= 3e+190) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.4e+127], t$95$3, If[LessEqual[z, -1.35e-105], t$95$2, If[LessEqual[z, 8.5e-182], N[(N[(x - N[(x / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+190], t$95$2, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
t_2 := \frac{x + \frac{y \cdot z}{t_1}}{x + 1}\\
t_3 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{+127}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-105}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-182}:\\
\;\;\;\;\frac{x - \frac{x}{t_1}}{x + 1}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+190}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -4.4000000000000003e127 or 2.99999999999999982e190 < z Initial program 62.8%
*-commutative62.8%
Simplified62.8%
Taylor expanded in z around inf 90.6%
if -4.4000000000000003e127 < z < -1.34999999999999996e-105 or 8.5000000000000001e-182 < z < 2.99999999999999982e190Initial program 96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in y around inf 90.4%
*-commutative90.4%
Simplified90.4%
if -1.34999999999999996e-105 < z < 8.5000000000000001e-182Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 86.9%
+-commutative86.9%
Simplified86.9%
Final simplification89.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (+ x 1.0))) (t_2 (* y (/ z (- (* z t) x)))))
(if (<= x -0.92)
t_1
(if (<= x -2.3e-49)
t_2
(if (<= x -4.8e-122)
(- x (* x x))
(if (<= x -2.65e-164)
(+ 1.0 (* t (/ z x)))
(if (<= x 1.5e-69) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double t_2 = y * (z / ((z * t) - x));
double tmp;
if (x <= -0.92) {
tmp = t_1;
} else if (x <= -2.3e-49) {
tmp = t_2;
} else if (x <= -4.8e-122) {
tmp = x - (x * x);
} else if (x <= -2.65e-164) {
tmp = 1.0 + (t * (z / x));
} else if (x <= 1.5e-69) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = x / (x + 1.0d0)
t_2 = y * (z / ((z * t) - x))
if (x <= (-0.92d0)) then
tmp = t_1
else if (x <= (-2.3d-49)) then
tmp = t_2
else if (x <= (-4.8d-122)) then
tmp = x - (x * x)
else if (x <= (-2.65d-164)) then
tmp = 1.0d0 + (t * (z / x))
else if (x <= 1.5d-69) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double t_2 = y * (z / ((z * t) - x));
double tmp;
if (x <= -0.92) {
tmp = t_1;
} else if (x <= -2.3e-49) {
tmp = t_2;
} else if (x <= -4.8e-122) {
tmp = x - (x * x);
} else if (x <= -2.65e-164) {
tmp = 1.0 + (t * (z / x));
} else if (x <= 1.5e-69) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (x + 1.0) t_2 = y * (z / ((z * t) - x)) tmp = 0 if x <= -0.92: tmp = t_1 elif x <= -2.3e-49: tmp = t_2 elif x <= -4.8e-122: tmp = x - (x * x) elif x <= -2.65e-164: tmp = 1.0 + (t * (z / x)) elif x <= 1.5e-69: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) t_2 = Float64(y * Float64(z / Float64(Float64(z * t) - x))) tmp = 0.0 if (x <= -0.92) tmp = t_1; elseif (x <= -2.3e-49) tmp = t_2; elseif (x <= -4.8e-122) tmp = Float64(x - Float64(x * x)); elseif (x <= -2.65e-164) tmp = Float64(1.0 + Float64(t * Float64(z / x))); elseif (x <= 1.5e-69) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (x + 1.0); t_2 = y * (z / ((z * t) - x)); tmp = 0.0; if (x <= -0.92) tmp = t_1; elseif (x <= -2.3e-49) tmp = t_2; elseif (x <= -4.8e-122) tmp = x - (x * x); elseif (x <= -2.65e-164) tmp = 1.0 + (t * (z / x)); elseif (x <= 1.5e-69) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(z / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.92], t$95$1, If[LessEqual[x, -2.3e-49], t$95$2, If[LessEqual[x, -4.8e-122], N[(x - N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.65e-164], N[(1.0 + N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e-69], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
t_2 := y \cdot \frac{z}{z \cdot t - x}\\
\mathbf{if}\;x \leq -0.92:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.3 \cdot 10^{-49}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-122}:\\
\;\;\;\;x - x \cdot x\\
\mathbf{elif}\;x \leq -2.65 \cdot 10^{-164}:\\
\;\;\;\;1 + t \cdot \frac{z}{x}\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-69}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -0.92000000000000004 or 1.49999999999999995e-69 < x Initial program 84.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in t around inf 86.9%
+-commutative86.9%
Simplified86.9%
if -0.92000000000000004 < x < -2.2999999999999999e-49 or -2.65000000000000016e-164 < x < 1.49999999999999995e-69Initial program 94.3%
*-commutative94.3%
Simplified94.3%
Taylor expanded in y around inf 61.7%
*-commutative61.7%
*-commutative61.7%
+-commutative61.7%
Simplified61.7%
*-commutative61.7%
times-frac65.0%
*-commutative65.0%
Applied egg-rr65.0%
Taylor expanded in x around 0 63.3%
if -2.2999999999999999e-49 < x < -4.79999999999999975e-122Initial program 87.1%
*-commutative87.1%
Simplified87.1%
Taylor expanded in t around inf 48.5%
+-commutative48.5%
Simplified48.5%
Taylor expanded in x around 0 48.5%
+-commutative48.5%
neg-mul-148.5%
unsub-neg48.5%
unpow248.5%
Simplified48.5%
if -4.79999999999999975e-122 < x < -2.65000000000000016e-164Initial program 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in x around -inf 67.6%
mul-1-neg67.6%
unsub-neg67.6%
distribute-rgt-out--67.6%
Simplified67.6%
Taylor expanded in y around 0 51.9%
div-sub51.9%
+-commutative51.9%
+-commutative51.9%
*-inverses51.9%
mul-1-neg51.9%
associate-/l*51.9%
+-commutative51.9%
Simplified51.9%
Taylor expanded in x around 0 51.9%
associate-*r/51.9%
neg-mul-151.9%
distribute-rgt-neg-in51.9%
Simplified51.9%
Final simplification75.6%
(FPCore (x y z t)
:precision binary64
(if (<= x -8.6e+18)
(- 1.0 (* (/ z x) (/ y x)))
(if (<= x -1.6e-36)
(/ (/ y (+ x 1.0)) t)
(if (<= x -3.4e-121)
(- x (* x x))
(if (<= x -2.65e-164)
(+ 1.0 (* t (/ z x)))
(if (<= x 7.5e-70) (* y (/ z (- (* z t) x))) (/ x (+ x 1.0))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -8.6e+18) {
tmp = 1.0 - ((z / x) * (y / x));
} else if (x <= -1.6e-36) {
tmp = (y / (x + 1.0)) / t;
} else if (x <= -3.4e-121) {
tmp = x - (x * x);
} else if (x <= -2.65e-164) {
tmp = 1.0 + (t * (z / x));
} else if (x <= 7.5e-70) {
tmp = y * (z / ((z * t) - x));
} else {
tmp = 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 (x <= (-8.6d+18)) then
tmp = 1.0d0 - ((z / x) * (y / x))
else if (x <= (-1.6d-36)) then
tmp = (y / (x + 1.0d0)) / t
else if (x <= (-3.4d-121)) then
tmp = x - (x * x)
else if (x <= (-2.65d-164)) then
tmp = 1.0d0 + (t * (z / x))
else if (x <= 7.5d-70) then
tmp = y * (z / ((z * t) - x))
else
tmp = 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 (x <= -8.6e+18) {
tmp = 1.0 - ((z / x) * (y / x));
} else if (x <= -1.6e-36) {
tmp = (y / (x + 1.0)) / t;
} else if (x <= -3.4e-121) {
tmp = x - (x * x);
} else if (x <= -2.65e-164) {
tmp = 1.0 + (t * (z / x));
} else if (x <= 7.5e-70) {
tmp = y * (z / ((z * t) - x));
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -8.6e+18: tmp = 1.0 - ((z / x) * (y / x)) elif x <= -1.6e-36: tmp = (y / (x + 1.0)) / t elif x <= -3.4e-121: tmp = x - (x * x) elif x <= -2.65e-164: tmp = 1.0 + (t * (z / x)) elif x <= 7.5e-70: tmp = y * (z / ((z * t) - x)) else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -8.6e+18) tmp = Float64(1.0 - Float64(Float64(z / x) * Float64(y / x))); elseif (x <= -1.6e-36) tmp = Float64(Float64(y / Float64(x + 1.0)) / t); elseif (x <= -3.4e-121) tmp = Float64(x - Float64(x * x)); elseif (x <= -2.65e-164) tmp = Float64(1.0 + Float64(t * Float64(z / x))); elseif (x <= 7.5e-70) tmp = Float64(y * Float64(z / Float64(Float64(z * t) - x))); else tmp = Float64(x / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -8.6e+18) tmp = 1.0 - ((z / x) * (y / x)); elseif (x <= -1.6e-36) tmp = (y / (x + 1.0)) / t; elseif (x <= -3.4e-121) tmp = x - (x * x); elseif (x <= -2.65e-164) tmp = 1.0 + (t * (z / x)); elseif (x <= 7.5e-70) tmp = y * (z / ((z * t) - x)); else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -8.6e+18], N[(1.0 - N[(N[(z / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.6e-36], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[x, -3.4e-121], N[(x - N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.65e-164], N[(1.0 + N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.5e-70], N[(y * N[(z / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.6 \cdot 10^{+18}:\\
\;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -1.6 \cdot 10^{-36}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{t}\\
\mathbf{elif}\;x \leq -3.4 \cdot 10^{-121}:\\
\;\;\;\;x - x \cdot x\\
\mathbf{elif}\;x \leq -2.65 \cdot 10^{-164}:\\
\;\;\;\;1 + t \cdot \frac{z}{x}\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-70}:\\
\;\;\;\;y \cdot \frac{z}{z \cdot t - x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -8.6e18Initial program 92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in x around -inf 81.3%
mul-1-neg81.3%
unsub-neg81.3%
distribute-rgt-out--81.3%
unpow281.3%
times-frac90.8%
Simplified90.8%
Taylor expanded in y around inf 94.9%
if -8.6e18 < x < -1.60000000000000011e-36Initial program 69.7%
*-commutative69.7%
Simplified69.7%
Taylor expanded in y around inf 69.7%
*-commutative69.7%
*-commutative69.7%
+-commutative69.7%
Simplified69.7%
Taylor expanded in z around inf 66.2%
associate-/r*66.2%
+-commutative66.2%
Simplified66.2%
if -1.60000000000000011e-36 < x < -3.40000000000000001e-121Initial program 88.6%
*-commutative88.6%
Simplified88.6%
Taylor expanded in t around inf 43.1%
+-commutative43.1%
Simplified43.1%
Taylor expanded in x around 0 43.1%
+-commutative43.1%
neg-mul-143.1%
unsub-neg43.1%
unpow243.1%
Simplified43.1%
if -3.40000000000000001e-121 < x < -2.65000000000000016e-164Initial program 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in x around -inf 67.6%
mul-1-neg67.6%
unsub-neg67.6%
distribute-rgt-out--67.6%
Simplified67.6%
Taylor expanded in y around 0 51.9%
div-sub51.9%
+-commutative51.9%
+-commutative51.9%
*-inverses51.9%
mul-1-neg51.9%
associate-/l*51.9%
+-commutative51.9%
Simplified51.9%
Taylor expanded in x around 0 51.9%
associate-*r/51.9%
neg-mul-151.9%
distribute-rgt-neg-in51.9%
Simplified51.9%
if -2.65000000000000016e-164 < x < 7.49999999999999973e-70Initial program 93.7%
*-commutative93.7%
Simplified93.7%
Taylor expanded in y around inf 59.0%
*-commutative59.0%
*-commutative59.0%
+-commutative59.0%
Simplified59.0%
*-commutative59.0%
times-frac62.6%
*-commutative62.6%
Applied egg-rr62.6%
Taylor expanded in x around 0 62.6%
if 7.49999999999999973e-70 < x Initial program 81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in t around inf 84.9%
+-commutative84.9%
Simplified84.9%
Final simplification75.7%
(FPCore (x y z t)
:precision binary64
(if (<= x -8.6e+18)
(- 1.0 (/ y (* x (/ x z))))
(if (<= x -1.45e-38)
(/ (/ y (+ x 1.0)) t)
(if (<= x -9e-124)
(- x (* x x))
(if (<= x -2.65e-164)
(+ 1.0 (* t (/ z x)))
(if (<= x 1.5e-69) (* y (/ z (- (* z t) x))) (/ x (+ x 1.0))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -8.6e+18) {
tmp = 1.0 - (y / (x * (x / z)));
} else if (x <= -1.45e-38) {
tmp = (y / (x + 1.0)) / t;
} else if (x <= -9e-124) {
tmp = x - (x * x);
} else if (x <= -2.65e-164) {
tmp = 1.0 + (t * (z / x));
} else if (x <= 1.5e-69) {
tmp = y * (z / ((z * t) - x));
} else {
tmp = 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 (x <= (-8.6d+18)) then
tmp = 1.0d0 - (y / (x * (x / z)))
else if (x <= (-1.45d-38)) then
tmp = (y / (x + 1.0d0)) / t
else if (x <= (-9d-124)) then
tmp = x - (x * x)
else if (x <= (-2.65d-164)) then
tmp = 1.0d0 + (t * (z / x))
else if (x <= 1.5d-69) then
tmp = y * (z / ((z * t) - x))
else
tmp = 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 (x <= -8.6e+18) {
tmp = 1.0 - (y / (x * (x / z)));
} else if (x <= -1.45e-38) {
tmp = (y / (x + 1.0)) / t;
} else if (x <= -9e-124) {
tmp = x - (x * x);
} else if (x <= -2.65e-164) {
tmp = 1.0 + (t * (z / x));
} else if (x <= 1.5e-69) {
tmp = y * (z / ((z * t) - x));
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -8.6e+18: tmp = 1.0 - (y / (x * (x / z))) elif x <= -1.45e-38: tmp = (y / (x + 1.0)) / t elif x <= -9e-124: tmp = x - (x * x) elif x <= -2.65e-164: tmp = 1.0 + (t * (z / x)) elif x <= 1.5e-69: tmp = y * (z / ((z * t) - x)) else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -8.6e+18) tmp = Float64(1.0 - Float64(y / Float64(x * Float64(x / z)))); elseif (x <= -1.45e-38) tmp = Float64(Float64(y / Float64(x + 1.0)) / t); elseif (x <= -9e-124) tmp = Float64(x - Float64(x * x)); elseif (x <= -2.65e-164) tmp = Float64(1.0 + Float64(t * Float64(z / x))); elseif (x <= 1.5e-69) tmp = Float64(y * Float64(z / Float64(Float64(z * t) - x))); else tmp = Float64(x / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -8.6e+18) tmp = 1.0 - (y / (x * (x / z))); elseif (x <= -1.45e-38) tmp = (y / (x + 1.0)) / t; elseif (x <= -9e-124) tmp = x - (x * x); elseif (x <= -2.65e-164) tmp = 1.0 + (t * (z / x)); elseif (x <= 1.5e-69) tmp = y * (z / ((z * t) - x)); else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -8.6e+18], N[(1.0 - N[(y / N[(x * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.45e-38], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[x, -9e-124], N[(x - N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.65e-164], N[(1.0 + N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e-69], N[(y * N[(z / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.6 \cdot 10^{+18}:\\
\;\;\;\;1 - \frac{y}{x \cdot \frac{x}{z}}\\
\mathbf{elif}\;x \leq -1.45 \cdot 10^{-38}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{t}\\
\mathbf{elif}\;x \leq -9 \cdot 10^{-124}:\\
\;\;\;\;x - x \cdot x\\
\mathbf{elif}\;x \leq -2.65 \cdot 10^{-164}:\\
\;\;\;\;1 + t \cdot \frac{z}{x}\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-69}:\\
\;\;\;\;y \cdot \frac{z}{z \cdot t - x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -8.6e18Initial program 92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in x around -inf 81.3%
mul-1-neg81.3%
unsub-neg81.3%
distribute-rgt-out--81.3%
unpow281.3%
times-frac90.8%
Simplified90.8%
Taylor expanded in y around inf 91.1%
associate-/l*94.8%
unpow294.8%
associate-*r/94.9%
Simplified94.9%
if -8.6e18 < x < -1.44999999999999997e-38Initial program 69.7%
*-commutative69.7%
Simplified69.7%
Taylor expanded in y around inf 69.7%
*-commutative69.7%
*-commutative69.7%
+-commutative69.7%
Simplified69.7%
Taylor expanded in z around inf 66.2%
associate-/r*66.2%
+-commutative66.2%
Simplified66.2%
if -1.44999999999999997e-38 < x < -8.9999999999999992e-124Initial program 88.6%
*-commutative88.6%
Simplified88.6%
Taylor expanded in t around inf 43.1%
+-commutative43.1%
Simplified43.1%
Taylor expanded in x around 0 43.1%
+-commutative43.1%
neg-mul-143.1%
unsub-neg43.1%
unpow243.1%
Simplified43.1%
if -8.9999999999999992e-124 < x < -2.65000000000000016e-164Initial program 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in x around -inf 67.6%
mul-1-neg67.6%
unsub-neg67.6%
distribute-rgt-out--67.6%
Simplified67.6%
Taylor expanded in y around 0 51.9%
div-sub51.9%
+-commutative51.9%
+-commutative51.9%
*-inverses51.9%
mul-1-neg51.9%
associate-/l*51.9%
+-commutative51.9%
Simplified51.9%
Taylor expanded in x around 0 51.9%
associate-*r/51.9%
neg-mul-151.9%
distribute-rgt-neg-in51.9%
Simplified51.9%
if -2.65000000000000016e-164 < x < 1.49999999999999995e-69Initial program 93.7%
*-commutative93.7%
Simplified93.7%
Taylor expanded in y around inf 59.0%
*-commutative59.0%
*-commutative59.0%
+-commutative59.0%
Simplified59.0%
*-commutative59.0%
times-frac62.6%
*-commutative62.6%
Applied egg-rr62.6%
Taylor expanded in x around 0 62.6%
if 1.49999999999999995e-69 < x Initial program 81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in t around inf 84.9%
+-commutative84.9%
Simplified84.9%
Final simplification75.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -7.2e-127) (not (<= t 9.6e-70))) (/ (+ x (/ y t)) (+ x 1.0)) (- 1.0 (/ (/ y (/ x z)) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7.2e-127) || !(t <= 9.6e-70)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 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 ((t <= (-7.2d-127)) .or. (.not. (t <= 9.6d-70))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 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 ((t <= -7.2e-127) || !(t <= 9.6e-70)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 - ((y / (x / z)) / (x + 1.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -7.2e-127) or not (t <= 9.6e-70): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 - ((y / (x / z)) / (x + 1.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -7.2e-127) || !(t <= 9.6e-70)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(1.0 - Float64(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 ((t <= -7.2e-127) || ~((t <= 9.6e-70))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0 - ((y / (x / z)) / (x + 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -7.2e-127], N[Not[LessEqual[t, 9.6e-70]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.2 \cdot 10^{-127} \lor \neg \left(t \leq 9.6 \cdot 10^{-70}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{y}{\frac{x}{z}}}{x + 1}\\
\end{array}
\end{array}
if t < -7.1999999999999999e-127 or 9.6000000000000005e-70 < t Initial program 84.9%
*-commutative84.9%
Simplified84.9%
Taylor expanded in z around inf 87.3%
if -7.1999999999999999e-127 < t < 9.6000000000000005e-70Initial program 93.8%
*-commutative93.8%
Simplified93.8%
Taylor expanded in x around -inf 76.9%
mul-1-neg76.9%
unsub-neg76.9%
distribute-rgt-out--76.9%
Simplified76.9%
Taylor expanded in t around 0 76.6%
div-sub76.6%
+-commutative76.6%
+-commutative76.6%
*-inverses76.6%
associate-/l*80.7%
+-commutative80.7%
Simplified80.7%
Final simplification84.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ 1.0 (/ -1.0 x))))
(if (<= x -0.95)
t_1
(if (<= x -4.6e-34)
(/ y t)
(if (<= x -3.2e-73) (- x (* x x)) (if (<= x 7.8) (/ y t) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 + (-1.0 / x);
double tmp;
if (x <= -0.95) {
tmp = t_1;
} else if (x <= -4.6e-34) {
tmp = y / t;
} else if (x <= -3.2e-73) {
tmp = x - (x * x);
} else if (x <= 7.8) {
tmp = y / t;
} 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 + ((-1.0d0) / x)
if (x <= (-0.95d0)) then
tmp = t_1
else if (x <= (-4.6d-34)) then
tmp = y / t
else if (x <= (-3.2d-73)) then
tmp = x - (x * x)
else if (x <= 7.8d0) then
tmp = y / t
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 + (-1.0 / x);
double tmp;
if (x <= -0.95) {
tmp = t_1;
} else if (x <= -4.6e-34) {
tmp = y / t;
} else if (x <= -3.2e-73) {
tmp = x - (x * x);
} else if (x <= 7.8) {
tmp = y / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 + (-1.0 / x) tmp = 0 if x <= -0.95: tmp = t_1 elif x <= -4.6e-34: tmp = y / t elif x <= -3.2e-73: tmp = x - (x * x) elif x <= 7.8: tmp = y / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 + Float64(-1.0 / x)) tmp = 0.0 if (x <= -0.95) tmp = t_1; elseif (x <= -4.6e-34) tmp = Float64(y / t); elseif (x <= -3.2e-73) tmp = Float64(x - Float64(x * x)); elseif (x <= 7.8) tmp = Float64(y / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 + (-1.0 / x); tmp = 0.0; if (x <= -0.95) tmp = t_1; elseif (x <= -4.6e-34) tmp = y / t; elseif (x <= -3.2e-73) tmp = x - (x * x); elseif (x <= 7.8) tmp = y / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.95], t$95$1, If[LessEqual[x, -4.6e-34], N[(y / t), $MachinePrecision], If[LessEqual[x, -3.2e-73], N[(x - N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.8], N[(y / t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 + \frac{-1}{x}\\
\mathbf{if}\;x \leq -0.95:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.6 \cdot 10^{-34}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{-73}:\\
\;\;\;\;x - x \cdot x\\
\mathbf{elif}\;x \leq 7.8:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -0.94999999999999996 or 7.79999999999999982 < x Initial program 85.1%
*-commutative85.1%
Simplified85.1%
Taylor expanded in y around inf 85.1%
*-commutative85.1%
Simplified85.1%
Taylor expanded in x around inf 89.9%
if -0.94999999999999996 < x < -4.60000000000000022e-34 or -3.19999999999999986e-73 < x < 7.79999999999999982Initial program 91.1%
*-commutative91.1%
Simplified91.1%
Taylor expanded in z around inf 66.2%
Taylor expanded in x around 0 49.2%
if -4.60000000000000022e-34 < x < -3.19999999999999986e-73Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around inf 51.0%
+-commutative51.0%
Simplified51.0%
Taylor expanded in x around 0 51.0%
+-commutative51.0%
neg-mul-151.0%
unsub-neg51.0%
unpow251.0%
Simplified51.0%
Final simplification71.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (+ x 1.0))))
(if (<= x -5.2e-5)
t_1
(if (<= x -4.5e-35)
(/ y t)
(if (<= x -2.4e-89) (- x (* x x)) (if (<= x 1.05e-21) (/ y t) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double tmp;
if (x <= -5.2e-5) {
tmp = t_1;
} else if (x <= -4.5e-35) {
tmp = y / t;
} else if (x <= -2.4e-89) {
tmp = x - (x * x);
} else if (x <= 1.05e-21) {
tmp = y / t;
} 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 / (x + 1.0d0)
if (x <= (-5.2d-5)) then
tmp = t_1
else if (x <= (-4.5d-35)) then
tmp = y / t
else if (x <= (-2.4d-89)) then
tmp = x - (x * x)
else if (x <= 1.05d-21) then
tmp = y / t
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 / (x + 1.0);
double tmp;
if (x <= -5.2e-5) {
tmp = t_1;
} else if (x <= -4.5e-35) {
tmp = y / t;
} else if (x <= -2.4e-89) {
tmp = x - (x * x);
} else if (x <= 1.05e-21) {
tmp = y / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (x + 1.0) tmp = 0 if x <= -5.2e-5: tmp = t_1 elif x <= -4.5e-35: tmp = y / t elif x <= -2.4e-89: tmp = x - (x * x) elif x <= 1.05e-21: tmp = y / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) tmp = 0.0 if (x <= -5.2e-5) tmp = t_1; elseif (x <= -4.5e-35) tmp = Float64(y / t); elseif (x <= -2.4e-89) tmp = Float64(x - Float64(x * x)); elseif (x <= 1.05e-21) tmp = Float64(y / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (x + 1.0); tmp = 0.0; if (x <= -5.2e-5) tmp = t_1; elseif (x <= -4.5e-35) tmp = y / t; elseif (x <= -2.4e-89) tmp = x - (x * x); elseif (x <= 1.05e-21) tmp = y / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.2e-5], t$95$1, If[LessEqual[x, -4.5e-35], N[(y / t), $MachinePrecision], If[LessEqual[x, -2.4e-89], N[(x - N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.05e-21], N[(y / t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
\mathbf{if}\;x \leq -5.2 \cdot 10^{-5}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-35}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{elif}\;x \leq -2.4 \cdot 10^{-89}:\\
\;\;\;\;x - x \cdot x\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-21}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -5.19999999999999968e-5 or 1.05000000000000006e-21 < x Initial program 85.5%
*-commutative85.5%
Simplified85.5%
Taylor expanded in t around inf 88.4%
+-commutative88.4%
Simplified88.4%
if -5.19999999999999968e-5 < x < -4.5000000000000001e-35 or -2.40000000000000016e-89 < x < 1.05000000000000006e-21Initial program 91.4%
*-commutative91.4%
Simplified91.4%
Taylor expanded in z around inf 66.3%
Taylor expanded in x around 0 51.6%
if -4.5000000000000001e-35 < x < -2.40000000000000016e-89Initial program 92.2%
*-commutative92.2%
Simplified92.2%
Taylor expanded in t around inf 48.0%
+-commutative48.0%
Simplified48.0%
Taylor expanded in x around 0 48.0%
+-commutative48.0%
neg-mul-148.0%
unsub-neg48.0%
unpow248.0%
Simplified48.0%
Final simplification71.8%
(FPCore (x y z t)
:precision binary64
(if (<= x -8.6e+18)
1.0
(if (<= x -8e-51)
(/ (/ y (+ x 1.0)) t)
(if (<= x -1.02e-85)
(- x (* x x))
(if (<= x 3.05e-27) (/ y t) (/ x (+ x 1.0)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -8.6e+18) {
tmp = 1.0;
} else if (x <= -8e-51) {
tmp = (y / (x + 1.0)) / t;
} else if (x <= -1.02e-85) {
tmp = x - (x * x);
} else if (x <= 3.05e-27) {
tmp = y / t;
} else {
tmp = 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 (x <= (-8.6d+18)) then
tmp = 1.0d0
else if (x <= (-8d-51)) then
tmp = (y / (x + 1.0d0)) / t
else if (x <= (-1.02d-85)) then
tmp = x - (x * x)
else if (x <= 3.05d-27) then
tmp = y / t
else
tmp = 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 (x <= -8.6e+18) {
tmp = 1.0;
} else if (x <= -8e-51) {
tmp = (y / (x + 1.0)) / t;
} else if (x <= -1.02e-85) {
tmp = x - (x * x);
} else if (x <= 3.05e-27) {
tmp = y / t;
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -8.6e+18: tmp = 1.0 elif x <= -8e-51: tmp = (y / (x + 1.0)) / t elif x <= -1.02e-85: tmp = x - (x * x) elif x <= 3.05e-27: tmp = y / t else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -8.6e+18) tmp = 1.0; elseif (x <= -8e-51) tmp = Float64(Float64(y / Float64(x + 1.0)) / t); elseif (x <= -1.02e-85) tmp = Float64(x - Float64(x * x)); elseif (x <= 3.05e-27) tmp = Float64(y / t); else tmp = Float64(x / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -8.6e+18) tmp = 1.0; elseif (x <= -8e-51) tmp = (y / (x + 1.0)) / t; elseif (x <= -1.02e-85) tmp = x - (x * x); elseif (x <= 3.05e-27) tmp = y / t; else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -8.6e+18], 1.0, If[LessEqual[x, -8e-51], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[x, -1.02e-85], N[(x - N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.05e-27], N[(y / t), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.6 \cdot 10^{+18}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-51}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{t}\\
\mathbf{elif}\;x \leq -1.02 \cdot 10^{-85}:\\
\;\;\;\;x - x \cdot x\\
\mathbf{elif}\;x \leq 3.05 \cdot 10^{-27}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -8.6e18Initial program 92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in y around inf 92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in x around inf 94.5%
if -8.6e18 < x < -8.0000000000000001e-51Initial program 74.7%
*-commutative74.7%
Simplified74.7%
Taylor expanded in y around inf 66.8%
*-commutative66.8%
*-commutative66.8%
+-commutative66.8%
Simplified66.8%
Taylor expanded in z around inf 55.7%
associate-/r*55.7%
+-commutative55.7%
Simplified55.7%
if -8.0000000000000001e-51 < x < -1.02000000000000001e-85Initial program 90.8%
*-commutative90.8%
Simplified90.8%
Taylor expanded in t around inf 56.3%
+-commutative56.3%
Simplified56.3%
Taylor expanded in x around 0 56.3%
+-commutative56.3%
neg-mul-156.3%
unsub-neg56.3%
unpow256.3%
Simplified56.3%
if -1.02000000000000001e-85 < x < 3.05e-27Initial program 91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in z around inf 65.0%
Taylor expanded in x around 0 49.7%
if 3.05e-27 < x Initial program 83.7%
*-commutative83.7%
Simplified83.7%
Taylor expanded in t around inf 88.3%
+-commutative88.3%
Simplified88.3%
Final simplification72.2%
(FPCore (x y z t)
:precision binary64
(if (<= x -2.9e+23)
(- 1.0 (/ y (* x (/ x z))))
(if (<= x 2.5e+56)
(/ (+ x (/ y t)) (+ x 1.0))
(- 1.0 (* (/ z x) (/ y x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.9e+23) {
tmp = 1.0 - (y / (x * (x / z)));
} else if (x <= 2.5e+56) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 - ((z / x) * (y / 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 (x <= (-2.9d+23)) then
tmp = 1.0d0 - (y / (x * (x / z)))
else if (x <= 2.5d+56) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0 - ((z / x) * (y / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.9e+23) {
tmp = 1.0 - (y / (x * (x / z)));
} else if (x <= 2.5e+56) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 - ((z / x) * (y / x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.9e+23: tmp = 1.0 - (y / (x * (x / z))) elif x <= 2.5e+56: tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 - ((z / x) * (y / x)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.9e+23) tmp = Float64(1.0 - Float64(y / Float64(x * Float64(x / z)))); elseif (x <= 2.5e+56) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(1.0 - Float64(Float64(z / x) * Float64(y / x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.9e+23) tmp = 1.0 - (y / (x * (x / z))); elseif (x <= 2.5e+56) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0 - ((z / x) * (y / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.9e+23], N[(1.0 - N[(y / N[(x * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.5e+56], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(z / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+23}:\\
\;\;\;\;1 - \frac{y}{x \cdot \frac{x}{z}}\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{+56}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\
\end{array}
\end{array}
if x < -2.90000000000000013e23Initial program 92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in x around -inf 81.3%
mul-1-neg81.3%
unsub-neg81.3%
distribute-rgt-out--81.3%
unpow281.3%
times-frac90.8%
Simplified90.8%
Taylor expanded in y around inf 91.1%
associate-/l*94.8%
unpow294.8%
associate-*r/94.9%
Simplified94.9%
if -2.90000000000000013e23 < x < 2.50000000000000012e56Initial program 88.8%
*-commutative88.8%
Simplified88.8%
Taylor expanded in z around inf 67.4%
if 2.50000000000000012e56 < x Initial program 83.7%
*-commutative83.7%
Simplified83.7%
Taylor expanded in x around -inf 73.6%
mul-1-neg73.6%
unsub-neg73.6%
distribute-rgt-out--73.7%
unpow273.7%
times-frac87.8%
Simplified87.8%
Taylor expanded in y around inf 93.2%
Final simplification80.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -0.95) (not (<= x 1.4))) (+ 1.0 (/ -1.0 x)) (/ y t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -0.95) || !(x <= 1.4)) {
tmp = 1.0 + (-1.0 / x);
} else {
tmp = y / t;
}
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 <= (-0.95d0)) .or. (.not. (x <= 1.4d0))) then
tmp = 1.0d0 + ((-1.0d0) / x)
else
tmp = y / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -0.95) || !(x <= 1.4)) {
tmp = 1.0 + (-1.0 / x);
} else {
tmp = y / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -0.95) or not (x <= 1.4): tmp = 1.0 + (-1.0 / x) else: tmp = y / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -0.95) || !(x <= 1.4)) tmp = Float64(1.0 + Float64(-1.0 / x)); else tmp = Float64(y / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -0.95) || ~((x <= 1.4))) tmp = 1.0 + (-1.0 / x); else tmp = y / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -0.95], N[Not[LessEqual[x, 1.4]], $MachinePrecision]], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], N[(y / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.95 \lor \neg \left(x \leq 1.4\right):\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t}\\
\end{array}
\end{array}
if x < -0.94999999999999996 or 1.3999999999999999 < x Initial program 85.1%
*-commutative85.1%
Simplified85.1%
Taylor expanded in y around inf 85.1%
*-commutative85.1%
Simplified85.1%
Taylor expanded in x around inf 89.9%
if -0.94999999999999996 < x < 1.3999999999999999Initial program 91.8%
*-commutative91.8%
Simplified91.8%
Taylor expanded in z around inf 65.5%
Taylor expanded in x around 0 45.8%
Final simplification69.6%
(FPCore (x y z t) :precision binary64 (if (<= x -0.92) 1.0 (if (<= x 3.9e-26) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -0.92) {
tmp = 1.0;
} else if (x <= 3.9e-26) {
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 <= (-0.92d0)) then
tmp = 1.0d0
else if (x <= 3.9d-26) 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 <= -0.92) {
tmp = 1.0;
} else if (x <= 3.9e-26) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -0.92: tmp = 1.0 elif x <= 3.9e-26: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -0.92) tmp = 1.0; elseif (x <= 3.9e-26) 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 <= -0.92) tmp = 1.0; elseif (x <= 3.9e-26) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -0.92], 1.0, If[LessEqual[x, 3.9e-26], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.92:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{-26}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -0.92000000000000004 or 3.89999999999999986e-26 < x Initial program 85.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in y around inf 84.7%
*-commutative84.7%
Simplified84.7%
Taylor expanded in x around inf 87.8%
if -0.92000000000000004 < x < 3.89999999999999986e-26Initial program 91.6%
*-commutative91.6%
Simplified91.6%
Taylor expanded in z around inf 65.4%
Taylor expanded in x around 0 46.7%
Final simplification69.3%
(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 88.2%
*-commutative88.2%
Simplified88.2%
Taylor expanded in y around inf 77.7%
*-commutative77.7%
Simplified77.7%
Taylor expanded in x around inf 55.9%
Final simplification55.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 2023178
(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)))