
(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 (- (* y z) x))
(t_2 (- (* z t) x))
(t_3 (/ y (/ (* t_2 (+ x 1.0)) z)))
(t_4 (/ (+ x (/ t_1 t_2)) (+ x 1.0))))
(if (<= t_4 -400.0)
t_3
(if (<= t_4 50000.0)
(/ (+ x (/ 1.0 (/ t_2 t_1))) (+ x 1.0))
(if (<= t_4 INFINITY) t_3 (/ (+ x (/ y t)) (+ x 1.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * z) - x;
double t_2 = (z * t) - x;
double t_3 = y / ((t_2 * (x + 1.0)) / z);
double t_4 = (x + (t_1 / t_2)) / (x + 1.0);
double tmp;
if (t_4 <= -400.0) {
tmp = t_3;
} else if (t_4 <= 50000.0) {
tmp = (x + (1.0 / (t_2 / t_1))) / (x + 1.0);
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (y * z) - x;
double t_2 = (z * t) - x;
double t_3 = y / ((t_2 * (x + 1.0)) / z);
double t_4 = (x + (t_1 / t_2)) / (x + 1.0);
double tmp;
if (t_4 <= -400.0) {
tmp = t_3;
} else if (t_4 <= 50000.0) {
tmp = (x + (1.0 / (t_2 / t_1))) / (x + 1.0);
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * z) - x t_2 = (z * t) - x t_3 = y / ((t_2 * (x + 1.0)) / z) t_4 = (x + (t_1 / t_2)) / (x + 1.0) tmp = 0 if t_4 <= -400.0: tmp = t_3 elif t_4 <= 50000.0: tmp = (x + (1.0 / (t_2 / t_1))) / (x + 1.0) elif t_4 <= math.inf: tmp = t_3 else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * z) - x) t_2 = Float64(Float64(z * t) - x) t_3 = Float64(y / Float64(Float64(t_2 * Float64(x + 1.0)) / z)) t_4 = Float64(Float64(x + Float64(t_1 / t_2)) / Float64(x + 1.0)) tmp = 0.0 if (t_4 <= -400.0) tmp = t_3; elseif (t_4 <= 50000.0) tmp = Float64(Float64(x + Float64(1.0 / Float64(t_2 / t_1))) / Float64(x + 1.0)); elseif (t_4 <= Inf) tmp = t_3; 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 = (y * z) - x; t_2 = (z * t) - x; t_3 = y / ((t_2 * (x + 1.0)) / z); t_4 = (x + (t_1 / t_2)) / (x + 1.0); tmp = 0.0; if (t_4 <= -400.0) tmp = t_3; elseif (t_4 <= 50000.0) tmp = (x + (1.0 / (t_2 / t_1))) / (x + 1.0); elseif (t_4 <= Inf) tmp = t_3; else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$3 = N[(y / N[(N[(t$95$2 * N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x + N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -400.0], t$95$3, If[LessEqual[t$95$4, 50000.0], N[(N[(x + N[(1.0 / N[(t$95$2 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$3, N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot z - x\\
t_2 := z \cdot t - x\\
t_3 := \frac{y}{\frac{t_2 \cdot \left(x + 1\right)}{z}}\\
t_4 := \frac{x + \frac{t_1}{t_2}}{x + 1}\\
\mathbf{if}\;t_4 \leq -400:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_4 \leq 50000:\\
\;\;\;\;\frac{x + \frac{1}{\frac{t_2}{t_1}}}{x + 1}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;t_3\\
\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)) < -400 or 5e4 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < +inf.0Initial program 79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in y around inf 79.1%
associate-/l*96.8%
*-commutative96.8%
+-commutative96.8%
Simplified96.8%
if -400 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 5e4Initial program 98.9%
*-commutative98.9%
Simplified98.9%
clear-num98.9%
inv-pow98.9%
Applied egg-rr98.9%
unpow-198.9%
*-commutative98.9%
*-commutative98.9%
Simplified98.9%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in z around inf 100.0%
Final simplification98.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x))
(t_2 (/ y (/ (* t_1 (+ x 1.0)) z)))
(t_3 (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0))))
(if (<= t_3 -400.0)
t_2
(if (<= t_3 50000.0)
t_3
(if (<= t_3 INFINITY) t_2 (/ (+ x (/ y t)) (+ x 1.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = y / ((t_1 * (x + 1.0)) / z);
double t_3 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_3 <= -400.0) {
tmp = t_2;
} else if (t_3 <= 50000.0) {
tmp = t_3;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = y / ((t_1 * (x + 1.0)) / z);
double t_3 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_3 <= -400.0) {
tmp = t_2;
} else if (t_3 <= 50000.0) {
tmp = t_3;
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * t) - x t_2 = y / ((t_1 * (x + 1.0)) / z) t_3 = (x + (((y * z) - x) / t_1)) / (x + 1.0) tmp = 0 if t_3 <= -400.0: tmp = t_2 elif t_3 <= 50000.0: tmp = t_3 elif t_3 <= math.inf: tmp = t_2 else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) t_2 = Float64(y / Float64(Float64(t_1 * Float64(x + 1.0)) / z)) t_3 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_1)) / Float64(x + 1.0)) tmp = 0.0 if (t_3 <= -400.0) tmp = t_2; elseif (t_3 <= 50000.0) tmp = t_3; elseif (t_3 <= Inf) tmp = t_2; else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * t) - x; t_2 = y / ((t_1 * (x + 1.0)) / z); t_3 = (x + (((y * z) - x) / t_1)) / (x + 1.0); tmp = 0.0; if (t_3 <= -400.0) tmp = t_2; elseif (t_3 <= 50000.0) tmp = t_3; elseif (t_3 <= Inf) tmp = t_2; else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$2 = N[(y / N[(N[(t$95$1 * N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -400.0], t$95$2, If[LessEqual[t$95$3, 50000.0], t$95$3, If[LessEqual[t$95$3, Infinity], t$95$2, N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
t_2 := \frac{y}{\frac{t_1 \cdot \left(x + 1\right)}{z}}\\
t_3 := \frac{x + \frac{y \cdot z - x}{t_1}}{x + 1}\\
\mathbf{if}\;t_3 \leq -400:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_3 \leq 50000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -400 or 5e4 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < +inf.0Initial program 79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in y around inf 79.1%
associate-/l*96.8%
*-commutative96.8%
+-commutative96.8%
Simplified96.8%
if -400 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 5e4Initial program 98.9%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in z around inf 100.0%
Final simplification98.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= x -23.5)
(- 1.0 (* (/ z x) (/ y x)))
(if (<= x -1.15e-51)
t_1
(if (<= x -3.8e-210)
(- 1.0 (/ y (/ x z)))
(if (<= x 3.7e+15) t_1 (- 1.0 (/ (/ z x) (/ x y)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (x <= -23.5) {
tmp = 1.0 - ((z / x) * (y / x));
} else if (x <= -1.15e-51) {
tmp = t_1;
} else if (x <= -3.8e-210) {
tmp = 1.0 - (y / (x / z));
} else if (x <= 3.7e+15) {
tmp = t_1;
} else {
tmp = 1.0 - ((z / x) / (x / y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
if (x <= (-23.5d0)) then
tmp = 1.0d0 - ((z / x) * (y / x))
else if (x <= (-1.15d-51)) then
tmp = t_1
else if (x <= (-3.8d-210)) then
tmp = 1.0d0 - (y / (x / z))
else if (x <= 3.7d+15) then
tmp = t_1
else
tmp = 1.0d0 - ((z / x) / (x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (x <= -23.5) {
tmp = 1.0 - ((z / x) * (y / x));
} else if (x <= -1.15e-51) {
tmp = t_1;
} else if (x <= -3.8e-210) {
tmp = 1.0 - (y / (x / z));
} else if (x <= 3.7e+15) {
tmp = t_1;
} else {
tmp = 1.0 - ((z / x) / (x / y));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if x <= -23.5: tmp = 1.0 - ((z / x) * (y / x)) elif x <= -1.15e-51: tmp = t_1 elif x <= -3.8e-210: tmp = 1.0 - (y / (x / z)) elif x <= 3.7e+15: tmp = t_1 else: tmp = 1.0 - ((z / x) / (x / y)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (x <= -23.5) tmp = Float64(1.0 - Float64(Float64(z / x) * Float64(y / x))); elseif (x <= -1.15e-51) tmp = t_1; elseif (x <= -3.8e-210) tmp = Float64(1.0 - Float64(y / Float64(x / z))); elseif (x <= 3.7e+15) tmp = t_1; else tmp = Float64(1.0 - Float64(Float64(z / x) / Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (x <= -23.5) tmp = 1.0 - ((z / x) * (y / x)); elseif (x <= -1.15e-51) tmp = t_1; elseif (x <= -3.8e-210) tmp = 1.0 - (y / (x / z)); elseif (x <= 3.7e+15) tmp = t_1; else tmp = 1.0 - ((z / x) / (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -23.5], N[(1.0 - N[(N[(z / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.15e-51], t$95$1, If[LessEqual[x, -3.8e-210], N[(1.0 - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.7e+15], t$95$1, N[(1.0 - N[(N[(z / x), $MachinePrecision] / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;x \leq -23.5:\\
\;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{-51}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-210}:\\
\;\;\;\;1 - \frac{y}{\frac{x}{z}}\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{z}{x}}{\frac{x}{y}}\\
\end{array}
\end{array}
if x < -23.5Initial program 92.4%
*-commutative92.4%
Simplified92.4%
Taylor expanded in x around -inf 77.4%
mul-1-neg77.4%
unsub-neg77.4%
distribute-rgt-out--77.4%
unpow277.4%
times-frac87.1%
Simplified87.1%
Taylor expanded in y around inf 98.1%
if -23.5 < x < -1.15000000000000001e-51 or -3.80000000000000003e-210 < x < 3.7e15Initial program 89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in z around inf 76.2%
if -1.15000000000000001e-51 < x < -3.80000000000000003e-210Initial program 96.3%
*-commutative96.3%
Simplified96.3%
Taylor expanded in z around 0 65.9%
neg-mul-165.9%
Simplified65.9%
Taylor expanded in y around 0 65.9%
mul-1-neg65.9%
unsub-neg65.9%
associate-/l*66.0%
associate-/l*66.0%
+-commutative66.0%
Simplified66.0%
Taylor expanded in x around 0 66.0%
if 3.7e15 < x Initial program 86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in x around -inf 76.7%
mul-1-neg76.7%
unsub-neg76.7%
distribute-rgt-out--76.7%
unpow276.7%
times-frac90.1%
Simplified90.1%
Taylor expanded in y around inf 94.7%
clear-num94.7%
un-div-inv94.7%
Applied egg-rr94.7%
Final simplification85.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- 1.0 (* (/ z x) (/ y x)))))
(if (<= x -1.02e-50)
t_1
(if (<= x -3.8e-210)
(- 1.0 (/ y (/ x z)))
(if (<= x 2.2e-9) (/ y (- t (/ x z))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - ((z / x) * (y / x));
double tmp;
if (x <= -1.02e-50) {
tmp = t_1;
} else if (x <= -3.8e-210) {
tmp = 1.0 - (y / (x / z));
} else if (x <= 2.2e-9) {
tmp = y / (t - (x / z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 - ((z / x) * (y / x))
if (x <= (-1.02d-50)) then
tmp = t_1
else if (x <= (-3.8d-210)) then
tmp = 1.0d0 - (y / (x / z))
else if (x <= 2.2d-9) then
tmp = y / (t - (x / z))
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 = 1.0 - ((z / x) * (y / x));
double tmp;
if (x <= -1.02e-50) {
tmp = t_1;
} else if (x <= -3.8e-210) {
tmp = 1.0 - (y / (x / z));
} else if (x <= 2.2e-9) {
tmp = y / (t - (x / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 - ((z / x) * (y / x)) tmp = 0 if x <= -1.02e-50: tmp = t_1 elif x <= -3.8e-210: tmp = 1.0 - (y / (x / z)) elif x <= 2.2e-9: tmp = y / (t - (x / z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 - Float64(Float64(z / x) * Float64(y / x))) tmp = 0.0 if (x <= -1.02e-50) tmp = t_1; elseif (x <= -3.8e-210) tmp = Float64(1.0 - Float64(y / Float64(x / z))); elseif (x <= 2.2e-9) tmp = Float64(y / Float64(t - Float64(x / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 - ((z / x) * (y / x)); tmp = 0.0; if (x <= -1.02e-50) tmp = t_1; elseif (x <= -3.8e-210) tmp = 1.0 - (y / (x / z)); elseif (x <= 2.2e-9) tmp = y / (t - (x / z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(N[(z / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.02e-50], t$95$1, If[LessEqual[x, -3.8e-210], N[(1.0 - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.2e-9], N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \frac{z}{x} \cdot \frac{y}{x}\\
\mathbf{if}\;x \leq -1.02 \cdot 10^{-50}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-210}:\\
\;\;\;\;1 - \frac{y}{\frac{x}{z}}\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{y}{t - \frac{x}{z}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.0199999999999999e-50 or 2.1999999999999998e-9 < x Initial program 88.9%
*-commutative88.9%
Simplified88.9%
Taylor expanded in x around -inf 72.3%
mul-1-neg72.3%
unsub-neg72.3%
distribute-rgt-out--72.3%
unpow272.3%
times-frac82.9%
Simplified82.9%
Taylor expanded in y around inf 90.7%
if -1.0199999999999999e-50 < x < -3.80000000000000003e-210Initial program 96.3%
*-commutative96.3%
Simplified96.3%
Taylor expanded in z around 0 65.9%
neg-mul-165.9%
Simplified65.9%
Taylor expanded in y around 0 65.9%
mul-1-neg65.9%
unsub-neg65.9%
associate-/l*66.0%
associate-/l*66.0%
+-commutative66.0%
Simplified66.0%
Taylor expanded in x around 0 66.0%
if -3.80000000000000003e-210 < x < 2.1999999999999998e-9Initial program 89.9%
*-commutative89.9%
Simplified89.9%
Taylor expanded in y around inf 54.0%
associate-/l*57.9%
*-commutative57.9%
+-commutative57.9%
Simplified57.9%
Taylor expanded in x around 0 63.1%
Taylor expanded in t around 0 63.1%
neg-mul-163.1%
distribute-neg-frac63.1%
Simplified63.1%
Final simplification79.6%
(FPCore (x y z t)
:precision binary64
(if (<= x -2.4e-50)
(- 1.0 (* (/ z x) (/ y x)))
(if (<= x -3.8e-210)
(- 1.0 (/ y (/ x z)))
(if (<= x 1.3e-8) (/ y (- t (/ x z))) (- 1.0 (/ (/ z x) (/ x y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.4e-50) {
tmp = 1.0 - ((z / x) * (y / x));
} else if (x <= -3.8e-210) {
tmp = 1.0 - (y / (x / z));
} else if (x <= 1.3e-8) {
tmp = y / (t - (x / z));
} else {
tmp = 1.0 - ((z / x) / (x / y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-2.4d-50)) then
tmp = 1.0d0 - ((z / x) * (y / x))
else if (x <= (-3.8d-210)) then
tmp = 1.0d0 - (y / (x / z))
else if (x <= 1.3d-8) then
tmp = y / (t - (x / z))
else
tmp = 1.0d0 - ((z / x) / (x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.4e-50) {
tmp = 1.0 - ((z / x) * (y / x));
} else if (x <= -3.8e-210) {
tmp = 1.0 - (y / (x / z));
} else if (x <= 1.3e-8) {
tmp = y / (t - (x / z));
} else {
tmp = 1.0 - ((z / x) / (x / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.4e-50: tmp = 1.0 - ((z / x) * (y / x)) elif x <= -3.8e-210: tmp = 1.0 - (y / (x / z)) elif x <= 1.3e-8: tmp = y / (t - (x / z)) else: tmp = 1.0 - ((z / x) / (x / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.4e-50) tmp = Float64(1.0 - Float64(Float64(z / x) * Float64(y / x))); elseif (x <= -3.8e-210) tmp = Float64(1.0 - Float64(y / Float64(x / z))); elseif (x <= 1.3e-8) tmp = Float64(y / Float64(t - Float64(x / z))); else tmp = Float64(1.0 - Float64(Float64(z / x) / Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.4e-50) tmp = 1.0 - ((z / x) * (y / x)); elseif (x <= -3.8e-210) tmp = 1.0 - (y / (x / z)); elseif (x <= 1.3e-8) tmp = y / (t - (x / z)); else tmp = 1.0 - ((z / x) / (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.4e-50], N[(1.0 - N[(N[(z / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.8e-210], N[(1.0 - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e-8], N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(z / x), $MachinePrecision] / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{-50}:\\
\;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-210}:\\
\;\;\;\;1 - \frac{y}{\frac{x}{z}}\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-8}:\\
\;\;\;\;\frac{y}{t - \frac{x}{z}}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{z}{x}}{\frac{x}{y}}\\
\end{array}
\end{array}
if x < -2.40000000000000002e-50Initial program 91.8%
*-commutative91.8%
Simplified91.8%
Taylor expanded in x around -inf 71.2%
mul-1-neg71.2%
unsub-neg71.2%
distribute-rgt-out--71.2%
unpow271.2%
times-frac79.9%
Simplified79.9%
Taylor expanded in y around inf 90.2%
if -2.40000000000000002e-50 < x < -3.80000000000000003e-210Initial program 96.3%
*-commutative96.3%
Simplified96.3%
Taylor expanded in z around 0 65.9%
neg-mul-165.9%
Simplified65.9%
Taylor expanded in y around 0 65.9%
mul-1-neg65.9%
unsub-neg65.9%
associate-/l*66.0%
associate-/l*66.0%
+-commutative66.0%
Simplified66.0%
Taylor expanded in x around 0 66.0%
if -3.80000000000000003e-210 < x < 1.3000000000000001e-8Initial program 89.9%
*-commutative89.9%
Simplified89.9%
Taylor expanded in y around inf 54.0%
associate-/l*57.9%
*-commutative57.9%
+-commutative57.9%
Simplified57.9%
Taylor expanded in x around 0 63.1%
Taylor expanded in t around 0 63.1%
neg-mul-163.1%
distribute-neg-frac63.1%
Simplified63.1%
if 1.3000000000000001e-8 < x Initial program 86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in x around -inf 73.2%
mul-1-neg73.2%
unsub-neg73.2%
distribute-rgt-out--73.2%
unpow273.2%
times-frac85.7%
Simplified85.7%
Taylor expanded in y around inf 91.1%
clear-num91.0%
un-div-inv91.1%
Applied egg-rr91.1%
Final simplification79.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -6.2e-59) (not (<= t 1.1e-99))) (/ (+ x (/ y t)) (+ x 1.0)) (- 1.0 (/ y (/ (+ x 1.0) (/ z x))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -6.2e-59) || !(t <= 1.1e-99)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 - (y / ((x + 1.0) / (z / 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 <= (-6.2d-59)) .or. (.not. (t <= 1.1d-99))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0 - (y / ((x + 1.0d0) / (z / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -6.2e-59) || !(t <= 1.1e-99)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 - (y / ((x + 1.0) / (z / x)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -6.2e-59) or not (t <= 1.1e-99): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 - (y / ((x + 1.0) / (z / x))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -6.2e-59) || !(t <= 1.1e-99)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(1.0 - Float64(y / Float64(Float64(x + 1.0) / Float64(z / x)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -6.2e-59) || ~((t <= 1.1e-99))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0 - (y / ((x + 1.0) / (z / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -6.2e-59], N[Not[LessEqual[t, 1.1e-99]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(y / N[(N[(x + 1.0), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{-59} \lor \neg \left(t \leq 1.1 \cdot 10^{-99}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{y}{\frac{x + 1}{\frac{z}{x}}}\\
\end{array}
\end{array}
if t < -6.19999999999999998e-59 or 1.10000000000000002e-99 < t Initial program 87.8%
*-commutative87.8%
Simplified87.8%
Taylor expanded in z around inf 88.4%
if -6.19999999999999998e-59 < t < 1.10000000000000002e-99Initial program 92.9%
*-commutative92.9%
Simplified92.9%
Taylor expanded in z around 0 84.2%
neg-mul-184.2%
Simplified84.2%
Taylor expanded in y around 0 84.2%
mul-1-neg84.2%
unsub-neg84.2%
associate-/l*90.3%
associate-/l*90.3%
+-commutative90.3%
Simplified90.3%
Final simplification89.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (+ x 1.0))))
(if (<= x -2.2e-66)
t_1
(if (<= x -1.6e-179)
(* y (/ (- z) x))
(if (<= x -3.8e-210) 1.0 (if (<= x 2.15e-153) (/ y t) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double tmp;
if (x <= -2.2e-66) {
tmp = t_1;
} else if (x <= -1.6e-179) {
tmp = y * (-z / x);
} else if (x <= -3.8e-210) {
tmp = 1.0;
} else if (x <= 2.15e-153) {
tmp = y / t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / (x + 1.0d0)
if (x <= (-2.2d-66)) then
tmp = t_1
else if (x <= (-1.6d-179)) then
tmp = y * (-z / x)
else if (x <= (-3.8d-210)) then
tmp = 1.0d0
else if (x <= 2.15d-153) then
tmp = y / t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double tmp;
if (x <= -2.2e-66) {
tmp = t_1;
} else if (x <= -1.6e-179) {
tmp = y * (-z / x);
} else if (x <= -3.8e-210) {
tmp = 1.0;
} else if (x <= 2.15e-153) {
tmp = y / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (x + 1.0) tmp = 0 if x <= -2.2e-66: tmp = t_1 elif x <= -1.6e-179: tmp = y * (-z / x) elif x <= -3.8e-210: tmp = 1.0 elif x <= 2.15e-153: tmp = y / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) tmp = 0.0 if (x <= -2.2e-66) tmp = t_1; elseif (x <= -1.6e-179) tmp = Float64(y * Float64(Float64(-z) / x)); elseif (x <= -3.8e-210) tmp = 1.0; elseif (x <= 2.15e-153) tmp = Float64(y / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (x + 1.0); tmp = 0.0; if (x <= -2.2e-66) tmp = t_1; elseif (x <= -1.6e-179) tmp = y * (-z / x); elseif (x <= -3.8e-210) tmp = 1.0; elseif (x <= 2.15e-153) tmp = y / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.2e-66], t$95$1, If[LessEqual[x, -1.6e-179], N[(y * N[((-z) / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.8e-210], 1.0, If[LessEqual[x, 2.15e-153], N[(y / t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
\mathbf{if}\;x \leq -2.2 \cdot 10^{-66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.6 \cdot 10^{-179}:\\
\;\;\;\;y \cdot \frac{-z}{x}\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-210}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{-153}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -2.2000000000000001e-66 or 2.15e-153 < x Initial program 90.2%
*-commutative90.2%
Simplified90.2%
Taylor expanded in t around inf 75.8%
+-commutative75.8%
Simplified75.8%
if -2.2000000000000001e-66 < x < -1.6e-179Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 51.8%
associate-/l*51.9%
*-commutative51.9%
+-commutative51.9%
Simplified51.9%
Taylor expanded in t around 0 45.5%
mul-1-neg45.5%
times-frac45.6%
distribute-rgt-neg-in45.6%
+-commutative45.6%
Simplified45.6%
Taylor expanded in x around 0 45.5%
associate-*r/45.6%
neg-mul-145.6%
distribute-lft-neg-in45.6%
Simplified45.6%
if -1.6e-179 < x < -3.80000000000000003e-210Initial program 84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in z around 0 60.2%
neg-mul-160.2%
Simplified60.2%
Taylor expanded in y around 0 60.2%
mul-1-neg60.2%
unsub-neg60.2%
associate-/l*60.1%
associate-/l*60.1%
+-commutative60.1%
Simplified60.1%
Taylor expanded in y around 0 49.4%
if -3.80000000000000003e-210 < x < 2.15e-153Initial program 87.0%
*-commutative87.0%
Simplified87.0%
clear-num87.0%
inv-pow87.0%
Applied egg-rr87.0%
unpow-187.0%
*-commutative87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in x around 0 64.2%
Final simplification70.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (+ x 1.0))))
(if (<= x -5.4e-41)
t_1
(if (<= x -3.7e-210)
(- 1.0 (* y (/ z x)))
(if (<= x 2.35e-153) (/ y t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double tmp;
if (x <= -5.4e-41) {
tmp = t_1;
} else if (x <= -3.7e-210) {
tmp = 1.0 - (y * (z / x));
} else if (x <= 2.35e-153) {
tmp = y / t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / (x + 1.0d0)
if (x <= (-5.4d-41)) then
tmp = t_1
else if (x <= (-3.7d-210)) then
tmp = 1.0d0 - (y * (z / x))
else if (x <= 2.35d-153) then
tmp = y / t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double tmp;
if (x <= -5.4e-41) {
tmp = t_1;
} else if (x <= -3.7e-210) {
tmp = 1.0 - (y * (z / x));
} else if (x <= 2.35e-153) {
tmp = y / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (x + 1.0) tmp = 0 if x <= -5.4e-41: tmp = t_1 elif x <= -3.7e-210: tmp = 1.0 - (y * (z / x)) elif x <= 2.35e-153: tmp = y / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) tmp = 0.0 if (x <= -5.4e-41) tmp = t_1; elseif (x <= -3.7e-210) tmp = Float64(1.0 - Float64(y * Float64(z / x))); elseif (x <= 2.35e-153) tmp = Float64(y / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (x + 1.0); tmp = 0.0; if (x <= -5.4e-41) tmp = t_1; elseif (x <= -3.7e-210) tmp = 1.0 - (y * (z / x)); elseif (x <= 2.35e-153) tmp = y / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.4e-41], t$95$1, If[LessEqual[x, -3.7e-210], N[(1.0 - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.35e-153], N[(y / t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
\mathbf{if}\;x \leq -5.4 \cdot 10^{-41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.7 \cdot 10^{-210}:\\
\;\;\;\;1 - y \cdot \frac{z}{x}\\
\mathbf{elif}\;x \leq 2.35 \cdot 10^{-153}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -5.4e-41 or 2.35e-153 < x Initial program 90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in t around inf 77.6%
+-commutative77.6%
Simplified77.6%
if -5.4e-41 < x < -3.7000000000000003e-210Initial program 93.1%
*-commutative93.1%
Simplified93.1%
Taylor expanded in z around 0 61.5%
neg-mul-161.5%
Simplified61.5%
Taylor expanded in y around 0 61.5%
mul-1-neg61.5%
unsub-neg61.5%
associate-/l*61.6%
associate-/l*61.6%
+-commutative61.6%
Simplified61.6%
Taylor expanded in x around 0 61.5%
associate-*r/61.6%
Simplified61.6%
if -3.7000000000000003e-210 < x < 2.35e-153Initial program 87.0%
*-commutative87.0%
Simplified87.0%
clear-num87.0%
inv-pow87.0%
Applied egg-rr87.0%
unpow-187.0%
*-commutative87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in x around 0 64.2%
Final simplification73.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (+ x 1.0))))
(if (<= x -2.7e-41)
t_1
(if (<= x -3.7e-210)
(- 1.0 (/ y (/ x z)))
(if (<= x 2.8e-153) (/ y t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double tmp;
if (x <= -2.7e-41) {
tmp = t_1;
} else if (x <= -3.7e-210) {
tmp = 1.0 - (y / (x / z));
} else if (x <= 2.8e-153) {
tmp = y / t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / (x + 1.0d0)
if (x <= (-2.7d-41)) then
tmp = t_1
else if (x <= (-3.7d-210)) then
tmp = 1.0d0 - (y / (x / z))
else if (x <= 2.8d-153) then
tmp = y / t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double tmp;
if (x <= -2.7e-41) {
tmp = t_1;
} else if (x <= -3.7e-210) {
tmp = 1.0 - (y / (x / z));
} else if (x <= 2.8e-153) {
tmp = y / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (x + 1.0) tmp = 0 if x <= -2.7e-41: tmp = t_1 elif x <= -3.7e-210: tmp = 1.0 - (y / (x / z)) elif x <= 2.8e-153: tmp = y / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) tmp = 0.0 if (x <= -2.7e-41) tmp = t_1; elseif (x <= -3.7e-210) tmp = Float64(1.0 - Float64(y / Float64(x / z))); elseif (x <= 2.8e-153) tmp = Float64(y / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (x + 1.0); tmp = 0.0; if (x <= -2.7e-41) tmp = t_1; elseif (x <= -3.7e-210) tmp = 1.0 - (y / (x / z)); elseif (x <= 2.8e-153) tmp = y / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.7e-41], t$95$1, If[LessEqual[x, -3.7e-210], N[(1.0 - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.8e-153], N[(y / t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
\mathbf{if}\;x \leq -2.7 \cdot 10^{-41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.7 \cdot 10^{-210}:\\
\;\;\;\;1 - \frac{y}{\frac{x}{z}}\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-153}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -2.7e-41 or 2.8000000000000001e-153 < x Initial program 90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in t around inf 77.6%
+-commutative77.6%
Simplified77.6%
if -2.7e-41 < x < -3.7000000000000003e-210Initial program 93.1%
*-commutative93.1%
Simplified93.1%
Taylor expanded in z around 0 61.5%
neg-mul-161.5%
Simplified61.5%
Taylor expanded in y around 0 61.5%
mul-1-neg61.5%
unsub-neg61.5%
associate-/l*61.6%
associate-/l*61.6%
+-commutative61.6%
Simplified61.6%
Taylor expanded in x around 0 61.6%
if -3.7000000000000003e-210 < x < 2.8000000000000001e-153Initial program 87.0%
*-commutative87.0%
Simplified87.0%
clear-num87.0%
inv-pow87.0%
Applied egg-rr87.0%
unpow-187.0%
*-commutative87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in x around 0 64.2%
Final simplification73.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5.8e-40) (not (<= x 0.00195))) (/ x (+ x 1.0)) (/ y (- t (/ x z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.8e-40) || !(x <= 0.00195)) {
tmp = x / (x + 1.0);
} else {
tmp = y / (t - (x / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-5.8d-40)) .or. (.not. (x <= 0.00195d0))) then
tmp = x / (x + 1.0d0)
else
tmp = y / (t - (x / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.8e-40) || !(x <= 0.00195)) {
tmp = x / (x + 1.0);
} else {
tmp = y / (t - (x / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5.8e-40) or not (x <= 0.00195): tmp = x / (x + 1.0) else: tmp = y / (t - (x / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -5.8e-40) || !(x <= 0.00195)) tmp = Float64(x / Float64(x + 1.0)); else tmp = Float64(y / Float64(t - Float64(x / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -5.8e-40) || ~((x <= 0.00195))) tmp = x / (x + 1.0); else tmp = y / (t - (x / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5.8e-40], N[Not[LessEqual[x, 0.00195]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-40} \lor \neg \left(x \leq 0.00195\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t - \frac{x}{z}}\\
\end{array}
\end{array}
if x < -5.7999999999999998e-40 or 0.0019499999999999999 < x Initial program 89.4%
*-commutative89.4%
Simplified89.4%
Taylor expanded in t around inf 84.8%
+-commutative84.8%
Simplified84.8%
if -5.7999999999999998e-40 < x < 0.0019499999999999999Initial program 90.8%
*-commutative90.8%
Simplified90.8%
Taylor expanded in y around inf 50.5%
associate-/l*54.3%
*-commutative54.3%
+-commutative54.3%
Simplified54.3%
Taylor expanded in x around 0 58.9%
Taylor expanded in t around 0 58.9%
neg-mul-158.9%
distribute-neg-frac58.9%
Simplified58.9%
Final simplification73.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5.4e-90) (not (<= x 2.35e-153))) (/ x (+ x 1.0)) (/ y t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.4e-90) || !(x <= 2.35e-153)) {
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 <= (-5.4d-90)) .or. (.not. (x <= 2.35d-153))) 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 <= -5.4e-90) || !(x <= 2.35e-153)) {
tmp = x / (x + 1.0);
} else {
tmp = y / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5.4e-90) or not (x <= 2.35e-153): tmp = x / (x + 1.0) else: tmp = y / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -5.4e-90) || !(x <= 2.35e-153)) 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 <= -5.4e-90) || ~((x <= 2.35e-153))) tmp = x / (x + 1.0); else tmp = y / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5.4e-90], N[Not[LessEqual[x, 2.35e-153]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(y / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.4 \cdot 10^{-90} \lor \neg \left(x \leq 2.35 \cdot 10^{-153}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t}\\
\end{array}
\end{array}
if x < -5.39999999999999993e-90 or 2.35e-153 < x Initial program 90.6%
*-commutative90.6%
Simplified90.6%
Taylor expanded in t around inf 74.1%
+-commutative74.1%
Simplified74.1%
if -5.39999999999999993e-90 < x < 2.35e-153Initial program 88.4%
*-commutative88.4%
Simplified88.4%
clear-num88.4%
inv-pow88.4%
Applied egg-rr88.4%
unpow-188.4%
*-commutative88.4%
*-commutative88.4%
Simplified88.4%
Taylor expanded in x around 0 56.2%
Final simplification69.3%
(FPCore (x y z t) :precision binary64 (if (<= x -3.8e-210) 1.0 (if (<= x 1.16e-9) (/ y t) (+ 1.0 (/ -1.0 x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.8e-210) {
tmp = 1.0;
} else if (x <= 1.16e-9) {
tmp = y / t;
} 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 <= (-3.8d-210)) then
tmp = 1.0d0
else if (x <= 1.16d-9) then
tmp = y / t
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 <= -3.8e-210) {
tmp = 1.0;
} else if (x <= 1.16e-9) {
tmp = y / t;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.8e-210: tmp = 1.0 elif x <= 1.16e-9: tmp = y / t else: tmp = 1.0 + (-1.0 / x) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.8e-210) tmp = 1.0; elseif (x <= 1.16e-9) tmp = Float64(y / t); 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 <= -3.8e-210) tmp = 1.0; elseif (x <= 1.16e-9) tmp = y / t; else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.8e-210], 1.0, If[LessEqual[x, 1.16e-9], N[(y / t), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{-210}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.16 \cdot 10^{-9}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if x < -3.80000000000000003e-210Initial program 93.0%
*-commutative93.0%
Simplified93.0%
Taylor expanded in z around 0 79.9%
neg-mul-179.9%
Simplified79.9%
Taylor expanded in y around 0 79.8%
mul-1-neg79.8%
unsub-neg79.8%
associate-/l*83.7%
associate-/l*83.8%
+-commutative83.8%
Simplified83.8%
Taylor expanded in y around 0 66.6%
if -3.80000000000000003e-210 < x < 1.15999999999999992e-9Initial program 89.6%
*-commutative89.6%
Simplified89.6%
clear-num89.7%
inv-pow89.7%
Applied egg-rr89.7%
unpow-189.7%
*-commutative89.7%
*-commutative89.7%
Simplified89.7%
Taylor expanded in x around 0 56.1%
if 1.15999999999999992e-9 < x Initial program 86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in t around inf 83.7%
+-commutative83.7%
Simplified83.7%
Taylor expanded in x around inf 83.0%
Final simplification68.6%
(FPCore (x y z t) :precision binary64 (if (<= x -3.8e-210) 1.0 (if (<= x 5.5e-16) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.8e-210) {
tmp = 1.0;
} else if (x <= 5.5e-16) {
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 <= (-3.8d-210)) then
tmp = 1.0d0
else if (x <= 5.5d-16) 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 <= -3.8e-210) {
tmp = 1.0;
} else if (x <= 5.5e-16) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.8e-210: tmp = 1.0 elif x <= 5.5e-16: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.8e-210) tmp = 1.0; elseif (x <= 5.5e-16) 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 <= -3.8e-210) tmp = 1.0; elseif (x <= 5.5e-16) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.8e-210], 1.0, If[LessEqual[x, 5.5e-16], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{-210}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-16}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -3.80000000000000003e-210 or 5.49999999999999964e-16 < x Initial program 90.2%
*-commutative90.2%
Simplified90.2%
Taylor expanded in z around 0 80.8%
neg-mul-180.8%
Simplified80.8%
Taylor expanded in y around 0 80.7%
mul-1-neg80.7%
unsub-neg80.7%
associate-/l*87.7%
associate-/l*86.6%
+-commutative86.6%
Simplified86.6%
Taylor expanded in y around 0 73.4%
if -3.80000000000000003e-210 < x < 5.49999999999999964e-16Initial program 89.5%
*-commutative89.5%
Simplified89.5%
clear-num89.5%
inv-pow89.5%
Applied egg-rr89.5%
unpow-189.5%
*-commutative89.5%
*-commutative89.5%
Simplified89.5%
Taylor expanded in x around 0 56.8%
Final simplification68.5%
(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.0%
*-commutative90.0%
Simplified90.0%
Taylor expanded in z around 0 65.2%
neg-mul-165.2%
Simplified65.2%
Taylor expanded in y around 0 65.2%
mul-1-neg65.2%
unsub-neg65.2%
associate-/l*70.1%
associate-/l*69.4%
+-commutative69.4%
Simplified69.4%
Taylor expanded in y around 0 56.3%
Final simplification56.3%
(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 2023213
(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)))