
(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 (- (* z t) x))
(t_2 (/ (+ x (/ y (/ t_1 z))) (+ x 1.0)))
(t_3 (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0))))
(if (<= t_3 -5e+24)
t_2
(if (<= t_3 2.0)
t_3
(if (<= t_3 INFINITY) 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 / (t_1 / z))) / (x + 1.0);
double t_3 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_3 <= -5e+24) {
tmp = t_2;
} else if (t_3 <= 2.0) {
tmp = t_3;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + (y / (t_1 / z))) / (x + 1.0);
double t_3 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_3 <= -5e+24) {
tmp = t_2;
} else if (t_3 <= 2.0) {
tmp = t_3;
} else if (t_3 <= Double.POSITIVE_INFINITY) {
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 / (t_1 / z))) / (x + 1.0) t_3 = (x + (((y * z) - x) / t_1)) / (x + 1.0) tmp = 0 if t_3 <= -5e+24: tmp = t_2 elif t_3 <= 2.0: tmp = t_3 elif t_3 <= math.inf: 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(y / Float64(t_1 / z))) / Float64(x + 1.0)) t_3 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_1)) / Float64(x + 1.0)) tmp = 0.0 if (t_3 <= -5e+24) tmp = t_2; elseif (t_3 <= 2.0) tmp = t_3; elseif (t_3 <= Inf) 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 / (t_1 / z))) / (x + 1.0); t_3 = (x + (((y * z) - x) / t_1)) / (x + 1.0); tmp = 0.0; if (t_3 <= -5e+24) tmp = t_2; elseif (t_3 <= 2.0) tmp = t_3; elseif (t_3 <= Inf) 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[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = 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$3, -5e+24], t$95$2, If[LessEqual[t$95$3, 2.0], t$95$3, If[LessEqual[t$95$3, Infinity], 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}{\frac{t_1}{z}}}{x + 1}\\
t_3 := \frac{x + \frac{y \cdot z - x}{t_1}}{x + 1}\\
\mathbf{if}\;t_3 \leq -5 \cdot 10^{+24}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_3 \leq 2:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;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)) < -5.00000000000000045e24 or 2 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < +inf.0Initial program 66.8%
*-commutative66.8%
Simplified66.8%
Taylor expanded in y around inf 66.8%
associate-/l*98.3%
Simplified98.3%
if -5.00000000000000045e24 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 2Initial program 97.5%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in z around inf 100.0%
Final simplification97.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -1.05e-47)
t_1
(if (<= t 7.5e-153)
(- 1.0 (/ (* z (/ y x)) (+ x 1.0)))
(if (<= t 1.56e+39) (/ (- x (/ x (- (* z t) 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.05e-47) {
tmp = t_1;
} else if (t <= 7.5e-153) {
tmp = 1.0 - ((z * (y / x)) / (x + 1.0));
} else if (t <= 1.56e+39) {
tmp = (x - (x / ((z * t) - 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.05d-47)) then
tmp = t_1
else if (t <= 7.5d-153) then
tmp = 1.0d0 - ((z * (y / x)) / (x + 1.0d0))
else if (t <= 1.56d+39) then
tmp = (x - (x / ((z * t) - 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.05e-47) {
tmp = t_1;
} else if (t <= 7.5e-153) {
tmp = 1.0 - ((z * (y / x)) / (x + 1.0));
} else if (t <= 1.56e+39) {
tmp = (x - (x / ((z * t) - 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.05e-47: tmp = t_1 elif t <= 7.5e-153: tmp = 1.0 - ((z * (y / x)) / (x + 1.0)) elif t <= 1.56e+39: tmp = (x - (x / ((z * t) - 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.05e-47) tmp = t_1; elseif (t <= 7.5e-153) tmp = Float64(1.0 - Float64(Float64(z * Float64(y / x)) / Float64(x + 1.0))); elseif (t <= 1.56e+39) tmp = Float64(Float64(x - Float64(x / Float64(Float64(z * t) - 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.05e-47) tmp = t_1; elseif (t <= 7.5e-153) tmp = 1.0 - ((z * (y / x)) / (x + 1.0)); elseif (t <= 1.56e+39) tmp = (x - (x / ((z * t) - 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.05e-47], t$95$1, If[LessEqual[t, 7.5e-153], N[(1.0 - N[(N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.56e+39], N[(N[(x - N[(x / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $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.05 \cdot 10^{-47}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-153}:\\
\;\;\;\;1 - \frac{z \cdot \frac{y}{x}}{x + 1}\\
\mathbf{elif}\;t \leq 1.56 \cdot 10^{+39}:\\
\;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.05e-47 or 1.56000000000000009e39 < t Initial program 82.2%
*-commutative82.2%
Simplified82.2%
Taylor expanded in z around inf 93.4%
if -1.05e-47 < t < 7.5e-153Initial program 90.8%
*-commutative90.8%
Simplified90.8%
Taylor expanded in t around 0 75.0%
associate-+r+75.0%
mul-1-neg75.0%
unsub-neg75.0%
+-commutative75.0%
associate-/l*81.5%
+-commutative81.5%
Simplified81.5%
div-sub81.5%
pow181.5%
pow181.5%
pow-div81.5%
metadata-eval81.5%
metadata-eval81.5%
associate-/r/77.8%
Applied egg-rr77.8%
if 7.5e-153 < t < 1.56000000000000009e39Initial program 92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in y around 0 77.3%
+-commutative77.3%
Simplified77.3%
Final simplification85.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -1.6e-46)
t_1
(if (<= t 1e-160)
(/ (- (+ x 1.0) (/ y (/ x z))) (+ x 1.0))
(if (<= t 1.4e+39) (/ (- x (/ x (- (* z t) 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.6e-46) {
tmp = t_1;
} else if (t <= 1e-160) {
tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0);
} else if (t <= 1.4e+39) {
tmp = (x - (x / ((z * t) - 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.6d-46)) then
tmp = t_1
else if (t <= 1d-160) then
tmp = ((x + 1.0d0) - (y / (x / z))) / (x + 1.0d0)
else if (t <= 1.4d+39) then
tmp = (x - (x / ((z * t) - 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.6e-46) {
tmp = t_1;
} else if (t <= 1e-160) {
tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0);
} else if (t <= 1.4e+39) {
tmp = (x - (x / ((z * t) - 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.6e-46: tmp = t_1 elif t <= 1e-160: tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0) elif t <= 1.4e+39: tmp = (x - (x / ((z * t) - 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.6e-46) tmp = t_1; elseif (t <= 1e-160) tmp = Float64(Float64(Float64(x + 1.0) - Float64(y / Float64(x / z))) / Float64(x + 1.0)); elseif (t <= 1.4e+39) tmp = Float64(Float64(x - Float64(x / Float64(Float64(z * t) - 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.6e-46) tmp = t_1; elseif (t <= 1e-160) tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0); elseif (t <= 1.4e+39) tmp = (x - (x / ((z * t) - 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.6e-46], t$95$1, If[LessEqual[t, 1e-160], N[(N[(N[(x + 1.0), $MachinePrecision] - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e+39], N[(N[(x - N[(x / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $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.6 \cdot 10^{-46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 10^{-160}:\\
\;\;\;\;\frac{\left(x + 1\right) - \frac{y}{\frac{x}{z}}}{x + 1}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+39}:\\
\;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.6e-46 or 1.40000000000000001e39 < t Initial program 82.2%
*-commutative82.2%
Simplified82.2%
Taylor expanded in z around inf 93.4%
if -1.6e-46 < t < 9.9999999999999999e-161Initial program 90.8%
*-commutative90.8%
Simplified90.8%
Taylor expanded in t around 0 75.0%
associate-+r+75.0%
mul-1-neg75.0%
unsub-neg75.0%
+-commutative75.0%
associate-/l*81.5%
+-commutative81.5%
Simplified81.5%
if 9.9999999999999999e-161 < t < 1.40000000000000001e39Initial program 92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in y around 0 77.3%
+-commutative77.3%
Simplified77.3%
Final simplification86.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x)))
(if (or (<= y -1.35e-23) (not (<= y 2.95e-167)))
(/ (+ x (/ y (/ t_1 z))) (+ x 1.0))
(/ (- x (/ x t_1)) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double tmp;
if ((y <= -1.35e-23) || !(y <= 2.95e-167)) {
tmp = (x + (y / (t_1 / z))) / (x + 1.0);
} else {
tmp = (x - (x / t_1)) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (z * t) - x
if ((y <= (-1.35d-23)) .or. (.not. (y <= 2.95d-167))) then
tmp = (x + (y / (t_1 / z))) / (x + 1.0d0)
else
tmp = (x - (x / t_1)) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double tmp;
if ((y <= -1.35e-23) || !(y <= 2.95e-167)) {
tmp = (x + (y / (t_1 / z))) / (x + 1.0);
} else {
tmp = (x - (x / t_1)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * t) - x tmp = 0 if (y <= -1.35e-23) or not (y <= 2.95e-167): tmp = (x + (y / (t_1 / z))) / (x + 1.0) else: tmp = (x - (x / t_1)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) tmp = 0.0 if ((y <= -1.35e-23) || !(y <= 2.95e-167)) tmp = Float64(Float64(x + Float64(y / Float64(t_1 / z))) / Float64(x + 1.0)); else tmp = Float64(Float64(x - Float64(x / t_1)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * t) - x; tmp = 0.0; if ((y <= -1.35e-23) || ~((y <= 2.95e-167))) tmp = (x + (y / (t_1 / z))) / (x + 1.0); else tmp = (x - (x / t_1)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, If[Or[LessEqual[y, -1.35e-23], N[Not[LessEqual[y, 2.95e-167]], $MachinePrecision]], N[(N[(x + N[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(x / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
\mathbf{if}\;y \leq -1.35 \cdot 10^{-23} \lor \neg \left(y \leq 2.95 \cdot 10^{-167}\right):\\
\;\;\;\;\frac{x + \frac{y}{\frac{t_1}{z}}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - \frac{x}{t_1}}{x + 1}\\
\end{array}
\end{array}
if y < -1.34999999999999992e-23 or 2.95000000000000011e-167 < y Initial program 78.4%
*-commutative78.4%
Simplified78.4%
Taylor expanded in y around inf 72.4%
associate-/l*87.3%
Simplified87.3%
if -1.34999999999999992e-23 < y < 2.95000000000000011e-167Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 91.0%
+-commutative91.0%
Simplified91.0%
Final simplification88.7%
(FPCore (x y z t)
:precision binary64
(if (<= x -8e-38)
(/ 1.0 (/ (+ x 1.0) x))
(if (<= x -8e-74)
(* y (/ (- z) x))
(if (<= x -1.9e-126)
1.0
(if (<= x 1.15e-27) (/ y (* t (+ x 1.0))) 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -8e-38) {
tmp = 1.0 / ((x + 1.0) / x);
} else if (x <= -8e-74) {
tmp = y * (-z / x);
} else if (x <= -1.9e-126) {
tmp = 1.0;
} else if (x <= 1.15e-27) {
tmp = 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 <= (-8d-38)) then
tmp = 1.0d0 / ((x + 1.0d0) / x)
else if (x <= (-8d-74)) then
tmp = y * (-z / x)
else if (x <= (-1.9d-126)) then
tmp = 1.0d0
else if (x <= 1.15d-27) then
tmp = 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 <= -8e-38) {
tmp = 1.0 / ((x + 1.0) / x);
} else if (x <= -8e-74) {
tmp = y * (-z / x);
} else if (x <= -1.9e-126) {
tmp = 1.0;
} else if (x <= 1.15e-27) {
tmp = y / (t * (x + 1.0));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -8e-38: tmp = 1.0 / ((x + 1.0) / x) elif x <= -8e-74: tmp = y * (-z / x) elif x <= -1.9e-126: tmp = 1.0 elif x <= 1.15e-27: tmp = y / (t * (x + 1.0)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -8e-38) tmp = Float64(1.0 / Float64(Float64(x + 1.0) / x)); elseif (x <= -8e-74) tmp = Float64(y * Float64(Float64(-z) / x)); elseif (x <= -1.9e-126) tmp = 1.0; elseif (x <= 1.15e-27) tmp = Float64(y / Float64(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 <= -8e-38) tmp = 1.0 / ((x + 1.0) / x); elseif (x <= -8e-74) tmp = y * (-z / x); elseif (x <= -1.9e-126) tmp = 1.0; elseif (x <= 1.15e-27) tmp = y / (t * (x + 1.0)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -8e-38], N[(1.0 / N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8e-74], N[(y * N[((-z) / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.9e-126], 1.0, If[LessEqual[x, 1.15e-27], N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{-38}:\\
\;\;\;\;\frac{1}{\frac{x + 1}{x}}\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-74}:\\
\;\;\;\;y \cdot \frac{-z}{x}\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-126}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-27}:\\
\;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -7.9999999999999997e-38Initial program 85.3%
*-commutative85.3%
Simplified85.3%
clear-num85.4%
inv-pow85.4%
fma-neg85.4%
Applied egg-rr85.4%
unpow-185.4%
fma-neg85.4%
*-commutative85.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in t around inf 84.1%
if -7.9999999999999997e-38 < x < -7.99999999999999966e-74Initial program 92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in y around inf 48.4%
times-frac55.8%
+-commutative55.8%
Simplified55.8%
Taylor expanded in x around 0 55.8%
Taylor expanded in z around 0 41.7%
associate-*r/41.7%
neg-mul-141.7%
Simplified41.7%
if -7.99999999999999966e-74 < x < -1.8999999999999999e-126 or 1.15e-27 < x Initial program 88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in z around inf 68.4%
Taylor expanded in x around inf 85.1%
if -1.8999999999999999e-126 < x < 1.15e-27Initial program 85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in y around inf 52.5%
times-frac57.8%
+-commutative57.8%
Simplified57.8%
Taylor expanded in z around inf 54.8%
Final simplification71.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.6e-46) (not (<= t 1.4e+39))) (/ (+ x (/ y t)) (+ x 1.0)) (- 1.0 (/ (* z (/ y x)) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.6e-46) || !(t <= 1.4e+39)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 - ((z * (y / 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.6d-46)) .or. (.not. (t <= 1.4d+39))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0 - ((z * (y / 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.6e-46) || !(t <= 1.4e+39)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 - ((z * (y / x)) / (x + 1.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.6e-46) or not (t <= 1.4e+39): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 - ((z * (y / x)) / (x + 1.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.6e-46) || !(t <= 1.4e+39)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(1.0 - Float64(Float64(z * Float64(y / x)) / Float64(x + 1.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.6e-46) || ~((t <= 1.4e+39))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0 - ((z * (y / x)) / (x + 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.6e-46], N[Not[LessEqual[t, 1.4e+39]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{-46} \lor \neg \left(t \leq 1.4 \cdot 10^{+39}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{z \cdot \frac{y}{x}}{x + 1}\\
\end{array}
\end{array}
if t < -1.6e-46 or 1.40000000000000001e39 < t Initial program 82.2%
*-commutative82.2%
Simplified82.2%
Taylor expanded in z around inf 93.4%
if -1.6e-46 < t < 1.40000000000000001e39Initial program 91.4%
*-commutative91.4%
Simplified91.4%
Taylor expanded in t around 0 71.0%
associate-+r+71.0%
mul-1-neg71.0%
unsub-neg71.0%
+-commutative71.0%
associate-/l*75.7%
+-commutative75.7%
Simplified75.7%
div-sub75.7%
pow175.7%
pow175.7%
pow-div75.7%
metadata-eval75.7%
metadata-eval75.7%
associate-/r/72.7%
Applied egg-rr72.7%
Final simplification83.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.9e-176) (not (<= z 3.8e-73))) (/ (+ x (/ y t)) (+ x 1.0)) 1.0))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.9e-176) || !(z <= 3.8e-73)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-4.9d-176)) .or. (.not. (z <= 3.8d-73))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.9e-176) || !(z <= 3.8e-73)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.9e-176) or not (z <= 3.8e-73): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.9e-176) || !(z <= 3.8e-73)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4.9e-176) || ~((z <= 3.8e-73))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.9e-176], N[Not[LessEqual[z, 3.8e-73]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.9 \cdot 10^{-176} \lor \neg \left(z \leq 3.8 \cdot 10^{-73}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if z < -4.8999999999999997e-176 or 3.8000000000000003e-73 < z Initial program 81.1%
*-commutative81.1%
Simplified81.1%
Taylor expanded in z around inf 77.4%
if -4.8999999999999997e-176 < z < 3.8000000000000003e-73Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 50.9%
Taylor expanded in x around inf 72.5%
Final simplification75.9%
(FPCore (x y z t) :precision binary64 (if (<= x -2.6e-37) (/ 1.0 (/ (+ x 1.0) x)) (if (<= x 3.7e-27) (* y (/ z (- (* z t) x))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.6e-37) {
tmp = 1.0 / ((x + 1.0) / x);
} else if (x <= 3.7e-27) {
tmp = y * (z / ((z * t) - 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 <= (-2.6d-37)) then
tmp = 1.0d0 / ((x + 1.0d0) / x)
else if (x <= 3.7d-27) then
tmp = y * (z / ((z * t) - 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 <= -2.6e-37) {
tmp = 1.0 / ((x + 1.0) / x);
} else if (x <= 3.7e-27) {
tmp = y * (z / ((z * t) - x));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.6e-37: tmp = 1.0 / ((x + 1.0) / x) elif x <= 3.7e-27: tmp = y * (z / ((z * t) - x)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.6e-37) tmp = Float64(1.0 / Float64(Float64(x + 1.0) / x)); elseif (x <= 3.7e-27) tmp = Float64(y * Float64(z / Float64(Float64(z * t) - x))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.6e-37) tmp = 1.0 / ((x + 1.0) / x); elseif (x <= 3.7e-27) tmp = y * (z / ((z * t) - x)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.6e-37], N[(1.0 / N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.7e-27], N[(y * N[(z / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-37}:\\
\;\;\;\;\frac{1}{\frac{x + 1}{x}}\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-27}:\\
\;\;\;\;y \cdot \frac{z}{z \cdot t - x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -2.5999999999999998e-37Initial program 85.3%
*-commutative85.3%
Simplified85.3%
clear-num85.4%
inv-pow85.4%
fma-neg85.4%
Applied egg-rr85.4%
unpow-185.4%
fma-neg85.4%
*-commutative85.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in t around inf 84.1%
if -2.5999999999999998e-37 < x < 3.70000000000000029e-27Initial program 86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in y around inf 49.0%
times-frac54.9%
+-commutative54.9%
Simplified54.9%
Taylor expanded in x around 0 54.9%
if 3.70000000000000029e-27 < x Initial program 88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in z around inf 73.1%
Taylor expanded in x around inf 91.6%
Final simplification72.8%
(FPCore (x y z t) :precision binary64 (if (<= x -5.8e-37) (/ 1.0 (/ (+ x 1.0) x)) (if (<= x 1.36e-27) (/ y (/ (- (* z t) x) z)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.8e-37) {
tmp = 1.0 / ((x + 1.0) / x);
} else if (x <= 1.36e-27) {
tmp = y / (((z * t) - x) / z);
} 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 <= (-5.8d-37)) then
tmp = 1.0d0 / ((x + 1.0d0) / x)
else if (x <= 1.36d-27) then
tmp = y / (((z * t) - x) / z)
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 <= -5.8e-37) {
tmp = 1.0 / ((x + 1.0) / x);
} else if (x <= 1.36e-27) {
tmp = y / (((z * t) - x) / z);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5.8e-37: tmp = 1.0 / ((x + 1.0) / x) elif x <= 1.36e-27: tmp = y / (((z * t) - x) / z) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5.8e-37) tmp = Float64(1.0 / Float64(Float64(x + 1.0) / x)); elseif (x <= 1.36e-27) tmp = Float64(y / Float64(Float64(Float64(z * t) - x) / z)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -5.8e-37) tmp = 1.0 / ((x + 1.0) / x); elseif (x <= 1.36e-27) tmp = y / (((z * t) - x) / z); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.8e-37], N[(1.0 / N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.36e-27], N[(y / N[(N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-37}:\\
\;\;\;\;\frac{1}{\frac{x + 1}{x}}\\
\mathbf{elif}\;x \leq 1.36 \cdot 10^{-27}:\\
\;\;\;\;\frac{y}{\frac{z \cdot t - x}{z}}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -5.80000000000000009e-37Initial program 85.3%
*-commutative85.3%
Simplified85.3%
clear-num85.4%
inv-pow85.4%
fma-neg85.4%
Applied egg-rr85.4%
unpow-185.4%
fma-neg85.4%
*-commutative85.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in t around inf 84.1%
if -5.80000000000000009e-37 < x < 1.36e-27Initial program 86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in y around inf 49.0%
times-frac54.9%
+-commutative54.9%
Simplified54.9%
Taylor expanded in x around 0 54.9%
Taylor expanded in y around 0 49.0%
associate-/l*55.0%
Simplified55.0%
if 1.36e-27 < x Initial program 88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in z around inf 73.1%
Taylor expanded in x around inf 91.6%
Final simplification72.9%
(FPCore (x y z t)
:precision binary64
(if (<= x -2.8e-38)
(/ x (+ x 1.0))
(if (<= x -4.5e-74)
(* y (/ (- z) x))
(if (<= x -2.2e-126) 1.0 (if (<= x 1.58e-27) (/ y t) 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.8e-38) {
tmp = x / (x + 1.0);
} else if (x <= -4.5e-74) {
tmp = y * (-z / x);
} else if (x <= -2.2e-126) {
tmp = 1.0;
} else if (x <= 1.58e-27) {
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.8d-38)) then
tmp = x / (x + 1.0d0)
else if (x <= (-4.5d-74)) then
tmp = y * (-z / x)
else if (x <= (-2.2d-126)) then
tmp = 1.0d0
else if (x <= 1.58d-27) 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.8e-38) {
tmp = x / (x + 1.0);
} else if (x <= -4.5e-74) {
tmp = y * (-z / x);
} else if (x <= -2.2e-126) {
tmp = 1.0;
} else if (x <= 1.58e-27) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.8e-38: tmp = x / (x + 1.0) elif x <= -4.5e-74: tmp = y * (-z / x) elif x <= -2.2e-126: tmp = 1.0 elif x <= 1.58e-27: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.8e-38) tmp = Float64(x / Float64(x + 1.0)); elseif (x <= -4.5e-74) tmp = Float64(y * Float64(Float64(-z) / x)); elseif (x <= -2.2e-126) tmp = 1.0; elseif (x <= 1.58e-27) 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.8e-38) tmp = x / (x + 1.0); elseif (x <= -4.5e-74) tmp = y * (-z / x); elseif (x <= -2.2e-126) tmp = 1.0; elseif (x <= 1.58e-27) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.8e-38], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.5e-74], N[(y * N[((-z) / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.2e-126], 1.0, If[LessEqual[x, 1.58e-27], N[(y / t), $MachinePrecision], 1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{-38}:\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-74}:\\
\;\;\;\;y \cdot \frac{-z}{x}\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-126}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.58 \cdot 10^{-27}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -2.8e-38Initial program 85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in t around inf 84.1%
+-commutative84.1%
Simplified84.1%
if -2.8e-38 < x < -4.4999999999999999e-74Initial program 92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in y around inf 48.4%
times-frac55.8%
+-commutative55.8%
Simplified55.8%
Taylor expanded in x around 0 55.8%
Taylor expanded in z around 0 41.7%
associate-*r/41.7%
neg-mul-141.7%
Simplified41.7%
if -4.4999999999999999e-74 < x < -2.20000000000000014e-126 or 1.58e-27 < x Initial program 88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in z around inf 68.4%
Taylor expanded in x around inf 85.1%
if -2.20000000000000014e-126 < x < 1.58e-27Initial program 85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in z around inf 67.0%
Taylor expanded in x around 0 54.8%
Final simplification71.7%
(FPCore (x y z t)
:precision binary64
(if (<= x -2.8e-38)
(/ 1.0 (/ (+ x 1.0) x))
(if (<= x -1.45e-74)
(* y (/ (- z) x))
(if (<= x -1.9e-126) 1.0 (if (<= x 9e-28) (/ y t) 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.8e-38) {
tmp = 1.0 / ((x + 1.0) / x);
} else if (x <= -1.45e-74) {
tmp = y * (-z / x);
} else if (x <= -1.9e-126) {
tmp = 1.0;
} else if (x <= 9e-28) {
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.8d-38)) then
tmp = 1.0d0 / ((x + 1.0d0) / x)
else if (x <= (-1.45d-74)) then
tmp = y * (-z / x)
else if (x <= (-1.9d-126)) then
tmp = 1.0d0
else if (x <= 9d-28) 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.8e-38) {
tmp = 1.0 / ((x + 1.0) / x);
} else if (x <= -1.45e-74) {
tmp = y * (-z / x);
} else if (x <= -1.9e-126) {
tmp = 1.0;
} else if (x <= 9e-28) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.8e-38: tmp = 1.0 / ((x + 1.0) / x) elif x <= -1.45e-74: tmp = y * (-z / x) elif x <= -1.9e-126: tmp = 1.0 elif x <= 9e-28: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.8e-38) tmp = Float64(1.0 / Float64(Float64(x + 1.0) / x)); elseif (x <= -1.45e-74) tmp = Float64(y * Float64(Float64(-z) / x)); elseif (x <= -1.9e-126) tmp = 1.0; elseif (x <= 9e-28) 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.8e-38) tmp = 1.0 / ((x + 1.0) / x); elseif (x <= -1.45e-74) tmp = y * (-z / x); elseif (x <= -1.9e-126) tmp = 1.0; elseif (x <= 9e-28) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.8e-38], N[(1.0 / N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.45e-74], N[(y * N[((-z) / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.9e-126], 1.0, If[LessEqual[x, 9e-28], N[(y / t), $MachinePrecision], 1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{-38}:\\
\;\;\;\;\frac{1}{\frac{x + 1}{x}}\\
\mathbf{elif}\;x \leq -1.45 \cdot 10^{-74}:\\
\;\;\;\;y \cdot \frac{-z}{x}\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-126}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-28}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -2.8e-38Initial program 85.3%
*-commutative85.3%
Simplified85.3%
clear-num85.4%
inv-pow85.4%
fma-neg85.4%
Applied egg-rr85.4%
unpow-185.4%
fma-neg85.4%
*-commutative85.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in t around inf 84.1%
if -2.8e-38 < x < -1.45e-74Initial program 92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in y around inf 48.4%
times-frac55.8%
+-commutative55.8%
Simplified55.8%
Taylor expanded in x around 0 55.8%
Taylor expanded in z around 0 41.7%
associate-*r/41.7%
neg-mul-141.7%
Simplified41.7%
if -1.45e-74 < x < -1.8999999999999999e-126 or 8.9999999999999996e-28 < x Initial program 88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in z around inf 68.4%
Taylor expanded in x around inf 85.1%
if -1.8999999999999999e-126 < x < 8.9999999999999996e-28Initial program 85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in z around inf 67.0%
Taylor expanded in x around 0 54.8%
Final simplification71.7%
(FPCore (x y z t) :precision binary64 (if (<= x -2.2e-126) 1.0 (if (<= x 1.15e-27) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.2e-126) {
tmp = 1.0;
} else if (x <= 1.15e-27) {
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-126)) then
tmp = 1.0d0
else if (x <= 1.15d-27) 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-126) {
tmp = 1.0;
} else if (x <= 1.15e-27) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.2e-126: tmp = 1.0 elif x <= 1.15e-27: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.2e-126) tmp = 1.0; elseif (x <= 1.15e-27) 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-126) tmp = 1.0; elseif (x <= 1.15e-27) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.2e-126], 1.0, If[LessEqual[x, 1.15e-27], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-126}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-27}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -2.20000000000000014e-126 or 1.15e-27 < x Initial program 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in z around inf 70.8%
Taylor expanded in x around inf 78.5%
if -2.20000000000000014e-126 < x < 1.15e-27Initial program 85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in z around inf 67.0%
Taylor expanded in x around 0 54.8%
Final simplification70.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 86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in z around inf 69.4%
Taylor expanded in x around inf 53.5%
Final simplification53.5%
(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 2023325
(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)))