
(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 10 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+17)
(* (/ y (- -1.0 x)) (/ z (- x (* z t))))
(if (<= t_1 5e+267)
t_1
(if (<= t_1 INFINITY)
(+ (* (/ z x) (/ (- t y) x)) 1.0)
(+
(/ x (+ x 1.0))
(/ (- (/ y (+ x 1.0)) (/ x (* z (+ x 1.0)))) 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+17) {
tmp = (y / (-1.0 - x)) * (z / (x - (z * t)));
} else if (t_1 <= 5e+267) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = ((z / x) * ((t - y) / x)) + 1.0;
} else {
tmp = (x / (x + 1.0)) + (((y / (x + 1.0)) - (x / (z * (x + 1.0)))) / 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+17) {
tmp = (y / (-1.0 - x)) * (z / (x - (z * t)));
} else if (t_1 <= 5e+267) {
tmp = t_1;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = ((z / x) * ((t - y) / x)) + 1.0;
} else {
tmp = (x / (x + 1.0)) + (((y / (x + 1.0)) - (x / (z * (x + 1.0)))) / 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+17: tmp = (y / (-1.0 - x)) * (z / (x - (z * t))) elif t_1 <= 5e+267: tmp = t_1 elif t_1 <= math.inf: tmp = ((z / x) * ((t - y) / x)) + 1.0 else: tmp = (x / (x + 1.0)) + (((y / (x + 1.0)) - (x / (z * (x + 1.0)))) / 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+17) tmp = Float64(Float64(y / Float64(-1.0 - x)) * Float64(z / Float64(x - Float64(z * t)))); elseif (t_1 <= 5e+267) tmp = t_1; elseif (t_1 <= Inf) tmp = Float64(Float64(Float64(z / x) * Float64(Float64(t - y) / x)) + 1.0); else tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(Float64(Float64(y / Float64(x + 1.0)) - Float64(x / Float64(z * Float64(x + 1.0)))) / 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+17) tmp = (y / (-1.0 - x)) * (z / (x - (z * t))); elseif (t_1 <= 5e+267) tmp = t_1; elseif (t_1 <= Inf) tmp = ((z / x) * ((t - y) / x)) + 1.0; else tmp = (x / (x + 1.0)) + (((y / (x + 1.0)) - (x / (z * (x + 1.0)))) / 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+17], N[(N[(y / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] * N[(z / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+267], t$95$1, If[LessEqual[t$95$1, Infinity], N[(N[(N[(z / x), $MachinePrecision] * N[(N[(t - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(x / N[(z * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $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^{+17}:\\
\;\;\;\;\frac{y}{-1 - x} \cdot \frac{z}{x - z \cdot t}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+267}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{z}{x} \cdot \frac{t - y}{x} + 1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1} + \frac{\frac{y}{x + 1} - \frac{x}{z \cdot \left(x + 1\right)}}{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))) < -5e17Initial program 77.4%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6477.4%
Simplified77.4%
Taylor expanded in y around inf
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6489.7%
Simplified89.7%
if -5e17 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 4.9999999999999999e267Initial program 99.5%
if 4.9999999999999999e267 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < +inf.0Initial program 35.8%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6435.8%
Simplified35.8%
Taylor expanded in x around -inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
distribute-rgt-out--N/A
unpow2N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6480.8%
Simplified80.8%
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%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f640.0%
Simplified0.0%
Taylor expanded in t around -inf
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
Simplified100.0%
Final simplification97.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))))
(if (<= t_1 -5e+17)
(* (/ y (- -1.0 x)) (/ z (- x (* z t))))
(if (<= t_1 5e+267)
t_1
(if (<= t_1 INFINITY)
(+ (* (/ z x) (/ (- t y) x)) 1.0)
(/ (+ x (/ y t)) (+ x 1.0)))))))
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+17) {
tmp = (y / (-1.0 - x)) * (z / (x - (z * t)));
} else if (t_1 <= 5e+267) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = ((z / x) * ((t - y) / 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 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
double tmp;
if (t_1 <= -5e+17) {
tmp = (y / (-1.0 - x)) * (z / (x - (z * t)));
} else if (t_1 <= 5e+267) {
tmp = t_1;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = ((z / x) * ((t - y) / x)) + 1.0;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
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+17: tmp = (y / (-1.0 - x)) * (z / (x - (z * t))) elif t_1 <= 5e+267: tmp = t_1 elif t_1 <= math.inf: tmp = ((z / x) * ((t - y) / x)) + 1.0 else: tmp = (x + (y / t)) / (x + 1.0) 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+17) tmp = Float64(Float64(y / Float64(-1.0 - x)) * Float64(z / Float64(x - Float64(z * t)))); elseif (t_1 <= 5e+267) tmp = t_1; elseif (t_1 <= Inf) tmp = Float64(Float64(Float64(z / x) * Float64(Float64(t - y) / 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 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0); tmp = 0.0; if (t_1 <= -5e+17) tmp = (y / (-1.0 - x)) * (z / (x - (z * t))); elseif (t_1 <= 5e+267) tmp = t_1; elseif (t_1 <= Inf) tmp = ((z / x) * ((t - y) / 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[(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+17], N[(N[(y / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] * N[(z / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+267], t$95$1, If[LessEqual[t$95$1, Infinity], N[(N[(N[(z / x), $MachinePrecision] * N[(N[(t - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $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^{+17}:\\
\;\;\;\;\frac{y}{-1 - x} \cdot \frac{z}{x - z \cdot t}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+267}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{z}{x} \cdot \frac{t - y}{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))) < -5e17Initial program 77.4%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6477.4%
Simplified77.4%
Taylor expanded in y around inf
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6489.7%
Simplified89.7%
if -5e17 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 4.9999999999999999e267Initial program 99.5%
if 4.9999999999999999e267 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < +inf.0Initial program 35.8%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6435.8%
Simplified35.8%
Taylor expanded in x around -inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
distribute-rgt-out--N/A
unpow2N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6480.8%
Simplified80.8%
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%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f640.0%
Simplified0.0%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6499.8%
Simplified99.8%
Final simplification97.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* z t))))
(if (<= (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0)) INFINITY)
(/ (+ x (* y (- (/ x (* y t_1)) (/ z t_1)))) (+ x 1.0))
(+ (/ x (+ x 1.0)) (/ (- (/ y (+ x 1.0)) (/ x (* z (+ x 1.0)))) t)))))
double code(double x, double y, double z, double t) {
double t_1 = x - (z * t);
double tmp;
if (((x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0)) <= ((double) INFINITY)) {
tmp = (x + (y * ((x / (y * t_1)) - (z / t_1)))) / (x + 1.0);
} else {
tmp = (x / (x + 1.0)) + (((y / (x + 1.0)) - (x / (z * (x + 1.0)))) / t);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = x - (z * t);
double tmp;
if (((x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0)) <= Double.POSITIVE_INFINITY) {
tmp = (x + (y * ((x / (y * t_1)) - (z / t_1)))) / (x + 1.0);
} else {
tmp = (x / (x + 1.0)) + (((y / (x + 1.0)) - (x / (z * (x + 1.0)))) / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (z * t) tmp = 0 if ((x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0)) <= math.inf: tmp = (x + (y * ((x / (y * t_1)) - (z / t_1)))) / (x + 1.0) else: tmp = (x / (x + 1.0)) + (((y / (x + 1.0)) - (x / (z * (x + 1.0)))) / t) return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(z * t)) tmp = 0.0 if (Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(z * t) - x))) / Float64(x + 1.0)) <= Inf) tmp = Float64(Float64(x + Float64(y * Float64(Float64(x / Float64(y * t_1)) - Float64(z / t_1)))) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(Float64(Float64(y / Float64(x + 1.0)) - Float64(x / Float64(z * Float64(x + 1.0)))) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (z * t); tmp = 0.0; if (((x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0)) <= Inf) tmp = (x + (y * ((x / (y * t_1)) - (z / t_1)))) / (x + 1.0); else tmp = (x / (x + 1.0)) + (((y / (x + 1.0)) - (x / (z * (x + 1.0)))) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[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], Infinity], N[(N[(x + N[(y * N[(N[(x / N[(y * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(x / N[(z * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - z \cdot t\\
\mathbf{if}\;\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1} \leq \infty:\\
\;\;\;\;\frac{x + y \cdot \left(\frac{x}{y \cdot t\_1} - \frac{z}{t\_1}\right)}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1} + \frac{\frac{y}{x + 1} - \frac{x}{z \cdot \left(x + 1\right)}}{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))) < +inf.0Initial program 92.2%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6492.2%
Simplified92.2%
Taylor expanded in y around inf
*-lowering-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6496.7%
Simplified96.7%
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%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f640.0%
Simplified0.0%
Taylor expanded in t around -inf
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
Simplified100.0%
Final simplification96.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* z t))))
(if (<= x -7e-12)
(/ x (+ x 1.0))
(if (<= x -1.55e-107)
(* (/ y (- -1.0 x)) (/ z t_1))
(if (<= x -6e-127)
(+ x (/ x t_1))
(if (<= x 2e+15) (/ (- (/ (- (/ x z) y) t) x) (- -1.0 x)) 1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (z * t);
double tmp;
if (x <= -7e-12) {
tmp = x / (x + 1.0);
} else if (x <= -1.55e-107) {
tmp = (y / (-1.0 - x)) * (z / t_1);
} else if (x <= -6e-127) {
tmp = x + (x / t_1);
} else if (x <= 2e+15) {
tmp = ((((x / z) - y) / t) - x) / (-1.0 - 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) :: t_1
real(8) :: tmp
t_1 = x - (z * t)
if (x <= (-7d-12)) then
tmp = x / (x + 1.0d0)
else if (x <= (-1.55d-107)) then
tmp = (y / ((-1.0d0) - x)) * (z / t_1)
else if (x <= (-6d-127)) then
tmp = x + (x / t_1)
else if (x <= 2d+15) then
tmp = ((((x / z) - y) / t) - x) / ((-1.0d0) - x)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x - (z * t);
double tmp;
if (x <= -7e-12) {
tmp = x / (x + 1.0);
} else if (x <= -1.55e-107) {
tmp = (y / (-1.0 - x)) * (z / t_1);
} else if (x <= -6e-127) {
tmp = x + (x / t_1);
} else if (x <= 2e+15) {
tmp = ((((x / z) - y) / t) - x) / (-1.0 - x);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (z * t) tmp = 0 if x <= -7e-12: tmp = x / (x + 1.0) elif x <= -1.55e-107: tmp = (y / (-1.0 - x)) * (z / t_1) elif x <= -6e-127: tmp = x + (x / t_1) elif x <= 2e+15: tmp = ((((x / z) - y) / t) - x) / (-1.0 - x) else: tmp = 1.0 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(z * t)) tmp = 0.0 if (x <= -7e-12) tmp = Float64(x / Float64(x + 1.0)); elseif (x <= -1.55e-107) tmp = Float64(Float64(y / Float64(-1.0 - x)) * Float64(z / t_1)); elseif (x <= -6e-127) tmp = Float64(x + Float64(x / t_1)); elseif (x <= 2e+15) tmp = Float64(Float64(Float64(Float64(Float64(x / z) - y) / t) - x) / Float64(-1.0 - x)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (z * t); tmp = 0.0; if (x <= -7e-12) tmp = x / (x + 1.0); elseif (x <= -1.55e-107) tmp = (y / (-1.0 - x)) * (z / t_1); elseif (x <= -6e-127) tmp = x + (x / t_1); elseif (x <= 2e+15) tmp = ((((x / z) - y) / t) - x) / (-1.0 - x); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7e-12], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.55e-107], N[(N[(y / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6e-127], N[(x + N[(x / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2e+15], N[(N[(N[(N[(N[(x / z), $MachinePrecision] - y), $MachinePrecision] / t), $MachinePrecision] - x), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision], 1.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - z \cdot t\\
\mathbf{if}\;x \leq -7 \cdot 10^{-12}:\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{elif}\;x \leq -1.55 \cdot 10^{-107}:\\
\;\;\;\;\frac{y}{-1 - x} \cdot \frac{z}{t\_1}\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-127}:\\
\;\;\;\;x + \frac{x}{t\_1}\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{\frac{x}{z} - y}{t} - x}{-1 - x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -7.0000000000000001e-12Initial program 87.6%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6487.6%
Simplified87.6%
Taylor expanded in t around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6486.1%
Simplified86.1%
if -7.0000000000000001e-12 < x < -1.55000000000000011e-107Initial program 88.8%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6488.8%
Simplified88.8%
Taylor expanded in y around inf
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6465.5%
Simplified65.5%
if -1.55000000000000011e-107 < x < -6.00000000000000017e-127Initial program 99.8%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6499.8%
Simplified99.8%
Taylor expanded in x around inf
Simplified90.6%
Taylor expanded in x around 0
Simplified90.6%
/-rgt-identityN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6490.6%
Applied egg-rr90.6%
if -6.00000000000000017e-127 < x < 2e15Initial program 92.1%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6492.1%
Simplified92.1%
Taylor expanded in t around -inf
+-lowering-+.f64N/A
associate-*r/N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
distribute-lft-inN/A
neg-mul-1N/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
sub-negN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6477.1%
Simplified77.1%
if 2e15 < x Initial program 86.2%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6486.2%
Simplified86.2%
Taylor expanded in x around inf
Simplified92.5%
Final simplification83.5%
(FPCore (x y z t) :precision binary64 (if (<= x -1.35e-127) (/ (+ x (/ x (- x (* z t)))) (+ x 1.0)) (if (<= x 1.55e+15) (/ (- (/ (- (/ x z) y) t) x) (- -1.0 x)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.35e-127) {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
} else if (x <= 1.55e+15) {
tmp = ((((x / z) - y) / t) - x) / (-1.0 - x);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-1.35d-127)) then
tmp = (x + (x / (x - (z * t)))) / (x + 1.0d0)
else if (x <= 1.55d+15) then
tmp = ((((x / z) - y) / t) - x) / ((-1.0d0) - x)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.35e-127) {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
} else if (x <= 1.55e+15) {
tmp = ((((x / z) - y) / t) - x) / (-1.0 - x);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.35e-127: tmp = (x + (x / (x - (z * t)))) / (x + 1.0) elif x <= 1.55e+15: tmp = ((((x / z) - y) / t) - x) / (-1.0 - x) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.35e-127) tmp = Float64(Float64(x + Float64(x / Float64(x - Float64(z * t)))) / Float64(x + 1.0)); elseif (x <= 1.55e+15) tmp = Float64(Float64(Float64(Float64(Float64(x / z) - y) / t) - x) / Float64(-1.0 - x)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.35e-127) tmp = (x + (x / (x - (z * t)))) / (x + 1.0); elseif (x <= 1.55e+15) tmp = ((((x / z) - y) / t) - x) / (-1.0 - x); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.35e-127], N[(N[(x + N[(x / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.55e+15], N[(N[(N[(N[(N[(x / z), $MachinePrecision] - y), $MachinePrecision] / t), $MachinePrecision] - x), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{-127}:\\
\;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{\frac{x}{z} - y}{t} - x}{-1 - x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.35e-127Initial program 88.9%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6488.9%
Simplified88.9%
Taylor expanded in x around inf
Simplified79.8%
if -1.35e-127 < x < 1.55e15Initial program 92.1%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6492.1%
Simplified92.1%
Taylor expanded in t around -inf
+-lowering-+.f64N/A
associate-*r/N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
distribute-lft-inN/A
neg-mul-1N/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
sub-negN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6477.1%
Simplified77.1%
if 1.55e15 < x Initial program 86.2%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6486.2%
Simplified86.2%
Taylor expanded in x around inf
Simplified92.5%
Final simplification82.1%
(FPCore (x y z t) :precision binary64 (if (<= x -1.45e+72) 1.0 (if (<= x 1.3e+16) (/ (+ x (/ y t)) (+ x 1.0)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.45e+72) {
tmp = 1.0;
} else if (x <= 1.3e+16) {
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 <= (-1.45d+72)) then
tmp = 1.0d0
else if (x <= 1.3d+16) 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 <= -1.45e+72) {
tmp = 1.0;
} else if (x <= 1.3e+16) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.45e+72: tmp = 1.0 elif x <= 1.3e+16: tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.45e+72) tmp = 1.0; elseif (x <= 1.3e+16) 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 <= -1.45e+72) tmp = 1.0; elseif (x <= 1.3e+16) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.45e+72], 1.0, If[LessEqual[x, 1.3e+16], 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 -1.45 \cdot 10^{+72}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+16}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.45000000000000009e72 or 1.3e16 < x Initial program 88.7%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6488.7%
Simplified88.7%
Taylor expanded in x around inf
Simplified93.7%
if -1.45000000000000009e72 < x < 1.3e16Initial program 89.9%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6489.9%
Simplified89.9%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6465.7%
Simplified65.7%
Final simplification78.9%
(FPCore (x y z t) :precision binary64 (if (<= x -4.1e-43) 1.0 (if (<= x 0.0054) (+ x (/ y t)) (/ x (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.1e-43) {
tmp = 1.0;
} else if (x <= 0.0054) {
tmp = x + (y / t);
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-4.1d-43)) then
tmp = 1.0d0
else if (x <= 0.0054d0) then
tmp = x + (y / t)
else
tmp = x / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.1e-43) {
tmp = 1.0;
} else if (x <= 0.0054) {
tmp = x + (y / t);
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.1e-43: tmp = 1.0 elif x <= 0.0054: tmp = x + (y / t) else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.1e-43) tmp = 1.0; elseif (x <= 0.0054) tmp = Float64(x + Float64(y / t)); else tmp = Float64(x / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4.1e-43) tmp = 1.0; elseif (x <= 0.0054) tmp = x + (y / t); else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.1e-43], 1.0, If[LessEqual[x, 0.0054], N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.1 \cdot 10^{-43}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 0.0054:\\
\;\;\;\;x + \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -4.0999999999999998e-43Initial program 88.4%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6488.4%
Simplified88.4%
Taylor expanded in x around inf
Simplified81.9%
if -4.0999999999999998e-43 < x < 0.0054000000000000003Initial program 91.8%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6491.8%
Simplified91.8%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6467.5%
Simplified67.5%
Taylor expanded in x around 0
Simplified66.9%
if 0.0054000000000000003 < x Initial program 86.4%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6486.4%
Simplified86.4%
Taylor expanded in t around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6492.7%
Simplified92.7%
Final simplification78.4%
(FPCore (x y z t) :precision binary64 (if (<= x -9.8e-127) 1.0 (if (<= x 5.5e-76) (/ y t) (/ x (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9.8e-127) {
tmp = 1.0;
} else if (x <= 5.5e-76) {
tmp = y / t;
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-9.8d-127)) then
tmp = 1.0d0
else if (x <= 5.5d-76) then
tmp = y / t
else
tmp = x / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9.8e-127) {
tmp = 1.0;
} else if (x <= 5.5e-76) {
tmp = y / t;
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -9.8e-127: tmp = 1.0 elif x <= 5.5e-76: tmp = y / t else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -9.8e-127) tmp = 1.0; elseif (x <= 5.5e-76) tmp = Float64(y / t); else tmp = Float64(x / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -9.8e-127) tmp = 1.0; elseif (x <= 5.5e-76) tmp = y / t; else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -9.8e-127], 1.0, If[LessEqual[x, 5.5e-76], N[(y / t), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.8 \cdot 10^{-127}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-76}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -9.8000000000000002e-127Initial program 88.9%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6488.9%
Simplified88.9%
Taylor expanded in x around inf
Simplified72.7%
if -9.8000000000000002e-127 < x < 5.50000000000000014e-76Initial program 91.1%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6491.1%
Simplified91.1%
Taylor expanded in x around 0
/-lowering-/.f6458.4%
Simplified58.4%
if 5.50000000000000014e-76 < x Initial program 88.0%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6488.0%
Simplified88.0%
Taylor expanded in t around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6486.9%
Simplified86.9%
(FPCore (x y z t) :precision binary64 (if (<= x -2.2e-127) 1.0 (if (<= x 0.0048) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.2e-127) {
tmp = 1.0;
} else if (x <= 0.0048) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-2.2d-127)) then
tmp = 1.0d0
else if (x <= 0.0048d0) then
tmp = y / t
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.2e-127) {
tmp = 1.0;
} else if (x <= 0.0048) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.2e-127: tmp = 1.0 elif x <= 0.0048: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.2e-127) tmp = 1.0; elseif (x <= 0.0048) tmp = Float64(y / t); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.2e-127) tmp = 1.0; elseif (x <= 0.0048) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.2e-127], 1.0, If[LessEqual[x, 0.0048], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-127}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 0.0048:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -2.2000000000000001e-127 or 0.00479999999999999958 < x Initial program 88.0%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6488.0%
Simplified88.0%
Taylor expanded in x around inf
Simplified80.3%
if -2.2000000000000001e-127 < x < 0.00479999999999999958Initial program 92.0%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6492.0%
Simplified92.0%
Taylor expanded in x around 0
/-lowering-/.f6453.0%
Simplified53.0%
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
return 1.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 89.3%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6489.3%
Simplified89.3%
Taylor expanded in x around inf
Simplified57.2%
(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 2024138
(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)))