
(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 (- (* z t) x)) (t_2 (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0))))
(if (<= t_2 (- INFINITY))
(/ (fma z (/ y t_1) x) (+ x 1.0))
(if (<= t_2 2e+294)
t_2
(-
(+ (/ y (* t (+ x 1.0))) (/ x (+ x 1.0)))
(/ x (* t (* z (+ x 1.0)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = fma(z, (y / t_1), x) / (x + 1.0);
} else if (t_2 <= 2e+294) {
tmp = t_2;
} else {
tmp = ((y / (t * (x + 1.0))) + (x / (x + 1.0))) - (x / (t * (z * (x + 1.0))));
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) t_2 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_1)) / Float64(x + 1.0)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(fma(z, Float64(y / t_1), x) / Float64(x + 1.0)); elseif (t_2 <= 2e+294) tmp = t_2; else tmp = Float64(Float64(Float64(y / Float64(t * Float64(x + 1.0))) + Float64(x / Float64(x + 1.0))) - Float64(x / Float64(t * Float64(z * Float64(x + 1.0))))); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(z * N[(y / t$95$1), $MachinePrecision] + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+294], t$95$2, N[(N[(N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[(t * N[(z * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
t_2 := \frac{x + \frac{y \cdot z - x}{t_1}}{x + 1}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \frac{y}{t_1}, x\right)}{x + 1}\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+294}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y}{t \cdot \left(x + 1\right)} + \frac{x}{x + 1}\right) - \frac{x}{t \cdot \left(z \cdot \left(x + 1\right)\right)}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -inf.0Initial program 37.1%
*-commutative37.1%
Simplified37.1%
add-cube-cbrt37.1%
pow337.1%
fma-neg37.1%
Applied egg-rr37.1%
Taylor expanded in x around 0 35.6%
unpow1/337.1%
*-commutative37.1%
Simplified37.1%
expm1-log1p-u0.0%
expm1-udef0.0%
Applied egg-rr11.1%
expm1-def11.1%
expm1-log1p89.4%
+-commutative89.4%
associate-*r/37.1%
*-commutative37.1%
associate-*r/89.4%
*-rgt-identity89.4%
associate-*r/89.4%
fma-def89.4%
associate-*r/89.4%
*-rgt-identity89.4%
fma-neg89.4%
Simplified89.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 2.00000000000000013e294Initial program 99.4%
if 2.00000000000000013e294 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 21.2%
*-commutative21.2%
Simplified21.2%
Taylor expanded in t around inf 86.4%
Final simplification98.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x)) (t_2 (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0))))
(if (<= t_2 -5e+117)
(/ 1.0 (* (/ (+ x 1.0) y) (/ t_1 z)))
(if (<= t_2 2e+294)
t_2
(-
(+ (/ y (* t (+ x 1.0))) (/ x (+ x 1.0)))
(/ x (* t (* z (+ x 1.0)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -5e+117) {
tmp = 1.0 / (((x + 1.0) / y) * (t_1 / z));
} else if (t_2 <= 2e+294) {
tmp = t_2;
} else {
tmp = ((y / (t * (x + 1.0))) + (x / (x + 1.0))) - (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) :: t_2
real(8) :: tmp
t_1 = (z * t) - x
t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0d0)
if (t_2 <= (-5d+117)) then
tmp = 1.0d0 / (((x + 1.0d0) / y) * (t_1 / z))
else if (t_2 <= 2d+294) then
tmp = t_2
else
tmp = ((y / (t * (x + 1.0d0))) + (x / (x + 1.0d0))) - (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 = (z * t) - x;
double t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -5e+117) {
tmp = 1.0 / (((x + 1.0) / y) * (t_1 / z));
} else if (t_2 <= 2e+294) {
tmp = t_2;
} else {
tmp = ((y / (t * (x + 1.0))) + (x / (x + 1.0))) - (x / (t * (z * (x + 1.0))));
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * t) - x t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0) tmp = 0 if t_2 <= -5e+117: tmp = 1.0 / (((x + 1.0) / y) * (t_1 / z)) elif t_2 <= 2e+294: tmp = t_2 else: tmp = ((y / (t * (x + 1.0))) + (x / (x + 1.0))) - (x / (t * (z * (x + 1.0)))) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) t_2 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_1)) / Float64(x + 1.0)) tmp = 0.0 if (t_2 <= -5e+117) tmp = Float64(1.0 / Float64(Float64(Float64(x + 1.0) / y) * Float64(t_1 / z))); elseif (t_2 <= 2e+294) tmp = t_2; else tmp = Float64(Float64(Float64(y / Float64(t * Float64(x + 1.0))) + Float64(x / Float64(x + 1.0))) - Float64(x / Float64(t * Float64(z * Float64(x + 1.0))))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * t) - x; t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0); tmp = 0.0; if (t_2 <= -5e+117) tmp = 1.0 / (((x + 1.0) / y) * (t_1 / z)); elseif (t_2 <= 2e+294) tmp = t_2; else tmp = ((y / (t * (x + 1.0))) + (x / (x + 1.0))) - (x / (t * (z * (x + 1.0)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+117], N[(1.0 / N[(N[(N[(x + 1.0), $MachinePrecision] / y), $MachinePrecision] * N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+294], t$95$2, N[(N[(N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[(t * N[(z * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
t_2 := \frac{x + \frac{y \cdot z - x}{t_1}}{x + 1}\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+117}:\\
\;\;\;\;\frac{1}{\frac{x + 1}{y} \cdot \frac{t_1}{z}}\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+294}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y}{t \cdot \left(x + 1\right)} + \frac{x}{x + 1}\right) - \frac{x}{t \cdot \left(z \cdot \left(x + 1\right)\right)}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -4.99999999999999983e117Initial program 69.9%
*-commutative69.9%
Simplified69.9%
Taylor expanded in y around inf 69.9%
clear-num70.0%
inv-pow70.0%
+-commutative70.0%
times-frac94.6%
*-commutative94.6%
fma-neg94.6%
Applied egg-rr94.6%
unpow-194.6%
fma-neg94.6%
*-commutative94.6%
*-commutative94.6%
Simplified94.6%
if -4.99999999999999983e117 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 2.00000000000000013e294Initial program 99.4%
if 2.00000000000000013e294 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 21.2%
*-commutative21.2%
Simplified21.2%
Taylor expanded in t around inf 86.4%
Final simplification98.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x)) (t_2 (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0))))
(if (<= t_2 -5e+117)
(/ 1.0 (* (/ (+ x 1.0) y) (/ t_1 z)))
(if (<= t_2 2e+294) t_2 (/ (+ x (/ y t)) (+ x 1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -5e+117) {
tmp = 1.0 / (((x + 1.0) / y) * (t_1 / z));
} else if (t_2 <= 2e+294) {
tmp = t_2;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z * t) - x
t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0d0)
if (t_2 <= (-5d+117)) then
tmp = 1.0d0 / (((x + 1.0d0) / y) * (t_1 / z))
else if (t_2 <= 2d+294) then
tmp = t_2
else
tmp = (x + (y / t)) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -5e+117) {
tmp = 1.0 / (((x + 1.0) / y) * (t_1 / z));
} else if (t_2 <= 2e+294) {
tmp = t_2;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * t) - x t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0) tmp = 0 if t_2 <= -5e+117: tmp = 1.0 / (((x + 1.0) / y) * (t_1 / z)) elif t_2 <= 2e+294: tmp = t_2 else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) t_2 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_1)) / Float64(x + 1.0)) tmp = 0.0 if (t_2 <= -5e+117) tmp = Float64(1.0 / Float64(Float64(Float64(x + 1.0) / y) * Float64(t_1 / z))); elseif (t_2 <= 2e+294) tmp = t_2; else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * t) - x; t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0); tmp = 0.0; if (t_2 <= -5e+117) tmp = 1.0 / (((x + 1.0) / y) * (t_1 / z)); elseif (t_2 <= 2e+294) tmp = t_2; else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+117], N[(1.0 / N[(N[(N[(x + 1.0), $MachinePrecision] / y), $MachinePrecision] * N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+294], t$95$2, N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
t_2 := \frac{x + \frac{y \cdot z - x}{t_1}}{x + 1}\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+117}:\\
\;\;\;\;\frac{1}{\frac{x + 1}{y} \cdot \frac{t_1}{z}}\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+294}:\\
\;\;\;\;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)) < -4.99999999999999983e117Initial program 69.9%
*-commutative69.9%
Simplified69.9%
Taylor expanded in y around inf 69.9%
clear-num70.0%
inv-pow70.0%
+-commutative70.0%
times-frac94.6%
*-commutative94.6%
fma-neg94.6%
Applied egg-rr94.6%
unpow-194.6%
fma-neg94.6%
*-commutative94.6%
*-commutative94.6%
Simplified94.6%
if -4.99999999999999983e117 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 2.00000000000000013e294Initial program 99.4%
if 2.00000000000000013e294 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 21.2%
*-commutative21.2%
Simplified21.2%
Taylor expanded in z around inf 86.2%
Final simplification98.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- 1.0 (/ z (/ (+ x 1.0) (/ (- y t) x)))))
(t_2 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -2.5e-96)
t_2
(if (<= t 9.4e-153)
t_1
(if (<= t 1.35e-121)
(* z (/ (/ y (+ x 1.0)) (- (* z t) x)))
(if (<= t 4.3e-88) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (z / ((x + 1.0) / ((y - t) / x)));
double t_2 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -2.5e-96) {
tmp = t_2;
} else if (t <= 9.4e-153) {
tmp = t_1;
} else if (t <= 1.35e-121) {
tmp = z * ((y / (x + 1.0)) / ((z * t) - x));
} else if (t <= 4.3e-88) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = 1.0d0 - (z / ((x + 1.0d0) / ((y - t) / x)))
t_2 = (x + (y / t)) / (x + 1.0d0)
if (t <= (-2.5d-96)) then
tmp = t_2
else if (t <= 9.4d-153) then
tmp = t_1
else if (t <= 1.35d-121) then
tmp = z * ((y / (x + 1.0d0)) / ((z * t) - x))
else if (t <= 4.3d-88) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (z / ((x + 1.0) / ((y - t) / x)));
double t_2 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -2.5e-96) {
tmp = t_2;
} else if (t <= 9.4e-153) {
tmp = t_1;
} else if (t <= 1.35e-121) {
tmp = z * ((y / (x + 1.0)) / ((z * t) - x));
} else if (t <= 4.3e-88) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 - (z / ((x + 1.0) / ((y - t) / x))) t_2 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -2.5e-96: tmp = t_2 elif t <= 9.4e-153: tmp = t_1 elif t <= 1.35e-121: tmp = z * ((y / (x + 1.0)) / ((z * t) - x)) elif t <= 4.3e-88: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 - Float64(z / Float64(Float64(x + 1.0) / Float64(Float64(y - t) / x)))) t_2 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (t <= -2.5e-96) tmp = t_2; elseif (t <= 9.4e-153) tmp = t_1; elseif (t <= 1.35e-121) tmp = Float64(z * Float64(Float64(y / Float64(x + 1.0)) / Float64(Float64(z * t) - x))); elseif (t <= 4.3e-88) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 - (z / ((x + 1.0) / ((y - t) / x))); t_2 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (t <= -2.5e-96) tmp = t_2; elseif (t <= 9.4e-153) tmp = t_1; elseif (t <= 1.35e-121) tmp = z * ((y / (x + 1.0)) / ((z * t) - x)); elseif (t <= 4.3e-88) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(z / N[(N[(x + 1.0), $MachinePrecision] / N[(N[(y - t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.5e-96], t$95$2, If[LessEqual[t, 9.4e-153], t$95$1, If[LessEqual[t, 1.35e-121], N[(z * N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.3e-88], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \frac{z}{\frac{x + 1}{\frac{y - t}{x}}}\\
t_2 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{-96}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 9.4 \cdot 10^{-153}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{-121}:\\
\;\;\;\;z \cdot \frac{\frac{y}{x + 1}}{z \cdot t - x}\\
\mathbf{elif}\;t \leq 4.3 \cdot 10^{-88}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -2.49999999999999997e-96 or 4.2999999999999997e-88 < t Initial program 89.8%
*-commutative89.8%
Simplified89.8%
Taylor expanded in z around inf 89.5%
if -2.49999999999999997e-96 < t < 9.3999999999999998e-153 or 1.3500000000000001e-121 < t < 4.2999999999999997e-88Initial program 93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in z around 0 77.3%
distribute-lft-out--77.3%
Simplified77.3%
Taylor expanded in z around 0 77.3%
mul-1-neg77.3%
unsub-neg77.3%
div-sub77.3%
associate-/l*79.2%
+-commutative79.2%
Simplified79.2%
if 9.3999999999999998e-153 < t < 1.3500000000000001e-121Initial program 62.3%
*-commutative62.3%
Simplified62.3%
add-cube-cbrt61.7%
pow361.7%
fma-neg61.7%
Applied egg-rr61.7%
Taylor expanded in x around 0 38.8%
unpow1/361.7%
*-commutative61.7%
Simplified61.7%
Taylor expanded in y around inf 61.2%
associate-/r*62.3%
+-commutative62.3%
associate-*l/62.3%
*-commutative62.3%
*-commutative62.3%
fma-neg62.3%
associate-*r/99.4%
fma-neg99.4%
Simplified99.4%
Final simplification85.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (- (+ x 1.0) (/ y (/ x z))) (+ x 1.0)))
(t_2 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -2.55e-98)
t_2
(if (<= t 1e-152)
t_1
(if (<= t 1.45e-121)
(* z (/ (/ y (+ x 1.0)) (- (* z t) x)))
(if (<= t 1.22e-88) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = ((x + 1.0) - (y / (x / z))) / (x + 1.0);
double t_2 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -2.55e-98) {
tmp = t_2;
} else if (t <= 1e-152) {
tmp = t_1;
} else if (t <= 1.45e-121) {
tmp = z * ((y / (x + 1.0)) / ((z * t) - x));
} else if (t <= 1.22e-88) {
tmp = t_1;
} else {
tmp = t_2;
}
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 + 1.0d0) - (y / (x / z))) / (x + 1.0d0)
t_2 = (x + (y / t)) / (x + 1.0d0)
if (t <= (-2.55d-98)) then
tmp = t_2
else if (t <= 1d-152) then
tmp = t_1
else if (t <= 1.45d-121) then
tmp = z * ((y / (x + 1.0d0)) / ((z * t) - x))
else if (t <= 1.22d-88) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = ((x + 1.0) - (y / (x / z))) / (x + 1.0);
double t_2 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -2.55e-98) {
tmp = t_2;
} else if (t <= 1e-152) {
tmp = t_1;
} else if (t <= 1.45e-121) {
tmp = z * ((y / (x + 1.0)) / ((z * t) - x));
} else if (t <= 1.22e-88) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((x + 1.0) - (y / (x / z))) / (x + 1.0) t_2 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -2.55e-98: tmp = t_2 elif t <= 1e-152: tmp = t_1 elif t <= 1.45e-121: tmp = z * ((y / (x + 1.0)) / ((z * t) - x)) elif t <= 1.22e-88: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(x + 1.0) - Float64(y / Float64(x / z))) / Float64(x + 1.0)) t_2 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (t <= -2.55e-98) tmp = t_2; elseif (t <= 1e-152) tmp = t_1; elseif (t <= 1.45e-121) tmp = Float64(z * Float64(Float64(y / Float64(x + 1.0)) / Float64(Float64(z * t) - x))); elseif (t <= 1.22e-88) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((x + 1.0) - (y / (x / z))) / (x + 1.0); t_2 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (t <= -2.55e-98) tmp = t_2; elseif (t <= 1e-152) tmp = t_1; elseif (t <= 1.45e-121) tmp = z * ((y / (x + 1.0)) / ((z * t) - x)); elseif (t <= 1.22e-88) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x + 1.0), $MachinePrecision] - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.55e-98], t$95$2, If[LessEqual[t, 1e-152], t$95$1, If[LessEqual[t, 1.45e-121], N[(z * N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.22e-88], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(x + 1\right) - \frac{y}{\frac{x}{z}}}{x + 1}\\
t_2 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -2.55 \cdot 10^{-98}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 10^{-152}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{-121}:\\
\;\;\;\;z \cdot \frac{\frac{y}{x + 1}}{z \cdot t - x}\\
\mathbf{elif}\;t \leq 1.22 \cdot 10^{-88}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -2.55000000000000011e-98 or 1.2200000000000001e-88 < t Initial program 89.8%
*-commutative89.8%
Simplified89.8%
Taylor expanded in z around inf 89.5%
if -2.55000000000000011e-98 < t < 1.00000000000000007e-152 or 1.45e-121 < t < 1.2200000000000001e-88Initial program 93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in t around 0 78.5%
associate-+r+78.5%
mul-1-neg78.5%
unsub-neg78.5%
+-commutative78.5%
associate-/l*80.9%
+-commutative80.9%
Simplified80.9%
if 1.00000000000000007e-152 < t < 1.45e-121Initial program 62.3%
*-commutative62.3%
Simplified62.3%
add-cube-cbrt61.7%
pow361.7%
fma-neg61.7%
Applied egg-rr61.7%
Taylor expanded in x around 0 38.8%
unpow1/361.7%
*-commutative61.7%
Simplified61.7%
Taylor expanded in y around inf 61.2%
associate-/r*62.3%
+-commutative62.3%
associate-*l/62.3%
*-commutative62.3%
*-commutative62.3%
fma-neg62.3%
associate-*r/99.4%
fma-neg99.4%
Simplified99.4%
Final simplification86.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.3e-35) (not (<= t 4.3e-47))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (+ x (/ (* y z) (- (* z t) x))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.3e-35) || !(t <= 4.3e-47)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + ((y * z) / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-4.3d-35)) .or. (.not. (t <= 4.3d-47))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = (x + ((y * z) / ((z * t) - x))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.3e-35) || !(t <= 4.3e-47)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + ((y * z) / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4.3e-35) or not (t <= 4.3e-47): tmp = (x + (y / t)) / (x + 1.0) else: tmp = (x + ((y * z) / ((z * t) - x))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4.3e-35) || !(t <= 4.3e-47)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(Float64(y * z) / Float64(Float64(z * t) - x))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -4.3e-35) || ~((t <= 4.3e-47))) tmp = (x + (y / t)) / (x + 1.0); else tmp = (x + ((y * z) / ((z * t) - x))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.3e-35], N[Not[LessEqual[t, 4.3e-47]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(N[(y * z), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.3 \cdot 10^{-35} \lor \neg \left(t \leq 4.3 \cdot 10^{-47}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{z \cdot t - x}}{x + 1}\\
\end{array}
\end{array}
if t < -4.3000000000000002e-35 or 4.2999999999999998e-47 < t Initial program 88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in z around inf 90.4%
if -4.3000000000000002e-35 < t < 4.2999999999999998e-47Initial program 93.3%
*-commutative93.3%
Simplified93.3%
Taylor expanded in y around inf 86.7%
*-commutative86.7%
Simplified86.7%
Final simplification88.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.4e-158) (not (<= t 3.7e-163))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (- x (/ y (/ x z))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.4e-158) || !(t <= 3.7e-163)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x - (y / (x / z))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-4.4d-158)) .or. (.not. (t <= 3.7d-163))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = (x - (y / (x / z))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.4e-158) || !(t <= 3.7e-163)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x - (y / (x / z))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4.4e-158) or not (t <= 3.7e-163): tmp = (x + (y / t)) / (x + 1.0) else: tmp = (x - (y / (x / z))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4.4e-158) || !(t <= 3.7e-163)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(x - Float64(y / Float64(x / z))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -4.4e-158) || ~((t <= 3.7e-163))) tmp = (x + (y / t)) / (x + 1.0); else tmp = (x - (y / (x / z))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.4e-158], N[Not[LessEqual[t, 3.7e-163]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.4 \cdot 10^{-158} \lor \neg \left(t \leq 3.7 \cdot 10^{-163}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - \frac{y}{\frac{x}{z}}}{x + 1}\\
\end{array}
\end{array}
if t < -4.4000000000000002e-158 or 3.6999999999999999e-163 < t Initial program 89.8%
*-commutative89.8%
Simplified89.8%
Taylor expanded in z around inf 84.7%
if -4.4000000000000002e-158 < t < 3.6999999999999999e-163Initial program 93.3%
*-commutative93.3%
Simplified93.3%
Taylor expanded in y around inf 86.8%
*-commutative86.8%
Simplified86.8%
Taylor expanded in t around 0 73.5%
mul-1-neg73.5%
unsub-neg73.5%
associate-/l*76.7%
+-commutative76.7%
Simplified76.7%
Final simplification82.4%
(FPCore (x y z t) :precision binary64 (if (<= x -5.2e+25) 1.0 (if (<= x 3.4e+30) (/ (+ x (/ y t)) (+ x 1.0)) (+ 1.0 (/ -1.0 x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.2e+25) {
tmp = 1.0;
} else if (x <= 3.4e+30) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 + (-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 (x <= (-5.2d+25)) then
tmp = 1.0d0
else if (x <= 3.4d+30) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.2e+25) {
tmp = 1.0;
} else if (x <= 3.4e+30) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5.2e+25: tmp = 1.0 elif x <= 3.4e+30: tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 + (-1.0 / x) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5.2e+25) tmp = 1.0; elseif (x <= 3.4e+30) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -5.2e+25) tmp = 1.0; elseif (x <= 3.4e+30) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.2e+25], 1.0, If[LessEqual[x, 3.4e+30], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+25}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+30}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if x < -5.1999999999999997e25Initial program 91.9%
*-commutative91.9%
Simplified91.9%
add-cube-cbrt91.8%
pow391.8%
fma-neg91.8%
Applied egg-rr91.8%
Taylor expanded in x around 0 43.2%
unpow1/391.8%
*-commutative91.8%
Simplified91.8%
Taylor expanded in x around inf 93.5%
if -5.1999999999999997e25 < x < 3.4000000000000002e30Initial program 92.1%
*-commutative92.1%
Simplified92.1%
Taylor expanded in z around inf 70.4%
if 3.4000000000000002e30 < x Initial program 86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in t around inf 88.2%
+-commutative88.2%
Simplified88.2%
Taylor expanded in x around inf 88.2%
Final simplification79.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2e-103) (not (<= x 1.2e-119))) (/ x (+ x 1.0)) (/ y t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2e-103) || !(x <= 1.2e-119)) {
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 <= (-2d-103)) .or. (.not. (x <= 1.2d-119))) 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 <= -2e-103) || !(x <= 1.2e-119)) {
tmp = x / (x + 1.0);
} else {
tmp = y / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2e-103) or not (x <= 1.2e-119): tmp = x / (x + 1.0) else: tmp = y / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2e-103) || !(x <= 1.2e-119)) 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 <= -2e-103) || ~((x <= 1.2e-119))) tmp = x / (x + 1.0); else tmp = y / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2e-103], N[Not[LessEqual[x, 1.2e-119]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(y / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{-103} \lor \neg \left(x \leq 1.2 \cdot 10^{-119}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t}\\
\end{array}
\end{array}
if x < -1.99999999999999992e-103 or 1.20000000000000004e-119 < x Initial program 90.7%
*-commutative90.7%
Simplified90.7%
Taylor expanded in t around inf 76.5%
+-commutative76.5%
Simplified76.5%
if -1.99999999999999992e-103 < x < 1.20000000000000004e-119Initial program 91.1%
*-commutative91.1%
Simplified91.1%
Taylor expanded in y around inf 68.2%
times-frac72.0%
+-commutative72.0%
fma-neg72.0%
Simplified72.0%
Taylor expanded in z around inf 62.0%
un-div-inv62.3%
Applied egg-rr62.3%
Taylor expanded in x around 0 62.3%
Final simplification72.1%
(FPCore (x y z t) :precision binary64 (if (<= x -5.9e-89) 1.0 (if (<= x 4e-20) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.9e-89) {
tmp = 1.0;
} else if (x <= 4e-20) {
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 <= (-5.9d-89)) then
tmp = 1.0d0
else if (x <= 4d-20) 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 <= -5.9e-89) {
tmp = 1.0;
} else if (x <= 4e-20) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5.9e-89: tmp = 1.0 elif x <= 4e-20: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5.9e-89) tmp = 1.0; elseif (x <= 4e-20) 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 <= -5.9e-89) tmp = 1.0; elseif (x <= 4e-20) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.9e-89], 1.0, If[LessEqual[x, 4e-20], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.9 \cdot 10^{-89}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-20}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -5.90000000000000021e-89 or 3.99999999999999978e-20 < x Initial program 90.7%
*-commutative90.7%
Simplified90.7%
add-cube-cbrt90.4%
pow390.4%
fma-neg90.4%
Applied egg-rr90.4%
Taylor expanded in x around 0 47.9%
unpow1/385.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in x around inf 79.3%
if -5.90000000000000021e-89 < x < 3.99999999999999978e-20Initial program 91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in y around inf 61.4%
times-frac65.3%
+-commutative65.3%
fma-neg65.3%
Simplified65.3%
Taylor expanded in z around inf 55.5%
un-div-inv55.7%
Applied egg-rr55.7%
Taylor expanded in x around 0 55.7%
Final simplification70.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 90.8%
*-commutative90.8%
Simplified90.8%
add-cube-cbrt90.1%
pow390.1%
fma-neg90.1%
Applied egg-rr90.1%
Taylor expanded in x around 0 42.0%
unpow1/382.1%
*-commutative82.1%
Simplified82.1%
Taylor expanded in x around inf 53.6%
Final simplification53.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 2023310
(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)))