
(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 12 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 (<= t_1 -5e+152)
(/ y (* (+ x 1.0) (- t (/ x z))))
(if (<= t_1 1.00000000000005)
(/ (+ x (/ (- x (* y z)) (* z (- (/ x z) t)))) (+ x 1.0))
(if (<= t_1 INFINITY)
(/
(+ x (* y (+ (/ x (* y (- x (* z t)))) (/ z (* t (- z (/ x t)))))))
(+ x 1.0))
(- (/ x (+ x 1.0)) (/ (/ y (- -1.0 x)) t)))))))
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 <= -5e+152) {
tmp = y / ((x + 1.0) * (t - (x / z)));
} else if (t_1 <= 1.00000000000005) {
tmp = (x + ((x - (y * z)) / (z * ((x / z) - t)))) / (x + 1.0);
} else if (t_1 <= ((double) INFINITY)) {
tmp = (x + (y * ((x / (y * (x - (z * t)))) + (z / (t * (z - (x / t))))))) / (x + 1.0);
} else {
tmp = (x / (x + 1.0)) - ((y / (-1.0 - x)) / t);
}
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 <= -5e+152) {
tmp = y / ((x + 1.0) * (t - (x / z)));
} else if (t_1 <= 1.00000000000005) {
tmp = (x + ((x - (y * z)) / (z * ((x / z) - t)))) / (x + 1.0);
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (x + (y * ((x / (y * (x - (z * t)))) + (z / (t * (z - (x / t))))))) / (x + 1.0);
} else {
tmp = (x / (x + 1.0)) - ((y / (-1.0 - x)) / t);
}
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 <= -5e+152: tmp = y / ((x + 1.0) * (t - (x / z))) elif t_1 <= 1.00000000000005: tmp = (x + ((x - (y * z)) / (z * ((x / z) - t)))) / (x + 1.0) elif t_1 <= math.inf: tmp = (x + (y * ((x / (y * (x - (z * t)))) + (z / (t * (z - (x / t))))))) / (x + 1.0) else: tmp = (x / (x + 1.0)) - ((y / (-1.0 - x)) / t) 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 <= -5e+152) tmp = Float64(y / Float64(Float64(x + 1.0) * Float64(t - Float64(x / z)))); elseif (t_1 <= 1.00000000000005) tmp = Float64(Float64(x + Float64(Float64(x - Float64(y * z)) / Float64(z * Float64(Float64(x / z) - t)))) / Float64(x + 1.0)); elseif (t_1 <= Inf) tmp = Float64(Float64(x + Float64(y * Float64(Float64(x / Float64(y * Float64(x - Float64(z * t)))) + Float64(z / Float64(t * Float64(z - Float64(x / t))))))) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(x + 1.0)) - Float64(Float64(y / Float64(-1.0 - x)) / t)); 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 <= -5e+152) tmp = y / ((x + 1.0) * (t - (x / z))); elseif (t_1 <= 1.00000000000005) tmp = (x + ((x - (y * z)) / (z * ((x / z) - t)))) / (x + 1.0); elseif (t_1 <= Inf) tmp = (x + (y * ((x / (y * (x - (z * t)))) + (z / (t * (z - (x / t))))))) / (x + 1.0); else tmp = (x / (x + 1.0)) - ((y / (-1.0 - x)) / t); 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[LessEqual[t$95$1, -5e+152], N[(y / N[(N[(x + 1.0), $MachinePrecision] * N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.00000000000005], N[(N[(x + N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(z * N[(N[(x / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(x + N[(y * N[(N[(x / N[(y * N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z / N[(t * N[(z - N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(y / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]
\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 -5 \cdot 10^{+152}:\\
\;\;\;\;\frac{y}{\left(x + 1\right) \cdot \left(t - \frac{x}{z}\right)}\\
\mathbf{elif}\;t\_1 \leq 1.00000000000005:\\
\;\;\;\;\frac{x + \frac{x - y \cdot z}{z \cdot \left(\frac{x}{z} - t\right)}}{x + 1}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{x + y \cdot \left(\frac{x}{y \cdot \left(x - z \cdot t\right)} + \frac{z}{t \cdot \left(z - \frac{x}{t}\right)}\right)}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1} - \frac{\frac{y}{-1 - x}}{t}\\
\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))) < -5e152Initial program 72.6%
*-commutative72.6%
Simplified72.6%
Taylor expanded in y around inf 72.6%
Taylor expanded in z around inf 72.5%
associate-*r/72.5%
neg-mul-172.5%
Simplified72.5%
Taylor expanded in y around 0 95.3%
if -5e152 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1.00000000000004996Initial program 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in z around inf 99.4%
mul-1-neg99.4%
unsub-neg99.4%
Simplified99.4%
if 1.00000000000004996 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < +inf.0Initial program 80.3%
*-commutative80.3%
Simplified80.3%
Taylor expanded in y around inf 99.5%
Taylor expanded in t around inf 99.5%
associate-*r/99.5%
neg-mul-199.5%
Simplified99.5%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in t around -inf 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
+-commutative100.0%
sub-neg100.0%
mul-1-neg100.0%
distribute-neg-frac2100.0%
distribute-neg-in100.0%
metadata-eval100.0%
unsub-neg100.0%
mul-1-neg100.0%
remove-double-neg100.0%
associate-/r*100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
associate-*r/100.0%
mul-1-neg100.0%
+-commutative100.0%
Simplified100.0%
Final simplification99.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))))
(if (<= t_1 -5e+152)
(/ y (* (+ x 1.0) (- t (/ x z))))
(if (<= t_1 1000.0)
(/ (+ x (/ (- x (* y z)) (* z (- (/ x z) t)))) (+ x 1.0))
(if (<= t_1 INFINITY)
(/ (- x (* y (- (/ -1.0 y) (/ z (* t (- z (/ x t))))))) (+ x 1.0))
(- (/ x (+ x 1.0)) (/ (/ y (- -1.0 x)) t)))))))
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 <= -5e+152) {
tmp = y / ((x + 1.0) * (t - (x / z)));
} else if (t_1 <= 1000.0) {
tmp = (x + ((x - (y * z)) / (z * ((x / z) - t)))) / (x + 1.0);
} else if (t_1 <= ((double) INFINITY)) {
tmp = (x - (y * ((-1.0 / y) - (z / (t * (z - (x / t))))))) / (x + 1.0);
} else {
tmp = (x / (x + 1.0)) - ((y / (-1.0 - x)) / t);
}
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 <= -5e+152) {
tmp = y / ((x + 1.0) * (t - (x / z)));
} else if (t_1 <= 1000.0) {
tmp = (x + ((x - (y * z)) / (z * ((x / z) - t)))) / (x + 1.0);
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (x - (y * ((-1.0 / y) - (z / (t * (z - (x / t))))))) / (x + 1.0);
} else {
tmp = (x / (x + 1.0)) - ((y / (-1.0 - x)) / t);
}
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 <= -5e+152: tmp = y / ((x + 1.0) * (t - (x / z))) elif t_1 <= 1000.0: tmp = (x + ((x - (y * z)) / (z * ((x / z) - t)))) / (x + 1.0) elif t_1 <= math.inf: tmp = (x - (y * ((-1.0 / y) - (z / (t * (z - (x / t))))))) / (x + 1.0) else: tmp = (x / (x + 1.0)) - ((y / (-1.0 - x)) / t) 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 <= -5e+152) tmp = Float64(y / Float64(Float64(x + 1.0) * Float64(t - Float64(x / z)))); elseif (t_1 <= 1000.0) tmp = Float64(Float64(x + Float64(Float64(x - Float64(y * z)) / Float64(z * Float64(Float64(x / z) - t)))) / Float64(x + 1.0)); elseif (t_1 <= Inf) tmp = Float64(Float64(x - Float64(y * Float64(Float64(-1.0 / y) - Float64(z / Float64(t * Float64(z - Float64(x / t))))))) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(x + 1.0)) - Float64(Float64(y / Float64(-1.0 - x)) / t)); 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 <= -5e+152) tmp = y / ((x + 1.0) * (t - (x / z))); elseif (t_1 <= 1000.0) tmp = (x + ((x - (y * z)) / (z * ((x / z) - t)))) / (x + 1.0); elseif (t_1 <= Inf) tmp = (x - (y * ((-1.0 / y) - (z / (t * (z - (x / t))))))) / (x + 1.0); else tmp = (x / (x + 1.0)) - ((y / (-1.0 - x)) / t); 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[LessEqual[t$95$1, -5e+152], N[(y / N[(N[(x + 1.0), $MachinePrecision] * N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1000.0], N[(N[(x + N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(z * N[(N[(x / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(x - N[(y * N[(N[(-1.0 / y), $MachinePrecision] - N[(z / N[(t * N[(z - N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(y / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]
\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 -5 \cdot 10^{+152}:\\
\;\;\;\;\frac{y}{\left(x + 1\right) \cdot \left(t - \frac{x}{z}\right)}\\
\mathbf{elif}\;t\_1 \leq 1000:\\
\;\;\;\;\frac{x + \frac{x - y \cdot z}{z \cdot \left(\frac{x}{z} - t\right)}}{x + 1}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{x - y \cdot \left(\frac{-1}{y} - \frac{z}{t \cdot \left(z - \frac{x}{t}\right)}\right)}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1} - \frac{\frac{y}{-1 - x}}{t}\\
\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))) < -5e152Initial program 72.6%
*-commutative72.6%
Simplified72.6%
Taylor expanded in y around inf 72.6%
Taylor expanded in z around inf 72.5%
associate-*r/72.5%
neg-mul-172.5%
Simplified72.5%
Taylor expanded in y around 0 95.3%
if -5e152 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1e3Initial program 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in z around inf 99.4%
mul-1-neg99.4%
unsub-neg99.4%
Simplified99.4%
if 1e3 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < +inf.0Initial program 79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in y around inf 99.5%
Taylor expanded in t around inf 99.5%
associate-*r/99.5%
neg-mul-199.5%
Simplified99.5%
Taylor expanded in x around inf 99.5%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in t around -inf 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
+-commutative100.0%
sub-neg100.0%
mul-1-neg100.0%
distribute-neg-frac2100.0%
distribute-neg-in100.0%
metadata-eval100.0%
unsub-neg100.0%
mul-1-neg100.0%
remove-double-neg100.0%
associate-/r*100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
associate-*r/100.0%
mul-1-neg100.0%
+-commutative100.0%
Simplified100.0%
Final simplification99.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 -5e+231)
(/ y (* (+ x 1.0) (- t (/ x z))))
(if (<= t_2 1.00000000000005)
t_2
(if (<= t_2 INFINITY)
(/ (+ x (* y (/ z t_1))) (+ x 1.0))
(- (/ x (+ x 1.0)) (/ (/ y (- -1.0 x)) t)))))))
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 <= -5e+231) {
tmp = y / ((x + 1.0) * (t - (x / z)));
} else if (t_2 <= 1.00000000000005) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = (x + (y * (z / t_1))) / (x + 1.0);
} else {
tmp = (x / (x + 1.0)) - ((y / (-1.0 - x)) / t);
}
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 <= -5e+231) {
tmp = y / ((x + 1.0) * (t - (x / z)));
} else if (t_2 <= 1.00000000000005) {
tmp = t_2;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = (x + (y * (z / t_1))) / (x + 1.0);
} else {
tmp = (x / (x + 1.0)) - ((y / (-1.0 - x)) / t);
}
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 <= -5e+231: tmp = y / ((x + 1.0) * (t - (x / z))) elif t_2 <= 1.00000000000005: tmp = t_2 elif t_2 <= math.inf: tmp = (x + (y * (z / t_1))) / (x + 1.0) else: tmp = (x / (x + 1.0)) - ((y / (-1.0 - x)) / t) 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 <= -5e+231) tmp = Float64(y / Float64(Float64(x + 1.0) * Float64(t - Float64(x / z)))); elseif (t_2 <= 1.00000000000005) tmp = t_2; elseif (t_2 <= Inf) tmp = Float64(Float64(x + Float64(y * Float64(z / t_1))) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(x + 1.0)) - Float64(Float64(y / Float64(-1.0 - x)) / t)); 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 <= -5e+231) tmp = y / ((x + 1.0) * (t - (x / z))); elseif (t_2 <= 1.00000000000005) tmp = t_2; elseif (t_2 <= Inf) tmp = (x + (y * (z / t_1))) / (x + 1.0); else tmp = (x / (x + 1.0)) - ((y / (-1.0 - x)) / t); 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, -5e+231], N[(y / N[(N[(x + 1.0), $MachinePrecision] * N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1.00000000000005], t$95$2, If[LessEqual[t$95$2, Infinity], N[(N[(x + N[(y * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(y / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / t), $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 -5 \cdot 10^{+231}:\\
\;\;\;\;\frac{y}{\left(x + 1\right) \cdot \left(t - \frac{x}{z}\right)}\\
\mathbf{elif}\;t\_2 \leq 1.00000000000005:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t\_1}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1} - \frac{\frac{y}{-1 - x}}{t}\\
\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))) < -5.00000000000000028e231Initial program 64.1%
*-commutative64.1%
Simplified64.1%
Taylor expanded in y around inf 64.1%
Taylor expanded in z around inf 64.1%
associate-*r/64.1%
neg-mul-164.1%
Simplified64.1%
Taylor expanded in y around 0 93.9%
if -5.00000000000000028e231 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1.00000000000004996Initial program 99.4%
if 1.00000000000004996 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < +inf.0Initial program 80.3%
*-commutative80.3%
Simplified80.3%
Taylor expanded in y around inf 80.3%
*-commutative80.3%
Simplified80.3%
Taylor expanded in y around 0 80.3%
associate-/l*99.5%
*-commutative99.5%
Simplified99.5%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in t around -inf 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
+-commutative100.0%
sub-neg100.0%
mul-1-neg100.0%
distribute-neg-frac2100.0%
distribute-neg-in100.0%
metadata-eval100.0%
unsub-neg100.0%
mul-1-neg100.0%
remove-double-neg100.0%
associate-/r*100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
associate-*r/100.0%
mul-1-neg100.0%
+-commutative100.0%
Simplified100.0%
Final simplification99.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 -5e+152)
(/ y (* (+ x 1.0) (- t (/ x z))))
(if (<= t_2 1.00000000000005)
(/ (+ x (/ (- x (* y z)) (* z (- (/ x z) t)))) (+ x 1.0))
(if (<= t_2 INFINITY)
(/ (+ x (* y (/ z t_1))) (+ x 1.0))
(- (/ x (+ x 1.0)) (/ (/ y (- -1.0 x)) t)))))))
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 <= -5e+152) {
tmp = y / ((x + 1.0) * (t - (x / z)));
} else if (t_2 <= 1.00000000000005) {
tmp = (x + ((x - (y * z)) / (z * ((x / z) - t)))) / (x + 1.0);
} else if (t_2 <= ((double) INFINITY)) {
tmp = (x + (y * (z / t_1))) / (x + 1.0);
} else {
tmp = (x / (x + 1.0)) - ((y / (-1.0 - x)) / t);
}
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 <= -5e+152) {
tmp = y / ((x + 1.0) * (t - (x / z)));
} else if (t_2 <= 1.00000000000005) {
tmp = (x + ((x - (y * z)) / (z * ((x / z) - t)))) / (x + 1.0);
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = (x + (y * (z / t_1))) / (x + 1.0);
} else {
tmp = (x / (x + 1.0)) - ((y / (-1.0 - x)) / t);
}
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 <= -5e+152: tmp = y / ((x + 1.0) * (t - (x / z))) elif t_2 <= 1.00000000000005: tmp = (x + ((x - (y * z)) / (z * ((x / z) - t)))) / (x + 1.0) elif t_2 <= math.inf: tmp = (x + (y * (z / t_1))) / (x + 1.0) else: tmp = (x / (x + 1.0)) - ((y / (-1.0 - x)) / t) 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 <= -5e+152) tmp = Float64(y / Float64(Float64(x + 1.0) * Float64(t - Float64(x / z)))); elseif (t_2 <= 1.00000000000005) tmp = Float64(Float64(x + Float64(Float64(x - Float64(y * z)) / Float64(z * Float64(Float64(x / z) - t)))) / Float64(x + 1.0)); elseif (t_2 <= Inf) tmp = Float64(Float64(x + Float64(y * Float64(z / t_1))) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(x + 1.0)) - Float64(Float64(y / Float64(-1.0 - x)) / t)); 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 <= -5e+152) tmp = y / ((x + 1.0) * (t - (x / z))); elseif (t_2 <= 1.00000000000005) tmp = (x + ((x - (y * z)) / (z * ((x / z) - t)))) / (x + 1.0); elseif (t_2 <= Inf) tmp = (x + (y * (z / t_1))) / (x + 1.0); else tmp = (x / (x + 1.0)) - ((y / (-1.0 - x)) / t); 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, -5e+152], N[(y / N[(N[(x + 1.0), $MachinePrecision] * N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1.00000000000005], N[(N[(x + N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(z * N[(N[(x / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(x + N[(y * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(y / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / t), $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 -5 \cdot 10^{+152}:\\
\;\;\;\;\frac{y}{\left(x + 1\right) \cdot \left(t - \frac{x}{z}\right)}\\
\mathbf{elif}\;t\_2 \leq 1.00000000000005:\\
\;\;\;\;\frac{x + \frac{x - y \cdot z}{z \cdot \left(\frac{x}{z} - t\right)}}{x + 1}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t\_1}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1} - \frac{\frac{y}{-1 - x}}{t}\\
\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))) < -5e152Initial program 72.6%
*-commutative72.6%
Simplified72.6%
Taylor expanded in y around inf 72.6%
Taylor expanded in z around inf 72.5%
associate-*r/72.5%
neg-mul-172.5%
Simplified72.5%
Taylor expanded in y around 0 95.3%
if -5e152 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1.00000000000004996Initial program 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in z around inf 99.4%
mul-1-neg99.4%
unsub-neg99.4%
Simplified99.4%
if 1.00000000000004996 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < +inf.0Initial program 80.3%
*-commutative80.3%
Simplified80.3%
Taylor expanded in y around inf 80.3%
*-commutative80.3%
Simplified80.3%
Taylor expanded in y around 0 80.3%
associate-/l*99.5%
*-commutative99.5%
Simplified99.5%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in t around -inf 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
+-commutative100.0%
sub-neg100.0%
mul-1-neg100.0%
distribute-neg-frac2100.0%
distribute-neg-in100.0%
metadata-eval100.0%
unsub-neg100.0%
mul-1-neg100.0%
remove-double-neg100.0%
associate-/r*100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
associate-*r/100.0%
mul-1-neg100.0%
+-commutative100.0%
Simplified100.0%
Final simplification99.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.6e-62) (not (<= z 4.8e-212))) (/ (+ x (* y (/ z (- (* z t) x)))) (+ 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 ((z <= -2.6e-62) || !(z <= 4.8e-212)) {
tmp = (x + (y * (z / ((z * t) - x)))) / (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 ((z <= (-2.6d-62)) .or. (.not. (z <= 4.8d-212))) then
tmp = (x + (y * (z / ((z * t) - x)))) / (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 ((z <= -2.6e-62) || !(z <= 4.8e-212)) {
tmp = (x + (y * (z / ((z * t) - x)))) / (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 (z <= -2.6e-62) or not (z <= 4.8e-212): tmp = (x + (y * (z / ((z * t) - x)))) / (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 ((z <= -2.6e-62) || !(z <= 4.8e-212)) tmp = Float64(Float64(x + Float64(y * Float64(z / Float64(Float64(z * t) - x)))) / 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 ((z <= -2.6e-62) || ~((z <= 4.8e-212))) tmp = (x + (y * (z / ((z * t) - x)))) / (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[z, -2.6e-62], N[Not[LessEqual[z, 4.8e-212]], $MachinePrecision]], N[(N[(x + N[(y * N[(z / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $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}\;z \leq -2.6 \cdot 10^{-62} \lor \neg \left(z \leq 4.8 \cdot 10^{-212}\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{z \cdot t - x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 1\right) - y \cdot \frac{z}{x}}{x + 1}\\
\end{array}
\end{array}
if z < -2.5999999999999999e-62 or 4.79999999999999978e-212 < z Initial program 84.7%
*-commutative84.7%
Simplified84.7%
Taylor expanded in y around inf 81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in y around 0 81.6%
associate-/l*91.5%
*-commutative91.5%
Simplified91.5%
if -2.5999999999999999e-62 < z < 4.79999999999999978e-212Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 89.6%
associate-+r+89.6%
mul-1-neg89.6%
unsub-neg89.6%
+-commutative89.6%
associate-/l*89.6%
+-commutative89.6%
Simplified89.6%
Final simplification90.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* y (/ z (- (* z t) x))))))
(if (<= z -4.8e-62)
(/ -1.0 (/ (- -1.0 x) t_1))
(if (<= z 3.4e-215)
(/ (- (+ x 1.0) (* y (/ z x))) (+ x 1.0))
(/ t_1 (+ x 1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y * (z / ((z * t) - x)));
double tmp;
if (z <= -4.8e-62) {
tmp = -1.0 / ((-1.0 - x) / t_1);
} else if (z <= 3.4e-215) {
tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0);
} else {
tmp = t_1 / (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 * (z / ((z * t) - x)))
if (z <= (-4.8d-62)) then
tmp = (-1.0d0) / (((-1.0d0) - x) / t_1)
else if (z <= 3.4d-215) then
tmp = ((x + 1.0d0) - (y * (z / x))) / (x + 1.0d0)
else
tmp = t_1 / (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)));
double tmp;
if (z <= -4.8e-62) {
tmp = -1.0 / ((-1.0 - x) / t_1);
} else if (z <= 3.4e-215) {
tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0);
} else {
tmp = t_1 / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (y * (z / ((z * t) - x))) tmp = 0 if z <= -4.8e-62: tmp = -1.0 / ((-1.0 - x) / t_1) elif z <= 3.4e-215: tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0) else: tmp = t_1 / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(y * Float64(z / Float64(Float64(z * t) - x)))) tmp = 0.0 if (z <= -4.8e-62) tmp = Float64(-1.0 / Float64(Float64(-1.0 - x) / t_1)); elseif (z <= 3.4e-215) tmp = Float64(Float64(Float64(x + 1.0) - Float64(y * Float64(z / x))) / Float64(x + 1.0)); else tmp = Float64(t_1 / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (y * (z / ((z * t) - x))); tmp = 0.0; if (z <= -4.8e-62) tmp = -1.0 / ((-1.0 - x) / t_1); elseif (z <= 3.4e-215) tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0); else tmp = t_1 / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y * N[(z / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e-62], N[(-1.0 / N[(N[(-1.0 - x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e-215], N[(N[(N[(x + 1.0), $MachinePrecision] - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z \cdot t - x}\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{-62}:\\
\;\;\;\;\frac{-1}{\frac{-1 - x}{t\_1}}\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-215}:\\
\;\;\;\;\frac{\left(x + 1\right) - y \cdot \frac{z}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{x + 1}\\
\end{array}
\end{array}
if z < -4.79999999999999967e-62Initial program 86.4%
*-commutative86.4%
Simplified86.4%
clear-num86.4%
inv-pow86.4%
fma-neg86.4%
Applied egg-rr86.4%
unpow-186.4%
fma-neg86.4%
*-commutative86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in y around inf 82.5%
fma-neg82.5%
associate-/l*92.0%
fma-neg92.0%
Simplified92.0%
if -4.79999999999999967e-62 < z < 3.40000000000000001e-215Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 89.6%
associate-+r+89.6%
mul-1-neg89.6%
unsub-neg89.6%
+-commutative89.6%
associate-/l*89.6%
+-commutative89.6%
Simplified89.6%
if 3.40000000000000001e-215 < z Initial program 83.6%
*-commutative83.6%
Simplified83.6%
Taylor expanded in y around inf 81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in y around 0 81.0%
associate-/l*91.1%
*-commutative91.1%
Simplified91.1%
Final simplification90.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -6e-59) (not (<= z 7.8e-171))) (/ (+ 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 <= -6e-59) || !(z <= 7.8e-171)) {
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 <= (-6d-59)) .or. (.not. (z <= 7.8d-171))) 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 <= -6e-59) || !(z <= 7.8e-171)) {
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 <= -6e-59) or not (z <= 7.8e-171): 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 <= -6e-59) || !(z <= 7.8e-171)) 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 <= -6e-59) || ~((z <= 7.8e-171))) 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, -6e-59], N[Not[LessEqual[z, 7.8e-171]], $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 -6 \cdot 10^{-59} \lor \neg \left(z \leq 7.8 \cdot 10^{-171}\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 < -6.0000000000000002e-59 or 7.7999999999999997e-171 < z Initial program 84.0%
*-commutative84.0%
Simplified84.0%
Taylor expanded in z around inf 85.3%
if -6.0000000000000002e-59 < z < 7.7999999999999997e-171Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 84.4%
+-commutative84.4%
Simplified84.4%
Final simplification85.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.4e-47) (not (<= z 8.8e-212))) (/ (+ 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 ((z <= -5.4e-47) || !(z <= 8.8e-212)) {
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 ((z <= (-5.4d-47)) .or. (.not. (z <= 8.8d-212))) 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 ((z <= -5.4e-47) || !(z <= 8.8e-212)) {
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 (z <= -5.4e-47) or not (z <= 8.8e-212): 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 ((z <= -5.4e-47) || !(z <= 8.8e-212)) 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 ((z <= -5.4e-47) || ~((z <= 8.8e-212))) 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[z, -5.4e-47], N[Not[LessEqual[z, 8.8e-212]], $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}\;z \leq -5.4 \cdot 10^{-47} \lor \neg \left(z \leq 8.8 \cdot 10^{-212}\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 z < -5.3999999999999996e-47 or 8.80000000000000012e-212 < z Initial program 84.5%
*-commutative84.5%
Simplified84.5%
Taylor expanded in z around inf 85.3%
if -5.3999999999999996e-47 < z < 8.80000000000000012e-212Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 88.0%
associate-+r+88.0%
mul-1-neg88.0%
unsub-neg88.0%
+-commutative88.0%
associate-/l*88.0%
+-commutative88.0%
Simplified88.0%
Final simplification86.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.8e-46) (not (<= z 8.8e-212))) (- (/ x (+ x 1.0)) (/ (/ y (- -1.0 x)) t)) (/ (- (+ x 1.0) (* y (/ z x))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.8e-46) || !(z <= 8.8e-212)) {
tmp = (x / (x + 1.0)) - ((y / (-1.0 - x)) / t);
} 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 ((z <= (-4.8d-46)) .or. (.not. (z <= 8.8d-212))) then
tmp = (x / (x + 1.0d0)) - ((y / ((-1.0d0) - x)) / t)
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 ((z <= -4.8e-46) || !(z <= 8.8e-212)) {
tmp = (x / (x + 1.0)) - ((y / (-1.0 - x)) / t);
} else {
tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.8e-46) or not (z <= 8.8e-212): tmp = (x / (x + 1.0)) - ((y / (-1.0 - x)) / t) else: tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.8e-46) || !(z <= 8.8e-212)) tmp = Float64(Float64(x / Float64(x + 1.0)) - Float64(Float64(y / Float64(-1.0 - x)) / t)); 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 ((z <= -4.8e-46) || ~((z <= 8.8e-212))) tmp = (x / (x + 1.0)) - ((y / (-1.0 - x)) / t); else tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.8e-46], N[Not[LessEqual[z, 8.8e-212]], $MachinePrecision]], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(y / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / t), $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}\;z \leq -4.8 \cdot 10^{-46} \lor \neg \left(z \leq 8.8 \cdot 10^{-212}\right):\\
\;\;\;\;\frac{x}{x + 1} - \frac{\frac{y}{-1 - x}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 1\right) - y \cdot \frac{z}{x}}{x + 1}\\
\end{array}
\end{array}
if z < -4.80000000000000027e-46 or 8.80000000000000012e-212 < z Initial program 84.5%
*-commutative84.5%
Simplified84.5%
Taylor expanded in t around -inf 80.3%
+-commutative80.3%
mul-1-neg80.3%
unsub-neg80.3%
+-commutative80.3%
sub-neg80.3%
mul-1-neg80.3%
distribute-neg-frac280.3%
distribute-neg-in80.3%
metadata-eval80.3%
unsub-neg80.3%
mul-1-neg80.3%
remove-double-neg80.3%
associate-/r*78.5%
+-commutative78.5%
Simplified78.5%
Taylor expanded in y around inf 85.3%
associate-*r/85.3%
mul-1-neg85.3%
+-commutative85.3%
Simplified85.3%
if -4.80000000000000027e-46 < z < 8.80000000000000012e-212Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 88.0%
associate-+r+88.0%
mul-1-neg88.0%
unsub-neg88.0%
+-commutative88.0%
associate-/l*88.0%
+-commutative88.0%
Simplified88.0%
Final simplification86.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -9.5e-58) (not (<= z 3.1e-212))) (/ (+ x (/ y t)) (+ x 1.0)) 1.0))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9.5e-58) || !(z <= 3.1e-212)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-9.5d-58)) .or. (.not. (z <= 3.1d-212))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9.5e-58) || !(z <= 3.1e-212)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -9.5e-58) or not (z <= 3.1e-212): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -9.5e-58) || !(z <= 3.1e-212)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -9.5e-58) || ~((z <= 3.1e-212))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -9.5e-58], N[Not[LessEqual[z, 3.1e-212]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-58} \lor \neg \left(z \leq 3.1 \cdot 10^{-212}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if z < -9.4999999999999994e-58 or 3.10000000000000006e-212 < z Initial program 84.6%
*-commutative84.6%
Simplified84.6%
Taylor expanded in z around inf 84.9%
if -9.4999999999999994e-58 < z < 3.10000000000000006e-212Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 90.1%
Taylor expanded in x around inf 77.8%
Final simplification82.8%
(FPCore (x y z t) :precision binary64 (if (<= x -6.2e-100) 1.0 (if (<= x 4.2e-19) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.2e-100) {
tmp = 1.0;
} else if (x <= 4.2e-19) {
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 <= (-6.2d-100)) then
tmp = 1.0d0
else if (x <= 4.2d-19) 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 <= -6.2e-100) {
tmp = 1.0;
} else if (x <= 4.2e-19) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -6.2e-100: tmp = 1.0 elif x <= 4.2e-19: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -6.2e-100) tmp = 1.0; elseif (x <= 4.2e-19) 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 <= -6.2e-100) tmp = 1.0; elseif (x <= 4.2e-19) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.2e-100], 1.0, If[LessEqual[x, 4.2e-19], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{-100}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-19}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -6.1999999999999997e-100 or 4.1999999999999998e-19 < x Initial program 88.9%
*-commutative88.9%
Simplified88.9%
Taylor expanded in y around inf 96.4%
Taylor expanded in x around inf 79.3%
if -6.1999999999999997e-100 < x < 4.1999999999999998e-19Initial program 89.6%
*-commutative89.6%
Simplified89.6%
Taylor expanded in y around inf 84.6%
Taylor expanded in x around 0 62.9%
Final simplification73.1%
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
return 1.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in y around inf 91.9%
Taylor expanded in x around inf 53.8%
Final simplification53.8%
(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 2024067
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))