
(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 14 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))))
(if (<= z -2.3e+103)
(+ t_1 (/ y (* (+ x 1.0) t)))
(if (<= z 1.35e+134)
(/ (+ x (/ (fma z y (- x)) (fma t z (- x)))) (+ x 1.0))
(+ t_1 (/ (+ (/ y (+ x 1.0)) (/ x (* z (- -1.0 x)))) t))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double tmp;
if (z <= -2.3e+103) {
tmp = t_1 + (y / ((x + 1.0) * t));
} else if (z <= 1.35e+134) {
tmp = (x + (fma(z, y, -x) / fma(t, z, -x))) / (x + 1.0);
} else {
tmp = t_1 + (((y / (x + 1.0)) + (x / (z * (-1.0 - x)))) / t);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) tmp = 0.0 if (z <= -2.3e+103) tmp = Float64(t_1 + Float64(y / Float64(Float64(x + 1.0) * t))); elseif (z <= 1.35e+134) tmp = Float64(Float64(x + Float64(fma(z, y, Float64(-x)) / fma(t, z, Float64(-x)))) / Float64(x + 1.0)); else tmp = Float64(t_1 + Float64(Float64(Float64(y / Float64(x + 1.0)) + Float64(x / Float64(z * Float64(-1.0 - x)))) / t)); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.3e+103], N[(t$95$1 + N[(y / N[(N[(x + 1.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e+134], N[(N[(x + N[(N[(z * y + (-x)), $MachinePrecision] / N[(t * z + (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x / N[(z * N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{+103}:\\
\;\;\;\;t\_1 + \frac{y}{\left(x + 1\right) \cdot t}\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+134}:\\
\;\;\;\;\frac{x + \frac{\mathsf{fma}\left(z, y, -x\right)}{\mathsf{fma}\left(t, z, -x\right)}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \frac{\frac{y}{x + 1} + \frac{x}{z \cdot \left(-1 - x\right)}}{t}\\
\end{array}
\end{array}
if z < -2.30000000000000008e103Initial program 70.6%
*-commutative70.6%
Simplified70.6%
Taylor expanded in y around 0 70.6%
mul-1-neg70.6%
+-commutative70.6%
sub-neg70.6%
*-commutative70.6%
*-commutative70.6%
div-sub70.6%
fma-neg70.6%
fma-define70.6%
*-commutative70.6%
fma-undefine70.6%
*-commutative70.6%
fma-neg70.6%
Simplified70.6%
Taylor expanded in y around inf 70.6%
*-commutative70.6%
sub-neg70.6%
*-commutative70.6%
*-rgt-identity70.6%
fma-undefine70.6%
*-rgt-identity70.6%
Simplified70.6%
Taylor expanded in t around inf 91.2%
+-commutative91.2%
+-commutative91.2%
Simplified91.2%
if -2.30000000000000008e103 < z < 1.35e134Initial program 98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in y around 0 98.3%
mul-1-neg98.3%
+-commutative98.3%
sub-neg98.3%
*-commutative98.3%
*-commutative98.3%
div-sub98.3%
fma-neg98.3%
fma-define98.3%
*-commutative98.3%
fma-undefine98.3%
*-commutative98.3%
fma-neg98.3%
Simplified98.3%
if 1.35e134 < z Initial program 64.4%
*-commutative64.4%
Simplified64.4%
Taylor expanded in t around -inf 96.0%
+-commutative96.0%
mul-1-neg96.0%
unsub-neg96.0%
+-commutative96.0%
sub-neg96.0%
mul-1-neg96.0%
distribute-neg-frac296.0%
distribute-neg-in96.0%
metadata-eval96.0%
unsub-neg96.0%
mul-1-neg96.0%
remove-double-neg96.0%
+-commutative96.0%
Simplified96.0%
Final simplification96.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (+ x 1.0))) (t_2 (- 1.0 (* y (/ z x)))))
(if (<= x -4e-70)
t_1
(if (<= x -1.1e-107)
t_2
(if (<= x -3.1e-218)
t_1
(if (<= x 2.2e-169) (/ y t) (if (<= x 7.4e-72) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double t_2 = 1.0 - (y * (z / x));
double tmp;
if (x <= -4e-70) {
tmp = t_1;
} else if (x <= -1.1e-107) {
tmp = t_2;
} else if (x <= -3.1e-218) {
tmp = t_1;
} else if (x <= 2.2e-169) {
tmp = y / t;
} else if (x <= 7.4e-72) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = x / (x + 1.0d0)
t_2 = 1.0d0 - (y * (z / x))
if (x <= (-4d-70)) then
tmp = t_1
else if (x <= (-1.1d-107)) then
tmp = t_2
else if (x <= (-3.1d-218)) then
tmp = t_1
else if (x <= 2.2d-169) then
tmp = y / t
else if (x <= 7.4d-72) then
tmp = t_2
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 t_2 = 1.0 - (y * (z / x));
double tmp;
if (x <= -4e-70) {
tmp = t_1;
} else if (x <= -1.1e-107) {
tmp = t_2;
} else if (x <= -3.1e-218) {
tmp = t_1;
} else if (x <= 2.2e-169) {
tmp = y / t;
} else if (x <= 7.4e-72) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (x + 1.0) t_2 = 1.0 - (y * (z / x)) tmp = 0 if x <= -4e-70: tmp = t_1 elif x <= -1.1e-107: tmp = t_2 elif x <= -3.1e-218: tmp = t_1 elif x <= 2.2e-169: tmp = y / t elif x <= 7.4e-72: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) t_2 = Float64(1.0 - Float64(y * Float64(z / x))) tmp = 0.0 if (x <= -4e-70) tmp = t_1; elseif (x <= -1.1e-107) tmp = t_2; elseif (x <= -3.1e-218) tmp = t_1; elseif (x <= 2.2e-169) tmp = Float64(y / t); elseif (x <= 7.4e-72) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (x + 1.0); t_2 = 1.0 - (y * (z / x)); tmp = 0.0; if (x <= -4e-70) tmp = t_1; elseif (x <= -1.1e-107) tmp = t_2; elseif (x <= -3.1e-218) tmp = t_1; elseif (x <= 2.2e-169) tmp = y / t; elseif (x <= 7.4e-72) tmp = t_2; 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]}, Block[{t$95$2 = N[(1.0 - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4e-70], t$95$1, If[LessEqual[x, -1.1e-107], t$95$2, If[LessEqual[x, -3.1e-218], t$95$1, If[LessEqual[x, 2.2e-169], N[(y / t), $MachinePrecision], If[LessEqual[x, 7.4e-72], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
t_2 := 1 - y \cdot \frac{z}{x}\\
\mathbf{if}\;x \leq -4 \cdot 10^{-70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.1 \cdot 10^{-107}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -3.1 \cdot 10^{-218}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-169}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{elif}\;x \leq 7.4 \cdot 10^{-72}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.99999999999999998e-70 or -1.10000000000000006e-107 < x < -3.09999999999999997e-218 or 7.3999999999999997e-72 < x Initial program 87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in t around inf 78.9%
+-commutative78.9%
Simplified78.9%
if -3.99999999999999998e-70 < x < -1.10000000000000006e-107 or 2.20000000000000007e-169 < x < 7.3999999999999997e-72Initial program 96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in z around 0 51.2%
Taylor expanded in y around inf 51.3%
Taylor expanded in z around 0 60.3%
associate-*r/60.3%
associate-*r*60.3%
neg-mul-160.3%
*-commutative60.3%
+-commutative60.3%
Simplified60.3%
Taylor expanded in x around 0 60.3%
mul-1-neg60.3%
associate-/l*60.4%
Simplified60.4%
if -3.09999999999999997e-218 < x < 2.20000000000000007e-169Initial program 89.0%
*-commutative89.0%
Simplified89.0%
Taylor expanded in y around inf 55.9%
associate-/l*57.9%
+-commutative57.9%
Simplified57.9%
Taylor expanded in x around 0 60.9%
un-div-inv61.1%
*-un-lft-identity61.1%
associate-/r*61.1%
Applied egg-rr61.1%
Final simplification73.4%
(FPCore (x y z t)
:precision binary64
(if (or (<= t -3.2e-79)
(and (not (<= t 2.2e-201)) (or (<= t 8.5e-194) (not (<= t 5.2e+49)))))
(/ (+ x (/ y t)) (+ x 1.0))
(+ 1.0 (* y (/ (/ z x) (- -1.0 x))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.2e-79) || (!(t <= 2.2e-201) && ((t <= 8.5e-194) || !(t <= 5.2e+49)))) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 + (y * ((z / x) / (-1.0 - 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 ((t <= (-3.2d-79)) .or. (.not. (t <= 2.2d-201)) .and. (t <= 8.5d-194) .or. (.not. (t <= 5.2d+49))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0 + (y * ((z / x) / ((-1.0d0) - x)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.2e-79) || (!(t <= 2.2e-201) && ((t <= 8.5e-194) || !(t <= 5.2e+49)))) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 + (y * ((z / x) / (-1.0 - x)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.2e-79) or (not (t <= 2.2e-201) and ((t <= 8.5e-194) or not (t <= 5.2e+49))): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 + (y * ((z / x) / (-1.0 - x))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.2e-79) || (!(t <= 2.2e-201) && ((t <= 8.5e-194) || !(t <= 5.2e+49)))) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(1.0 + Float64(y * Float64(Float64(z / x) / Float64(-1.0 - x)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3.2e-79) || (~((t <= 2.2e-201)) && ((t <= 8.5e-194) || ~((t <= 5.2e+49))))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0 + (y * ((z / x) / (-1.0 - x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.2e-79], And[N[Not[LessEqual[t, 2.2e-201]], $MachinePrecision], Or[LessEqual[t, 8.5e-194], N[Not[LessEqual[t, 5.2e+49]], $MachinePrecision]]]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y * N[(N[(z / x), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{-79} \lor \neg \left(t \leq 2.2 \cdot 10^{-201}\right) \land \left(t \leq 8.5 \cdot 10^{-194} \lor \neg \left(t \leq 5.2 \cdot 10^{+49}\right)\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 + y \cdot \frac{\frac{z}{x}}{-1 - x}\\
\end{array}
\end{array}
if t < -3.19999999999999988e-79 or 2.2e-201 < t < 8.5000000000000005e-194 or 5.19999999999999977e49 < t Initial program 81.3%
*-commutative81.3%
Simplified81.3%
Taylor expanded in z around inf 86.9%
if -3.19999999999999988e-79 < t < 2.2e-201 or 8.5000000000000005e-194 < t < 5.19999999999999977e49Initial program 96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in z around 0 79.5%
Taylor expanded in y around inf 80.3%
Taylor expanded in z around 0 80.2%
associate-*r/80.2%
associate-*r*80.2%
neg-mul-180.2%
*-commutative80.2%
+-commutative80.2%
Simplified80.2%
Taylor expanded in z around 0 80.2%
mul-1-neg80.2%
associate-/l*82.5%
distribute-rgt-neg-in82.5%
associate-/r*82.5%
+-commutative82.5%
distribute-neg-frac282.5%
+-commutative82.5%
distribute-neg-in82.5%
metadata-eval82.5%
unsub-neg82.5%
Simplified82.5%
Final simplification84.9%
(FPCore (x y z t)
:precision binary64
(if (<= t -1.8e-78)
(+ (/ x (+ x 1.0)) (/ y (* (+ x 1.0) t)))
(if (or (<= t 2.2e-201) (and (not (<= t 7.8e-194)) (<= t 5.2e+49)))
(+ 1.0 (* y (/ (/ z x) (- -1.0 x))))
(/ (+ x (/ y t)) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.8e-78) {
tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t));
} else if ((t <= 2.2e-201) || (!(t <= 7.8e-194) && (t <= 5.2e+49))) {
tmp = 1.0 + (y * ((z / x) / (-1.0 - x)));
} 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 (t <= (-1.8d-78)) then
tmp = (x / (x + 1.0d0)) + (y / ((x + 1.0d0) * t))
else if ((t <= 2.2d-201) .or. (.not. (t <= 7.8d-194)) .and. (t <= 5.2d+49)) then
tmp = 1.0d0 + (y * ((z / x) / ((-1.0d0) - x)))
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 (t <= -1.8e-78) {
tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t));
} else if ((t <= 2.2e-201) || (!(t <= 7.8e-194) && (t <= 5.2e+49))) {
tmp = 1.0 + (y * ((z / x) / (-1.0 - x)));
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.8e-78: tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t)) elif (t <= 2.2e-201) or (not (t <= 7.8e-194) and (t <= 5.2e+49)): tmp = 1.0 + (y * ((z / x) / (-1.0 - x))) else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.8e-78) tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(y / Float64(Float64(x + 1.0) * t))); elseif ((t <= 2.2e-201) || (!(t <= 7.8e-194) && (t <= 5.2e+49))) tmp = Float64(1.0 + Float64(y * Float64(Float64(z / x) / Float64(-1.0 - x)))); 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 (t <= -1.8e-78) tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t)); elseif ((t <= 2.2e-201) || (~((t <= 7.8e-194)) && (t <= 5.2e+49))) tmp = 1.0 + (y * ((z / x) / (-1.0 - x))); else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.8e-78], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(N[(x + 1.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 2.2e-201], And[N[Not[LessEqual[t, 7.8e-194]], $MachinePrecision], LessEqual[t, 5.2e+49]]], N[(1.0 + N[(y * N[(N[(z / x), $MachinePrecision] / N[(-1.0 - x), $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}\;t \leq -1.8 \cdot 10^{-78}:\\
\;\;\;\;\frac{x}{x + 1} + \frac{y}{\left(x + 1\right) \cdot t}\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{-201} \lor \neg \left(t \leq 7.8 \cdot 10^{-194}\right) \land t \leq 5.2 \cdot 10^{+49}:\\
\;\;\;\;1 + y \cdot \frac{\frac{z}{x}}{-1 - x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if t < -1.8000000000000001e-78Initial program 80.6%
*-commutative80.6%
Simplified80.6%
Taylor expanded in y around 0 80.6%
mul-1-neg80.6%
+-commutative80.6%
sub-neg80.6%
*-commutative80.6%
*-commutative80.6%
div-sub80.6%
fma-neg80.6%
fma-define80.6%
*-commutative80.6%
fma-undefine80.6%
*-commutative80.6%
fma-neg80.6%
Simplified80.6%
Taylor expanded in y around inf 74.2%
*-commutative74.2%
sub-neg74.2%
*-commutative74.2%
*-rgt-identity74.2%
fma-undefine74.2%
*-rgt-identity74.2%
Simplified74.2%
Taylor expanded in t around inf 85.8%
+-commutative85.8%
+-commutative85.8%
Simplified85.8%
if -1.8000000000000001e-78 < t < 2.2e-201 or 7.7999999999999997e-194 < t < 5.19999999999999977e49Initial program 96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in z around 0 79.5%
Taylor expanded in y around inf 80.3%
Taylor expanded in z around 0 80.2%
associate-*r/80.2%
associate-*r*80.2%
neg-mul-180.2%
*-commutative80.2%
+-commutative80.2%
Simplified80.2%
Taylor expanded in z around 0 80.2%
mul-1-neg80.2%
associate-/l*82.5%
distribute-rgt-neg-in82.5%
associate-/r*82.5%
+-commutative82.5%
distribute-neg-frac282.5%
+-commutative82.5%
distribute-neg-in82.5%
metadata-eval82.5%
unsub-neg82.5%
Simplified82.5%
if 2.2e-201 < t < 7.7999999999999997e-194 or 5.19999999999999977e49 < t Initial program 82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in z around inf 93.4%
Final simplification86.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (+ x 1.0))))
(if (<= z -1.4e+103)
(+ t_1 (/ y (* (+ x 1.0) t)))
(if (<= z 2.1e+136)
(/ (- x (/ (- (* z y) x) (- x (* z t)))) (+ x 1.0))
(+ t_1 (/ (+ (/ y (+ x 1.0)) (/ x (* z (- -1.0 x)))) t))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double tmp;
if (z <= -1.4e+103) {
tmp = t_1 + (y / ((x + 1.0) * t));
} else if (z <= 2.1e+136) {
tmp = (x - (((z * y) - x) / (x - (z * t)))) / (x + 1.0);
} else {
tmp = t_1 + (((y / (x + 1.0)) + (x / (z * (-1.0 - x)))) / 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) :: t_1
real(8) :: tmp
t_1 = x / (x + 1.0d0)
if (z <= (-1.4d+103)) then
tmp = t_1 + (y / ((x + 1.0d0) * t))
else if (z <= 2.1d+136) then
tmp = (x - (((z * y) - x) / (x - (z * t)))) / (x + 1.0d0)
else
tmp = t_1 + (((y / (x + 1.0d0)) + (x / (z * ((-1.0d0) - x)))) / t)
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 (z <= -1.4e+103) {
tmp = t_1 + (y / ((x + 1.0) * t));
} else if (z <= 2.1e+136) {
tmp = (x - (((z * y) - x) / (x - (z * t)))) / (x + 1.0);
} else {
tmp = t_1 + (((y / (x + 1.0)) + (x / (z * (-1.0 - x)))) / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (x + 1.0) tmp = 0 if z <= -1.4e+103: tmp = t_1 + (y / ((x + 1.0) * t)) elif z <= 2.1e+136: tmp = (x - (((z * y) - x) / (x - (z * t)))) / (x + 1.0) else: tmp = t_1 + (((y / (x + 1.0)) + (x / (z * (-1.0 - x)))) / t) return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) tmp = 0.0 if (z <= -1.4e+103) tmp = Float64(t_1 + Float64(y / Float64(Float64(x + 1.0) * t))); elseif (z <= 2.1e+136) tmp = Float64(Float64(x - Float64(Float64(Float64(z * y) - x) / Float64(x - Float64(z * t)))) / Float64(x + 1.0)); else tmp = Float64(t_1 + Float64(Float64(Float64(y / Float64(x + 1.0)) + Float64(x / Float64(z * Float64(-1.0 - x)))) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (x + 1.0); tmp = 0.0; if (z <= -1.4e+103) tmp = t_1 + (y / ((x + 1.0) * t)); elseif (z <= 2.1e+136) tmp = (x - (((z * y) - x) / (x - (z * t)))) / (x + 1.0); else tmp = t_1 + (((y / (x + 1.0)) + (x / (z * (-1.0 - x)))) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.4e+103], N[(t$95$1 + N[(y / N[(N[(x + 1.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e+136], N[(N[(x - N[(N[(N[(z * y), $MachinePrecision] - x), $MachinePrecision] / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x / N[(z * N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
\mathbf{if}\;z \leq -1.4 \cdot 10^{+103}:\\
\;\;\;\;t\_1 + \frac{y}{\left(x + 1\right) \cdot t}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+136}:\\
\;\;\;\;\frac{x - \frac{z \cdot y - x}{x - z \cdot t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \frac{\frac{y}{x + 1} + \frac{x}{z \cdot \left(-1 - x\right)}}{t}\\
\end{array}
\end{array}
if z < -1.40000000000000004e103Initial program 70.6%
*-commutative70.6%
Simplified70.6%
Taylor expanded in y around 0 70.6%
mul-1-neg70.6%
+-commutative70.6%
sub-neg70.6%
*-commutative70.6%
*-commutative70.6%
div-sub70.6%
fma-neg70.6%
fma-define70.6%
*-commutative70.6%
fma-undefine70.6%
*-commutative70.6%
fma-neg70.6%
Simplified70.6%
Taylor expanded in y around inf 70.6%
*-commutative70.6%
sub-neg70.6%
*-commutative70.6%
*-rgt-identity70.6%
fma-undefine70.6%
*-rgt-identity70.6%
Simplified70.6%
Taylor expanded in t around inf 91.2%
+-commutative91.2%
+-commutative91.2%
Simplified91.2%
if -1.40000000000000004e103 < z < 2.0999999999999999e136Initial program 98.3%
if 2.0999999999999999e136 < z Initial program 64.4%
*-commutative64.4%
Simplified64.4%
Taylor expanded in t around -inf 96.0%
+-commutative96.0%
mul-1-neg96.0%
unsub-neg96.0%
+-commutative96.0%
sub-neg96.0%
mul-1-neg96.0%
distribute-neg-frac296.0%
distribute-neg-in96.0%
metadata-eval96.0%
unsub-neg96.0%
mul-1-neg96.0%
remove-double-neg96.0%
+-commutative96.0%
Simplified96.0%
Final simplification96.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.4e+87) (not (<= z 3.4e+50))) (+ (/ x (+ x 1.0)) (/ y (* (+ x 1.0) t))) (/ (+ x (/ 1.0 (/ (- (* z t) x) (- (* z y) x)))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.4e+87) || !(z <= 3.4e+50)) {
tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t));
} else {
tmp = (x + (1.0 / (((z * t) - x) / ((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 ((z <= (-5.4d+87)) .or. (.not. (z <= 3.4d+50))) then
tmp = (x / (x + 1.0d0)) + (y / ((x + 1.0d0) * t))
else
tmp = (x + (1.0d0 / (((z * t) - x) / ((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 ((z <= -5.4e+87) || !(z <= 3.4e+50)) {
tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t));
} else {
tmp = (x + (1.0 / (((z * t) - x) / ((z * y) - x)))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.4e+87) or not (z <= 3.4e+50): tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t)) else: tmp = (x + (1.0 / (((z * t) - x) / ((z * y) - x)))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.4e+87) || !(z <= 3.4e+50)) tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(y / Float64(Float64(x + 1.0) * t))); else tmp = Float64(Float64(x + Float64(1.0 / Float64(Float64(Float64(z * t) - x) / Float64(Float64(z * y) - x)))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.4e+87) || ~((z <= 3.4e+50))) tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t)); else tmp = (x + (1.0 / (((z * t) - x) / ((z * y) - x)))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.4e+87], N[Not[LessEqual[z, 3.4e+50]], $MachinePrecision]], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(N[(x + 1.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(1.0 / N[(N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision] / N[(N[(z * y), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{+87} \lor \neg \left(z \leq 3.4 \cdot 10^{+50}\right):\\
\;\;\;\;\frac{x}{x + 1} + \frac{y}{\left(x + 1\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{1}{\frac{z \cdot t - x}{z \cdot y - x}}}{x + 1}\\
\end{array}
\end{array}
if z < -5.40000000000000013e87 or 3.3999999999999998e50 < z Initial program 74.0%
*-commutative74.0%
Simplified74.0%
Taylor expanded in y around 0 74.0%
mul-1-neg74.0%
+-commutative74.0%
sub-neg74.0%
*-commutative74.0%
*-commutative74.0%
div-sub74.0%
fma-neg74.0%
fma-define74.0%
*-commutative74.0%
fma-undefine74.0%
*-commutative74.0%
fma-neg74.1%
Simplified74.1%
Taylor expanded in y around inf 74.0%
*-commutative74.0%
sub-neg74.0%
*-commutative74.0%
*-rgt-identity74.0%
fma-undefine74.1%
*-rgt-identity74.1%
Simplified74.1%
Taylor expanded in t around inf 93.8%
+-commutative93.8%
+-commutative93.8%
Simplified93.8%
if -5.40000000000000013e87 < z < 3.3999999999999998e50Initial program 98.6%
*-commutative98.6%
Simplified98.6%
clear-num98.6%
inv-pow98.6%
fma-neg98.6%
Applied egg-rr98.6%
unpow-198.6%
*-commutative98.6%
fma-neg98.6%
*-commutative98.6%
Simplified98.6%
Final simplification96.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -6.2e+102) (not (<= z 3.25e+50))) (+ (/ x (+ x 1.0)) (/ y (* (+ x 1.0) t))) (/ (- x (/ (- (* z y) x) (- x (* z t)))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.2e+102) || !(z <= 3.25e+50)) {
tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t));
} else {
tmp = (x - (((z * y) - x) / (x - (z * t)))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-6.2d+102)) .or. (.not. (z <= 3.25d+50))) then
tmp = (x / (x + 1.0d0)) + (y / ((x + 1.0d0) * t))
else
tmp = (x - (((z * y) - x) / (x - (z * t)))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.2e+102) || !(z <= 3.25e+50)) {
tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t));
} else {
tmp = (x - (((z * y) - x) / (x - (z * t)))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -6.2e+102) or not (z <= 3.25e+50): tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t)) else: tmp = (x - (((z * y) - x) / (x - (z * t)))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -6.2e+102) || !(z <= 3.25e+50)) tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(y / Float64(Float64(x + 1.0) * t))); else tmp = Float64(Float64(x - Float64(Float64(Float64(z * y) - x) / Float64(x - Float64(z * t)))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -6.2e+102) || ~((z <= 3.25e+50))) tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t)); else tmp = (x - (((z * y) - x) / (x - (z * t)))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6.2e+102], N[Not[LessEqual[z, 3.25e+50]], $MachinePrecision]], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(N[(x + 1.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(N[(N[(z * y), $MachinePrecision] - x), $MachinePrecision] / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+102} \lor \neg \left(z \leq 3.25 \cdot 10^{+50}\right):\\
\;\;\;\;\frac{x}{x + 1} + \frac{y}{\left(x + 1\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - \frac{z \cdot y - x}{x - z \cdot t}}{x + 1}\\
\end{array}
\end{array}
if z < -6.19999999999999973e102 or 3.2500000000000001e50 < z Initial program 72.2%
*-commutative72.2%
Simplified72.2%
Taylor expanded in y around 0 72.2%
mul-1-neg72.2%
+-commutative72.2%
sub-neg72.2%
*-commutative72.2%
*-commutative72.2%
div-sub72.2%
fma-neg72.2%
fma-define72.2%
*-commutative72.2%
fma-undefine72.2%
*-commutative72.2%
fma-neg72.2%
Simplified72.2%
Taylor expanded in y around inf 72.2%
*-commutative72.2%
sub-neg72.2%
*-commutative72.2%
*-rgt-identity72.2%
fma-undefine72.2%
*-rgt-identity72.2%
Simplified72.2%
Taylor expanded in t around inf 93.4%
+-commutative93.4%
+-commutative93.4%
Simplified93.4%
if -6.19999999999999973e102 < z < 3.2500000000000001e50Initial program 98.7%
Final simplification96.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.8e+60) (not (<= z 2.1e+24))) (+ (/ x (+ x 1.0)) (/ y (* (+ x 1.0) t))) (/ (+ x (/ x (- x (* z t)))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.8e+60) || !(z <= 2.1e+24)) {
tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t));
} else {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-5.8d+60)) .or. (.not. (z <= 2.1d+24))) then
tmp = (x / (x + 1.0d0)) + (y / ((x + 1.0d0) * t))
else
tmp = (x + (x / (x - (z * t)))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.8e+60) || !(z <= 2.1e+24)) {
tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t));
} else {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.8e+60) or not (z <= 2.1e+24): tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t)) else: tmp = (x + (x / (x - (z * t)))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.8e+60) || !(z <= 2.1e+24)) tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(y / Float64(Float64(x + 1.0) * t))); else tmp = Float64(Float64(x + Float64(x / Float64(x - Float64(z * t)))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.8e+60) || ~((z <= 2.1e+24))) tmp = (x / (x + 1.0)) + (y / ((x + 1.0) * t)); else tmp = (x + (x / (x - (z * t)))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.8e+60], N[Not[LessEqual[z, 2.1e+24]], $MachinePrecision]], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(N[(x + 1.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(x / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+60} \lor \neg \left(z \leq 2.1 \cdot 10^{+24}\right):\\
\;\;\;\;\frac{x}{x + 1} + \frac{y}{\left(x + 1\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\
\end{array}
\end{array}
if z < -5.79999999999999999e60 or 2.1000000000000001e24 < z Initial program 75.5%
*-commutative75.5%
Simplified75.5%
Taylor expanded in y around 0 75.5%
mul-1-neg75.5%
+-commutative75.5%
sub-neg75.5%
*-commutative75.5%
*-commutative75.5%
div-sub75.5%
fma-neg75.5%
fma-define75.5%
*-commutative75.5%
fma-undefine75.5%
*-commutative75.5%
fma-neg75.5%
Simplified75.5%
Taylor expanded in y around inf 75.5%
*-commutative75.5%
sub-neg75.5%
*-commutative75.5%
*-rgt-identity75.5%
fma-undefine75.5%
*-rgt-identity75.5%
Simplified75.5%
Taylor expanded in t around inf 92.7%
+-commutative92.7%
+-commutative92.7%
Simplified92.7%
if -5.79999999999999999e60 < z < 2.1000000000000001e24Initial program 99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in y around 0 76.6%
+-commutative76.6%
Simplified76.6%
Final simplification83.9%
(FPCore (x y z t)
:precision binary64
(if (<= x -90000.0)
(+ 1.0 (* y (/ (/ z x) (- -1.0 x))))
(if (<= x 29.5)
(/ (- x (/ (- (/ x z) y) t)) (+ x 1.0))
(/ (+ x (/ x (- x (* z t)))) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -90000.0) {
tmp = 1.0 + (y * ((z / x) / (-1.0 - x)));
} else if (x <= 29.5) {
tmp = (x - (((x / z) - y) / t)) / (x + 1.0);
} else {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-90000.0d0)) then
tmp = 1.0d0 + (y * ((z / x) / ((-1.0d0) - x)))
else if (x <= 29.5d0) then
tmp = (x - (((x / z) - y) / t)) / (x + 1.0d0)
else
tmp = (x + (x / (x - (z * t)))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -90000.0) {
tmp = 1.0 + (y * ((z / x) / (-1.0 - x)));
} else if (x <= 29.5) {
tmp = (x - (((x / z) - y) / t)) / (x + 1.0);
} else {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -90000.0: tmp = 1.0 + (y * ((z / x) / (-1.0 - x))) elif x <= 29.5: tmp = (x - (((x / z) - y) / t)) / (x + 1.0) else: tmp = (x + (x / (x - (z * t)))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -90000.0) tmp = Float64(1.0 + Float64(y * Float64(Float64(z / x) / Float64(-1.0 - x)))); elseif (x <= 29.5) tmp = Float64(Float64(x - Float64(Float64(Float64(x / z) - y) / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(x / Float64(x - Float64(z * t)))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -90000.0) tmp = 1.0 + (y * ((z / x) / (-1.0 - x))); elseif (x <= 29.5) tmp = (x - (((x / z) - y) / t)) / (x + 1.0); else tmp = (x + (x / (x - (z * t)))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -90000.0], N[(1.0 + N[(y * N[(N[(z / x), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 29.5], 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[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -90000:\\
\;\;\;\;1 + y \cdot \frac{\frac{z}{x}}{-1 - x}\\
\mathbf{elif}\;x \leq 29.5:\\
\;\;\;\;\frac{x - \frac{\frac{x}{z} - y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\
\end{array}
\end{array}
if x < -9e4Initial program 88.6%
*-commutative88.6%
Simplified88.6%
Taylor expanded in z around 0 94.0%
Taylor expanded in y around inf 94.0%
Taylor expanded in z around 0 86.3%
associate-*r/86.3%
associate-*r*86.3%
neg-mul-186.3%
*-commutative86.3%
+-commutative86.3%
Simplified86.3%
Taylor expanded in z around 0 86.3%
mul-1-neg86.3%
associate-/l*94.0%
distribute-rgt-neg-in94.0%
associate-/r*94.0%
+-commutative94.0%
distribute-neg-frac294.0%
+-commutative94.0%
distribute-neg-in94.0%
metadata-eval94.0%
unsub-neg94.0%
Simplified94.0%
if -9e4 < x < 29.5Initial program 90.6%
*-commutative90.6%
Simplified90.6%
Taylor expanded in t around -inf 75.8%
mul-1-neg75.8%
unsub-neg75.8%
cancel-sign-sub-inv75.8%
metadata-eval75.8%
*-lft-identity75.8%
+-commutative75.8%
mul-1-neg75.8%
unsub-neg75.8%
Simplified75.8%
if 29.5 < x Initial program 84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in y around 0 93.1%
+-commutative93.1%
Simplified93.1%
Final simplification84.6%
(FPCore (x y z t) :precision binary64 (if (<= x -112000.0) 1.0 (if (<= x 6.5e+28) (/ (+ x (/ y t)) (+ x 1.0)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -112000.0) {
tmp = 1.0;
} else if (x <= 6.5e+28) {
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 <= (-112000.0d0)) then
tmp = 1.0d0
else if (x <= 6.5d+28) 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 <= -112000.0) {
tmp = 1.0;
} else if (x <= 6.5e+28) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -112000.0: tmp = 1.0 elif x <= 6.5e+28: tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -112000.0) tmp = 1.0; elseif (x <= 6.5e+28) 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 <= -112000.0) tmp = 1.0; elseif (x <= 6.5e+28) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -112000.0], 1.0, If[LessEqual[x, 6.5e+28], 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 -112000:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+28}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -112000 or 6.5000000000000001e28 < x Initial program 87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in y around 0 87.3%
mul-1-neg87.3%
+-commutative87.3%
sub-neg87.3%
*-commutative87.3%
*-commutative87.3%
div-sub87.3%
fma-neg87.3%
fma-define87.3%
*-commutative87.3%
fma-undefine87.3%
*-commutative87.3%
fma-neg87.3%
Simplified87.3%
Taylor expanded in y around inf 87.1%
*-commutative87.1%
sub-neg87.1%
*-commutative87.1%
*-rgt-identity87.1%
fma-undefine87.1%
*-rgt-identity87.1%
Simplified87.1%
Taylor expanded in x around inf 90.8%
if -112000 < x < 6.5000000000000001e28Initial program 89.5%
*-commutative89.5%
Simplified89.5%
Taylor expanded in z around inf 70.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.1e-218) (not (<= x 2.9e-81))) (/ x (+ x 1.0)) (/ y t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.1e-218) || !(x <= 2.9e-81)) {
tmp = x / (x + 1.0);
} else {
tmp = y / 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 <= (-3.1d-218)) .or. (.not. (x <= 2.9d-81))) then
tmp = x / (x + 1.0d0)
else
tmp = y / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.1e-218) || !(x <= 2.9e-81)) {
tmp = x / (x + 1.0);
} else {
tmp = y / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.1e-218) or not (x <= 2.9e-81): tmp = x / (x + 1.0) else: tmp = y / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.1e-218) || !(x <= 2.9e-81)) tmp = Float64(x / Float64(x + 1.0)); else tmp = Float64(y / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.1e-218) || ~((x <= 2.9e-81))) tmp = x / (x + 1.0); else tmp = y / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.1e-218], N[Not[LessEqual[x, 2.9e-81]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(y / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{-218} \lor \neg \left(x \leq 2.9 \cdot 10^{-81}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t}\\
\end{array}
\end{array}
if x < -3.09999999999999997e-218 or 2.89999999999999989e-81 < x Initial program 88.2%
*-commutative88.2%
Simplified88.2%
Taylor expanded in t around inf 74.5%
+-commutative74.5%
Simplified74.5%
if -3.09999999999999997e-218 < x < 2.89999999999999989e-81Initial program 89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in y around inf 54.8%
associate-/l*57.8%
+-commutative57.8%
Simplified57.8%
Taylor expanded in x around 0 54.9%
un-div-inv55.0%
*-un-lft-identity55.0%
associate-/r*55.0%
Applied egg-rr55.0%
Final simplification69.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.1e-218) (not (<= x 1.02e-115))) (/ x (+ x 1.0)) (* y (/ 1.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.1e-218) || !(x <= 1.02e-115)) {
tmp = x / (x + 1.0);
} else {
tmp = y * (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 <= (-3.1d-218)) .or. (.not. (x <= 1.02d-115))) then
tmp = x / (x + 1.0d0)
else
tmp = y * (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 <= -3.1e-218) || !(x <= 1.02e-115)) {
tmp = x / (x + 1.0);
} else {
tmp = y * (1.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.1e-218) or not (x <= 1.02e-115): tmp = x / (x + 1.0) else: tmp = y * (1.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.1e-218) || !(x <= 1.02e-115)) tmp = Float64(x / Float64(x + 1.0)); else tmp = Float64(y * Float64(1.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.1e-218) || ~((x <= 1.02e-115))) tmp = x / (x + 1.0); else tmp = y * (1.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.1e-218], N[Not[LessEqual[x, 1.02e-115]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{-218} \lor \neg \left(x \leq 1.02 \cdot 10^{-115}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{1}{t}\\
\end{array}
\end{array}
if x < -3.09999999999999997e-218 or 1.02e-115 < x Initial program 88.4%
*-commutative88.4%
Simplified88.4%
Taylor expanded in t around inf 73.5%
+-commutative73.5%
Simplified73.5%
if -3.09999999999999997e-218 < x < 1.02e-115Initial program 88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in y around inf 55.0%
associate-/l*58.2%
+-commutative58.2%
Simplified58.2%
Taylor expanded in x around 0 56.7%
Final simplification69.6%
(FPCore (x y z t) :precision binary64 (if (<= x -4.2e-47) 1.0 (if (<= x 1.5e-7) (* y (/ 1.0 t)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.2e-47) {
tmp = 1.0;
} else if (x <= 1.5e-7) {
tmp = y * (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 <= (-4.2d-47)) then
tmp = 1.0d0
else if (x <= 1.5d-7) then
tmp = y * (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 <= -4.2e-47) {
tmp = 1.0;
} else if (x <= 1.5e-7) {
tmp = y * (1.0 / t);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.2e-47: tmp = 1.0 elif x <= 1.5e-7: tmp = y * (1.0 / t) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.2e-47) tmp = 1.0; elseif (x <= 1.5e-7) tmp = Float64(y * Float64(1.0 / t)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4.2e-47) tmp = 1.0; elseif (x <= 1.5e-7) tmp = y * (1.0 / t); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.2e-47], 1.0, If[LessEqual[x, 1.5e-7], N[(y * N[(1.0 / t), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{-47}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-7}:\\
\;\;\;\;y \cdot \frac{1}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -4.2000000000000001e-47 or 1.4999999999999999e-7 < x Initial program 85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in y around 0 85.2%
mul-1-neg85.2%
+-commutative85.2%
sub-neg85.2%
*-commutative85.2%
*-commutative85.2%
div-sub85.2%
fma-neg85.2%
fma-define85.2%
*-commutative85.2%
fma-undefine85.2%
*-commutative85.2%
fma-neg85.2%
Simplified85.2%
Taylor expanded in y around inf 82.2%
*-commutative82.2%
sub-neg82.2%
*-commutative82.2%
*-rgt-identity82.2%
fma-undefine82.2%
*-rgt-identity82.2%
Simplified82.2%
Taylor expanded in x around inf 84.8%
if -4.2000000000000001e-47 < x < 1.4999999999999999e-7Initial program 92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in y around inf 49.7%
associate-/l*51.4%
+-commutative51.4%
Simplified51.4%
Taylor expanded in x around 0 44.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 88.4%
*-commutative88.4%
Simplified88.4%
Taylor expanded in y around 0 88.4%
mul-1-neg88.4%
+-commutative88.4%
sub-neg88.4%
*-commutative88.4%
*-commutative88.4%
div-sub88.4%
fma-neg88.4%
fma-define88.4%
*-commutative88.4%
fma-undefine88.4%
*-commutative88.4%
fma-neg88.4%
Simplified88.4%
Taylor expanded in y around inf 79.2%
*-commutative79.2%
sub-neg79.2%
*-commutative79.2%
*-rgt-identity79.2%
fma-undefine79.2%
*-rgt-identity79.2%
Simplified79.2%
Taylor expanded in x around inf 52.6%
(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 2024100
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))