
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))))
(if (or (<= t_1 -1e+61) (not (<= t_1 2e+17)))
(/ (+ x (/ y (- t (/ x z)))) (+ x 1.0))
t_1)))
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 <= -1e+61) || !(t_1 <= 2e+17)) {
tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
} else {
tmp = t_1;
}
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) - x) / ((z * t) - x))) / (x + 1.0d0)
if ((t_1 <= (-1d+61)) .or. (.not. (t_1 <= 2d+17))) then
tmp = (x + (y / (t - (x / z)))) / (x + 1.0d0)
else
tmp = t_1
end if
code = tmp
end function
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 <= -1e+61) || !(t_1 <= 2e+17)) {
tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
} else {
tmp = t_1;
}
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 <= -1e+61) or not (t_1 <= 2e+17): tmp = (x + (y / (t - (x / z)))) / (x + 1.0) else: tmp = t_1 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 <= -1e+61) || !(t_1 <= 2e+17)) tmp = Float64(Float64(x + Float64(y / Float64(t - Float64(x / z)))) / Float64(x + 1.0)); else tmp = t_1; 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 <= -1e+61) || ~((t_1 <= 2e+17))) tmp = (x + (y / (t - (x / z)))) / (x + 1.0); else tmp = t_1; 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[Or[LessEqual[t$95$1, -1e+61], N[Not[LessEqual[t$95$1, 2e+17]], $MachinePrecision]], N[(N[(x + N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]
\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 -1 \cdot 10^{+61} \lor \neg \left(t_1 \leq 2 \cdot 10^{+17}\right):\\
\;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -9.99999999999999949e60 or 2e17 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 73.7%
*-commutative73.7%
Simplified73.7%
Taylor expanded in y around inf 73.7%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in t around 0 99.9%
neg-mul-199.9%
unsub-neg99.9%
Simplified99.9%
if -9.99999999999999949e60 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 2e17Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ x (+ x 1.0))) (t_2 (- (* z t) x))) (- (fma (/ y (+ x 1.0)) (/ z t_2) t_1) (/ t_1 t_2))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double t_2 = (z * t) - x;
return fma((y / (x + 1.0)), (z / t_2), t_1) - (t_1 / t_2);
}
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) t_2 = Float64(Float64(z * t) - x) return Float64(fma(Float64(y / Float64(x + 1.0)), Float64(z / t_2), t_1) - 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[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, N[(N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(z / t$95$2), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
t_2 := z \cdot t - x\\
\mathsf{fma}\left(\frac{y}{x + 1}, \frac{z}{t_2}, t_1\right) - \frac{t_1}{t_2}
\end{array}
\end{array}
Initial program 92.2%
*-commutative92.2%
Simplified92.2%
Taylor expanded in y around 0 92.2%
+-commutative92.2%
times-frac98.4%
fma-def98.4%
+-commutative98.4%
+-commutative98.4%
associate-/r*98.4%
+-commutative98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -1.35e-49)
t_1
(if (<= t 3.2e-208)
(- 1.0 (* (/ y x) (/ z (+ x 1.0))))
(if (<= t 1.12e-175)
(* (/ y (+ x 1.0)) (/ z (- (* z t) x)))
(if (<= t 4.1e-83) (- 1.0 (/ (* z (/ y x)) (+ x 1.0))) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -1.35e-49) {
tmp = t_1;
} else if (t <= 3.2e-208) {
tmp = 1.0 - ((y / x) * (z / (x + 1.0)));
} else if (t <= 1.12e-175) {
tmp = (y / (x + 1.0)) * (z / ((z * t) - x));
} else if (t <= 4.1e-83) {
tmp = 1.0 - ((z * (y / x)) / (x + 1.0));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
if (t <= (-1.35d-49)) then
tmp = t_1
else if (t <= 3.2d-208) then
tmp = 1.0d0 - ((y / x) * (z / (x + 1.0d0)))
else if (t <= 1.12d-175) then
tmp = (y / (x + 1.0d0)) * (z / ((z * t) - x))
else if (t <= 4.1d-83) then
tmp = 1.0d0 - ((z * (y / x)) / (x + 1.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -1.35e-49) {
tmp = t_1;
} else if (t <= 3.2e-208) {
tmp = 1.0 - ((y / x) * (z / (x + 1.0)));
} else if (t <= 1.12e-175) {
tmp = (y / (x + 1.0)) * (z / ((z * t) - x));
} else if (t <= 4.1e-83) {
tmp = 1.0 - ((z * (y / x)) / (x + 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -1.35e-49: tmp = t_1 elif t <= 3.2e-208: tmp = 1.0 - ((y / x) * (z / (x + 1.0))) elif t <= 1.12e-175: tmp = (y / (x + 1.0)) * (z / ((z * t) - x)) elif t <= 4.1e-83: tmp = 1.0 - ((z * (y / x)) / (x + 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (t <= -1.35e-49) tmp = t_1; elseif (t <= 3.2e-208) tmp = Float64(1.0 - Float64(Float64(y / x) * Float64(z / Float64(x + 1.0)))); elseif (t <= 1.12e-175) tmp = Float64(Float64(y / Float64(x + 1.0)) * Float64(z / Float64(Float64(z * t) - x))); elseif (t <= 4.1e-83) tmp = Float64(1.0 - Float64(Float64(z * Float64(y / x)) / Float64(x + 1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (t <= -1.35e-49) tmp = t_1; elseif (t <= 3.2e-208) tmp = 1.0 - ((y / x) * (z / (x + 1.0))); elseif (t <= 1.12e-175) tmp = (y / (x + 1.0)) * (z / ((z * t) - x)); elseif (t <= 4.1e-83) tmp = 1.0 - ((z * (y / x)) / (x + 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.35e-49], t$95$1, If[LessEqual[t, 3.2e-208], N[(1.0 - N[(N[(y / x), $MachinePrecision] * N[(z / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.12e-175], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(z / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.1e-83], N[(1.0 - N[(N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -1.35 \cdot 10^{-49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-208}:\\
\;\;\;\;1 - \frac{y}{x} \cdot \frac{z}{x + 1}\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{-175}:\\
\;\;\;\;\frac{y}{x + 1} \cdot \frac{z}{z \cdot t - x}\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{-83}:\\
\;\;\;\;1 - \frac{z \cdot \frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.35e-49 or 4.1e-83 < t Initial program 89.0%
*-commutative89.0%
Simplified89.0%
Taylor expanded in z around inf 88.6%
if -1.35e-49 < t < 3.2000000000000001e-208Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 85.6%
associate-+r+85.6%
mul-1-neg85.6%
unsub-neg85.6%
+-commutative85.6%
associate-/l*85.6%
+-commutative85.6%
Simplified85.6%
Taylor expanded in y around 0 85.6%
mul-1-neg85.6%
sub-neg85.6%
times-frac77.3%
+-commutative77.3%
Simplified77.3%
if 3.2000000000000001e-208 < t < 1.1200000000000001e-175Initial program 90.1%
*-commutative90.1%
Simplified90.1%
Taylor expanded in y around inf 82.6%
associate-/l*92.3%
Simplified92.3%
Taylor expanded in y around inf 82.5%
times-frac82.4%
+-commutative82.4%
*-commutative82.4%
Simplified82.4%
if 1.1200000000000001e-175 < t < 4.1e-83Initial program 94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in t around 0 88.2%
associate-+r+88.2%
mul-1-neg88.2%
unsub-neg88.2%
+-commutative88.2%
associate-/l*94.0%
+-commutative94.0%
Simplified94.0%
div-sub94.0%
pow194.0%
pow194.0%
pow-div94.0%
metadata-eval94.0%
metadata-eval94.0%
associate-/r/83.1%
Applied egg-rr83.1%
Final simplification85.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -1.7e-49)
t_1
(if (<= t 8e-208)
(- 1.0 (* (/ y x) (/ z (+ x 1.0))))
(if (<= t 2.65e-191)
(/ (* y z) (* (+ x 1.0) (- (* z t) x)))
(if (<= t 1.7e-87) (- 1.0 (/ (* z (/ y x)) (+ x 1.0))) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -1.7e-49) {
tmp = t_1;
} else if (t <= 8e-208) {
tmp = 1.0 - ((y / x) * (z / (x + 1.0)));
} else if (t <= 2.65e-191) {
tmp = (y * z) / ((x + 1.0) * ((z * t) - x));
} else if (t <= 1.7e-87) {
tmp = 1.0 - ((z * (y / x)) / (x + 1.0));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
if (t <= (-1.7d-49)) then
tmp = t_1
else if (t <= 8d-208) then
tmp = 1.0d0 - ((y / x) * (z / (x + 1.0d0)))
else if (t <= 2.65d-191) then
tmp = (y * z) / ((x + 1.0d0) * ((z * t) - x))
else if (t <= 1.7d-87) then
tmp = 1.0d0 - ((z * (y / x)) / (x + 1.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -1.7e-49) {
tmp = t_1;
} else if (t <= 8e-208) {
tmp = 1.0 - ((y / x) * (z / (x + 1.0)));
} else if (t <= 2.65e-191) {
tmp = (y * z) / ((x + 1.0) * ((z * t) - x));
} else if (t <= 1.7e-87) {
tmp = 1.0 - ((z * (y / x)) / (x + 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -1.7e-49: tmp = t_1 elif t <= 8e-208: tmp = 1.0 - ((y / x) * (z / (x + 1.0))) elif t <= 2.65e-191: tmp = (y * z) / ((x + 1.0) * ((z * t) - x)) elif t <= 1.7e-87: tmp = 1.0 - ((z * (y / x)) / (x + 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (t <= -1.7e-49) tmp = t_1; elseif (t <= 8e-208) tmp = Float64(1.0 - Float64(Float64(y / x) * Float64(z / Float64(x + 1.0)))); elseif (t <= 2.65e-191) tmp = Float64(Float64(y * z) / Float64(Float64(x + 1.0) * Float64(Float64(z * t) - x))); elseif (t <= 1.7e-87) tmp = Float64(1.0 - Float64(Float64(z * Float64(y / x)) / Float64(x + 1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (t <= -1.7e-49) tmp = t_1; elseif (t <= 8e-208) tmp = 1.0 - ((y / x) * (z / (x + 1.0))); elseif (t <= 2.65e-191) tmp = (y * z) / ((x + 1.0) * ((z * t) - x)); elseif (t <= 1.7e-87) tmp = 1.0 - ((z * (y / x)) / (x + 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.7e-49], t$95$1, If[LessEqual[t, 8e-208], N[(1.0 - N[(N[(y / x), $MachinePrecision] * N[(z / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.65e-191], N[(N[(y * z), $MachinePrecision] / N[(N[(x + 1.0), $MachinePrecision] * N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.7e-87], N[(1.0 - N[(N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -1.7 \cdot 10^{-49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 8 \cdot 10^{-208}:\\
\;\;\;\;1 - \frac{y}{x} \cdot \frac{z}{x + 1}\\
\mathbf{elif}\;t \leq 2.65 \cdot 10^{-191}:\\
\;\;\;\;\frac{y \cdot z}{\left(x + 1\right) \cdot \left(z \cdot t - x\right)}\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{-87}:\\
\;\;\;\;1 - \frac{z \cdot \frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.70000000000000002e-49 or 1.6999999999999999e-87 < t Initial program 89.0%
*-commutative89.0%
Simplified89.0%
Taylor expanded in z around inf 88.6%
if -1.70000000000000002e-49 < t < 8.0000000000000008e-208Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 85.6%
associate-+r+85.6%
mul-1-neg85.6%
unsub-neg85.6%
+-commutative85.6%
associate-/l*85.6%
+-commutative85.6%
Simplified85.6%
Taylor expanded in y around 0 85.6%
mul-1-neg85.6%
sub-neg85.6%
times-frac77.3%
+-commutative77.3%
Simplified77.3%
if 8.0000000000000008e-208 < t < 2.64999999999999993e-191Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 90.6%
*-commutative90.6%
+-commutative90.6%
Simplified90.6%
if 2.64999999999999993e-191 < t < 1.6999999999999999e-87Initial program 89.5%
*-commutative89.5%
Simplified89.5%
Taylor expanded in t around 0 78.9%
associate-+r+78.9%
mul-1-neg78.9%
unsub-neg78.9%
+-commutative78.9%
associate-/l*89.4%
+-commutative89.4%
Simplified89.4%
div-sub89.4%
pow189.4%
pow189.4%
pow-div89.4%
metadata-eval89.4%
metadata-eval89.4%
associate-/r/79.6%
Applied egg-rr79.6%
Final simplification85.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.35e-49) (not (<= t 1.05e-88))) (/ (+ x (/ y t)) (+ x 1.0)) (- 1.0 (* (/ y x) (/ z (+ x 1.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.35e-49) || !(t <= 1.05e-88)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 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 <= (-1.35d-49)) .or. (.not. (t <= 1.05d-88))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 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 <= -1.35e-49) || !(t <= 1.05e-88)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 - ((y / x) * (z / (x + 1.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.35e-49) or not (t <= 1.05e-88): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 - ((y / x) * (z / (x + 1.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.35e-49) || !(t <= 1.05e-88)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(1.0 - Float64(Float64(y / x) * Float64(z / Float64(x + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.35e-49) || ~((t <= 1.05e-88))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0 - ((y / x) * (z / (x + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.35e-49], N[Not[LessEqual[t, 1.05e-88]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(y / x), $MachinePrecision] * N[(z / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{-49} \lor \neg \left(t \leq 1.05 \cdot 10^{-88}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{y}{x} \cdot \frac{z}{x + 1}\\
\end{array}
\end{array}
if t < -1.35e-49 or 1.05e-88 < t Initial program 89.0%
*-commutative89.0%
Simplified89.0%
Taylor expanded in z around inf 88.6%
if -1.35e-49 < t < 1.05e-88Initial program 97.7%
*-commutative97.7%
Simplified97.7%
Taylor expanded in t around 0 81.3%
associate-+r+81.3%
mul-1-neg81.3%
unsub-neg81.3%
+-commutative81.3%
associate-/l*83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in y around 0 81.3%
mul-1-neg81.3%
sub-neg81.3%
times-frac74.5%
+-commutative74.5%
Simplified74.5%
Final simplification83.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (+ x 1.0))))
(if (<= t -1.9e+106)
t_1
(if (<= t -3.5e-119)
1.0
(if (<= t -8.2e-158) (/ (* y (- z)) x) (if (<= t 2e+32) 1.0 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double tmp;
if (t <= -1.9e+106) {
tmp = t_1;
} else if (t <= -3.5e-119) {
tmp = 1.0;
} else if (t <= -8.2e-158) {
tmp = (y * -z) / x;
} else if (t <= 2e+32) {
tmp = 1.0;
} else {
tmp = t_1;
}
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 / (x + 1.0d0)
if (t <= (-1.9d+106)) then
tmp = t_1
else if (t <= (-3.5d-119)) then
tmp = 1.0d0
else if (t <= (-8.2d-158)) then
tmp = (y * -z) / x
else if (t <= 2d+32) then
tmp = 1.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double tmp;
if (t <= -1.9e+106) {
tmp = t_1;
} else if (t <= -3.5e-119) {
tmp = 1.0;
} else if (t <= -8.2e-158) {
tmp = (y * -z) / x;
} else if (t <= 2e+32) {
tmp = 1.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (x + 1.0) tmp = 0 if t <= -1.9e+106: tmp = t_1 elif t <= -3.5e-119: tmp = 1.0 elif t <= -8.2e-158: tmp = (y * -z) / x elif t <= 2e+32: tmp = 1.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) tmp = 0.0 if (t <= -1.9e+106) tmp = t_1; elseif (t <= -3.5e-119) tmp = 1.0; elseif (t <= -8.2e-158) tmp = Float64(Float64(y * Float64(-z)) / x); elseif (t <= 2e+32) tmp = 1.0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (x + 1.0); tmp = 0.0; if (t <= -1.9e+106) tmp = t_1; elseif (t <= -3.5e-119) tmp = 1.0; elseif (t <= -8.2e-158) tmp = (y * -z) / x; elseif (t <= 2e+32) tmp = 1.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.9e+106], t$95$1, If[LessEqual[t, -3.5e-119], 1.0, If[LessEqual[t, -8.2e-158], N[(N[(y * (-z)), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t, 2e+32], 1.0, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
\mathbf{if}\;t \leq -1.9 \cdot 10^{+106}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -3.5 \cdot 10^{-119}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq -8.2 \cdot 10^{-158}:\\
\;\;\;\;\frac{y \cdot \left(-z\right)}{x}\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+32}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.8999999999999999e106 or 2.00000000000000011e32 < t Initial program 88.0%
*-commutative88.0%
Simplified88.0%
Taylor expanded in t around inf 74.8%
+-commutative74.8%
Simplified74.8%
if -1.8999999999999999e106 < t < -3.5e-119 or -8.20000000000000008e-158 < t < 2.00000000000000011e32Initial program 94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in y around inf 81.9%
associate-/l*86.7%
Simplified86.7%
Taylor expanded in x around inf 54.3%
if -3.5e-119 < t < -8.20000000000000008e-158Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 89.7%
associate-+r+89.7%
mul-1-neg89.7%
unsub-neg89.7%
+-commutative89.7%
associate-/l*89.7%
+-commutative89.7%
Simplified89.7%
Taylor expanded in x around 0 70.6%
associate-*r/70.6%
associate-*r*70.6%
mul-1-neg70.6%
Simplified70.6%
Final simplification62.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.35e-101) (not (<= t 6.3e-87))) (/ (+ x (/ y t)) (+ x 1.0)) (+ 1.0 (/ z (/ x (- t y))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.35e-101) || !(t <= 6.3e-87)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 + (z / (x / (t - y)));
}
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 <= (-2.35d-101)) .or. (.not. (t <= 6.3d-87))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0 + (z / (x / (t - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.35e-101) || !(t <= 6.3e-87)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 + (z / (x / (t - y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.35e-101) or not (t <= 6.3e-87): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 + (z / (x / (t - y))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.35e-101) || !(t <= 6.3e-87)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(1.0 + Float64(z / Float64(x / Float64(t - y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.35e-101) || ~((t <= 6.3e-87))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0 + (z / (x / (t - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.35e-101], N[Not[LessEqual[t, 6.3e-87]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(z / N[(x / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.35 \cdot 10^{-101} \lor \neg \left(t \leq 6.3 \cdot 10^{-87}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{z}{\frac{x}{t - y}}\\
\end{array}
\end{array}
if t < -2.35e-101 or 6.29999999999999976e-87 < t Initial program 89.6%
*-commutative89.6%
Simplified89.6%
Taylor expanded in z around inf 86.4%
if -2.35e-101 < t < 6.29999999999999976e-87Initial program 97.5%
*-commutative97.5%
Simplified97.5%
Taylor expanded in z around 0 76.0%
Taylor expanded in x around 0 74.4%
associate-/l*66.2%
mul-1-neg66.2%
sub-neg66.2%
Simplified66.2%
Final simplification79.7%
(FPCore (x y z t) :precision binary64 (/ (+ x (/ y (- t (/ x z)))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (y / (t - (x / z)))) / (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 + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (y / (t - (x / z)))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (y / (t - (x / z)))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(y / Float64(t - Float64(x / z)))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (y / (t - (x / z)))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}
\end{array}
Initial program 92.2%
*-commutative92.2%
Simplified92.2%
Taylor expanded in y around inf 84.3%
associate-/l*90.5%
Simplified90.5%
Taylor expanded in t around 0 92.0%
neg-mul-192.0%
unsub-neg92.0%
Simplified92.0%
Final simplification92.0%
(FPCore (x y z t) :precision binary64 (if (<= x -3.8) (/ x (+ x 1.0)) (if (<= x 9e-42) (/ y (* (+ x 1.0) t)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.8) {
tmp = x / (x + 1.0);
} else if (x <= 9e-42) {
tmp = y / ((x + 1.0) * t);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-3.8d0)) then
tmp = x / (x + 1.0d0)
else if (x <= 9d-42) then
tmp = y / ((x + 1.0d0) * t)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.8) {
tmp = x / (x + 1.0);
} else if (x <= 9e-42) {
tmp = y / ((x + 1.0) * t);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.8: tmp = x / (x + 1.0) elif x <= 9e-42: tmp = y / ((x + 1.0) * t) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.8) tmp = Float64(x / Float64(x + 1.0)); elseif (x <= 9e-42) tmp = Float64(y / Float64(Float64(x + 1.0) * t)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -3.8) tmp = x / (x + 1.0); elseif (x <= 9e-42) tmp = y / ((x + 1.0) * t); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.8], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9e-42], N[(y / N[(N[(x + 1.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8:\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-42}:\\
\;\;\;\;\frac{y}{\left(x + 1\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -3.7999999999999998Initial program 93.1%
*-commutative93.1%
Simplified93.1%
Taylor expanded in t around inf 93.2%
+-commutative93.2%
Simplified93.2%
if -3.7999999999999998 < x < 9e-42Initial program 92.6%
*-commutative92.6%
Simplified92.6%
Taylor expanded in t around inf 66.1%
*-commutative66.1%
Simplified66.1%
Taylor expanded in y around inf 53.1%
+-commutative53.1%
Simplified53.1%
if 9e-42 < x Initial program 91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in y around inf 84.0%
associate-/l*91.9%
Simplified91.9%
Taylor expanded in x around inf 84.7%
Final simplification71.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.9e+106) (not (<= t 8.6e+31))) (/ x (+ x 1.0)) 1.0))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.9e+106) || !(t <= 8.6e+31)) {
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 <= (-1.9d+106)) .or. (.not. (t <= 8.6d+31))) 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 <= -1.9e+106) || !(t <= 8.6e+31)) {
tmp = x / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.9e+106) or not (t <= 8.6e+31): tmp = x / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.9e+106) || !(t <= 8.6e+31)) 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 <= -1.9e+106) || ~((t <= 8.6e+31))) tmp = x / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.9e+106], N[Not[LessEqual[t, 8.6e+31]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{+106} \lor \neg \left(t \leq 8.6 \cdot 10^{+31}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -1.8999999999999999e106 or 8.59999999999999978e31 < t Initial program 88.0%
*-commutative88.0%
Simplified88.0%
Taylor expanded in t around inf 74.8%
+-commutative74.8%
Simplified74.8%
if -1.8999999999999999e106 < t < 8.59999999999999978e31Initial program 94.9%
*-commutative94.9%
Simplified94.9%
Taylor expanded in y around inf 83.1%
associate-/l*87.5%
Simplified87.5%
Taylor expanded in x around inf 52.3%
Final simplification61.0%
(FPCore (x y z t) :precision binary64 (if (<= x -2e-200) 1.0 (if (<= x 0.000105) (* x (- 1.0 x)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2e-200) {
tmp = 1.0;
} else if (x <= 0.000105) {
tmp = 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 <= (-2d-200)) then
tmp = 1.0d0
else if (x <= 0.000105d0) then
tmp = 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 <= -2e-200) {
tmp = 1.0;
} else if (x <= 0.000105) {
tmp = x * (1.0 - x);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2e-200: tmp = 1.0 elif x <= 0.000105: tmp = x * (1.0 - x) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2e-200) tmp = 1.0; elseif (x <= 0.000105) tmp = Float64(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 <= -2e-200) tmp = 1.0; elseif (x <= 0.000105) tmp = x * (1.0 - x); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2e-200], 1.0, If[LessEqual[x, 0.000105], N[(x * N[(1.0 - x), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{-200}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 0.000105:\\
\;\;\;\;x \cdot \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -2e-200 or 1.05e-4 < x Initial program 91.8%
*-commutative91.8%
Simplified91.8%
Taylor expanded in y around inf 85.9%
associate-/l*92.3%
Simplified92.3%
Taylor expanded in x around inf 77.6%
if -2e-200 < x < 1.05e-4Initial program 92.9%
*-commutative92.9%
Simplified92.9%
Taylor expanded in t around inf 24.2%
+-commutative24.2%
Simplified24.2%
div-inv24.2%
Applied egg-rr24.2%
Taylor expanded in x around 0 24.0%
neg-mul-124.0%
unsub-neg24.0%
Simplified24.0%
Final simplification57.3%
(FPCore (x y z t) :precision binary64 (if (<= x -1.45e-199) 1.0 (if (<= x 1.65e-39) x 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.45e-199) {
tmp = 1.0;
} else if (x <= 1.65e-39) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-1.45d-199)) then
tmp = 1.0d0
else if (x <= 1.65d-39) then
tmp = x
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.45e-199) {
tmp = 1.0;
} else if (x <= 1.65e-39) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.45e-199: tmp = 1.0 elif x <= 1.65e-39: tmp = x else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.45e-199) tmp = 1.0; elseif (x <= 1.65e-39) tmp = x; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.45e-199) tmp = 1.0; elseif (x <= 1.65e-39) tmp = x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.45e-199], 1.0, If[LessEqual[x, 1.65e-39], x, 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{-199}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-39}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.45e-199 or 1.64999999999999992e-39 < x Initial program 91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in y around inf 84.5%
associate-/l*91.1%
Simplified91.1%
Taylor expanded in x around inf 75.0%
if -1.45e-199 < x < 1.64999999999999992e-39Initial program 93.2%
*-commutative93.2%
Simplified93.2%
Taylor expanded in t around inf 22.2%
+-commutative22.2%
Simplified22.2%
Taylor expanded in x around 0 22.2%
Final simplification57.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 92.2%
*-commutative92.2%
Simplified92.2%
Taylor expanded in y around inf 84.3%
associate-/l*90.5%
Simplified90.5%
Taylor expanded in x around inf 52.0%
Final simplification52.0%
(FPCore (x y z t) :precision binary64 (/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0);
}
def code(x, y, z, t): return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(y / Float64(t - Float64(x / z))) - Float64(x / Float64(Float64(t * z) - x)))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \left(\frac{y}{t - \frac{x}{z}} - \frac{x}{t \cdot z - x}\right)}{x + 1}
\end{array}
herbie shell --seed 2023322
(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)))