
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* y z) x))
(t_2 (/ (* z t) x))
(t_3 (- (* z t) x))
(t_4 (/ (+ x (/ t_1 t_3)) (+ x 1.0))))
(if (<= t_4 (- INFINITY))
(/
(+ x (* y (+ (/ z (* x (+ t_2 -1.0))) (/ 1.0 (* y (- 1.0 t_2))))))
(+ x 1.0))
(if (<= t_4 2e+223)
(/ (+ x (/ 1.0 (/ t_3 t_1))) (+ x 1.0))
(/ (+ x (/ y t)) (+ x 1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * z) - x;
double t_2 = (z * t) / x;
double t_3 = (z * t) - x;
double t_4 = (x + (t_1 / t_3)) / (x + 1.0);
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = (x + (y * ((z / (x * (t_2 + -1.0))) + (1.0 / (y * (1.0 - t_2)))))) / (x + 1.0);
} else if (t_4 <= 2e+223) {
tmp = (x + (1.0 / (t_3 / t_1))) / (x + 1.0);
} 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 = (y * z) - x;
double t_2 = (z * t) / x;
double t_3 = (z * t) - x;
double t_4 = (x + (t_1 / t_3)) / (x + 1.0);
double tmp;
if (t_4 <= -Double.POSITIVE_INFINITY) {
tmp = (x + (y * ((z / (x * (t_2 + -1.0))) + (1.0 / (y * (1.0 - t_2)))))) / (x + 1.0);
} else if (t_4 <= 2e+223) {
tmp = (x + (1.0 / (t_3 / t_1))) / (x + 1.0);
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * z) - x t_2 = (z * t) / x t_3 = (z * t) - x t_4 = (x + (t_1 / t_3)) / (x + 1.0) tmp = 0 if t_4 <= -math.inf: tmp = (x + (y * ((z / (x * (t_2 + -1.0))) + (1.0 / (y * (1.0 - t_2)))))) / (x + 1.0) elif t_4 <= 2e+223: tmp = (x + (1.0 / (t_3 / t_1))) / (x + 1.0) else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * z) - x) t_2 = Float64(Float64(z * t) / x) t_3 = Float64(Float64(z * t) - x) t_4 = Float64(Float64(x + Float64(t_1 / t_3)) / Float64(x + 1.0)) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = Float64(Float64(x + Float64(y * Float64(Float64(z / Float64(x * Float64(t_2 + -1.0))) + Float64(1.0 / Float64(y * Float64(1.0 - t_2)))))) / Float64(x + 1.0)); elseif (t_4 <= 2e+223) tmp = Float64(Float64(x + Float64(1.0 / Float64(t_3 / t_1))) / Float64(x + 1.0)); 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 = (y * z) - x; t_2 = (z * t) / x; t_3 = (z * t) - x; t_4 = (x + (t_1 / t_3)) / (x + 1.0); tmp = 0.0; if (t_4 <= -Inf) tmp = (x + (y * ((z / (x * (t_2 + -1.0))) + (1.0 / (y * (1.0 - t_2)))))) / (x + 1.0); elseif (t_4 <= 2e+223) tmp = (x + (1.0 / (t_3 / t_1))) / (x + 1.0); else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x + N[(t$95$1 / t$95$3), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], N[(N[(x + N[(y * N[(N[(z / N[(x * N[(t$95$2 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(y * N[(1.0 - t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 2e+223], N[(N[(x + N[(1.0 / N[(t$95$3 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot z - x\\
t_2 := \frac{z \cdot t}{x}\\
t_3 := z \cdot t - x\\
t_4 := \frac{x + \frac{t\_1}{t\_3}}{x + 1}\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;\frac{x + y \cdot \left(\frac{z}{x \cdot \left(t\_2 + -1\right)} + \frac{1}{y \cdot \left(1 - t\_2\right)}\right)}{x + 1}\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+223}:\\
\;\;\;\;\frac{x + \frac{1}{\frac{t\_3}{t\_1}}}{x + 1}\\
\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 #s(literal 1 binary64))) < -inf.0Initial program 34.1%
*-commutative34.1%
Simplified34.1%
Taylor expanded in x around inf 34.1%
sub-neg34.1%
associate-/l*25.7%
metadata-eval25.7%
Simplified25.7%
Taylor expanded in y around inf 92.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2.00000000000000009e223Initial program 99.4%
*-commutative99.4%
Simplified99.4%
clear-num99.4%
inv-pow99.4%
fma-neg99.4%
Applied egg-rr99.4%
unpow-199.4%
div-sub99.4%
*-commutative99.4%
div-sub99.4%
fma-neg99.4%
*-commutative99.4%
Simplified99.4%
if 2.00000000000000009e223 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 25.5%
*-commutative25.5%
Simplified25.5%
Taylor expanded in z around inf 81.2%
Final simplification97.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* y z) x))
(t_2 (- (* z t) x))
(t_3 (/ (+ x (/ t_1 t_2)) (+ x 1.0))))
(if (<= t_3 (- INFINITY))
(* y (/ (/ z (+ x 1.0)) t_2))
(if (<= t_3 2e+223)
(/ (+ x (/ 1.0 (/ t_2 t_1))) (+ x 1.0))
(/ (+ x (/ y t)) (+ x 1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * z) - x;
double t_2 = (z * t) - x;
double t_3 = (x + (t_1 / t_2)) / (x + 1.0);
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = y * ((z / (x + 1.0)) / t_2);
} else if (t_3 <= 2e+223) {
tmp = (x + (1.0 / (t_2 / t_1))) / (x + 1.0);
} 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 = (y * z) - x;
double t_2 = (z * t) - x;
double t_3 = (x + (t_1 / t_2)) / (x + 1.0);
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = y * ((z / (x + 1.0)) / t_2);
} else if (t_3 <= 2e+223) {
tmp = (x + (1.0 / (t_2 / t_1))) / (x + 1.0);
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * z) - x t_2 = (z * t) - x t_3 = (x + (t_1 / t_2)) / (x + 1.0) tmp = 0 if t_3 <= -math.inf: tmp = y * ((z / (x + 1.0)) / t_2) elif t_3 <= 2e+223: tmp = (x + (1.0 / (t_2 / t_1))) / (x + 1.0) else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * z) - x) t_2 = Float64(Float64(z * t) - x) t_3 = Float64(Float64(x + Float64(t_1 / t_2)) / Float64(x + 1.0)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(y * Float64(Float64(z / Float64(x + 1.0)) / t_2)); elseif (t_3 <= 2e+223) tmp = Float64(Float64(x + Float64(1.0 / Float64(t_2 / t_1))) / Float64(x + 1.0)); 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 = (y * z) - x; t_2 = (z * t) - x; t_3 = (x + (t_1 / t_2)) / (x + 1.0); tmp = 0.0; if (t_3 <= -Inf) tmp = y * ((z / (x + 1.0)) / t_2); elseif (t_3 <= 2e+223) tmp = (x + (1.0 / (t_2 / t_1))) / (x + 1.0); else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(y * N[(N[(z / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+223], N[(N[(x + N[(1.0 / N[(t$95$2 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot z - x\\
t_2 := z \cdot t - x\\
t_3 := \frac{x + \frac{t\_1}{t\_2}}{x + 1}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;y \cdot \frac{\frac{z}{x + 1}}{t\_2}\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+223}:\\
\;\;\;\;\frac{x + \frac{1}{\frac{t\_2}{t\_1}}}{x + 1}\\
\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 #s(literal 1 binary64))) < -inf.0Initial program 34.1%
*-commutative34.1%
Simplified34.1%
Taylor expanded in y around inf 32.9%
associate-/l*62.3%
associate-/r*84.6%
+-commutative84.6%
Simplified84.6%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2.00000000000000009e223Initial program 99.4%
*-commutative99.4%
Simplified99.4%
clear-num99.4%
inv-pow99.4%
fma-neg99.4%
Applied egg-rr99.4%
unpow-199.4%
div-sub99.4%
*-commutative99.4%
div-sub99.4%
fma-neg99.4%
*-commutative99.4%
Simplified99.4%
if 2.00000000000000009e223 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 25.5%
*-commutative25.5%
Simplified25.5%
Taylor expanded in z around inf 81.2%
Final simplification97.1%
(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 (/ (/ z (+ x 1.0)) t_1))
(if (<= t_2 2e+223) 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 * ((z / (x + 1.0)) / t_1);
} else if (t_2 <= 2e+223) {
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 * ((z / (x + 1.0)) / t_1);
} else if (t_2 <= 2e+223) {
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 * ((z / (x + 1.0)) / t_1) elif t_2 <= 2e+223: 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(y * Float64(Float64(z / Float64(x + 1.0)) / t_1)); elseif (t_2 <= 2e+223) 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 * ((z / (x + 1.0)) / t_1); elseif (t_2 <= 2e+223) 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[(y * N[(N[(z / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+223], 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:\\
\;\;\;\;y \cdot \frac{\frac{z}{x + 1}}{t\_1}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+223}:\\
\;\;\;\;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 #s(literal 1 binary64))) < -inf.0Initial program 34.1%
*-commutative34.1%
Simplified34.1%
Taylor expanded in y around inf 32.9%
associate-/l*62.3%
associate-/r*84.6%
+-commutative84.6%
Simplified84.6%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2.00000000000000009e223Initial program 99.4%
if 2.00000000000000009e223 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 25.5%
*-commutative25.5%
Simplified25.5%
Taylor expanded in z around inf 81.2%
Final simplification97.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) (- (* z t) x))) (+ x 1.0)))
(t_2 (+ x (/ y t))))
(if (<= z -1.8e+134)
(/ t_2 (+ x 1.0))
(if (<= z -8.2e-164)
t_1
(if (<= z 3.5e-212)
(/ (+ x (/ x (- x (* z t)))) (+ x 1.0))
(if (<= z 1.7e+177) t_1 (/ (- t_2 (/ x (* z t))) (+ x 1.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + ((y * z) / ((z * t) - x))) / (x + 1.0);
double t_2 = x + (y / t);
double tmp;
if (z <= -1.8e+134) {
tmp = t_2 / (x + 1.0);
} else if (z <= -8.2e-164) {
tmp = t_1;
} else if (z <= 3.5e-212) {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
} else if (z <= 1.7e+177) {
tmp = t_1;
} else {
tmp = (t_2 - (x / (z * t))) / (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) :: t_2
real(8) :: tmp
t_1 = (x + ((y * z) / ((z * t) - x))) / (x + 1.0d0)
t_2 = x + (y / t)
if (z <= (-1.8d+134)) then
tmp = t_2 / (x + 1.0d0)
else if (z <= (-8.2d-164)) then
tmp = t_1
else if (z <= 3.5d-212) then
tmp = (x + (x / (x - (z * t)))) / (x + 1.0d0)
else if (z <= 1.7d+177) then
tmp = t_1
else
tmp = (t_2 - (x / (z * t))) / (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 * z) / ((z * t) - x))) / (x + 1.0);
double t_2 = x + (y / t);
double tmp;
if (z <= -1.8e+134) {
tmp = t_2 / (x + 1.0);
} else if (z <= -8.2e-164) {
tmp = t_1;
} else if (z <= 3.5e-212) {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
} else if (z <= 1.7e+177) {
tmp = t_1;
} else {
tmp = (t_2 - (x / (z * t))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + ((y * z) / ((z * t) - x))) / (x + 1.0) t_2 = x + (y / t) tmp = 0 if z <= -1.8e+134: tmp = t_2 / (x + 1.0) elif z <= -8.2e-164: tmp = t_1 elif z <= 3.5e-212: tmp = (x + (x / (x - (z * t)))) / (x + 1.0) elif z <= 1.7e+177: tmp = t_1 else: tmp = (t_2 - (x / (z * t))) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(Float64(y * z) / Float64(Float64(z * t) - x))) / Float64(x + 1.0)) t_2 = Float64(x + Float64(y / t)) tmp = 0.0 if (z <= -1.8e+134) tmp = Float64(t_2 / Float64(x + 1.0)); elseif (z <= -8.2e-164) tmp = t_1; elseif (z <= 3.5e-212) tmp = Float64(Float64(x + Float64(x / Float64(x - Float64(z * t)))) / Float64(x + 1.0)); elseif (z <= 1.7e+177) tmp = t_1; else tmp = Float64(Float64(t_2 - Float64(x / Float64(z * t))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + ((y * z) / ((z * t) - x))) / (x + 1.0); t_2 = x + (y / t); tmp = 0.0; if (z <= -1.8e+134) tmp = t_2 / (x + 1.0); elseif (z <= -8.2e-164) tmp = t_1; elseif (z <= 3.5e-212) tmp = (x + (x / (x - (z * t)))) / (x + 1.0); elseif (z <= 1.7e+177) tmp = t_1; else tmp = (t_2 - (x / (z * t))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e+134], N[(t$95$2 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.2e-164], t$95$1, If[LessEqual[z, 3.5e-212], N[(N[(x + N[(x / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e+177], t$95$1, N[(N[(t$95$2 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{z \cdot t - x}}{x + 1}\\
t_2 := x + \frac{y}{t}\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+134}:\\
\;\;\;\;\frac{t\_2}{x + 1}\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-164}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-212}:\\
\;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+177}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_2 - \frac{x}{z \cdot t}}{x + 1}\\
\end{array}
\end{array}
if z < -1.79999999999999994e134Initial program 69.6%
*-commutative69.6%
Simplified69.6%
Taylor expanded in z around inf 91.8%
if -1.79999999999999994e134 < z < -8.1999999999999996e-164 or 3.4999999999999998e-212 < z < 1.6999999999999999e177Initial program 97.8%
*-commutative97.8%
Simplified97.8%
Taylor expanded in y around inf 92.8%
*-commutative92.8%
Simplified92.8%
if -8.1999999999999996e-164 < z < 3.4999999999999998e-212Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 84.2%
+-commutative84.2%
Simplified84.2%
if 1.6999999999999999e177 < z Initial program 63.2%
*-commutative63.2%
Simplified63.2%
Taylor expanded in t around inf 93.1%
Final simplification91.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) (- (* z t) x))) (+ x 1.0)))
(t_2 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= z -6.8e+134)
t_2
(if (<= z -2.1e-167)
t_1
(if (<= z 1.6e-207)
(/ (+ x (/ x (- x (* z t)))) (+ x 1.0))
(if (<= z 6.2e+175) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + ((y * z) / ((z * t) - x))) / (x + 1.0);
double t_2 = (x + (y / t)) / (x + 1.0);
double tmp;
if (z <= -6.8e+134) {
tmp = t_2;
} else if (z <= -2.1e-167) {
tmp = t_1;
} else if (z <= 1.6e-207) {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
} else if (z <= 6.2e+175) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x + ((y * z) / ((z * t) - x))) / (x + 1.0d0)
t_2 = (x + (y / t)) / (x + 1.0d0)
if (z <= (-6.8d+134)) then
tmp = t_2
else if (z <= (-2.1d-167)) then
tmp = t_1
else if (z <= 1.6d-207) then
tmp = (x + (x / (x - (z * t)))) / (x + 1.0d0)
else if (z <= 6.2d+175) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + ((y * z) / ((z * t) - x))) / (x + 1.0);
double t_2 = (x + (y / t)) / (x + 1.0);
double tmp;
if (z <= -6.8e+134) {
tmp = t_2;
} else if (z <= -2.1e-167) {
tmp = t_1;
} else if (z <= 1.6e-207) {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
} else if (z <= 6.2e+175) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + ((y * z) / ((z * t) - x))) / (x + 1.0) t_2 = (x + (y / t)) / (x + 1.0) tmp = 0 if z <= -6.8e+134: tmp = t_2 elif z <= -2.1e-167: tmp = t_1 elif z <= 1.6e-207: tmp = (x + (x / (x - (z * t)))) / (x + 1.0) elif z <= 6.2e+175: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(Float64(y * z) / Float64(Float64(z * t) - x))) / Float64(x + 1.0)) t_2 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (z <= -6.8e+134) tmp = t_2; elseif (z <= -2.1e-167) tmp = t_1; elseif (z <= 1.6e-207) tmp = Float64(Float64(x + Float64(x / Float64(x - Float64(z * t)))) / Float64(x + 1.0)); elseif (z <= 6.2e+175) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + ((y * z) / ((z * t) - x))) / (x + 1.0); t_2 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (z <= -6.8e+134) tmp = t_2; elseif (z <= -2.1e-167) tmp = t_1; elseif (z <= 1.6e-207) tmp = (x + (x / (x - (z * t)))) / (x + 1.0); elseif (z <= 6.2e+175) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.8e+134], t$95$2, If[LessEqual[z, -2.1e-167], t$95$1, If[LessEqual[z, 1.6e-207], N[(N[(x + N[(x / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e+175], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{z \cdot t - x}}{x + 1}\\
t_2 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{+134}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-167}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-207}:\\
\;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+175}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -6.80000000000000035e134 or 6.19999999999999968e175 < z Initial program 67.0%
*-commutative67.0%
Simplified67.0%
Taylor expanded in z around inf 92.3%
if -6.80000000000000035e134 < z < -2.10000000000000017e-167 or 1.6000000000000002e-207 < z < 6.19999999999999968e175Initial program 97.8%
*-commutative97.8%
Simplified97.8%
Taylor expanded in y around inf 92.8%
*-commutative92.8%
Simplified92.8%
if -2.10000000000000017e-167 < z < 1.6000000000000002e-207Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 84.2%
+-commutative84.2%
Simplified84.2%
Final simplification91.2%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.65e-5) (not (<= t 1.2e-93))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (- (+ x 1.0) (* y (/ z x))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.65e-5) || !(t <= 1.2e-93)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = ((x + 1.0) - (y * (z / 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 ((t <= (-1.65d-5)) .or. (.not. (t <= 1.2d-93))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = ((x + 1.0d0) - (y * (z / 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 ((t <= -1.65e-5) || !(t <= 1.2e-93)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.65e-5) or not (t <= 1.2e-93): tmp = (x + (y / t)) / (x + 1.0) else: tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.65e-5) || !(t <= 1.2e-93)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(Float64(x + 1.0) - Float64(y * Float64(z / x))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.65e-5) || ~((t <= 1.2e-93))) tmp = (x + (y / t)) / (x + 1.0); else tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.65e-5], N[Not[LessEqual[t, 1.2e-93]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + 1.0), $MachinePrecision] - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{-5} \lor \neg \left(t \leq 1.2 \cdot 10^{-93}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 1\right) - y \cdot \frac{z}{x}}{x + 1}\\
\end{array}
\end{array}
if t < -1.6500000000000001e-5 or 1.2000000000000001e-93 < t Initial program 87.7%
*-commutative87.7%
Simplified87.7%
Taylor expanded in z around inf 92.2%
if -1.6500000000000001e-5 < t < 1.2000000000000001e-93Initial program 93.4%
*-commutative93.4%
Simplified93.4%
Taylor expanded in t around 0 76.6%
associate-+r+76.6%
mul-1-neg76.6%
unsub-neg76.6%
+-commutative76.6%
associate-/l*79.3%
+-commutative79.3%
Simplified79.3%
Final simplification87.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -9e-156) (not (<= z 7.5e+53))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (+ x (/ x (- x (* z t)))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9e-156) || !(z <= 7.5e+53)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-9d-156)) .or. (.not. (z <= 7.5d+53))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = (x + (x / (x - (z * t)))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9e-156) || !(z <= 7.5e+53)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -9e-156) or not (z <= 7.5e+53): tmp = (x + (y / t)) / (x + 1.0) else: tmp = (x + (x / (x - (z * t)))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -9e-156) || !(z <= 7.5e+53)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(x / Float64(x - Float64(z * t)))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -9e-156) || ~((z <= 7.5e+53))) tmp = (x + (y / t)) / (x + 1.0); else tmp = (x + (x / (x - (z * t)))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -9e-156], N[Not[LessEqual[z, 7.5e+53]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(x / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-156} \lor \neg \left(z \leq 7.5 \cdot 10^{+53}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\
\end{array}
\end{array}
if z < -8.99999999999999971e-156 or 7.4999999999999997e53 < z Initial program 83.2%
*-commutative83.2%
Simplified83.2%
Taylor expanded in z around inf 84.7%
if -8.99999999999999971e-156 < z < 7.4999999999999997e53Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 82.3%
+-commutative82.3%
Simplified82.3%
Final simplification83.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.9e-145) (not (<= t 6.2e-94))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (- x (/ (* y z) x)) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.9e-145) || !(t <= 6.2e-94)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x - ((y * z) / 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 ((t <= (-4.9d-145)) .or. (.not. (t <= 6.2d-94))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = (x - ((y * z) / 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 ((t <= -4.9e-145) || !(t <= 6.2e-94)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x - ((y * z) / x)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4.9e-145) or not (t <= 6.2e-94): tmp = (x + (y / t)) / (x + 1.0) else: tmp = (x - ((y * z) / x)) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4.9e-145) || !(t <= 6.2e-94)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(x - Float64(Float64(y * z) / x)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -4.9e-145) || ~((t <= 6.2e-94))) tmp = (x + (y / t)) / (x + 1.0); else tmp = (x - ((y * z) / x)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.9e-145], N[Not[LessEqual[t, 6.2e-94]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.9 \cdot 10^{-145} \lor \neg \left(t \leq 6.2 \cdot 10^{-94}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - \frac{y \cdot z}{x}}{x + 1}\\
\end{array}
\end{array}
if t < -4.89999999999999967e-145 or 6.1999999999999996e-94 < t Initial program 87.6%
*-commutative87.6%
Simplified87.6%
Taylor expanded in z around inf 87.5%
if -4.89999999999999967e-145 < t < 6.1999999999999996e-94Initial program 95.2%
*-commutative95.2%
Simplified95.2%
Taylor expanded in y around inf 82.9%
*-commutative82.9%
Simplified82.9%
Taylor expanded in z around 0 68.7%
associate-*r/68.7%
associate-*r*68.7%
mul-1-neg68.7%
Simplified68.7%
Final simplification81.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -7.6e-22) (not (<= x 4.1e-153))) (/ x (+ x 1.0)) (* y (/ z (- (* z t) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.6e-22) || !(x <= 4.1e-153)) {
tmp = x / (x + 1.0);
} else {
tmp = y * (z / ((z * t) - 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 <= (-7.6d-22)) .or. (.not. (x <= 4.1d-153))) then
tmp = x / (x + 1.0d0)
else
tmp = y * (z / ((z * t) - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.6e-22) || !(x <= 4.1e-153)) {
tmp = x / (x + 1.0);
} else {
tmp = y * (z / ((z * t) - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -7.6e-22) or not (x <= 4.1e-153): tmp = x / (x + 1.0) else: tmp = y * (z / ((z * t) - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -7.6e-22) || !(x <= 4.1e-153)) tmp = Float64(x / Float64(x + 1.0)); else tmp = Float64(y * Float64(z / Float64(Float64(z * t) - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -7.6e-22) || ~((x <= 4.1e-153))) tmp = x / (x + 1.0); else tmp = y * (z / ((z * t) - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -7.6e-22], N[Not[LessEqual[x, 4.1e-153]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(z / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.6 \cdot 10^{-22} \lor \neg \left(x \leq 4.1 \cdot 10^{-153}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{z \cdot t - x}\\
\end{array}
\end{array}
if x < -7.60000000000000046e-22 or 4.1e-153 < x Initial program 89.4%
*-commutative89.4%
Simplified89.4%
Taylor expanded in t around inf 79.8%
+-commutative79.8%
Simplified79.8%
if -7.60000000000000046e-22 < x < 4.1e-153Initial program 91.3%
*-commutative91.3%
Simplified91.3%
Taylor expanded in y around inf 57.9%
associate-/l*61.5%
associate-/r*61.5%
+-commutative61.5%
Simplified61.5%
Taylor expanded in x around 0 61.5%
Final simplification74.1%
(FPCore (x y z t) :precision binary64 (if (<= x -7.5e+114) 1.0 (if (<= x 0.00039) (/ (+ x (/ y t)) (+ x 1.0)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -7.5e+114) {
tmp = 1.0;
} else if (x <= 0.00039) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-7.5d+114)) then
tmp = 1.0d0
else if (x <= 0.00039d0) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -7.5e+114) {
tmp = 1.0;
} else if (x <= 0.00039) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -7.5e+114: tmp = 1.0 elif x <= 0.00039: tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -7.5e+114) tmp = 1.0; elseif (x <= 0.00039) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -7.5e+114) tmp = 1.0; elseif (x <= 0.00039) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -7.5e+114], 1.0, If[LessEqual[x, 0.00039], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{+114}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 0.00039:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -7.5000000000000001e114 or 3.89999999999999993e-4 < x Initial program 87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in z around inf 76.2%
Taylor expanded in x around inf 87.6%
if -7.5000000000000001e114 < x < 3.89999999999999993e-4Initial program 92.5%
*-commutative92.5%
Simplified92.5%
Taylor expanded in z around inf 73.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5.5e-126) (not (<= x 5e-148))) (/ x (+ x 1.0)) (/ y t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.5e-126) || !(x <= 5e-148)) {
tmp = x / (x + 1.0);
} 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 <= (-5.5d-126)) .or. (.not. (x <= 5d-148))) then
tmp = x / (x + 1.0d0)
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 <= -5.5e-126) || !(x <= 5e-148)) {
tmp = x / (x + 1.0);
} else {
tmp = y / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5.5e-126) or not (x <= 5e-148): tmp = x / (x + 1.0) else: tmp = y / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -5.5e-126) || !(x <= 5e-148)) tmp = Float64(x / Float64(x + 1.0)); else tmp = Float64(y / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -5.5e-126) || ~((x <= 5e-148))) tmp = x / (x + 1.0); else tmp = y / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5.5e-126], N[Not[LessEqual[x, 5e-148]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(y / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{-126} \lor \neg \left(x \leq 5 \cdot 10^{-148}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t}\\
\end{array}
\end{array}
if x < -5.49999999999999987e-126 or 4.9999999999999999e-148 < x Initial program 90.1%
*-commutative90.1%
Simplified90.1%
Taylor expanded in t around inf 77.1%
+-commutative77.1%
Simplified77.1%
if -5.49999999999999987e-126 < x < 4.9999999999999999e-148Initial program 89.6%
*-commutative89.6%
Simplified89.6%
clear-num89.6%
inv-pow89.6%
fma-neg89.6%
Applied egg-rr89.6%
unpow-189.6%
div-sub88.0%
*-commutative88.0%
div-sub89.6%
fma-neg89.6%
*-commutative89.6%
Simplified89.6%
Taylor expanded in x around 0 61.4%
Final simplification73.0%
(FPCore (x y z t) :precision binary64 (if (<= x -3.0) 1.0 (if (<= x 1.18e-123) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.0) {
tmp = 1.0;
} else if (x <= 1.18e-123) {
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.0d0)) then
tmp = 1.0d0
else if (x <= 1.18d-123) 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.0) {
tmp = 1.0;
} else if (x <= 1.18e-123) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.0: tmp = 1.0 elif x <= 1.18e-123: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.0) tmp = 1.0; elseif (x <= 1.18e-123) 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.0) tmp = 1.0; elseif (x <= 1.18e-123) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.0], 1.0, If[LessEqual[x, 1.18e-123], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.18 \cdot 10^{-123}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -3 or 1.18e-123 < x Initial program 88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in z around inf 75.6%
Taylor expanded in x around inf 80.4%
if -3 < x < 1.18e-123Initial program 92.4%
*-commutative92.4%
Simplified92.4%
clear-num92.4%
inv-pow92.4%
fma-neg92.4%
Applied egg-rr92.4%
unpow-192.4%
div-sub91.2%
*-commutative91.2%
div-sub92.4%
fma-neg92.4%
*-commutative92.4%
Simplified92.4%
Taylor expanded in x around 0 53.0%
(FPCore (x y z t) :precision binary64 (if (<= x -3.0) 1.0 (if (<= x 1.05e-74) x 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.0) {
tmp = 1.0;
} else if (x <= 1.05e-74) {
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 <= (-3.0d0)) then
tmp = 1.0d0
else if (x <= 1.05d-74) 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 <= -3.0) {
tmp = 1.0;
} else if (x <= 1.05e-74) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.0: tmp = 1.0 elif x <= 1.05e-74: tmp = x else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.0) tmp = 1.0; elseif (x <= 1.05e-74) tmp = x; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -3.0) tmp = 1.0; elseif (x <= 1.05e-74) tmp = x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.0], 1.0, If[LessEqual[x, 1.05e-74], x, 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-74}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -3 or 1.05e-74 < x Initial program 88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in z around inf 76.1%
Taylor expanded in x around inf 82.7%
if -3 < x < 1.05e-74Initial program 92.8%
*-commutative92.8%
Simplified92.8%
Taylor expanded in t around inf 26.3%
+-commutative26.3%
Simplified26.3%
Taylor expanded in x around 0 26.3%
Taylor expanded in x around 0 25.9%
(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 90.0%
*-commutative90.0%
Simplified90.0%
Taylor expanded in z around inf 75.0%
Taylor expanded in x around inf 56.0%
(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 2024137
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(! :herbie-platform default (/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1)))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))