
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x)))
(if (<= (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0)) INFINITY)
(/ (fma y (/ z t_1) (- x (/ x t_1))) (+ x 1.0))
(/ (+ x (/ y t)) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double tmp;
if (((x + (((y * z) - x) / t_1)) / (x + 1.0)) <= ((double) INFINITY)) {
tmp = fma(y, (z / t_1), (x - (x / t_1))) / (x + 1.0);
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) tmp = 0.0 if (Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_1)) / Float64(x + 1.0)) <= Inf) tmp = Float64(fma(y, Float64(z / t_1), Float64(x - Float64(x / t_1))) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, If[LessEqual[N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(y * N[(z / t$95$1), $MachinePrecision] + N[(x - N[(x / t$95$1), $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}
t_1 := z \cdot t - x\\
\mathbf{if}\;\frac{x + \frac{y \cdot z - x}{t_1}}{x + 1} \leq \infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, \frac{z}{t_1}, x - \frac{x}{t_1}\right)}{x + 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 1)) < +inf.0Initial program 94.5%
*-commutative94.5%
Simplified94.5%
+-commutative94.5%
div-sub94.5%
associate-+l-94.5%
*-un-lft-identity94.5%
times-frac99.2%
fma-neg99.2%
Applied egg-rr99.2%
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 simplification99.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0)))) (if (<= t_1 5e+290) 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) / ((z * t) - x))) / (x + 1.0);
double tmp;
if (t_1 <= 5e+290) {
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) / ((z * t) - x))) / (x + 1.0d0)
if (t_1 <= 5d+290) 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) / ((z * t) - x))) / (x + 1.0);
double tmp;
if (t_1 <= 5e+290) {
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) / ((z * t) - x))) / (x + 1.0) tmp = 0 if t_1 <= 5e+290: 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(Float64(z * t) - x))) / Float64(x + 1.0)) tmp = 0.0 if (t_1 <= 5e+290) 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) / ((z * t) - x))) / (x + 1.0); tmp = 0.0; if (t_1 <= 5e+290) 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[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+290], 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}{z \cdot t - x}}{x + 1}\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+290}:\\
\;\;\;\;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 1)) < 4.9999999999999998e290Initial program 97.5%
if 4.9999999999999998e290 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 33.2%
*-commutative33.2%
Simplified33.2%
Taylor expanded in z around inf 97.2%
Final simplification97.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))) (t_2 (- (* z t) x)))
(if (<= t -5.8e+22)
t_1
(if (<= t 2.5e-173)
(- 1.0 (* (/ y (+ x 1.0)) (/ z x)))
(if (<= t 1e-78)
(/ (* y z) (* t_2 (+ x 1.0)))
(if (<= t 7.5e-34) (/ (- x (/ x t_2)) (+ x 1.0)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double t_2 = (z * t) - x;
double tmp;
if (t <= -5.8e+22) {
tmp = t_1;
} else if (t <= 2.5e-173) {
tmp = 1.0 - ((y / (x + 1.0)) * (z / x));
} else if (t <= 1e-78) {
tmp = (y * z) / (t_2 * (x + 1.0));
} else if (t <= 7.5e-34) {
tmp = (x - (x / t_2)) / (x + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
t_2 = (z * t) - x
if (t <= (-5.8d+22)) then
tmp = t_1
else if (t <= 2.5d-173) then
tmp = 1.0d0 - ((y / (x + 1.0d0)) * (z / x))
else if (t <= 1d-78) then
tmp = (y * z) / (t_2 * (x + 1.0d0))
else if (t <= 7.5d-34) then
tmp = (x - (x / t_2)) / (x + 1.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double t_2 = (z * t) - x;
double tmp;
if (t <= -5.8e+22) {
tmp = t_1;
} else if (t <= 2.5e-173) {
tmp = 1.0 - ((y / (x + 1.0)) * (z / x));
} else if (t <= 1e-78) {
tmp = (y * z) / (t_2 * (x + 1.0));
} else if (t <= 7.5e-34) {
tmp = (x - (x / t_2)) / (x + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) t_2 = (z * t) - x tmp = 0 if t <= -5.8e+22: tmp = t_1 elif t <= 2.5e-173: tmp = 1.0 - ((y / (x + 1.0)) * (z / x)) elif t <= 1e-78: tmp = (y * z) / (t_2 * (x + 1.0)) elif t <= 7.5e-34: tmp = (x - (x / t_2)) / (x + 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) t_2 = Float64(Float64(z * t) - x) tmp = 0.0 if (t <= -5.8e+22) tmp = t_1; elseif (t <= 2.5e-173) tmp = Float64(1.0 - Float64(Float64(y / Float64(x + 1.0)) * Float64(z / x))); elseif (t <= 1e-78) tmp = Float64(Float64(y * z) / Float64(t_2 * Float64(x + 1.0))); elseif (t <= 7.5e-34) tmp = Float64(Float64(x - Float64(x / t_2)) / Float64(x + 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); t_2 = (z * t) - x; tmp = 0.0; if (t <= -5.8e+22) tmp = t_1; elseif (t <= 2.5e-173) tmp = 1.0 - ((y / (x + 1.0)) * (z / x)); elseif (t <= 1e-78) tmp = (y * z) / (t_2 * (x + 1.0)); elseif (t <= 7.5e-34) tmp = (x - (x / t_2)) / (x + 1.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, If[LessEqual[t, -5.8e+22], t$95$1, If[LessEqual[t, 2.5e-173], N[(1.0 - N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-78], N[(N[(y * z), $MachinePrecision] / N[(t$95$2 * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.5e-34], N[(N[(x - N[(x / t$95$2), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
t_2 := z \cdot t - x\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{+22}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-173}:\\
\;\;\;\;1 - \frac{y}{x + 1} \cdot \frac{z}{x}\\
\mathbf{elif}\;t \leq 10^{-78}:\\
\;\;\;\;\frac{y \cdot z}{t_2 \cdot \left(x + 1\right)}\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-34}:\\
\;\;\;\;\frac{x - \frac{x}{t_2}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -5.8e22 or 7.5000000000000004e-34 < t Initial program 87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in z around inf 93.8%
if -5.8e22 < t < 2.5000000000000001e-173Initial program 93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in t around 0 79.9%
+-commutative79.9%
mul-1-neg79.9%
unsub-neg79.9%
associate-/l*83.9%
+-commutative83.9%
Simplified83.9%
Taylor expanded in y around 0 79.8%
mul-1-neg79.8%
unsub-neg79.8%
times-frac84.0%
+-commutative84.0%
Simplified84.0%
if 2.5000000000000001e-173 < t < 9.99999999999999999e-79Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in y around inf 79.7%
*-commutative79.7%
*-commutative79.7%
+-commutative79.7%
Simplified79.7%
if 9.99999999999999999e-79 < t < 7.5000000000000004e-34Initial program 93.2%
*-commutative93.2%
Simplified93.2%
Taylor expanded in y around 0 93.0%
+-commutative93.0%
Simplified93.0%
Final simplification89.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -6.1e+22)
t_1
(if (<= t 2.5e-173)
(- 1.0 (* (/ y (+ x 1.0)) (/ z x)))
(if (<= t 1e-78)
(/ (* y z) (* (- (* z t) x) (+ x 1.0)))
(if (<= t 3.2e-60) 1.0 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -6.1e+22) {
tmp = t_1;
} else if (t <= 2.5e-173) {
tmp = 1.0 - ((y / (x + 1.0)) * (z / x));
} else if (t <= 1e-78) {
tmp = (y * z) / (((z * t) - x) * (x + 1.0));
} else if (t <= 3.2e-60) {
tmp = 1.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
if (t <= (-6.1d+22)) then
tmp = t_1
else if (t <= 2.5d-173) then
tmp = 1.0d0 - ((y / (x + 1.0d0)) * (z / x))
else if (t <= 1d-78) then
tmp = (y * z) / (((z * t) - x) * (x + 1.0d0))
else if (t <= 3.2d-60) then
tmp = 1.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -6.1e+22) {
tmp = t_1;
} else if (t <= 2.5e-173) {
tmp = 1.0 - ((y / (x + 1.0)) * (z / x));
} else if (t <= 1e-78) {
tmp = (y * z) / (((z * t) - x) * (x + 1.0));
} else if (t <= 3.2e-60) {
tmp = 1.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -6.1e+22: tmp = t_1 elif t <= 2.5e-173: tmp = 1.0 - ((y / (x + 1.0)) * (z / x)) elif t <= 1e-78: tmp = (y * z) / (((z * t) - x) * (x + 1.0)) elif t <= 3.2e-60: tmp = 1.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (t <= -6.1e+22) tmp = t_1; elseif (t <= 2.5e-173) tmp = Float64(1.0 - Float64(Float64(y / Float64(x + 1.0)) * Float64(z / x))); elseif (t <= 1e-78) tmp = Float64(Float64(y * z) / Float64(Float64(Float64(z * t) - x) * Float64(x + 1.0))); elseif (t <= 3.2e-60) tmp = 1.0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (t <= -6.1e+22) tmp = t_1; elseif (t <= 2.5e-173) tmp = 1.0 - ((y / (x + 1.0)) * (z / x)); elseif (t <= 1e-78) tmp = (y * z) / (((z * t) - x) * (x + 1.0)); elseif (t <= 3.2e-60) tmp = 1.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.1e+22], t$95$1, If[LessEqual[t, 2.5e-173], N[(1.0 - N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-78], N[(N[(y * z), $MachinePrecision] / N[(N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e-60], 1.0, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -6.1 \cdot 10^{+22}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-173}:\\
\;\;\;\;1 - \frac{y}{x + 1} \cdot \frac{z}{x}\\
\mathbf{elif}\;t \leq 10^{-78}:\\
\;\;\;\;\frac{y \cdot z}{\left(z \cdot t - x\right) \cdot \left(x + 1\right)}\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-60}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -6.0999999999999998e22 or 3.2000000000000001e-60 < t Initial program 88.1%
*-commutative88.1%
Simplified88.1%
Taylor expanded in z around inf 92.9%
if -6.0999999999999998e22 < t < 2.5000000000000001e-173Initial program 93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in t around 0 79.9%
+-commutative79.9%
mul-1-neg79.9%
unsub-neg79.9%
associate-/l*83.9%
+-commutative83.9%
Simplified83.9%
Taylor expanded in y around 0 79.8%
mul-1-neg79.8%
unsub-neg79.8%
times-frac84.0%
+-commutative84.0%
Simplified84.0%
if 2.5000000000000001e-173 < t < 9.99999999999999999e-79Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in y around inf 79.7%
*-commutative79.7%
*-commutative79.7%
+-commutative79.7%
Simplified79.7%
if 9.99999999999999999e-79 < t < 3.2000000000000001e-60Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around inf 27.6%
+-commutative27.6%
Simplified27.6%
Taylor expanded in x around inf 75.5%
Final simplification88.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ 1.0 (/ -1.0 (/ x (* y z))))))
(if (<= x -0.98)
(- 1.0 (* z (/ (/ y x) x)))
(if (<= x -2.3e-151)
t_1
(if (<= x 3.1e-136)
(/ y t)
(if (<= x 4e-76) t_1 (if (<= x 5e-53) (/ y t) 1.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 + (-1.0 / (x / (y * z)));
double tmp;
if (x <= -0.98) {
tmp = 1.0 - (z * ((y / x) / x));
} else if (x <= -2.3e-151) {
tmp = t_1;
} else if (x <= 3.1e-136) {
tmp = y / t;
} else if (x <= 4e-76) {
tmp = t_1;
} else if (x <= 5e-53) {
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) :: t_1
real(8) :: tmp
t_1 = 1.0d0 + ((-1.0d0) / (x / (y * z)))
if (x <= (-0.98d0)) then
tmp = 1.0d0 - (z * ((y / x) / x))
else if (x <= (-2.3d-151)) then
tmp = t_1
else if (x <= 3.1d-136) then
tmp = y / t
else if (x <= 4d-76) then
tmp = t_1
else if (x <= 5d-53) 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 t_1 = 1.0 + (-1.0 / (x / (y * z)));
double tmp;
if (x <= -0.98) {
tmp = 1.0 - (z * ((y / x) / x));
} else if (x <= -2.3e-151) {
tmp = t_1;
} else if (x <= 3.1e-136) {
tmp = y / t;
} else if (x <= 4e-76) {
tmp = t_1;
} else if (x <= 5e-53) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 + (-1.0 / (x / (y * z))) tmp = 0 if x <= -0.98: tmp = 1.0 - (z * ((y / x) / x)) elif x <= -2.3e-151: tmp = t_1 elif x <= 3.1e-136: tmp = y / t elif x <= 4e-76: tmp = t_1 elif x <= 5e-53: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 + Float64(-1.0 / Float64(x / Float64(y * z)))) tmp = 0.0 if (x <= -0.98) tmp = Float64(1.0 - Float64(z * Float64(Float64(y / x) / x))); elseif (x <= -2.3e-151) tmp = t_1; elseif (x <= 3.1e-136) tmp = Float64(y / t); elseif (x <= 4e-76) tmp = t_1; elseif (x <= 5e-53) tmp = Float64(y / t); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 + (-1.0 / (x / (y * z))); tmp = 0.0; if (x <= -0.98) tmp = 1.0 - (z * ((y / x) / x)); elseif (x <= -2.3e-151) tmp = t_1; elseif (x <= 3.1e-136) tmp = y / t; elseif (x <= 4e-76) tmp = t_1; elseif (x <= 5e-53) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 + N[(-1.0 / N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.98], N[(1.0 - N[(z * N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.3e-151], t$95$1, If[LessEqual[x, 3.1e-136], N[(y / t), $MachinePrecision], If[LessEqual[x, 4e-76], t$95$1, If[LessEqual[x, 5e-53], N[(y / t), $MachinePrecision], 1.0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 + \frac{-1}{\frac{x}{y \cdot z}}\\
\mathbf{if}\;x \leq -0.98:\\
\;\;\;\;1 - z \cdot \frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -2.3 \cdot 10^{-151}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-136}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-76}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-53}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -0.97999999999999998Initial program 95.8%
*-commutative95.8%
Simplified95.8%
Taylor expanded in t around 0 92.9%
+-commutative92.9%
mul-1-neg92.9%
unsub-neg92.9%
associate-/l*97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in y around 0 92.8%
mul-1-neg92.8%
unsub-neg92.8%
times-frac97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in x around inf 92.8%
unpow292.8%
*-commutative92.8%
associate-*r/95.7%
associate-/r*97.1%
Simplified97.1%
if -0.97999999999999998 < x < -2.29999999999999996e-151 or 3.1e-136 < x < 3.99999999999999971e-76Initial program 88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in t around 0 59.8%
+-commutative59.8%
mul-1-neg59.8%
unsub-neg59.8%
associate-/l*59.7%
+-commutative59.7%
Simplified59.7%
Taylor expanded in y around 0 59.8%
mul-1-neg59.8%
unsub-neg59.8%
times-frac59.8%
+-commutative59.8%
Simplified59.8%
Taylor expanded in x around 0 58.3%
clear-num58.4%
inv-pow58.4%
Applied egg-rr58.4%
unpow-158.4%
Simplified58.4%
if -2.29999999999999996e-151 < x < 3.1e-136 or 3.99999999999999971e-76 < x < 5e-53Initial program 90.6%
*-commutative90.6%
Simplified90.6%
Taylor expanded in z around inf 78.4%
div-inv78.4%
+-commutative78.4%
Applied egg-rr78.4%
Taylor expanded in x around 0 58.8%
if 5e-53 < x Initial program 88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in t around inf 82.1%
+-commutative82.1%
Simplified82.1%
Taylor expanded in x around inf 84.7%
Final simplification75.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- 1.0 (/ (* y z) x))))
(if (<= x -0.36)
(- 1.0 (* z (/ (/ y x) x)))
(if (<= x -3.2e-151)
t_1
(if (<= x 2.9e-136)
(/ y t)
(if (<= x 3.8e-76) t_1 (if (<= x 2.2e-53) (/ y t) 1.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - ((y * z) / x);
double tmp;
if (x <= -0.36) {
tmp = 1.0 - (z * ((y / x) / x));
} else if (x <= -3.2e-151) {
tmp = t_1;
} else if (x <= 2.9e-136) {
tmp = y / t;
} else if (x <= 3.8e-76) {
tmp = t_1;
} else if (x <= 2.2e-53) {
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) :: t_1
real(8) :: tmp
t_1 = 1.0d0 - ((y * z) / x)
if (x <= (-0.36d0)) then
tmp = 1.0d0 - (z * ((y / x) / x))
else if (x <= (-3.2d-151)) then
tmp = t_1
else if (x <= 2.9d-136) then
tmp = y / t
else if (x <= 3.8d-76) then
tmp = t_1
else if (x <= 2.2d-53) 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 t_1 = 1.0 - ((y * z) / x);
double tmp;
if (x <= -0.36) {
tmp = 1.0 - (z * ((y / x) / x));
} else if (x <= -3.2e-151) {
tmp = t_1;
} else if (x <= 2.9e-136) {
tmp = y / t;
} else if (x <= 3.8e-76) {
tmp = t_1;
} else if (x <= 2.2e-53) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 - ((y * z) / x) tmp = 0 if x <= -0.36: tmp = 1.0 - (z * ((y / x) / x)) elif x <= -3.2e-151: tmp = t_1 elif x <= 2.9e-136: tmp = y / t elif x <= 3.8e-76: tmp = t_1 elif x <= 2.2e-53: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 - Float64(Float64(y * z) / x)) tmp = 0.0 if (x <= -0.36) tmp = Float64(1.0 - Float64(z * Float64(Float64(y / x) / x))); elseif (x <= -3.2e-151) tmp = t_1; elseif (x <= 2.9e-136) tmp = Float64(y / t); elseif (x <= 3.8e-76) tmp = t_1; elseif (x <= 2.2e-53) tmp = Float64(y / t); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 - ((y * z) / x); tmp = 0.0; if (x <= -0.36) tmp = 1.0 - (z * ((y / x) / x)); elseif (x <= -3.2e-151) tmp = t_1; elseif (x <= 2.9e-136) tmp = y / t; elseif (x <= 3.8e-76) tmp = t_1; elseif (x <= 2.2e-53) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.36], N[(1.0 - N[(z * N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.2e-151], t$95$1, If[LessEqual[x, 2.9e-136], N[(y / t), $MachinePrecision], If[LessEqual[x, 3.8e-76], t$95$1, If[LessEqual[x, 2.2e-53], N[(y / t), $MachinePrecision], 1.0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \frac{y \cdot z}{x}\\
\mathbf{if}\;x \leq -0.36:\\
\;\;\;\;1 - z \cdot \frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{-151}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-136}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-76}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-53}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -0.35999999999999999Initial program 95.8%
*-commutative95.8%
Simplified95.8%
Taylor expanded in t around 0 92.9%
+-commutative92.9%
mul-1-neg92.9%
unsub-neg92.9%
associate-/l*97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in y around 0 92.8%
mul-1-neg92.8%
unsub-neg92.8%
times-frac97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in x around inf 92.8%
unpow292.8%
*-commutative92.8%
associate-*r/95.7%
associate-/r*97.1%
Simplified97.1%
if -0.35999999999999999 < x < -3.20000000000000021e-151 or 2.89999999999999995e-136 < x < 3.8000000000000002e-76Initial program 88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in t around 0 59.8%
+-commutative59.8%
mul-1-neg59.8%
unsub-neg59.8%
associate-/l*59.7%
+-commutative59.7%
Simplified59.7%
Taylor expanded in y around 0 59.8%
mul-1-neg59.8%
unsub-neg59.8%
times-frac59.8%
+-commutative59.8%
Simplified59.8%
Taylor expanded in x around 0 58.3%
if -3.20000000000000021e-151 < x < 2.89999999999999995e-136 or 3.8000000000000002e-76 < x < 2.20000000000000018e-53Initial program 90.6%
*-commutative90.6%
Simplified90.6%
Taylor expanded in z around inf 78.4%
div-inv78.4%
+-commutative78.4%
Applied egg-rr78.4%
Taylor expanded in x around 0 58.8%
if 2.20000000000000018e-53 < x Initial program 88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in t around inf 82.1%
+-commutative82.1%
Simplified82.1%
Taylor expanded in x around inf 84.7%
Final simplification75.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -4.8e-14)
t_1
(if (<= t -1.9e-77)
(- 1.0 (* z (/ (/ y x) x)))
(if (<= t 2.5e-173) (- 1.0 (/ (* y z) x)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -4.8e-14) {
tmp = t_1;
} else if (t <= -1.9e-77) {
tmp = 1.0 - (z * ((y / x) / x));
} else if (t <= 2.5e-173) {
tmp = 1.0 - ((y * z) / x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
if (t <= (-4.8d-14)) then
tmp = t_1
else if (t <= (-1.9d-77)) then
tmp = 1.0d0 - (z * ((y / x) / x))
else if (t <= 2.5d-173) then
tmp = 1.0d0 - ((y * z) / x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -4.8e-14) {
tmp = t_1;
} else if (t <= -1.9e-77) {
tmp = 1.0 - (z * ((y / x) / x));
} else if (t <= 2.5e-173) {
tmp = 1.0 - ((y * z) / x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -4.8e-14: tmp = t_1 elif t <= -1.9e-77: tmp = 1.0 - (z * ((y / x) / x)) elif t <= 2.5e-173: tmp = 1.0 - ((y * z) / x) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (t <= -4.8e-14) tmp = t_1; elseif (t <= -1.9e-77) tmp = Float64(1.0 - Float64(z * Float64(Float64(y / x) / x))); elseif (t <= 2.5e-173) tmp = Float64(1.0 - Float64(Float64(y * z) / x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (t <= -4.8e-14) tmp = t_1; elseif (t <= -1.9e-77) tmp = 1.0 - (z * ((y / x) / x)); elseif (t <= 2.5e-173) tmp = 1.0 - ((y * z) / x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.8e-14], t$95$1, If[LessEqual[t, -1.9e-77], N[(1.0 - N[(z * N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e-173], N[(1.0 - N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{-14}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.9 \cdot 10^{-77}:\\
\;\;\;\;1 - z \cdot \frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-173}:\\
\;\;\;\;1 - \frac{y \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -4.8e-14 or 2.5000000000000001e-173 < t Initial program 89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in z around inf 86.8%
if -4.8e-14 < t < -1.8999999999999999e-77Initial program 78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in t around 0 72.9%
+-commutative72.9%
mul-1-neg72.9%
unsub-neg72.9%
associate-/l*89.0%
+-commutative89.0%
Simplified89.0%
Taylor expanded in y around 0 72.5%
mul-1-neg72.5%
unsub-neg72.5%
times-frac89.1%
+-commutative89.1%
Simplified89.1%
Taylor expanded in x around inf 55.8%
unpow255.8%
*-commutative55.8%
associate-*r/67.6%
associate-/r*78.1%
Simplified78.1%
if -1.8999999999999999e-77 < t < 2.5000000000000001e-173Initial program 98.5%
*-commutative98.5%
Simplified98.5%
Taylor expanded in t around 0 84.6%
+-commutative84.6%
mul-1-neg84.6%
unsub-neg84.6%
associate-/l*84.7%
+-commutative84.7%
Simplified84.7%
Taylor expanded in y around 0 84.6%
mul-1-neg84.6%
unsub-neg84.6%
times-frac84.7%
+-commutative84.7%
Simplified84.7%
Taylor expanded in x around 0 77.5%
Final simplification83.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.2e+24) (not (<= t 1.08e-60))) (/ (+ 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 <= -1.2e+24) || !(t <= 1.08e-60)) {
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 <= (-1.2d+24)) .or. (.not. (t <= 1.08d-60))) 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 <= -1.2e+24) || !(t <= 1.08e-60)) {
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 <= -1.2e+24) or not (t <= 1.08e-60): 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 <= -1.2e+24) || !(t <= 1.08e-60)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(1.0 - Float64(Float64(y / Float64(x + 1.0)) * Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.2e+24) || ~((t <= 1.08e-60))) 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, -1.2e+24], N[Not[LessEqual[t, 1.08e-60]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+24} \lor \neg \left(t \leq 1.08 \cdot 10^{-60}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{y}{x + 1} \cdot \frac{z}{x}\\
\end{array}
\end{array}
if t < -1.2e24 or 1.07999999999999997e-60 < t Initial program 88.1%
*-commutative88.1%
Simplified88.1%
Taylor expanded in z around inf 92.9%
if -1.2e24 < t < 1.07999999999999997e-60Initial program 94.8%
*-commutative94.8%
Simplified94.8%
Taylor expanded in t around 0 75.6%
+-commutative75.6%
mul-1-neg75.6%
unsub-neg75.6%
associate-/l*79.0%
+-commutative79.0%
Simplified79.0%
Taylor expanded in y around 0 75.5%
mul-1-neg75.5%
unsub-neg75.5%
times-frac79.0%
+-commutative79.0%
Simplified79.0%
Final simplification86.5%
(FPCore (x y z t)
:precision binary64
(if (<= x -1.32e-5)
1.0
(if (<= x -2.8e-61)
(* z (/ (- y) x))
(if (<= x -7e-151) 1.0 (if (<= x 1e-137) (/ y t) (/ x (+ x 1.0)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.32e-5) {
tmp = 1.0;
} else if (x <= -2.8e-61) {
tmp = z * (-y / x);
} else if (x <= -7e-151) {
tmp = 1.0;
} else if (x <= 1e-137) {
tmp = y / t;
} else {
tmp = 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 (x <= (-1.32d-5)) then
tmp = 1.0d0
else if (x <= (-2.8d-61)) then
tmp = z * (-y / x)
else if (x <= (-7d-151)) then
tmp = 1.0d0
else if (x <= 1d-137) then
tmp = y / t
else
tmp = 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 (x <= -1.32e-5) {
tmp = 1.0;
} else if (x <= -2.8e-61) {
tmp = z * (-y / x);
} else if (x <= -7e-151) {
tmp = 1.0;
} else if (x <= 1e-137) {
tmp = y / t;
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.32e-5: tmp = 1.0 elif x <= -2.8e-61: tmp = z * (-y / x) elif x <= -7e-151: tmp = 1.0 elif x <= 1e-137: tmp = y / t else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.32e-5) tmp = 1.0; elseif (x <= -2.8e-61) tmp = Float64(z * Float64(Float64(-y) / x)); elseif (x <= -7e-151) tmp = 1.0; elseif (x <= 1e-137) tmp = Float64(y / t); else tmp = Float64(x / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.32e-5) tmp = 1.0; elseif (x <= -2.8e-61) tmp = z * (-y / x); elseif (x <= -7e-151) tmp = 1.0; elseif (x <= 1e-137) tmp = y / t; else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.32e-5], 1.0, If[LessEqual[x, -2.8e-61], N[(z * N[((-y) / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7e-151], 1.0, If[LessEqual[x, 1e-137], N[(y / t), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.32 \cdot 10^{-5}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{-61}:\\
\;\;\;\;z \cdot \frac{-y}{x}\\
\mathbf{elif}\;x \leq -7 \cdot 10^{-151}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 10^{-137}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -1.32000000000000007e-5 or -2.8000000000000001e-61 < x < -6.99999999999999991e-151Initial program 96.5%
*-commutative96.5%
Simplified96.5%
Taylor expanded in t around inf 79.6%
+-commutative79.6%
Simplified79.6%
Taylor expanded in x around inf 83.4%
if -1.32000000000000007e-5 < x < -2.8000000000000001e-61Initial program 77.6%
*-commutative77.6%
Simplified77.6%
Taylor expanded in y around inf 55.7%
times-frac68.8%
+-commutative68.8%
Simplified68.8%
Taylor expanded in t around 0 50.8%
mul-1-neg50.8%
times-frac50.7%
distribute-rgt-neg-in50.7%
+-commutative50.7%
distribute-frac-neg50.7%
Simplified50.7%
Taylor expanded in x around 0 47.9%
mul-1-neg47.9%
associate-*l/48.0%
Simplified48.0%
if -6.99999999999999991e-151 < x < 9.99999999999999978e-138Initial program 89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in z around inf 75.9%
div-inv75.9%
+-commutative75.9%
Applied egg-rr75.9%
Taylor expanded in x around 0 60.3%
if 9.99999999999999978e-138 < x Initial program 91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in t around inf 73.4%
+-commutative73.4%
Simplified73.4%
Final simplification70.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.2e-77) (not (<= t 2.6e-59))) (/ x (+ x 1.0)) (- 1.0 (/ (* y z) x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.2e-77) || !(t <= 2.6e-59)) {
tmp = x / (x + 1.0);
} else {
tmp = 1.0 - ((y * 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 <= (-2.2d-77)) .or. (.not. (t <= 2.6d-59))) then
tmp = x / (x + 1.0d0)
else
tmp = 1.0d0 - ((y * z) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.2e-77) || !(t <= 2.6e-59)) {
tmp = x / (x + 1.0);
} else {
tmp = 1.0 - ((y * z) / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.2e-77) or not (t <= 2.6e-59): tmp = x / (x + 1.0) else: tmp = 1.0 - ((y * z) / x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.2e-77) || !(t <= 2.6e-59)) tmp = Float64(x / Float64(x + 1.0)); else tmp = Float64(1.0 - Float64(Float64(y * z) / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.2e-77) || ~((t <= 2.6e-59))) tmp = x / (x + 1.0); else tmp = 1.0 - ((y * z) / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.2e-77], N[Not[LessEqual[t, 2.6e-59]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{-77} \lor \neg \left(t \leq 2.6 \cdot 10^{-59}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{y \cdot z}{x}\\
\end{array}
\end{array}
if t < -2.20000000000000007e-77 or 2.59999999999999998e-59 < t Initial program 86.9%
*-commutative86.9%
Simplified86.9%
Taylor expanded in t around inf 68.3%
+-commutative68.3%
Simplified68.3%
if -2.20000000000000007e-77 < t < 2.59999999999999998e-59Initial program 98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in t around 0 78.2%
+-commutative78.2%
mul-1-neg78.2%
unsub-neg78.2%
associate-/l*78.3%
+-commutative78.3%
Simplified78.3%
Taylor expanded in y around 0 78.2%
mul-1-neg78.2%
unsub-neg78.2%
times-frac78.3%
+-commutative78.3%
Simplified78.3%
Taylor expanded in x around 0 71.6%
Final simplification69.5%
(FPCore (x y z t) :precision binary64 (if (<= x -7e-151) 1.0 (if (<= x 3.4e-141) (/ y t) (/ x (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -7e-151) {
tmp = 1.0;
} else if (x <= 3.4e-141) {
tmp = y / t;
} else {
tmp = 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 (x <= (-7d-151)) then
tmp = 1.0d0
else if (x <= 3.4d-141) then
tmp = y / t
else
tmp = 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 (x <= -7e-151) {
tmp = 1.0;
} else if (x <= 3.4e-141) {
tmp = y / t;
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -7e-151: tmp = 1.0 elif x <= 3.4e-141: tmp = y / t else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -7e-151) tmp = 1.0; elseif (x <= 3.4e-141) tmp = Float64(y / t); else tmp = Float64(x / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -7e-151) tmp = 1.0; elseif (x <= 3.4e-141) tmp = y / t; else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -7e-151], 1.0, If[LessEqual[x, 3.4e-141], N[(y / t), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{-151}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-141}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -6.99999999999999991e-151Initial program 92.6%
*-commutative92.6%
Simplified92.6%
Taylor expanded in t around inf 66.7%
+-commutative66.7%
Simplified66.7%
Taylor expanded in x around inf 69.0%
if -6.99999999999999991e-151 < x < 3.3999999999999998e-141Initial program 89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in z around inf 75.9%
div-inv75.9%
+-commutative75.9%
Applied egg-rr75.9%
Taylor expanded in x around 0 60.3%
if 3.3999999999999998e-141 < x Initial program 91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in t around inf 73.4%
+-commutative73.4%
Simplified73.4%
Final simplification67.8%
(FPCore (x y z t) :precision binary64 (if (<= x -4.5e-151) 1.0 (if (<= x 2.8e-52) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.5e-151) {
tmp = 1.0;
} else if (x <= 2.8e-52) {
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 <= (-4.5d-151)) then
tmp = 1.0d0
else if (x <= 2.8d-52) 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 <= -4.5e-151) {
tmp = 1.0;
} else if (x <= 2.8e-52) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.5e-151: tmp = 1.0 elif x <= 2.8e-52: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.5e-151) tmp = 1.0; elseif (x <= 2.8e-52) 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 <= -4.5e-151) tmp = 1.0; elseif (x <= 2.8e-52) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.5e-151], 1.0, If[LessEqual[x, 2.8e-52], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{-151}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-52}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -4.5000000000000002e-151 or 2.79999999999999995e-52 < x Initial program 91.2%
*-commutative91.2%
Simplified91.2%
Taylor expanded in t around inf 72.1%
+-commutative72.1%
Simplified72.1%
Taylor expanded in x around inf 74.6%
if -4.5000000000000002e-151 < x < 2.79999999999999995e-52Initial program 91.3%
*-commutative91.3%
Simplified91.3%
Taylor expanded in z around inf 74.7%
div-inv74.7%
+-commutative74.7%
Applied egg-rr74.7%
Taylor expanded in x around 0 54.5%
Final simplification67.6%
(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 91.2%
*-commutative91.2%
Simplified91.2%
Taylor expanded in t around inf 55.1%
+-commutative55.1%
Simplified55.1%
Taylor expanded in x around inf 52.9%
Final simplification52.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 2023229
(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)))