
(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 17 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 (+ x 1.0))) (t_2 (fma t z (- x)))) (- (+ t_1 (* (/ y (+ x 1.0)) (/ z t_2))) (/ t_1 t_2))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double t_2 = fma(t, z, -x);
return (t_1 + ((y / (x + 1.0)) * (z / t_2))) - (t_1 / t_2);
}
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) t_2 = fma(t, z, Float64(-x)) return Float64(Float64(t_1 + Float64(Float64(y / Float64(x + 1.0)) * Float64(z / t_2))) - Float64(t_1 / t_2)) end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * z + (-x)), $MachinePrecision]}, N[(N[(t$95$1 + N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(z / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
t_2 := \mathsf{fma}\left(t, z, -x\right)\\
\left(t\_1 + \frac{y}{x + 1} \cdot \frac{z}{t\_2}\right) - \frac{t\_1}{t\_2}
\end{array}
\end{array}
Initial program 91.4%
*-commutative91.4%
Simplified91.4%
Taylor expanded in y around 0 91.4%
+-commutative91.4%
times-frac98.6%
+-commutative98.6%
fma-neg98.6%
associate-/r*98.6%
+-commutative98.6%
fma-neg98.6%
Simplified98.6%
Final simplification98.6%
(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 -20000.0)
(* (/ y (+ x 1.0)) (/ z t_1))
(if (<= t_2 2e+271) 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 <= -20000.0) {
tmp = (y / (x + 1.0)) * (z / t_1);
} else if (t_2 <= 2e+271) {
tmp = t_2;
} else {
tmp = (x + (y / 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 = (z * t) - x
t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0d0)
if (t_2 <= (-20000.0d0)) then
tmp = (y / (x + 1.0d0)) * (z / t_1)
else if (t_2 <= 2d+271) then
tmp = t_2
else
tmp = (x + (y / 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 = (z * t) - x;
double t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -20000.0) {
tmp = (y / (x + 1.0)) * (z / t_1);
} else if (t_2 <= 2e+271) {
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 <= -20000.0: tmp = (y / (x + 1.0)) * (z / t_1) elif t_2 <= 2e+271: 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 <= -20000.0) tmp = Float64(Float64(y / Float64(x + 1.0)) * Float64(z / t_1)); elseif (t_2 <= 2e+271) 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 <= -20000.0) tmp = (y / (x + 1.0)) * (z / t_1); elseif (t_2 <= 2e+271) 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, -20000.0], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+271], 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 -20000:\\
\;\;\;\;\frac{y}{x + 1} \cdot \frac{z}{t\_1}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+271}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -2e4Initial program 82.9%
*-commutative82.9%
Simplified82.9%
clear-num82.9%
associate-/r/83.0%
fma-neg83.0%
Applied egg-rr83.0%
Taylor expanded in y around inf 82.8%
times-frac97.0%
+-commutative97.0%
Simplified97.0%
if -2e4 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 1.99999999999999991e271Initial program 98.7%
if 1.99999999999999991e271 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 38.3%
*-commutative38.3%
Simplified38.3%
Taylor expanded in z around inf 82.7%
Final simplification97.1%
(FPCore (x y z t)
:precision binary64
(if (<= x -1.55e-54)
(/ (- (+ x 1.0) (/ y (/ x z))) (+ x 1.0))
(if (<= x 7.2e-155)
(/ (- (+ x (/ y t)) (/ x (* z t))) (+ x 1.0))
(* (/ 1.0 (+ x 1.0)) (+ x (/ (* y z) (- (* z t) x)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.55e-54) {
tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0);
} else if (x <= 7.2e-155) {
tmp = ((x + (y / t)) - (x / (z * t))) / (x + 1.0);
} else {
tmp = (1.0 / (x + 1.0)) * (x + ((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 <= (-1.55d-54)) then
tmp = ((x + 1.0d0) - (y / (x / z))) / (x + 1.0d0)
else if (x <= 7.2d-155) then
tmp = ((x + (y / t)) - (x / (z * t))) / (x + 1.0d0)
else
tmp = (1.0d0 / (x + 1.0d0)) * (x + ((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 <= -1.55e-54) {
tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0);
} else if (x <= 7.2e-155) {
tmp = ((x + (y / t)) - (x / (z * t))) / (x + 1.0);
} else {
tmp = (1.0 / (x + 1.0)) * (x + ((y * z) / ((z * t) - x)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.55e-54: tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0) elif x <= 7.2e-155: tmp = ((x + (y / t)) - (x / (z * t))) / (x + 1.0) else: tmp = (1.0 / (x + 1.0)) * (x + ((y * z) / ((z * t) - x))) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.55e-54) tmp = Float64(Float64(Float64(x + 1.0) - Float64(y / Float64(x / z))) / Float64(x + 1.0)); elseif (x <= 7.2e-155) tmp = Float64(Float64(Float64(x + Float64(y / t)) - Float64(x / Float64(z * t))) / Float64(x + 1.0)); else tmp = Float64(Float64(1.0 / Float64(x + 1.0)) * Float64(x + Float64(Float64(y * z) / Float64(Float64(z * t) - x)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.55e-54) tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0); elseif (x <= 7.2e-155) tmp = ((x + (y / t)) - (x / (z * t))) / (x + 1.0); else tmp = (1.0 / (x + 1.0)) * (x + ((y * z) / ((z * t) - x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.55e-54], N[(N[(N[(x + 1.0), $MachinePrecision] - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.2e-155], N[(N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(x + N[(N[(y * z), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{-54}:\\
\;\;\;\;\frac{\left(x + 1\right) - \frac{y}{\frac{x}{z}}}{x + 1}\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{-155}:\\
\;\;\;\;\frac{\left(x + \frac{y}{t}\right) - \frac{x}{z \cdot t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x + 1} \cdot \left(x + \frac{y \cdot z}{z \cdot t - x}\right)\\
\end{array}
\end{array}
if x < -1.55000000000000002e-54Initial program 81.2%
*-commutative81.2%
Simplified81.2%
Taylor expanded in t around 0 78.1%
associate-+r+78.1%
mul-1-neg78.1%
unsub-neg78.1%
+-commutative78.1%
associate-/l*86.2%
+-commutative86.2%
Simplified86.2%
if -1.55000000000000002e-54 < x < 7.19999999999999977e-155Initial program 94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in t around inf 82.2%
if 7.19999999999999977e-155 < x Initial program 96.8%
*-commutative96.8%
Simplified96.8%
clear-num96.8%
associate-/r/96.7%
fma-neg96.7%
Applied egg-rr96.7%
Taylor expanded in y around inf 92.2%
Final simplification87.0%
(FPCore (x y z t)
:precision binary64
(if (<= x -1e-55)
(/ (- (+ x 1.0) (/ y (/ x z))) (+ x 1.0))
(if (<= x 2.85e-27)
(/ (+ x (- (/ y t) (/ (/ x t) z))) (+ x 1.0))
(/ (- x (/ x (- (* z t) x))) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1e-55) {
tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0);
} else if (x <= 2.85e-27) {
tmp = (x + ((y / t) - ((x / t) / z))) / (x + 1.0);
} else {
tmp = (x - (x / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-1d-55)) then
tmp = ((x + 1.0d0) - (y / (x / z))) / (x + 1.0d0)
else if (x <= 2.85d-27) then
tmp = (x + ((y / t) - ((x / t) / z))) / (x + 1.0d0)
else
tmp = (x - (x / ((z * t) - x))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1e-55) {
tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0);
} else if (x <= 2.85e-27) {
tmp = (x + ((y / t) - ((x / t) / z))) / (x + 1.0);
} else {
tmp = (x - (x / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1e-55: tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0) elif x <= 2.85e-27: tmp = (x + ((y / t) - ((x / t) / z))) / (x + 1.0) else: tmp = (x - (x / ((z * t) - x))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1e-55) tmp = Float64(Float64(Float64(x + 1.0) - Float64(y / Float64(x / z))) / Float64(x + 1.0)); elseif (x <= 2.85e-27) tmp = Float64(Float64(x + Float64(Float64(y / t) - Float64(Float64(x / t) / z))) / Float64(x + 1.0)); else tmp = Float64(Float64(x - Float64(x / Float64(Float64(z * t) - x))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1e-55) tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0); elseif (x <= 2.85e-27) tmp = (x + ((y / t) - ((x / t) / z))) / (x + 1.0); else tmp = (x - (x / ((z * t) - x))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1e-55], N[(N[(N[(x + 1.0), $MachinePrecision] - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.85e-27], N[(N[(x + N[(N[(y / t), $MachinePrecision] - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(x / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-55}:\\
\;\;\;\;\frac{\left(x + 1\right) - \frac{y}{\frac{x}{z}}}{x + 1}\\
\mathbf{elif}\;x \leq 2.85 \cdot 10^{-27}:\\
\;\;\;\;\frac{x + \left(\frac{y}{t} - \frac{\frac{x}{t}}{z}\right)}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\
\end{array}
\end{array}
if x < -9.99999999999999995e-56Initial program 81.2%
*-commutative81.2%
Simplified81.2%
Taylor expanded in t around 0 78.1%
associate-+r+78.1%
mul-1-neg78.1%
unsub-neg78.1%
+-commutative78.1%
associate-/l*86.2%
+-commutative86.2%
Simplified86.2%
if -9.99999999999999995e-56 < x < 2.8499999999999998e-27Initial program 95.4%
*-commutative95.4%
Simplified95.4%
Taylor expanded in t around inf 77.9%
associate--l+77.9%
associate-/r*73.9%
Applied egg-rr73.9%
if 2.8499999999999998e-27 < x Initial program 95.5%
*-commutative95.5%
Simplified95.5%
Taylor expanded in y around 0 95.7%
Final simplification83.1%
(FPCore (x y z t)
:precision binary64
(if (<= x -9.5e-55)
(/ (- (+ x 1.0) (/ y (/ x z))) (+ x 1.0))
(if (<= x 1.5e-29)
(/ (- (+ x (/ y t)) (/ x (* z t))) (+ x 1.0))
(/ (- x (/ x (- (* z t) x))) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9.5e-55) {
tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0);
} else if (x <= 1.5e-29) {
tmp = ((x + (y / t)) - (x / (z * t))) / (x + 1.0);
} else {
tmp = (x - (x / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-9.5d-55)) then
tmp = ((x + 1.0d0) - (y / (x / z))) / (x + 1.0d0)
else if (x <= 1.5d-29) then
tmp = ((x + (y / t)) - (x / (z * t))) / (x + 1.0d0)
else
tmp = (x - (x / ((z * t) - x))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9.5e-55) {
tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0);
} else if (x <= 1.5e-29) {
tmp = ((x + (y / t)) - (x / (z * t))) / (x + 1.0);
} else {
tmp = (x - (x / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -9.5e-55: tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0) elif x <= 1.5e-29: tmp = ((x + (y / t)) - (x / (z * t))) / (x + 1.0) else: tmp = (x - (x / ((z * t) - x))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -9.5e-55) tmp = Float64(Float64(Float64(x + 1.0) - Float64(y / Float64(x / z))) / Float64(x + 1.0)); elseif (x <= 1.5e-29) tmp = Float64(Float64(Float64(x + Float64(y / t)) - Float64(x / Float64(z * t))) / Float64(x + 1.0)); else tmp = Float64(Float64(x - Float64(x / Float64(Float64(z * t) - x))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -9.5e-55) tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0); elseif (x <= 1.5e-29) tmp = ((x + (y / t)) - (x / (z * t))) / (x + 1.0); else tmp = (x - (x / ((z * t) - x))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -9.5e-55], N[(N[(N[(x + 1.0), $MachinePrecision] - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e-29], N[(N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(x / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{-55}:\\
\;\;\;\;\frac{\left(x + 1\right) - \frac{y}{\frac{x}{z}}}{x + 1}\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-29}:\\
\;\;\;\;\frac{\left(x + \frac{y}{t}\right) - \frac{x}{z \cdot t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\
\end{array}
\end{array}
if x < -9.5000000000000006e-55Initial program 81.2%
*-commutative81.2%
Simplified81.2%
Taylor expanded in t around 0 78.1%
associate-+r+78.1%
mul-1-neg78.1%
unsub-neg78.1%
+-commutative78.1%
associate-/l*86.2%
+-commutative86.2%
Simplified86.2%
if -9.5000000000000006e-55 < x < 1.5000000000000001e-29Initial program 95.4%
*-commutative95.4%
Simplified95.4%
Taylor expanded in t around inf 77.9%
if 1.5000000000000001e-29 < x Initial program 95.5%
*-commutative95.5%
Simplified95.5%
Taylor expanded in y around 0 95.7%
Final simplification84.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.25e-153) (not (<= z 3.15e-83))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (- x (/ x (- (* z t) x))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.25e-153) || !(z <= 3.15e-83)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x - (x / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.25d-153)) .or. (.not. (z <= 3.15d-83))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = (x - (x / ((z * t) - x))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.25e-153) || !(z <= 3.15e-83)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x - (x / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.25e-153) or not (z <= 3.15e-83): tmp = (x + (y / t)) / (x + 1.0) else: tmp = (x - (x / ((z * t) - x))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.25e-153) || !(z <= 3.15e-83)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(x - Float64(x / Float64(Float64(z * t) - x))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.25e-153) || ~((z <= 3.15e-83))) tmp = (x + (y / t)) / (x + 1.0); else tmp = (x - (x / ((z * t) - x))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.25e-153], N[Not[LessEqual[z, 3.15e-83]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(x / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-153} \lor \neg \left(z \leq 3.15 \cdot 10^{-83}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\
\end{array}
\end{array}
if z < -1.25000000000000008e-153 or 3.14999999999999983e-83 < z Initial program 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in z around inf 78.9%
if -1.25000000000000008e-153 < z < 3.14999999999999983e-83Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 85.4%
Final simplification81.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.6e-40) (not (<= t 1.15e-11))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (- (+ x 1.0) (/ y (/ x z))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.6e-40) || !(t <= 1.15e-11)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-4.6d-40)) .or. (.not. (t <= 1.15d-11))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = ((x + 1.0d0) - (y / (x / z))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.6e-40) || !(t <= 1.15e-11)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4.6e-40) or not (t <= 1.15e-11): tmp = (x + (y / t)) / (x + 1.0) else: tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4.6e-40) || !(t <= 1.15e-11)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(Float64(x + 1.0) - Float64(y / Float64(x / z))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -4.6e-40) || ~((t <= 1.15e-11))) tmp = (x + (y / t)) / (x + 1.0); else tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.6e-40], N[Not[LessEqual[t, 1.15e-11]], $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[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.6 \cdot 10^{-40} \lor \neg \left(t \leq 1.15 \cdot 10^{-11}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 1\right) - \frac{y}{\frac{x}{z}}}{x + 1}\\
\end{array}
\end{array}
if t < -4.6e-40 or 1.15000000000000007e-11 < t Initial program 88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in z around inf 89.6%
if -4.6e-40 < t < 1.15000000000000007e-11Initial program 94.2%
*-commutative94.2%
Simplified94.2%
Taylor expanded in t around 0 72.7%
associate-+r+72.7%
mul-1-neg72.7%
unsub-neg72.7%
+-commutative72.7%
associate-/l*74.8%
+-commutative74.8%
Simplified74.8%
Final simplification81.9%
(FPCore (x y z t)
:precision binary64
(if (<= x -4.6e-55)
(/ (- (+ x 1.0) (/ y (/ x z))) (+ x 1.0))
(if (<= x 1.5e-29)
(/ (- x (/ (- (/ x z) y) t)) (+ x 1.0))
(/ (- x (/ x (- (* z t) x))) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.6e-55) {
tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0);
} else if (x <= 1.5e-29) {
tmp = (x - (((x / z) - y) / t)) / (x + 1.0);
} else {
tmp = (x - (x / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-4.6d-55)) then
tmp = ((x + 1.0d0) - (y / (x / z))) / (x + 1.0d0)
else if (x <= 1.5d-29) then
tmp = (x - (((x / z) - y) / t)) / (x + 1.0d0)
else
tmp = (x - (x / ((z * t) - x))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.6e-55) {
tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0);
} else if (x <= 1.5e-29) {
tmp = (x - (((x / z) - y) / t)) / (x + 1.0);
} else {
tmp = (x - (x / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.6e-55: tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0) elif x <= 1.5e-29: tmp = (x - (((x / z) - y) / t)) / (x + 1.0) else: tmp = (x - (x / ((z * t) - x))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.6e-55) tmp = Float64(Float64(Float64(x + 1.0) - Float64(y / Float64(x / z))) / Float64(x + 1.0)); elseif (x <= 1.5e-29) tmp = Float64(Float64(x - Float64(Float64(Float64(x / z) - y) / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(x - Float64(x / Float64(Float64(z * t) - x))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4.6e-55) tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0); elseif (x <= 1.5e-29) tmp = (x - (((x / z) - y) / t)) / (x + 1.0); else tmp = (x - (x / ((z * t) - x))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.6e-55], N[(N[(N[(x + 1.0), $MachinePrecision] - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e-29], N[(N[(x - N[(N[(N[(x / z), $MachinePrecision] - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(x / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{-55}:\\
\;\;\;\;\frac{\left(x + 1\right) - \frac{y}{\frac{x}{z}}}{x + 1}\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-29}:\\
\;\;\;\;\frac{x - \frac{\frac{x}{z} - y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\
\end{array}
\end{array}
if x < -4.60000000000000023e-55Initial program 81.2%
*-commutative81.2%
Simplified81.2%
Taylor expanded in t around 0 78.1%
associate-+r+78.1%
mul-1-neg78.1%
unsub-neg78.1%
+-commutative78.1%
associate-/l*86.2%
+-commutative86.2%
Simplified86.2%
if -4.60000000000000023e-55 < x < 1.5000000000000001e-29Initial program 95.4%
*-commutative95.4%
Simplified95.4%
Taylor expanded in t around -inf 77.9%
mul-1-neg77.9%
distribute-lft-out--77.9%
Simplified77.9%
if 1.5000000000000001e-29 < x Initial program 95.5%
*-commutative95.5%
Simplified95.5%
Taylor expanded in y around 0 95.7%
Final simplification84.9%
(FPCore (x y z t)
:precision binary64
(if (<= x -1.9e-56)
1.0
(if (or (<= x -7e-143) (not (<= x 1.7e-25)))
(/ x (+ x 1.0))
(/ y (* (+ x 1.0) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.9e-56) {
tmp = 1.0;
} else if ((x <= -7e-143) || !(x <= 1.7e-25)) {
tmp = x / (x + 1.0);
} else {
tmp = y / ((x + 1.0) * 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 <= (-1.9d-56)) then
tmp = 1.0d0
else if ((x <= (-7d-143)) .or. (.not. (x <= 1.7d-25))) then
tmp = x / (x + 1.0d0)
else
tmp = y / ((x + 1.0d0) * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.9e-56) {
tmp = 1.0;
} else if ((x <= -7e-143) || !(x <= 1.7e-25)) {
tmp = x / (x + 1.0);
} else {
tmp = y / ((x + 1.0) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.9e-56: tmp = 1.0 elif (x <= -7e-143) or not (x <= 1.7e-25): tmp = x / (x + 1.0) else: tmp = y / ((x + 1.0) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.9e-56) tmp = 1.0; elseif ((x <= -7e-143) || !(x <= 1.7e-25)) tmp = Float64(x / Float64(x + 1.0)); else tmp = Float64(y / Float64(Float64(x + 1.0) * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.9e-56) tmp = 1.0; elseif ((x <= -7e-143) || ~((x <= 1.7e-25))) tmp = x / (x + 1.0); else tmp = y / ((x + 1.0) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.9e-56], 1.0, If[Or[LessEqual[x, -7e-143], N[Not[LessEqual[x, 1.7e-25]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(y / N[(N[(x + 1.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{-56}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -7 \cdot 10^{-143} \lor \neg \left(x \leq 1.7 \cdot 10^{-25}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\left(x + 1\right) \cdot t}\\
\end{array}
\end{array}
if x < -1.9000000000000001e-56Initial program 81.5%
*-commutative81.5%
Simplified81.5%
clear-num81.4%
associate-/r/81.4%
fma-neg81.4%
Applied egg-rr81.4%
Taylor expanded in y around inf 72.0%
Taylor expanded in x around inf 78.1%
if -1.9000000000000001e-56 < x < -7.00000000000000011e-143 or 1.70000000000000001e-25 < x Initial program 96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in t around inf 88.9%
+-commutative88.9%
Simplified88.9%
if -7.00000000000000011e-143 < x < 1.70000000000000001e-25Initial program 94.8%
*-commutative94.8%
Simplified94.8%
Taylor expanded in t around inf 77.5%
Taylor expanded in t around 0 64.2%
+-commutative64.2%
Simplified64.2%
Taylor expanded in y around inf 56.3%
Final simplification72.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.6e-56) (not (<= x 1.45e+44))) (- 1.0 (* z (/ y (* x (+ x 1.0))))) (/ (+ x (/ y t)) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.6e-56) || !(x <= 1.45e+44)) {
tmp = 1.0 - (z * (y / (x * (x + 1.0))));
} else {
tmp = (x + (y / 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 ((x <= (-1.6d-56)) .or. (.not. (x <= 1.45d+44))) then
tmp = 1.0d0 - (z * (y / (x * (x + 1.0d0))))
else
tmp = (x + (y / 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 ((x <= -1.6e-56) || !(x <= 1.45e+44)) {
tmp = 1.0 - (z * (y / (x * (x + 1.0))));
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.6e-56) or not (x <= 1.45e+44): tmp = 1.0 - (z * (y / (x * (x + 1.0)))) else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.6e-56) || !(x <= 1.45e+44)) tmp = Float64(1.0 - Float64(z * Float64(y / Float64(x * 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) tmp = 0.0; if ((x <= -1.6e-56) || ~((x <= 1.45e+44))) tmp = 1.0 - (z * (y / (x * (x + 1.0)))); else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.6e-56], N[Not[LessEqual[x, 1.45e+44]], $MachinePrecision]], N[(1.0 - N[(z * N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{-56} \lor \neg \left(x \leq 1.45 \cdot 10^{+44}\right):\\
\;\;\;\;1 - z \cdot \frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if x < -1.59999999999999993e-56 or 1.4500000000000001e44 < x Initial program 87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in z around 0 85.8%
Taylor expanded in y around inf 90.8%
associate-*r/90.8%
mul-1-neg90.8%
+-commutative90.8%
Simplified90.8%
if -1.59999999999999993e-56 < x < 1.4500000000000001e44Initial program 95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in z around inf 70.8%
Final simplification81.0%
(FPCore (x y z t) :precision binary64 (if (<= x -1.52e-18) 1.0 (if (<= x 8.5e-27) (* y (/ z (- (* z t) x))) (/ x (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.52e-18) {
tmp = 1.0;
} else if (x <= 8.5e-27) {
tmp = y * (z / ((z * t) - x));
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-1.52d-18)) then
tmp = 1.0d0
else if (x <= 8.5d-27) then
tmp = y * (z / ((z * t) - x))
else
tmp = x / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.52e-18) {
tmp = 1.0;
} else if (x <= 8.5e-27) {
tmp = y * (z / ((z * t) - x));
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.52e-18: tmp = 1.0 elif x <= 8.5e-27: tmp = y * (z / ((z * t) - x)) else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.52e-18) tmp = 1.0; elseif (x <= 8.5e-27) tmp = Float64(y * Float64(z / Float64(Float64(z * t) - x))); else tmp = Float64(x / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.52e-18) tmp = 1.0; elseif (x <= 8.5e-27) tmp = y * (z / ((z * t) - x)); else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.52e-18], 1.0, If[LessEqual[x, 8.5e-27], N[(y * N[(z / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.52 \cdot 10^{-18}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-27}:\\
\;\;\;\;y \cdot \frac{z}{z \cdot t - x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -1.52e-18Initial program 82.8%
*-commutative82.8%
Simplified82.8%
clear-num82.8%
associate-/r/82.8%
fma-neg82.8%
Applied egg-rr82.8%
Taylor expanded in y around inf 79.6%
Taylor expanded in x around inf 85.2%
if -1.52e-18 < x < 8.50000000000000033e-27Initial program 93.5%
*-commutative93.5%
Simplified93.5%
clear-num93.4%
associate-/r/93.5%
fma-neg93.5%
Applied egg-rr93.5%
Taylor expanded in y around inf 57.8%
times-frac61.5%
+-commutative61.5%
Simplified61.5%
Taylor expanded in x around 0 61.5%
if 8.50000000000000033e-27 < x Initial program 95.5%
*-commutative95.5%
Simplified95.5%
Taylor expanded in t around inf 94.8%
+-commutative94.8%
Simplified94.8%
Final simplification76.0%
(FPCore (x y z t) :precision binary64 (if (<= x -2.35e-56) 1.0 (if (<= x 0.00015) (/ (+ x (/ y t)) (+ x 1.0)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.35e-56) {
tmp = 1.0;
} else if (x <= 0.00015) {
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 <= (-2.35d-56)) then
tmp = 1.0d0
else if (x <= 0.00015d0) 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 <= -2.35e-56) {
tmp = 1.0;
} else if (x <= 0.00015) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.35e-56: tmp = 1.0 elif x <= 0.00015: tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.35e-56) tmp = 1.0; elseif (x <= 0.00015) 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 <= -2.35e-56) tmp = 1.0; elseif (x <= 0.00015) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.35e-56], 1.0, If[LessEqual[x, 0.00015], 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 -2.35 \cdot 10^{-56}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 0.00015:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -2.35e-56 or 1.49999999999999987e-4 < x Initial program 88.0%
*-commutative88.0%
Simplified88.0%
clear-num88.0%
associate-/r/87.9%
fma-neg87.9%
Applied egg-rr87.9%
Taylor expanded in y around inf 82.5%
Taylor expanded in x around inf 86.1%
if -2.35e-56 < x < 1.49999999999999987e-4Initial program 95.4%
*-commutative95.4%
Simplified95.4%
Taylor expanded in z around inf 70.5%
Final simplification78.9%
(FPCore (x y z t) :precision binary64 (if (<= x -1.35e-20) (/ (- x (/ y (/ x z))) (+ x 1.0)) (if (<= x 0.00088) (/ (+ x (/ y t)) (+ x 1.0)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.35e-20) {
tmp = (x - (y / (x / z))) / (x + 1.0);
} else if (x <= 0.00088) {
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.35d-20)) then
tmp = (x - (y / (x / z))) / (x + 1.0d0)
else if (x <= 0.00088d0) 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.35e-20) {
tmp = (x - (y / (x / z))) / (x + 1.0);
} else if (x <= 0.00088) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.35e-20: tmp = (x - (y / (x / z))) / (x + 1.0) elif x <= 0.00088: 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.35e-20) tmp = Float64(Float64(x - Float64(y / Float64(x / z))) / Float64(x + 1.0)); elseif (x <= 0.00088) 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.35e-20) tmp = (x - (y / (x / z))) / (x + 1.0); elseif (x <= 0.00088) 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.35e-20], N[(N[(x - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.00088], 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.35 \cdot 10^{-20}:\\
\;\;\;\;\frac{x - \frac{y}{\frac{x}{z}}}{x + 1}\\
\mathbf{elif}\;x \leq 0.00088:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.35e-20Initial program 83.3%
*-commutative83.3%
Simplified83.3%
clear-num83.3%
associate-/r/83.3%
fma-neg83.3%
Applied egg-rr83.3%
Taylor expanded in y around inf 80.2%
Taylor expanded in t around 0 77.4%
mul-1-neg77.4%
unsub-neg77.4%
associate-/l*86.4%
+-commutative86.4%
Simplified86.4%
if -1.35e-20 < x < 8.80000000000000031e-4Initial program 93.5%
*-commutative93.5%
Simplified93.5%
Taylor expanded in z around inf 67.9%
if 8.80000000000000031e-4 < x Initial program 95.4%
*-commutative95.4%
Simplified95.4%
clear-num95.4%
associate-/r/95.2%
fma-neg95.2%
Applied egg-rr95.2%
Taylor expanded in y around inf 94.4%
Taylor expanded in x around inf 95.2%
Final simplification79.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -9.5e-23) (not (<= t 0.038))) (/ x (+ x 1.0)) 1.0))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9.5e-23) || !(t <= 0.038)) {
tmp = x / (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 ((t <= (-9.5d-23)) .or. (.not. (t <= 0.038d0))) then
tmp = x / (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 ((t <= -9.5e-23) || !(t <= 0.038)) {
tmp = x / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -9.5e-23) or not (t <= 0.038): tmp = x / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -9.5e-23) || !(t <= 0.038)) tmp = Float64(x / Float64(x + 1.0)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -9.5e-23) || ~((t <= 0.038))) tmp = x / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -9.5e-23], N[Not[LessEqual[t, 0.038]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{-23} \lor \neg \left(t \leq 0.038\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -9.50000000000000058e-23 or 0.0379999999999999991 < t Initial program 88.4%
*-commutative88.4%
Simplified88.4%
Taylor expanded in t around inf 66.9%
+-commutative66.9%
Simplified66.9%
if -9.50000000000000058e-23 < t < 0.0379999999999999991Initial program 94.2%
*-commutative94.2%
Simplified94.2%
clear-num94.2%
associate-/r/94.2%
fma-neg94.2%
Applied egg-rr94.2%
Taylor expanded in y around inf 81.5%
Taylor expanded in x around inf 53.6%
Final simplification60.0%
(FPCore (x y z t) :precision binary64 (if (<= t -1.7e-25) (/ 1.0 (/ (+ x 1.0) x)) (if (<= t 9.5e-6) 1.0 (/ x (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.7e-25) {
tmp = 1.0 / ((x + 1.0) / x);
} else if (t <= 9.5e-6) {
tmp = 1.0;
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.7d-25)) then
tmp = 1.0d0 / ((x + 1.0d0) / x)
else if (t <= 9.5d-6) then
tmp = 1.0d0
else
tmp = x / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.7e-25) {
tmp = 1.0 / ((x + 1.0) / x);
} else if (t <= 9.5e-6) {
tmp = 1.0;
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.7e-25: tmp = 1.0 / ((x + 1.0) / x) elif t <= 9.5e-6: tmp = 1.0 else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.7e-25) tmp = Float64(1.0 / Float64(Float64(x + 1.0) / x)); elseif (t <= 9.5e-6) tmp = 1.0; else tmp = Float64(x / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.7e-25) tmp = 1.0 / ((x + 1.0) / x); elseif (t <= 9.5e-6) tmp = 1.0; else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.7e-25], N[(1.0 / N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e-6], 1.0, N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{-25}:\\
\;\;\;\;\frac{1}{\frac{x + 1}{x}}\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-6}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if t < -1.70000000000000001e-25Initial program 91.5%
*-commutative91.5%
Simplified91.5%
Taylor expanded in t around inf 66.6%
+-commutative66.6%
Simplified66.6%
clear-num66.7%
inv-pow66.7%
Applied egg-rr66.7%
unpow-166.7%
Simplified66.7%
if -1.70000000000000001e-25 < t < 9.5000000000000005e-6Initial program 94.2%
*-commutative94.2%
Simplified94.2%
clear-num94.2%
associate-/r/94.2%
fma-neg94.2%
Applied egg-rr94.2%
Taylor expanded in y around inf 81.5%
Taylor expanded in x around inf 53.6%
if 9.5000000000000005e-6 < t Initial program 85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in t around inf 67.2%
+-commutative67.2%
Simplified67.2%
Final simplification60.0%
(FPCore (x y z t) :precision binary64 (if (<= x -2e-56) 1.0 (if (<= x 4.8e-5) x 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2e-56) {
tmp = 1.0;
} else if (x <= 4.8e-5) {
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 <= (-2d-56)) then
tmp = 1.0d0
else if (x <= 4.8d-5) 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 <= -2e-56) {
tmp = 1.0;
} else if (x <= 4.8e-5) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2e-56: tmp = 1.0 elif x <= 4.8e-5: tmp = x else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2e-56) tmp = 1.0; elseif (x <= 4.8e-5) tmp = x; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2e-56) tmp = 1.0; elseif (x <= 4.8e-5) tmp = x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2e-56], 1.0, If[LessEqual[x, 4.8e-5], x, 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{-56}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-5}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -2.0000000000000001e-56 or 4.8000000000000001e-5 < x Initial program 88.0%
*-commutative88.0%
Simplified88.0%
clear-num88.0%
associate-/r/87.9%
fma-neg87.9%
Applied egg-rr87.9%
Taylor expanded in y around inf 82.5%
Taylor expanded in x around inf 86.1%
if -2.0000000000000001e-56 < x < 4.8000000000000001e-5Initial program 95.4%
*-commutative95.4%
Simplified95.4%
Taylor expanded in t around inf 22.2%
+-commutative22.2%
Simplified22.2%
Taylor expanded in x around 0 21.8%
Final simplification56.5%
(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 91.4%
*-commutative91.4%
Simplified91.4%
clear-num91.4%
associate-/r/91.4%
fma-neg91.4%
Applied egg-rr91.4%
Taylor expanded in y around inf 80.5%
Taylor expanded in x around inf 52.2%
Final simplification52.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 2024040
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))