
(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 11 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 (/ y (+ x 1.0)))
(t_2 (/ (- x (/ (- (* y z) x) (- x (* z t)))) (+ x 1.0)))
(t_3 (- (* z t) x)))
(if (<= t_2 -2e+187)
(* (/ z t_3) t_1)
(if (<= t_2 1e+211)
(/ (+ x (pow (/ t_3 (fma y z (- x))) -1.0)) (+ x 1.0))
(+ (/ x (+ x 1.0)) (/ (- t_1 (/ x (* z (+ x 1.0)))) t))))))
double code(double x, double y, double z, double t) {
double t_1 = y / (x + 1.0);
double t_2 = (x - (((y * z) - x) / (x - (z * t)))) / (x + 1.0);
double t_3 = (z * t) - x;
double tmp;
if (t_2 <= -2e+187) {
tmp = (z / t_3) * t_1;
} else if (t_2 <= 1e+211) {
tmp = (x + pow((t_3 / fma(y, z, -x)), -1.0)) / (x + 1.0);
} else {
tmp = (x / (x + 1.0)) + ((t_1 - (x / (z * (x + 1.0)))) / t);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(y / Float64(x + 1.0)) t_2 = Float64(Float64(x - Float64(Float64(Float64(y * z) - x) / Float64(x - Float64(z * t)))) / Float64(x + 1.0)) t_3 = Float64(Float64(z * t) - x) tmp = 0.0 if (t_2 <= -2e+187) tmp = Float64(Float64(z / t_3) * t_1); elseif (t_2 <= 1e+211) tmp = Float64(Float64(x + (Float64(t_3 / fma(y, z, Float64(-x))) ^ -1.0)) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(Float64(t_1 - Float64(x / Float64(z * Float64(x + 1.0)))) / t)); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x - N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+187], N[(N[(z / t$95$3), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 1e+211], N[(N[(x + N[Power[N[(t$95$3 / N[(y * z + (-x)), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[(x / N[(z * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{x + 1}\\
t_2 := \frac{x - \frac{y \cdot z - x}{x - z \cdot t}}{x + 1}\\
t_3 := z \cdot t - x\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+187}:\\
\;\;\;\;\frac{z}{t\_3} \cdot t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+211}:\\
\;\;\;\;\frac{x + {\left(\frac{t\_3}{\mathsf{fma}\left(y, z, -x\right)}\right)}^{-1}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1} + \frac{t\_1 - \frac{x}{z \cdot \left(x + 1\right)}}{t}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < -1.99999999999999981e187Initial program 38.0%
*-commutative38.0%
Simplified38.0%
clear-num37.7%
inv-pow37.7%
fma-neg37.7%
Applied egg-rr37.7%
Taylor expanded in y around inf 37.2%
times-frac78.7%
*-commutative78.7%
Simplified78.7%
if -1.99999999999999981e187 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 9.9999999999999996e210Initial program 98.9%
*-commutative98.9%
Simplified98.9%
clear-num99.0%
inv-pow99.0%
fma-neg99.0%
Applied egg-rr99.0%
if 9.9999999999999996e210 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 14.1%
*-commutative14.1%
Simplified14.1%
Taylor expanded in t around -inf 95.7%
+-commutative95.7%
mul-1-neg95.7%
unsub-neg95.7%
+-commutative95.7%
Simplified95.7%
Final simplification97.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (- x (/ (- (* y z) x) (- x (* z t)))) (+ x 1.0)))
(t_2 (/ y (+ x 1.0))))
(if (<= t_1 -5e+289)
(* (/ z (- (* z t) x)) t_2)
(if (<= t_1 1e+211)
t_1
(+ (/ x (+ x 1.0)) (/ (- t_2 (/ x (* z (+ x 1.0)))) t))))))
double code(double x, double y, double z, double t) {
double t_1 = (x - (((y * z) - x) / (x - (z * t)))) / (x + 1.0);
double t_2 = y / (x + 1.0);
double tmp;
if (t_1 <= -5e+289) {
tmp = (z / ((z * t) - x)) * t_2;
} else if (t_1 <= 1e+211) {
tmp = t_1;
} else {
tmp = (x / (x + 1.0)) + ((t_2 - (x / (z * (x + 1.0)))) / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x - (((y * z) - x) / (x - (z * t)))) / (x + 1.0d0)
t_2 = y / (x + 1.0d0)
if (t_1 <= (-5d+289)) then
tmp = (z / ((z * t) - x)) * t_2
else if (t_1 <= 1d+211) then
tmp = t_1
else
tmp = (x / (x + 1.0d0)) + ((t_2 - (x / (z * (x + 1.0d0)))) / t)
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) / (x - (z * t)))) / (x + 1.0);
double t_2 = y / (x + 1.0);
double tmp;
if (t_1 <= -5e+289) {
tmp = (z / ((z * t) - x)) * t_2;
} else if (t_1 <= 1e+211) {
tmp = t_1;
} else {
tmp = (x / (x + 1.0)) + ((t_2 - (x / (z * (x + 1.0)))) / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - (((y * z) - x) / (x - (z * t)))) / (x + 1.0) t_2 = y / (x + 1.0) tmp = 0 if t_1 <= -5e+289: tmp = (z / ((z * t) - x)) * t_2 elif t_1 <= 1e+211: tmp = t_1 else: tmp = (x / (x + 1.0)) + ((t_2 - (x / (z * (x + 1.0)))) / t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - Float64(Float64(Float64(y * z) - x) / Float64(x - Float64(z * t)))) / Float64(x + 1.0)) t_2 = Float64(y / Float64(x + 1.0)) tmp = 0.0 if (t_1 <= -5e+289) tmp = Float64(Float64(z / Float64(Float64(z * t) - x)) * t_2); elseif (t_1 <= 1e+211) tmp = t_1; else tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(Float64(t_2 - Float64(x / Float64(z * Float64(x + 1.0)))) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - (((y * z) - x) / (x - (z * t)))) / (x + 1.0); t_2 = y / (x + 1.0); tmp = 0.0; if (t_1 <= -5e+289) tmp = (z / ((z * t) - x)) * t_2; elseif (t_1 <= 1e+211) tmp = t_1; else tmp = (x / (x + 1.0)) + ((t_2 - (x / (z * (x + 1.0)))) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+289], N[(N[(z / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$1, 1e+211], t$95$1, N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[(x / N[(z * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - \frac{y \cdot z - x}{x - z \cdot t}}{x + 1}\\
t_2 := \frac{y}{x + 1}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+289}:\\
\;\;\;\;\frac{z}{z \cdot t - x} \cdot t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+211}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1} + \frac{t\_2 - \frac{x}{z \cdot \left(x + 1\right)}}{t}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < -5.00000000000000031e289Initial program 13.2%
*-commutative13.2%
Simplified13.2%
clear-num13.2%
inv-pow13.2%
fma-neg13.2%
Applied egg-rr13.2%
Taylor expanded in y around inf 12.0%
times-frac70.4%
*-commutative70.4%
Simplified70.4%
if -5.00000000000000031e289 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 9.9999999999999996e210Initial program 99.0%
if 9.9999999999999996e210 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 14.1%
*-commutative14.1%
Simplified14.1%
Taylor expanded in t around -inf 95.7%
+-commutative95.7%
mul-1-neg95.7%
unsub-neg95.7%
+-commutative95.7%
Simplified95.7%
Final simplification97.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (- x (/ (- (* y z) x) (- x (* z t)))) (+ x 1.0))))
(if (<= t_1 -5e+289)
(* (/ z (- (* z t) x)) (/ y (+ x 1.0)))
(if (<= t_1 1e+211) t_1 (/ (+ x (/ y t)) (+ x 1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (x - (((y * z) - x) / (x - (z * t)))) / (x + 1.0);
double tmp;
if (t_1 <= -5e+289) {
tmp = (z / ((z * t) - x)) * (y / (x + 1.0));
} else if (t_1 <= 1e+211) {
tmp = t_1;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x - (((y * z) - x) / (x - (z * t)))) / (x + 1.0d0)
if (t_1 <= (-5d+289)) then
tmp = (z / ((z * t) - x)) * (y / (x + 1.0d0))
else if (t_1 <= 1d+211) then
tmp = t_1
else
tmp = (x + (y / t)) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x - (((y * z) - x) / (x - (z * t)))) / (x + 1.0);
double tmp;
if (t_1 <= -5e+289) {
tmp = (z / ((z * t) - x)) * (y / (x + 1.0));
} else if (t_1 <= 1e+211) {
tmp = t_1;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - (((y * z) - x) / (x - (z * t)))) / (x + 1.0) tmp = 0 if t_1 <= -5e+289: tmp = (z / ((z * t) - x)) * (y / (x + 1.0)) elif t_1 <= 1e+211: tmp = t_1 else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - Float64(Float64(Float64(y * z) - x) / Float64(x - Float64(z * t)))) / Float64(x + 1.0)) tmp = 0.0 if (t_1 <= -5e+289) tmp = Float64(Float64(z / Float64(Float64(z * t) - x)) * Float64(y / Float64(x + 1.0))); elseif (t_1 <= 1e+211) tmp = t_1; else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - (((y * z) - x) / (x - (z * t)))) / (x + 1.0); tmp = 0.0; if (t_1 <= -5e+289) tmp = (z / ((z * t) - x)) * (y / (x + 1.0)); elseif (t_1 <= 1e+211) tmp = t_1; else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+289], N[(N[(z / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+211], t$95$1, N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - \frac{y \cdot z - x}{x - z \cdot t}}{x + 1}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+289}:\\
\;\;\;\;\frac{z}{z \cdot t - x} \cdot \frac{y}{x + 1}\\
\mathbf{elif}\;t\_1 \leq 10^{+211}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < -5.00000000000000031e289Initial program 13.2%
*-commutative13.2%
Simplified13.2%
clear-num13.2%
inv-pow13.2%
fma-neg13.2%
Applied egg-rr13.2%
Taylor expanded in y around inf 12.0%
times-frac70.4%
*-commutative70.4%
Simplified70.4%
if -5.00000000000000031e289 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 9.9999999999999996e210Initial program 99.0%
if 9.9999999999999996e210 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 14.1%
*-commutative14.1%
Simplified14.1%
Taylor expanded in z around inf 91.7%
Final simplification97.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (* (* y z) (/ -1.0 (- x (* z t))))) (+ x 1.0))))
(if (<= z -2.5e+73)
(- (/ x (+ x 1.0)) (/ (/ y t) (- -1.0 x)))
(if (<= z -9e-117)
t_1
(if (<= z 3.2e-154)
(/ (- (+ x 1.0) (* y (/ z x))) (+ x 1.0))
(if (<= z 1.62e+115)
t_1
(/ (+ x (- (/ y t) (/ (/ x t) z))) (+ x 1.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + ((y * z) * (-1.0 / (x - (z * t))))) / (x + 1.0);
double tmp;
if (z <= -2.5e+73) {
tmp = (x / (x + 1.0)) - ((y / t) / (-1.0 - x));
} else if (z <= -9e-117) {
tmp = t_1;
} else if (z <= 3.2e-154) {
tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0);
} else if (z <= 1.62e+115) {
tmp = t_1;
} else {
tmp = (x + ((y / t) - ((x / t) / 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) :: t_1
real(8) :: tmp
t_1 = (x + ((y * z) * ((-1.0d0) / (x - (z * t))))) / (x + 1.0d0)
if (z <= (-2.5d+73)) then
tmp = (x / (x + 1.0d0)) - ((y / t) / ((-1.0d0) - x))
else if (z <= (-9d-117)) then
tmp = t_1
else if (z <= 3.2d-154) then
tmp = ((x + 1.0d0) - (y * (z / x))) / (x + 1.0d0)
else if (z <= 1.62d+115) then
tmp = t_1
else
tmp = (x + ((y / t) - ((x / t) / z))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + ((y * z) * (-1.0 / (x - (z * t))))) / (x + 1.0);
double tmp;
if (z <= -2.5e+73) {
tmp = (x / (x + 1.0)) - ((y / t) / (-1.0 - x));
} else if (z <= -9e-117) {
tmp = t_1;
} else if (z <= 3.2e-154) {
tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0);
} else if (z <= 1.62e+115) {
tmp = t_1;
} else {
tmp = (x + ((y / t) - ((x / t) / z))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + ((y * z) * (-1.0 / (x - (z * t))))) / (x + 1.0) tmp = 0 if z <= -2.5e+73: tmp = (x / (x + 1.0)) - ((y / t) / (-1.0 - x)) elif z <= -9e-117: tmp = t_1 elif z <= 3.2e-154: tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0) elif z <= 1.62e+115: tmp = t_1 else: tmp = (x + ((y / t) - ((x / t) / z))) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(Float64(y * z) * Float64(-1.0 / Float64(x - Float64(z * t))))) / Float64(x + 1.0)) tmp = 0.0 if (z <= -2.5e+73) tmp = Float64(Float64(x / Float64(x + 1.0)) - Float64(Float64(y / t) / Float64(-1.0 - x))); elseif (z <= -9e-117) tmp = t_1; elseif (z <= 3.2e-154) tmp = Float64(Float64(Float64(x + 1.0) - Float64(y * Float64(z / x))) / Float64(x + 1.0)); elseif (z <= 1.62e+115) tmp = t_1; else tmp = Float64(Float64(x + Float64(Float64(y / t) - Float64(Float64(x / t) / z))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + ((y * z) * (-1.0 / (x - (z * t))))) / (x + 1.0); tmp = 0.0; if (z <= -2.5e+73) tmp = (x / (x + 1.0)) - ((y / t) / (-1.0 - x)); elseif (z <= -9e-117) tmp = t_1; elseif (z <= 3.2e-154) tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0); elseif (z <= 1.62e+115) tmp = t_1; else tmp = (x + ((y / t) - ((x / t) / z))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] * N[(-1.0 / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.5e+73], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(y / t), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9e-117], t$95$1, If[LessEqual[z, 3.2e-154], N[(N[(N[(x + 1.0), $MachinePrecision] - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.62e+115], t$95$1, N[(N[(x + N[(N[(y / t), $MachinePrecision] - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \left(y \cdot z\right) \cdot \frac{-1}{x - z \cdot t}}{x + 1}\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{+73}:\\
\;\;\;\;\frac{x}{x + 1} - \frac{\frac{y}{t}}{-1 - x}\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-117}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-154}:\\
\;\;\;\;\frac{\left(x + 1\right) - y \cdot \frac{z}{x}}{x + 1}\\
\mathbf{elif}\;z \leq 1.62 \cdot 10^{+115}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \left(\frac{y}{t} - \frac{\frac{x}{t}}{z}\right)}{x + 1}\\
\end{array}
\end{array}
if z < -2.49999999999999988e73Initial program 62.0%
*-commutative62.0%
Simplified62.0%
Taylor expanded in t around -inf 88.1%
mul-1-neg88.1%
unsub-neg88.1%
sub-neg88.1%
mul-1-neg88.1%
remove-double-neg88.1%
+-commutative88.1%
mul-1-neg88.1%
unsub-neg88.1%
Simplified88.1%
div-sub88.1%
Applied egg-rr88.1%
Taylor expanded in z around inf 88.1%
mul-1-neg88.1%
associate-/r*88.1%
+-commutative88.1%
distribute-neg-frac288.1%
neg-sub088.1%
+-commutative88.1%
associate--r+88.1%
metadata-eval88.1%
Simplified88.1%
if -2.49999999999999988e73 < z < -8.99999999999999939e-117 or 3.20000000000000005e-154 < z < 1.62e115Initial program 97.9%
*-commutative97.9%
Simplified97.9%
div-inv97.8%
fma-neg97.8%
Applied egg-rr97.8%
Taylor expanded in y around inf 89.2%
*-commutative89.2%
Simplified89.2%
if -8.99999999999999939e-117 < z < 3.20000000000000005e-154Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 92.2%
associate-+r+92.2%
mul-1-neg92.2%
unsub-neg92.2%
+-commutative92.2%
associate-/l*92.2%
+-commutative92.2%
Simplified92.2%
if 1.62e115 < z Initial program 71.5%
*-commutative71.5%
Simplified71.5%
Taylor expanded in t around inf 92.0%
associate--l+92.0%
associate-/r*92.0%
Simplified92.0%
Final simplification90.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -4.5e-50)
(- (/ x (+ x 1.0)) (/ (/ y t) (- -1.0 x)))
(if (<= z 3.1e-97)
(/ (- (+ x 1.0) (* y (/ z x))) (+ x 1.0))
(/ (+ x (/ y t)) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.5e-50) {
tmp = (x / (x + 1.0)) - ((y / t) / (-1.0 - x));
} else if (z <= 3.1e-97) {
tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0);
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-4.5d-50)) then
tmp = (x / (x + 1.0d0)) - ((y / t) / ((-1.0d0) - x))
else if (z <= 3.1d-97) then
tmp = ((x + 1.0d0) - (y * (z / x))) / (x + 1.0d0)
else
tmp = (x + (y / t)) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.5e-50) {
tmp = (x / (x + 1.0)) - ((y / t) / (-1.0 - x));
} else if (z <= 3.1e-97) {
tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0);
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.5e-50: tmp = (x / (x + 1.0)) - ((y / t) / (-1.0 - x)) elif z <= 3.1e-97: tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0) else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.5e-50) tmp = Float64(Float64(x / Float64(x + 1.0)) - Float64(Float64(y / t) / Float64(-1.0 - x))); elseif (z <= 3.1e-97) tmp = Float64(Float64(Float64(x + 1.0) - Float64(y * Float64(z / x))) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.5e-50) tmp = (x / (x + 1.0)) - ((y / t) / (-1.0 - x)); elseif (z <= 3.1e-97) tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0); else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.5e-50], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(y / t), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e-97], N[(N[(N[(x + 1.0), $MachinePrecision] - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-50}:\\
\;\;\;\;\frac{x}{x + 1} - \frac{\frac{y}{t}}{-1 - x}\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-97}:\\
\;\;\;\;\frac{\left(x + 1\right) - y \cdot \frac{z}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if z < -4.49999999999999962e-50Initial program 75.3%
*-commutative75.3%
Simplified75.3%
Taylor expanded in t around -inf 80.5%
mul-1-neg80.5%
unsub-neg80.5%
sub-neg80.5%
mul-1-neg80.5%
remove-double-neg80.5%
+-commutative80.5%
mul-1-neg80.5%
unsub-neg80.5%
Simplified80.5%
div-sub80.5%
Applied egg-rr80.5%
Taylor expanded in z around inf 86.0%
mul-1-neg86.0%
associate-/r*86.0%
+-commutative86.0%
distribute-neg-frac286.0%
neg-sub086.0%
+-commutative86.0%
associate--r+86.0%
metadata-eval86.0%
Simplified86.0%
if -4.49999999999999962e-50 < z < 3.10000000000000002e-97Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 88.8%
associate-+r+88.8%
mul-1-neg88.8%
unsub-neg88.8%
+-commutative88.8%
associate-/l*88.7%
+-commutative88.7%
Simplified88.7%
if 3.10000000000000002e-97 < z Initial program 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in z around inf 82.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.26e-51)
(- (/ x (+ x 1.0)) (/ (/ y t) (- -1.0 x)))
(if (<= z 8e-76)
(/ (+ x (/ x (- x (* z t)))) (+ x 1.0))
(/ (+ x (/ y t)) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.26e-51) {
tmp = (x / (x + 1.0)) - ((y / t) / (-1.0 - x));
} else if (z <= 8e-76) {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.26d-51)) then
tmp = (x / (x + 1.0d0)) - ((y / t) / ((-1.0d0) - x))
else if (z <= 8d-76) then
tmp = (x + (x / (x - (z * t)))) / (x + 1.0d0)
else
tmp = (x + (y / t)) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.26e-51) {
tmp = (x / (x + 1.0)) - ((y / t) / (-1.0 - x));
} else if (z <= 8e-76) {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.26e-51: tmp = (x / (x + 1.0)) - ((y / t) / (-1.0 - x)) elif z <= 8e-76: tmp = (x + (x / (x - (z * t)))) / (x + 1.0) else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.26e-51) tmp = Float64(Float64(x / Float64(x + 1.0)) - Float64(Float64(y / t) / Float64(-1.0 - x))); elseif (z <= 8e-76) tmp = Float64(Float64(x + Float64(x / Float64(x - Float64(z * t)))) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.26e-51) tmp = (x / (x + 1.0)) - ((y / t) / (-1.0 - x)); elseif (z <= 8e-76) tmp = (x + (x / (x - (z * t)))) / (x + 1.0); else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.26e-51], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(y / t), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e-76], N[(N[(x + N[(x / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.26 \cdot 10^{-51}:\\
\;\;\;\;\frac{x}{x + 1} - \frac{\frac{y}{t}}{-1 - x}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-76}:\\
\;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if z < -1.2600000000000001e-51Initial program 75.6%
*-commutative75.6%
Simplified75.6%
Taylor expanded in t around -inf 79.7%
mul-1-neg79.7%
unsub-neg79.7%
sub-neg79.7%
mul-1-neg79.7%
remove-double-neg79.7%
+-commutative79.7%
mul-1-neg79.7%
unsub-neg79.7%
Simplified79.7%
div-sub79.7%
Applied egg-rr79.7%
Taylor expanded in z around inf 85.1%
mul-1-neg85.1%
associate-/r*85.1%
+-commutative85.1%
distribute-neg-frac285.1%
neg-sub085.1%
+-commutative85.1%
associate--r+85.1%
metadata-eval85.1%
Simplified85.1%
if -1.2600000000000001e-51 < z < 7.99999999999999942e-76Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 83.1%
if 7.99999999999999942e-76 < z Initial program 86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in z around inf 83.1%
Final simplification83.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -7.5e-57) (not (<= z 1.9e-99))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (+ x 1.0) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.5e-57) || !(z <= 1.9e-99)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + 1.0) / (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 <= (-7.5d-57)) .or. (.not. (z <= 1.9d-99))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = (x + 1.0d0) / (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 <= -7.5e-57) || !(z <= 1.9e-99)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + 1.0) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -7.5e-57) or not (z <= 1.9e-99): tmp = (x + (y / t)) / (x + 1.0) else: tmp = (x + 1.0) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -7.5e-57) || !(z <= 1.9e-99)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(x + 1.0) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -7.5e-57) || ~((z <= 1.9e-99))) tmp = (x + (y / t)) / (x + 1.0); else tmp = (x + 1.0) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.5e-57], N[Not[LessEqual[z, 1.9e-99]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + 1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-57} \lor \neg \left(z \leq 1.9 \cdot 10^{-99}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 1}{x + 1}\\
\end{array}
\end{array}
if z < -7.49999999999999973e-57 or 1.8999999999999998e-99 < z Initial program 80.9%
*-commutative80.9%
Simplified80.9%
Taylor expanded in z around inf 83.8%
if -7.49999999999999973e-57 < z < 1.8999999999999998e-99Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 76.9%
Final simplification81.2%
(FPCore (x y z t) :precision binary64 (if (<= z -1.7e-54) (- (/ x (+ x 1.0)) (/ (/ y t) (- -1.0 x))) (if (<= z 1.14e-97) (/ (+ x 1.0) (+ x 1.0)) (/ (+ x (/ y t)) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.7e-54) {
tmp = (x / (x + 1.0)) - ((y / t) / (-1.0 - x));
} else if (z <= 1.14e-97) {
tmp = (x + 1.0) / (x + 1.0);
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.7d-54)) then
tmp = (x / (x + 1.0d0)) - ((y / t) / ((-1.0d0) - x))
else if (z <= 1.14d-97) then
tmp = (x + 1.0d0) / (x + 1.0d0)
else
tmp = (x + (y / t)) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.7e-54) {
tmp = (x / (x + 1.0)) - ((y / t) / (-1.0 - x));
} else if (z <= 1.14e-97) {
tmp = (x + 1.0) / (x + 1.0);
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.7e-54: tmp = (x / (x + 1.0)) - ((y / t) / (-1.0 - x)) elif z <= 1.14e-97: tmp = (x + 1.0) / (x + 1.0) else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.7e-54) tmp = Float64(Float64(x / Float64(x + 1.0)) - Float64(Float64(y / t) / Float64(-1.0 - x))); elseif (z <= 1.14e-97) tmp = Float64(Float64(x + 1.0) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.7e-54) tmp = (x / (x + 1.0)) - ((y / t) / (-1.0 - x)); elseif (z <= 1.14e-97) tmp = (x + 1.0) / (x + 1.0); else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.7e-54], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(y / t), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.14e-97], N[(N[(x + 1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-54}:\\
\;\;\;\;\frac{x}{x + 1} - \frac{\frac{y}{t}}{-1 - x}\\
\mathbf{elif}\;z \leq 1.14 \cdot 10^{-97}:\\
\;\;\;\;\frac{x + 1}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if z < -1.69999999999999994e-54Initial program 75.6%
*-commutative75.6%
Simplified75.6%
Taylor expanded in t around -inf 79.7%
mul-1-neg79.7%
unsub-neg79.7%
sub-neg79.7%
mul-1-neg79.7%
remove-double-neg79.7%
+-commutative79.7%
mul-1-neg79.7%
unsub-neg79.7%
Simplified79.7%
div-sub79.7%
Applied egg-rr79.7%
Taylor expanded in z around inf 85.1%
mul-1-neg85.1%
associate-/r*85.1%
+-commutative85.1%
distribute-neg-frac285.1%
neg-sub085.1%
+-commutative85.1%
associate--r+85.1%
metadata-eval85.1%
Simplified85.1%
if -1.69999999999999994e-54 < z < 1.14e-97Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 76.9%
if 1.14e-97 < z Initial program 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in z around inf 82.1%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.6e-158) (not (<= x 2.5e-53))) (/ (+ x 1.0) (+ x 1.0)) (/ y t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.6e-158) || !(x <= 2.5e-53)) {
tmp = (x + 1.0) / (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.6d-158)) .or. (.not. (x <= 2.5d-53))) then
tmp = (x + 1.0d0) / (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.6e-158) || !(x <= 2.5e-53)) {
tmp = (x + 1.0) / (x + 1.0);
} else {
tmp = y / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.6e-158) or not (x <= 2.5e-53): tmp = (x + 1.0) / (x + 1.0) else: tmp = y / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.6e-158) || !(x <= 2.5e-53)) tmp = Float64(Float64(x + 1.0) / 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.6e-158) || ~((x <= 2.5e-53))) tmp = (x + 1.0) / (x + 1.0); else tmp = y / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.6e-158], N[Not[LessEqual[x, 2.5e-53]], $MachinePrecision]], N[(N[(x + 1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(y / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{-158} \lor \neg \left(x \leq 2.5 \cdot 10^{-53}\right):\\
\;\;\;\;\frac{x + 1}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t}\\
\end{array}
\end{array}
if x < -3.59999999999999991e-158 or 2.5e-53 < x Initial program 88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in z around 0 78.2%
if -3.59999999999999991e-158 < x < 2.5e-53Initial program 87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in t around -inf 74.6%
mul-1-neg74.6%
unsub-neg74.6%
sub-neg74.6%
mul-1-neg74.6%
remove-double-neg74.6%
+-commutative74.6%
mul-1-neg74.6%
unsub-neg74.6%
Simplified74.6%
Taylor expanded in x around 0 56.4%
Final simplification72.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -9.5e-54) (not (<= x 1.45e-54))) (/ x (+ x 1.0)) (/ y t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -9.5e-54) || !(x <= 1.45e-54)) {
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 <= (-9.5d-54)) .or. (.not. (x <= 1.45d-54))) 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 <= -9.5e-54) || !(x <= 1.45e-54)) {
tmp = x / (x + 1.0);
} else {
tmp = y / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -9.5e-54) or not (x <= 1.45e-54): tmp = x / (x + 1.0) else: tmp = y / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -9.5e-54) || !(x <= 1.45e-54)) 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 <= -9.5e-54) || ~((x <= 1.45e-54))) tmp = x / (x + 1.0); else tmp = y / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -9.5e-54], N[Not[LessEqual[x, 1.45e-54]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(y / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{-54} \lor \neg \left(x \leq 1.45 \cdot 10^{-54}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t}\\
\end{array}
\end{array}
if x < -9.4999999999999994e-54 or 1.45000000000000007e-54 < x Initial program 86.9%
*-commutative86.9%
Simplified86.9%
Taylor expanded in t around inf 81.2%
+-commutative81.2%
Simplified81.2%
if -9.4999999999999994e-54 < x < 1.45000000000000007e-54Initial program 89.9%
*-commutative89.9%
Simplified89.9%
Taylor expanded in t around -inf 69.4%
mul-1-neg69.4%
unsub-neg69.4%
sub-neg69.4%
mul-1-neg69.4%
remove-double-neg69.4%
+-commutative69.4%
mul-1-neg69.4%
unsub-neg69.4%
Simplified69.4%
Taylor expanded in x around 0 49.0%
Final simplification69.8%
(FPCore (x y z t) :precision binary64 (/ y t))
double code(double x, double y, double z, double t) {
return y / t;
}
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 = y / t
end function
public static double code(double x, double y, double z, double t) {
return y / t;
}
def code(x, y, z, t): return y / t
function code(x, y, z, t) return Float64(y / t) end
function tmp = code(x, y, z, t) tmp = y / t; end
code[x_, y_, z_, t_] := N[(y / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{t}
\end{array}
Initial program 88.0%
*-commutative88.0%
Simplified88.0%
Taylor expanded in t around -inf 54.0%
mul-1-neg54.0%
unsub-neg54.0%
sub-neg54.0%
mul-1-neg54.0%
remove-double-neg54.0%
+-commutative54.0%
mul-1-neg54.0%
unsub-neg54.0%
Simplified54.0%
Taylor expanded in x around 0 20.9%
(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 2024111
(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)))