
(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 (- (* z t) x)) (t_2 (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0))))
(if (<= t_2 (- INFINITY))
(* (/ y t_1) (/ z (+ x 1.0)))
(if (<= t_2 2e+176) t_2 (/ (+ x (/ y t)) (+ x 1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (y / t_1) * (z / (x + 1.0));
} else if (t_2 <= 2e+176) {
tmp = t_2;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (y / t_1) * (z / (x + 1.0));
} else if (t_2 <= 2e+176) {
tmp = t_2;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * t) - x t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0) tmp = 0 if t_2 <= -math.inf: tmp = (y / t_1) * (z / (x + 1.0)) elif t_2 <= 2e+176: tmp = t_2 else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) t_2 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_1)) / Float64(x + 1.0)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(y / t_1) * Float64(z / Float64(x + 1.0))); elseif (t_2 <= 2e+176) tmp = t_2; else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * t) - x; t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0); tmp = 0.0; if (t_2 <= -Inf) tmp = (y / t_1) * (z / (x + 1.0)); elseif (t_2 <= 2e+176) tmp = t_2; else tmp = (x + (y / t)) / (x + 1.0); 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[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(y / t$95$1), $MachinePrecision] * N[(z / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+176], t$95$2, N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
t_2 := \frac{x + \frac{y \cdot z - x}{t_1}}{x + 1}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\frac{y}{t_1} \cdot \frac{z}{x + 1}\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+176}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -inf.0Initial program 45.3%
*-commutative45.3%
Simplified45.3%
Taylor expanded in y around inf 44.5%
*-commutative44.5%
*-commutative44.5%
times-frac98.6%
*-commutative98.6%
+-commutative98.6%
Simplified98.6%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 2e176Initial program 99.1%
if 2e176 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 28.2%
*-commutative28.2%
Simplified28.2%
Taylor expanded in z around inf 87.3%
Final simplification98.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (/ y t))))
(if (<= t -1.4e-120)
(/ t_1 (+ x 1.0))
(if (<= t 4.8e-80)
(/ (+ 1.0 (- x (/ y (/ x z)))) (+ x 1.0))
(if (or (<= t 2.2e+17) (not (<= t 2.7e+106)))
(/ (- t_1 (/ x (* z t))) (+ x 1.0))
(/ (- x (/ x (- (* z t) x))) (+ x 1.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y / t);
double tmp;
if (t <= -1.4e-120) {
tmp = t_1 / (x + 1.0);
} else if (t <= 4.8e-80) {
tmp = (1.0 + (x - (y / (x / z)))) / (x + 1.0);
} else if ((t <= 2.2e+17) || !(t <= 2.7e+106)) {
tmp = (t_1 - (x / (z * t))) / (x + 1.0);
} else {
tmp = (x - (x / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y / t)
if (t <= (-1.4d-120)) then
tmp = t_1 / (x + 1.0d0)
else if (t <= 4.8d-80) then
tmp = (1.0d0 + (x - (y / (x / z)))) / (x + 1.0d0)
else if ((t <= 2.2d+17) .or. (.not. (t <= 2.7d+106))) then
tmp = (t_1 - (x / (z * t))) / (x + 1.0d0)
else
tmp = (x - (x / ((z * t) - x))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x + (y / t);
double tmp;
if (t <= -1.4e-120) {
tmp = t_1 / (x + 1.0);
} else if (t <= 4.8e-80) {
tmp = (1.0 + (x - (y / (x / z)))) / (x + 1.0);
} else if ((t <= 2.2e+17) || !(t <= 2.7e+106)) {
tmp = (t_1 - (x / (z * t))) / (x + 1.0);
} else {
tmp = (x - (x / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (y / t) tmp = 0 if t <= -1.4e-120: tmp = t_1 / (x + 1.0) elif t <= 4.8e-80: tmp = (1.0 + (x - (y / (x / z)))) / (x + 1.0) elif (t <= 2.2e+17) or not (t <= 2.7e+106): tmp = (t_1 - (x / (z * t))) / (x + 1.0) else: tmp = (x - (x / ((z * t) - x))) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(y / t)) tmp = 0.0 if (t <= -1.4e-120) tmp = Float64(t_1 / Float64(x + 1.0)); elseif (t <= 4.8e-80) tmp = Float64(Float64(1.0 + Float64(x - Float64(y / Float64(x / z)))) / Float64(x + 1.0)); elseif ((t <= 2.2e+17) || !(t <= 2.7e+106)) tmp = Float64(Float64(t_1 - Float64(x / Float64(z * t))) / Float64(x + 1.0)); else tmp = Float64(Float64(x - Float64(x / Float64(Float64(z * t) - x))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (y / t); tmp = 0.0; if (t <= -1.4e-120) tmp = t_1 / (x + 1.0); elseif (t <= 4.8e-80) tmp = (1.0 + (x - (y / (x / z)))) / (x + 1.0); elseif ((t <= 2.2e+17) || ~((t <= 2.7e+106))) tmp = (t_1 - (x / (z * t))) / (x + 1.0); else tmp = (x - (x / ((z * t) - x))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.4e-120], N[(t$95$1 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.8e-80], N[(N[(1.0 + N[(x - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 2.2e+17], N[Not[LessEqual[t, 2.7e+106]], $MachinePrecision]], N[(N[(t$95$1 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(x / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{t}\\
\mathbf{if}\;t \leq -1.4 \cdot 10^{-120}:\\
\;\;\;\;\frac{t_1}{x + 1}\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-80}:\\
\;\;\;\;\frac{1 + \left(x - \frac{y}{\frac{x}{z}}\right)}{x + 1}\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{+17} \lor \neg \left(t \leq 2.7 \cdot 10^{+106}\right):\\
\;\;\;\;\frac{t_1 - \frac{x}{z \cdot t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\
\end{array}
\end{array}
if t < -1.39999999999999997e-120Initial program 87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in z around inf 87.5%
if -1.39999999999999997e-120 < t < 4.7999999999999998e-80Initial program 95.5%
*-commutative95.5%
Simplified95.5%
Taylor expanded in t around 0 84.4%
mul-1-neg84.4%
unsub-neg84.4%
associate-/l*86.6%
+-commutative86.6%
Simplified86.6%
if 4.7999999999999998e-80 < t < 2.2e17 or 2.70000000000000006e106 < t Initial program 82.1%
*-commutative82.1%
Simplified82.1%
Taylor expanded in t around inf 85.7%
if 2.2e17 < t < 2.70000000000000006e106Initial program 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
Simplified100.0%
Final simplification87.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -4e-120)
t_1
(if (<= t 4e-80)
(/ (+ 1.0 (- x (/ y (/ x z)))) (+ x 1.0))
(if (or (<= t 8.2e+14) (not (<= t 4e+105)))
t_1
(/ (- x (/ x (- (* z t) x))) (+ x 1.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -4e-120) {
tmp = t_1;
} else if (t <= 4e-80) {
tmp = (1.0 + (x - (y / (x / z)))) / (x + 1.0);
} else if ((t <= 8.2e+14) || !(t <= 4e+105)) {
tmp = t_1;
} else {
tmp = (x - (x / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
if (t <= (-4d-120)) then
tmp = t_1
else if (t <= 4d-80) then
tmp = (1.0d0 + (x - (y / (x / z)))) / (x + 1.0d0)
else if ((t <= 8.2d+14) .or. (.not. (t <= 4d+105))) then
tmp = t_1
else
tmp = (x - (x / ((z * t) - x))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -4e-120) {
tmp = t_1;
} else if (t <= 4e-80) {
tmp = (1.0 + (x - (y / (x / z)))) / (x + 1.0);
} else if ((t <= 8.2e+14) || !(t <= 4e+105)) {
tmp = t_1;
} else {
tmp = (x - (x / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -4e-120: tmp = t_1 elif t <= 4e-80: tmp = (1.0 + (x - (y / (x / z)))) / (x + 1.0) elif (t <= 8.2e+14) or not (t <= 4e+105): tmp = t_1 else: tmp = (x - (x / ((z * t) - x))) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (t <= -4e-120) tmp = t_1; elseif (t <= 4e-80) tmp = Float64(Float64(1.0 + Float64(x - Float64(y / Float64(x / z)))) / Float64(x + 1.0)); elseif ((t <= 8.2e+14) || !(t <= 4e+105)) tmp = t_1; else tmp = Float64(Float64(x - Float64(x / Float64(Float64(z * t) - x))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (t <= -4e-120) tmp = t_1; elseif (t <= 4e-80) tmp = (1.0 + (x - (y / (x / z)))) / (x + 1.0); elseif ((t <= 8.2e+14) || ~((t <= 4e+105))) tmp = t_1; else tmp = (x - (x / ((z * t) - x))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4e-120], t$95$1, If[LessEqual[t, 4e-80], N[(N[(1.0 + N[(x - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 8.2e+14], N[Not[LessEqual[t, 4e+105]], $MachinePrecision]], t$95$1, N[(N[(x - N[(x / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -4 \cdot 10^{-120}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-80}:\\
\;\;\;\;\frac{1 + \left(x - \frac{y}{\frac{x}{z}}\right)}{x + 1}\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{+14} \lor \neg \left(t \leq 4 \cdot 10^{+105}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\
\end{array}
\end{array}
if t < -3.99999999999999991e-120 or 3.99999999999999985e-80 < t < 8.2e14 or 3.9999999999999998e105 < t Initial program 84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in z around inf 85.9%
if -3.99999999999999991e-120 < t < 3.99999999999999985e-80Initial program 95.5%
*-commutative95.5%
Simplified95.5%
Taylor expanded in t around 0 84.4%
mul-1-neg84.4%
unsub-neg84.4%
associate-/l*86.6%
+-commutative86.6%
Simplified86.6%
if 8.2e14 < t < 3.9999999999999998e105Initial program 90.9%
*-commutative90.9%
Simplified90.9%
Taylor expanded in y around 0 91.0%
+-commutative91.0%
Simplified91.0%
Final simplification86.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (/ z (- (* z t) x)))))
(if (<= x -1.36e-46)
1.0
(if (<= x 4e-144)
t_1
(if (<= x 1.1e-101)
(* x (+ 1.0 (/ -1.0 (* z t))))
(if (<= x 2.8e-21) t_1 (/ 1.0 (/ (+ x 1.0) x))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (z / ((z * t) - x));
double tmp;
if (x <= -1.36e-46) {
tmp = 1.0;
} else if (x <= 4e-144) {
tmp = t_1;
} else if (x <= 1.1e-101) {
tmp = x * (1.0 + (-1.0 / (z * t)));
} else if (x <= 2.8e-21) {
tmp = t_1;
} else {
tmp = 1.0 / ((x + 1.0) / 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) :: t_1
real(8) :: tmp
t_1 = y * (z / ((z * t) - x))
if (x <= (-1.36d-46)) then
tmp = 1.0d0
else if (x <= 4d-144) then
tmp = t_1
else if (x <= 1.1d-101) then
tmp = x * (1.0d0 + ((-1.0d0) / (z * t)))
else if (x <= 2.8d-21) then
tmp = t_1
else
tmp = 1.0d0 / ((x + 1.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (z / ((z * t) - x));
double tmp;
if (x <= -1.36e-46) {
tmp = 1.0;
} else if (x <= 4e-144) {
tmp = t_1;
} else if (x <= 1.1e-101) {
tmp = x * (1.0 + (-1.0 / (z * t)));
} else if (x <= 2.8e-21) {
tmp = t_1;
} else {
tmp = 1.0 / ((x + 1.0) / x);
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (z / ((z * t) - x)) tmp = 0 if x <= -1.36e-46: tmp = 1.0 elif x <= 4e-144: tmp = t_1 elif x <= 1.1e-101: tmp = x * (1.0 + (-1.0 / (z * t))) elif x <= 2.8e-21: tmp = t_1 else: tmp = 1.0 / ((x + 1.0) / x) return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(z / Float64(Float64(z * t) - x))) tmp = 0.0 if (x <= -1.36e-46) tmp = 1.0; elseif (x <= 4e-144) tmp = t_1; elseif (x <= 1.1e-101) tmp = Float64(x * Float64(1.0 + Float64(-1.0 / Float64(z * t)))); elseif (x <= 2.8e-21) tmp = t_1; else tmp = Float64(1.0 / Float64(Float64(x + 1.0) / x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (z / ((z * t) - x)); tmp = 0.0; if (x <= -1.36e-46) tmp = 1.0; elseif (x <= 4e-144) tmp = t_1; elseif (x <= 1.1e-101) tmp = x * (1.0 + (-1.0 / (z * t))); elseif (x <= 2.8e-21) tmp = t_1; else tmp = 1.0 / ((x + 1.0) / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(z / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.36e-46], 1.0, If[LessEqual[x, 4e-144], t$95$1, If[LessEqual[x, 1.1e-101], N[(x * N[(1.0 + N[(-1.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.8e-21], t$95$1, N[(1.0 / N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{z \cdot t - x}\\
\mathbf{if}\;x \leq -1.36 \cdot 10^{-46}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-144}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{-101}:\\
\;\;\;\;x \cdot \left(1 + \frac{-1}{z \cdot t}\right)\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-21}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x + 1}{x}}\\
\end{array}
\end{array}
if x < -1.3600000000000001e-46Initial program 92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in z around inf 70.9%
Taylor expanded in x around inf 82.2%
if -1.3600000000000001e-46 < x < 3.9999999999999998e-144 or 1.0999999999999999e-101 < x < 2.80000000000000004e-21Initial program 87.6%
*-commutative87.6%
Simplified87.6%
Taylor expanded in y around inf 56.0%
*-commutative56.0%
*-commutative56.0%
times-frac58.6%
*-commutative58.6%
+-commutative58.6%
Simplified58.6%
Taylor expanded in x around 0 58.6%
Taylor expanded in y around 0 56.0%
*-commutative56.0%
*-commutative56.0%
fma-neg56.0%
associate-*l/65.4%
*-commutative65.4%
fma-neg65.4%
*-commutative65.4%
Simplified65.4%
if 3.9999999999999998e-144 < x < 1.0999999999999999e-101Initial program 91.5%
*-commutative91.5%
Simplified91.5%
Taylor expanded in y around 0 83.9%
+-commutative83.9%
Simplified83.9%
Taylor expanded in x around 0 51.5%
*-commutative51.5%
Simplified51.5%
if 2.80000000000000004e-21 < x Initial program 85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in t around inf 87.3%
+-commutative87.3%
Simplified87.3%
clear-num87.3%
inv-pow87.3%
+-commutative87.3%
Applied egg-rr87.3%
unpow-187.3%
Simplified87.3%
Final simplification75.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x)))
(if (<= x -2.4e-48)
1.0
(if (<= x 7e-144)
(* y (/ z t_1))
(if (<= x 3e-94)
(* x (+ 1.0 (/ -1.0 (* z t))))
(if (<= x 3.9e-19) (* z (/ y t_1)) (/ 1.0 (/ (+ x 1.0) x))))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double tmp;
if (x <= -2.4e-48) {
tmp = 1.0;
} else if (x <= 7e-144) {
tmp = y * (z / t_1);
} else if (x <= 3e-94) {
tmp = x * (1.0 + (-1.0 / (z * t)));
} else if (x <= 3.9e-19) {
tmp = z * (y / t_1);
} else {
tmp = 1.0 / ((x + 1.0) / 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) :: t_1
real(8) :: tmp
t_1 = (z * t) - x
if (x <= (-2.4d-48)) then
tmp = 1.0d0
else if (x <= 7d-144) then
tmp = y * (z / t_1)
else if (x <= 3d-94) then
tmp = x * (1.0d0 + ((-1.0d0) / (z * t)))
else if (x <= 3.9d-19) then
tmp = z * (y / t_1)
else
tmp = 1.0d0 / ((x + 1.0d0) / x)
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 tmp;
if (x <= -2.4e-48) {
tmp = 1.0;
} else if (x <= 7e-144) {
tmp = y * (z / t_1);
} else if (x <= 3e-94) {
tmp = x * (1.0 + (-1.0 / (z * t)));
} else if (x <= 3.9e-19) {
tmp = z * (y / t_1);
} else {
tmp = 1.0 / ((x + 1.0) / x);
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * t) - x tmp = 0 if x <= -2.4e-48: tmp = 1.0 elif x <= 7e-144: tmp = y * (z / t_1) elif x <= 3e-94: tmp = x * (1.0 + (-1.0 / (z * t))) elif x <= 3.9e-19: tmp = z * (y / t_1) else: tmp = 1.0 / ((x + 1.0) / x) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) tmp = 0.0 if (x <= -2.4e-48) tmp = 1.0; elseif (x <= 7e-144) tmp = Float64(y * Float64(z / t_1)); elseif (x <= 3e-94) tmp = Float64(x * Float64(1.0 + Float64(-1.0 / Float64(z * t)))); elseif (x <= 3.9e-19) tmp = Float64(z * Float64(y / t_1)); else tmp = Float64(1.0 / Float64(Float64(x + 1.0) / x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * t) - x; tmp = 0.0; if (x <= -2.4e-48) tmp = 1.0; elseif (x <= 7e-144) tmp = y * (z / t_1); elseif (x <= 3e-94) tmp = x * (1.0 + (-1.0 / (z * t))); elseif (x <= 3.9e-19) tmp = z * (y / t_1); else tmp = 1.0 / ((x + 1.0) / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, If[LessEqual[x, -2.4e-48], 1.0, If[LessEqual[x, 7e-144], N[(y * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3e-94], N[(x * N[(1.0 + N[(-1.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.9e-19], N[(z * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
\mathbf{if}\;x \leq -2.4 \cdot 10^{-48}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-144}:\\
\;\;\;\;y \cdot \frac{z}{t_1}\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-94}:\\
\;\;\;\;x \cdot \left(1 + \frac{-1}{z \cdot t}\right)\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{-19}:\\
\;\;\;\;z \cdot \frac{y}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x + 1}{x}}\\
\end{array}
\end{array}
if x < -2.4e-48Initial program 92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in z around inf 70.9%
Taylor expanded in x around inf 82.2%
if -2.4e-48 < x < 6.9999999999999997e-144Initial program 87.1%
*-commutative87.1%
Simplified87.1%
Taylor expanded in y around inf 57.6%
*-commutative57.6%
*-commutative57.6%
times-frac59.5%
*-commutative59.5%
+-commutative59.5%
Simplified59.5%
Taylor expanded in x around 0 59.5%
Taylor expanded in y around 0 57.6%
*-commutative57.6%
*-commutative57.6%
fma-neg57.7%
associate-*l/67.3%
*-commutative67.3%
fma-neg67.3%
*-commutative67.3%
Simplified67.3%
if 6.9999999999999997e-144 < x < 3.0000000000000001e-94Initial program 91.5%
*-commutative91.5%
Simplified91.5%
Taylor expanded in y around 0 83.9%
+-commutative83.9%
Simplified83.9%
Taylor expanded in x around 0 51.5%
*-commutative51.5%
Simplified51.5%
if 3.0000000000000001e-94 < x < 3.89999999999999995e-19Initial program 91.8%
*-commutative91.8%
Simplified91.8%
Taylor expanded in y around inf 43.1%
*-commutative43.1%
*-commutative43.1%
times-frac51.1%
*-commutative51.1%
+-commutative51.1%
Simplified51.1%
Taylor expanded in x around 0 51.1%
if 3.89999999999999995e-19 < x Initial program 85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in t around inf 87.3%
+-commutative87.3%
Simplified87.3%
clear-num87.3%
inv-pow87.3%
+-commutative87.3%
Applied egg-rr87.3%
unpow-187.3%
Simplified87.3%
Final simplification75.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x)))
(if (<= x -1.7e-46)
(- 1.0 (* (/ z x) (/ y x)))
(if (<= x 6e-144)
(* y (/ z t_1))
(if (<= x 1.08e-93)
(* x (+ 1.0 (/ -1.0 (* z t))))
(if (<= x 1.65e-19) (* z (/ y t_1)) (/ 1.0 (/ (+ x 1.0) x))))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double tmp;
if (x <= -1.7e-46) {
tmp = 1.0 - ((z / x) * (y / x));
} else if (x <= 6e-144) {
tmp = y * (z / t_1);
} else if (x <= 1.08e-93) {
tmp = x * (1.0 + (-1.0 / (z * t)));
} else if (x <= 1.65e-19) {
tmp = z * (y / t_1);
} else {
tmp = 1.0 / ((x + 1.0) / 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) :: t_1
real(8) :: tmp
t_1 = (z * t) - x
if (x <= (-1.7d-46)) then
tmp = 1.0d0 - ((z / x) * (y / x))
else if (x <= 6d-144) then
tmp = y * (z / t_1)
else if (x <= 1.08d-93) then
tmp = x * (1.0d0 + ((-1.0d0) / (z * t)))
else if (x <= 1.65d-19) then
tmp = z * (y / t_1)
else
tmp = 1.0d0 / ((x + 1.0d0) / x)
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 tmp;
if (x <= -1.7e-46) {
tmp = 1.0 - ((z / x) * (y / x));
} else if (x <= 6e-144) {
tmp = y * (z / t_1);
} else if (x <= 1.08e-93) {
tmp = x * (1.0 + (-1.0 / (z * t)));
} else if (x <= 1.65e-19) {
tmp = z * (y / t_1);
} else {
tmp = 1.0 / ((x + 1.0) / x);
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * t) - x tmp = 0 if x <= -1.7e-46: tmp = 1.0 - ((z / x) * (y / x)) elif x <= 6e-144: tmp = y * (z / t_1) elif x <= 1.08e-93: tmp = x * (1.0 + (-1.0 / (z * t))) elif x <= 1.65e-19: tmp = z * (y / t_1) else: tmp = 1.0 / ((x + 1.0) / x) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) tmp = 0.0 if (x <= -1.7e-46) tmp = Float64(1.0 - Float64(Float64(z / x) * Float64(y / x))); elseif (x <= 6e-144) tmp = Float64(y * Float64(z / t_1)); elseif (x <= 1.08e-93) tmp = Float64(x * Float64(1.0 + Float64(-1.0 / Float64(z * t)))); elseif (x <= 1.65e-19) tmp = Float64(z * Float64(y / t_1)); else tmp = Float64(1.0 / Float64(Float64(x + 1.0) / x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * t) - x; tmp = 0.0; if (x <= -1.7e-46) tmp = 1.0 - ((z / x) * (y / x)); elseif (x <= 6e-144) tmp = y * (z / t_1); elseif (x <= 1.08e-93) tmp = x * (1.0 + (-1.0 / (z * t))); elseif (x <= 1.65e-19) tmp = z * (y / t_1); else tmp = 1.0 / ((x + 1.0) / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, If[LessEqual[x, -1.7e-46], N[(1.0 - N[(N[(z / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6e-144], N[(y * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.08e-93], N[(x * N[(1.0 + N[(-1.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.65e-19], N[(z * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{-46}:\\
\;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-144}:\\
\;\;\;\;y \cdot \frac{z}{t_1}\\
\mathbf{elif}\;x \leq 1.08 \cdot 10^{-93}:\\
\;\;\;\;x \cdot \left(1 + \frac{-1}{z \cdot t}\right)\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-19}:\\
\;\;\;\;z \cdot \frac{y}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x + 1}{x}}\\
\end{array}
\end{array}
if x < -1.69999999999999998e-46Initial program 92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in x around -inf 76.8%
mul-1-neg76.8%
unsub-neg76.8%
distribute-rgt-out--76.8%
unpow276.8%
times-frac82.0%
Simplified82.0%
Taylor expanded in y around inf 89.2%
if -1.69999999999999998e-46 < x < 5.9999999999999997e-144Initial program 87.1%
*-commutative87.1%
Simplified87.1%
Taylor expanded in y around inf 57.6%
*-commutative57.6%
*-commutative57.6%
times-frac59.5%
*-commutative59.5%
+-commutative59.5%
Simplified59.5%
Taylor expanded in x around 0 59.5%
Taylor expanded in y around 0 57.6%
*-commutative57.6%
*-commutative57.6%
fma-neg57.7%
associate-*l/67.3%
*-commutative67.3%
fma-neg67.3%
*-commutative67.3%
Simplified67.3%
if 5.9999999999999997e-144 < x < 1.08e-93Initial program 91.5%
*-commutative91.5%
Simplified91.5%
Taylor expanded in y around 0 83.9%
+-commutative83.9%
Simplified83.9%
Taylor expanded in x around 0 51.5%
*-commutative51.5%
Simplified51.5%
if 1.08e-93 < x < 1.6499999999999999e-19Initial program 91.8%
*-commutative91.8%
Simplified91.8%
Taylor expanded in y around inf 43.1%
*-commutative43.1%
*-commutative43.1%
times-frac51.1%
*-commutative51.1%
+-commutative51.1%
Simplified51.1%
Taylor expanded in x around 0 51.1%
if 1.6499999999999999e-19 < x Initial program 85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in t around inf 87.3%
+-commutative87.3%
Simplified87.3%
clear-num87.3%
inv-pow87.3%
+-commutative87.3%
Applied egg-rr87.3%
unpow-187.3%
Simplified87.3%
Final simplification77.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -7.5e-121) (not (<= t 9e-80))) (/ (+ 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 ((t <= -7.5e-121) || !(t <= 9e-80)) {
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 ((t <= (-7.5d-121)) .or. (.not. (t <= 9d-80))) 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 ((t <= -7.5e-121) || !(t <= 9e-80)) {
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 (t <= -7.5e-121) or not (t <= 9e-80): 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 ((t <= -7.5e-121) || !(t <= 9e-80)) 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 ((t <= -7.5e-121) || ~((t <= 9e-80))) 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[t, -7.5e-121], N[Not[LessEqual[t, 9e-80]], $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}\;t \leq -7.5 \cdot 10^{-121} \lor \neg \left(t \leq 9 \cdot 10^{-80}\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 t < -7.50000000000000027e-121 or 9.0000000000000006e-80 < t Initial program 85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in z around inf 82.9%
if -7.50000000000000027e-121 < t < 9.0000000000000006e-80Initial program 95.5%
*-commutative95.5%
Simplified95.5%
Taylor expanded in t around 0 84.4%
mul-1-neg84.4%
unsub-neg84.4%
associate-/l*86.6%
+-commutative86.6%
Simplified86.6%
Final simplification84.1%
(FPCore (x y z t) :precision binary64 (if (<= x -2.2e-18) (- 1.0 (* (/ z x) (/ y x))) (if (<= x 17200000000000.0) (/ (+ x (/ y t)) (+ x 1.0)) (/ x (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.2e-18) {
tmp = 1.0 - ((z / x) * (y / x));
} else if (x <= 17200000000000.0) {
tmp = (x + (y / t)) / (x + 1.0);
} 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 <= (-2.2d-18)) then
tmp = 1.0d0 - ((z / x) * (y / x))
else if (x <= 17200000000000.0d0) then
tmp = (x + (y / t)) / (x + 1.0d0)
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 <= -2.2e-18) {
tmp = 1.0 - ((z / x) * (y / x));
} else if (x <= 17200000000000.0) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.2e-18: tmp = 1.0 - ((z / x) * (y / x)) elif x <= 17200000000000.0: tmp = (x + (y / t)) / (x + 1.0) else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.2e-18) tmp = Float64(1.0 - Float64(Float64(z / x) * Float64(y / x))); elseif (x <= 17200000000000.0) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); 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 <= -2.2e-18) tmp = 1.0 - ((z / x) * (y / x)); elseif (x <= 17200000000000.0) tmp = (x + (y / t)) / (x + 1.0); else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.2e-18], N[(1.0 - N[(N[(z / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 17200000000000.0], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-18}:\\
\;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq 17200000000000:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -2.1999999999999998e-18Initial program 93.2%
*-commutative93.2%
Simplified93.2%
Taylor expanded in x around -inf 80.7%
mul-1-neg80.7%
unsub-neg80.7%
distribute-rgt-out--80.7%
unpow280.7%
times-frac86.3%
Simplified86.3%
Taylor expanded in y around inf 92.6%
if -2.1999999999999998e-18 < x < 1.72e13Initial program 85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in z around inf 66.8%
if 1.72e13 < x Initial program 90.6%
*-commutative90.6%
Simplified90.6%
Taylor expanded in t around inf 94.5%
+-commutative94.5%
Simplified94.5%
Final simplification79.6%
(FPCore (x y z t) :precision binary64 (if (<= x -8e-68) 1.0 (if (<= x 1.48e-139) (/ y (+ t (* x t))) (/ x (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -8e-68) {
tmp = 1.0;
} else if (x <= 1.48e-139) {
tmp = y / (t + (x * 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 <= (-8d-68)) then
tmp = 1.0d0
else if (x <= 1.48d-139) then
tmp = y / (t + (x * 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 <= -8e-68) {
tmp = 1.0;
} else if (x <= 1.48e-139) {
tmp = y / (t + (x * t));
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -8e-68: tmp = 1.0 elif x <= 1.48e-139: tmp = y / (t + (x * t)) else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -8e-68) tmp = 1.0; elseif (x <= 1.48e-139) tmp = Float64(y / Float64(t + Float64(x * 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 <= -8e-68) tmp = 1.0; elseif (x <= 1.48e-139) tmp = y / (t + (x * t)); else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -8e-68], 1.0, If[LessEqual[x, 1.48e-139], N[(y / N[(t + N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{-68}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.48 \cdot 10^{-139}:\\
\;\;\;\;\frac{y}{t + x \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -8.00000000000000053e-68Initial program 92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in z around inf 68.8%
Taylor expanded in x around inf 79.5%
if -8.00000000000000053e-68 < x < 1.47999999999999991e-139Initial program 86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in y around inf 56.3%
*-commutative56.3%
*-commutative56.3%
times-frac58.2%
*-commutative58.2%
+-commutative58.2%
Simplified58.2%
Taylor expanded in t around inf 57.1%
distribute-lft-in57.1%
*-rgt-identity57.1%
Simplified57.1%
if 1.47999999999999991e-139 < x Initial program 87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in t around inf 72.3%
+-commutative72.3%
Simplified72.3%
Final simplification69.1%
(FPCore (x y z t) :precision binary64 (if (<= x -6.8e-68) 1.0 (if (<= x 6.1e-139) (/ y t) (/ x (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.8e-68) {
tmp = 1.0;
} else if (x <= 6.1e-139) {
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 <= (-6.8d-68)) then
tmp = 1.0d0
else if (x <= 6.1d-139) 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 <= -6.8e-68) {
tmp = 1.0;
} else if (x <= 6.1e-139) {
tmp = y / t;
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -6.8e-68: tmp = 1.0 elif x <= 6.1e-139: tmp = y / t else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -6.8e-68) tmp = 1.0; elseif (x <= 6.1e-139) 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 <= -6.8e-68) tmp = 1.0; elseif (x <= 6.1e-139) tmp = y / t; else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.8e-68], 1.0, If[LessEqual[x, 6.1e-139], N[(y / t), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{-68}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 6.1 \cdot 10^{-139}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -6.80000000000000037e-68Initial program 92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in z around inf 68.8%
Taylor expanded in x around inf 79.5%
if -6.80000000000000037e-68 < x < 6.0999999999999998e-139Initial program 86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in z around inf 70.9%
Taylor expanded in x around 0 57.1%
if 6.0999999999999998e-139 < x Initial program 87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in t around inf 72.3%
+-commutative72.3%
Simplified72.3%
Final simplification69.1%
(FPCore (x y z t) :precision binary64 (if (<= x -3.8e-67) 1.0 (if (<= x 9.8e-148) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.8e-67) {
tmp = 1.0;
} else if (x <= 9.8e-148) {
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.8d-67)) then
tmp = 1.0d0
else if (x <= 9.8d-148) 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.8e-67) {
tmp = 1.0;
} else if (x <= 9.8e-148) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.8e-67: tmp = 1.0 elif x <= 9.8e-148: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.8e-67) tmp = 1.0; elseif (x <= 9.8e-148) 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.8e-67) tmp = 1.0; elseif (x <= 9.8e-148) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.8e-67], 1.0, If[LessEqual[x, 9.8e-148], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{-67}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 9.8 \cdot 10^{-148}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -3.79999999999999988e-67 or 9.8000000000000001e-148 < x Initial program 90.0%
*-commutative90.0%
Simplified90.0%
Taylor expanded in z around inf 68.2%
Taylor expanded in x around inf 74.6%
if -3.79999999999999988e-67 < x < 9.8000000000000001e-148Initial program 86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in z around inf 72.4%
Taylor expanded in x around 0 58.3%
Final simplification68.9%
(FPCore (x y z t) :precision binary64 (if (<= x -1.8e-108) 1.0 (if (<= x 1.22e-291) x 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.8e-108) {
tmp = 1.0;
} else if (x <= 1.22e-291) {
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.8d-108)) then
tmp = 1.0d0
else if (x <= 1.22d-291) 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.8e-108) {
tmp = 1.0;
} else if (x <= 1.22e-291) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.8e-108: tmp = 1.0 elif x <= 1.22e-291: tmp = x else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.8e-108) tmp = 1.0; elseif (x <= 1.22e-291) tmp = x; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.8e-108) tmp = 1.0; elseif (x <= 1.22e-291) tmp = x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.8e-108], 1.0, If[LessEqual[x, 1.22e-291], x, 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{-108}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{-291}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.8e-108 or 1.21999999999999993e-291 < x Initial program 88.4%
*-commutative88.4%
Simplified88.4%
Taylor expanded in z around inf 67.9%
Taylor expanded in x around inf 62.6%
if -1.8e-108 < x < 1.21999999999999993e-291Initial program 90.3%
*-commutative90.3%
Simplified90.3%
Taylor expanded in t around inf 25.3%
+-commutative25.3%
Simplified25.3%
Taylor expanded in x around 0 25.3%
Final simplification55.7%
(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.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in z around inf 69.7%
Taylor expanded in x around inf 52.1%
Final simplification52.1%
(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 2023292
(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)))