
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x))
(t_2 (fma y (/ z (* t_1 (+ x 1.0))) 1.0))
(t_3 (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0))))
(if (<= t_3 -100000.0)
t_2
(if (<= t_3 0.0001)
(/ (+ x (/ (- y (/ x z)) t)) (+ x 1.0))
(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 = fma(y, (z / (t_1 * (x + 1.0))), 1.0);
double t_3 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_3 <= -100000.0) {
tmp = t_2;
} else if (t_3 <= 0.0001) {
tmp = (x + ((y - (x / z)) / t)) / (x + 1.0);
} else if (t_3 <= ((double) INFINITY)) {
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 = fma(y, Float64(z / Float64(t_1 * Float64(x + 1.0))), 1.0) t_3 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_1)) / Float64(x + 1.0)) tmp = 0.0 if (t_3 <= -100000.0) tmp = t_2; elseif (t_3 <= 0.0001) tmp = Float64(Float64(x + Float64(Float64(y - Float64(x / z)) / t)) / Float64(x + 1.0)); elseif (t_3 <= Inf) tmp = t_2; 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]}, Block[{t$95$2 = N[(y * N[(z / N[(t$95$1 * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $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, -100000.0], t$95$2, If[LessEqual[t$95$3, 0.0001], N[(N[(x + N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 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 := \mathsf{fma}\left(y, \frac{z}{t\_1 \cdot \left(x + 1\right)}, 1\right)\\
t_3 := \frac{x + \frac{y \cdot z - x}{t\_1}}{x + 1}\\
\mathbf{if}\;t\_3 \leq -100000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 0.0001:\\
\;\;\;\;\frac{x + \frac{y - \frac{x}{z}}{t}}{x + 1}\\
\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 #s(literal 1 binary64))) < -1e5 or 1.00000000000000005e-4 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < +inf.0Initial program 91.7%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f6485.6
Simplified85.6%
Taylor expanded in y around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6492.8
Simplified92.8%
Taylor expanded in x around inf
Simplified98.4%
if -1e5 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1.00000000000000005e-4Initial program 93.9%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
/-lowering-/.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6499.1
Simplified99.1%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 0.0%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0
Simplified100.0%
Final simplification98.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0)))
(t_2 (- (* z t) x))
(t_3 (/ (+ x (/ (- (* y z) x) t_2)) (+ x 1.0))))
(if (<= t_3 -1e+195)
(/ (- x (* y (/ z x))) (+ x 1.0))
(if (<= t_3 0.0001)
t_1
(if (<= t_3 2.0)
1.0
(if (<= t_3 1e+285) (/ (* y z) (* 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 t_3 = (x + (((y * z) - x) / t_2)) / (x + 1.0);
double tmp;
if (t_3 <= -1e+195) {
tmp = (x - (y * (z / x))) / (x + 1.0);
} else if (t_3 <= 0.0001) {
tmp = t_1;
} else if (t_3 <= 2.0) {
tmp = 1.0;
} else if (t_3 <= 1e+285) {
tmp = (y * z) / (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) :: t_3
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
t_2 = (z * t) - x
t_3 = (x + (((y * z) - x) / t_2)) / (x + 1.0d0)
if (t_3 <= (-1d+195)) then
tmp = (x - (y * (z / x))) / (x + 1.0d0)
else if (t_3 <= 0.0001d0) then
tmp = t_1
else if (t_3 <= 2.0d0) then
tmp = 1.0d0
else if (t_3 <= 1d+285) then
tmp = (y * z) / (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 t_3 = (x + (((y * z) - x) / t_2)) / (x + 1.0);
double tmp;
if (t_3 <= -1e+195) {
tmp = (x - (y * (z / x))) / (x + 1.0);
} else if (t_3 <= 0.0001) {
tmp = t_1;
} else if (t_3 <= 2.0) {
tmp = 1.0;
} else if (t_3 <= 1e+285) {
tmp = (y * z) / (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 t_3 = (x + (((y * z) - x) / t_2)) / (x + 1.0) tmp = 0 if t_3 <= -1e+195: tmp = (x - (y * (z / x))) / (x + 1.0) elif t_3 <= 0.0001: tmp = t_1 elif t_3 <= 2.0: tmp = 1.0 elif t_3 <= 1e+285: tmp = (y * z) / (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) t_3 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_2)) / Float64(x + 1.0)) tmp = 0.0 if (t_3 <= -1e+195) tmp = Float64(Float64(x - Float64(y * Float64(z / x))) / Float64(x + 1.0)); elseif (t_3 <= 0.0001) tmp = t_1; elseif (t_3 <= 2.0) tmp = 1.0; elseif (t_3 <= 1e+285) tmp = Float64(Float64(y * z) / Float64(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; t_3 = (x + (((y * z) - x) / t_2)) / (x + 1.0); tmp = 0.0; if (t_3 <= -1e+195) tmp = (x - (y * (z / x))) / (x + 1.0); elseif (t_3 <= 0.0001) tmp = t_1; elseif (t_3 <= 2.0) tmp = 1.0; elseif (t_3 <= 1e+285) tmp = (y * z) / (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]}, Block[{t$95$3 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e+195], N[(N[(x - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 0.0001], t$95$1, If[LessEqual[t$95$3, 2.0], 1.0, If[LessEqual[t$95$3, 1e+285], N[(N[(y * z), $MachinePrecision] / N[(t$95$2 * N[(x + 1.0), $MachinePrecision]), $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\\
t_3 := \frac{x + \frac{y \cdot z - x}{t\_2}}{x + 1}\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{+195}:\\
\;\;\;\;\frac{x - y \cdot \frac{z}{x}}{x + 1}\\
\mathbf{elif}\;t\_3 \leq 0.0001:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq 2:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_3 \leq 10^{+285}:\\
\;\;\;\;\frac{y \cdot z}{t\_2 \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < -9.99999999999999977e194Initial program 48.4%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f6448.4
Simplified48.4%
Taylor expanded in z around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6483.3
Simplified83.3%
if -9.99999999999999977e194 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1.00000000000000005e-4 or 9.9999999999999998e284 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 75.7%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6482.3
Simplified82.3%
if 1.00000000000000005e-4 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2Initial program 100.0%
Taylor expanded in x around inf
Simplified98.4%
if 2 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 9.9999999999999998e284Initial program 99.4%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6497.8
Simplified97.8%
Final simplification92.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0)))
(t_2 (- (* z t) x))
(t_3 (/ (+ x (/ (- (* y z) x) t_2)) (+ x 1.0))))
(if (<= t_3 -1e+195)
(fma (- 0.0 y) (/ z (fma x x x)) 1.0)
(if (<= t_3 0.0001)
t_1
(if (<= t_3 2.0)
1.0
(if (<= t_3 1e+285) (/ (* y z) (* 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 t_3 = (x + (((y * z) - x) / t_2)) / (x + 1.0);
double tmp;
if (t_3 <= -1e+195) {
tmp = fma((0.0 - y), (z / fma(x, x, x)), 1.0);
} else if (t_3 <= 0.0001) {
tmp = t_1;
} else if (t_3 <= 2.0) {
tmp = 1.0;
} else if (t_3 <= 1e+285) {
tmp = (y * z) / (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) t_3 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_2)) / Float64(x + 1.0)) tmp = 0.0 if (t_3 <= -1e+195) tmp = fma(Float64(0.0 - y), Float64(z / fma(x, x, x)), 1.0); elseif (t_3 <= 0.0001) tmp = t_1; elseif (t_3 <= 2.0) tmp = 1.0; elseif (t_3 <= 1e+285) tmp = Float64(Float64(y * z) / Float64(t_2 * Float64(x + 1.0))); else tmp = t_1; end return 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]}, Block[{t$95$3 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e+195], N[(N[(0.0 - y), $MachinePrecision] * N[(z / N[(x * x + x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[t$95$3, 0.0001], t$95$1, If[LessEqual[t$95$3, 2.0], 1.0, If[LessEqual[t$95$3, 1e+285], N[(N[(y * z), $MachinePrecision] / N[(t$95$2 * N[(x + 1.0), $MachinePrecision]), $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\\
t_3 := \frac{x + \frac{y \cdot z - x}{t\_2}}{x + 1}\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{+195}:\\
\;\;\;\;\mathsf{fma}\left(0 - y, \frac{z}{\mathsf{fma}\left(x, x, x\right)}, 1\right)\\
\mathbf{elif}\;t\_3 \leq 0.0001:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq 2:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_3 \leq 10^{+285}:\\
\;\;\;\;\frac{y \cdot z}{t\_2 \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < -9.99999999999999977e194Initial program 48.4%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
remove-double-negN/A
mul-1-negN/A
sub-negN/A
distribute-lft-out--N/A
distribute-lft-out--N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified67.2%
Taylor expanded in z around 0
+-commutativeN/A
associate-/r*N/A
associate-/r*N/A
div-subN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
div-subN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f6472.7
Simplified72.7%
Taylor expanded in t around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f6483.0
Simplified83.0%
if -9.99999999999999977e194 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1.00000000000000005e-4 or 9.9999999999999998e284 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 75.7%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6482.3
Simplified82.3%
if 1.00000000000000005e-4 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2Initial program 100.0%
Taylor expanded in x around inf
Simplified98.4%
if 2 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 9.9999999999999998e284Initial program 99.4%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6497.8
Simplified97.8%
Final simplification92.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x))
(t_2 (fma y (/ z (* t_1 (+ x 1.0))) 1.0))
(t_3 (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0))))
(if (<= t_3 -100000.0)
t_2
(if (<= t_3 0.0001)
(+ x (/ (- y (/ x z)) t))
(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 = fma(y, (z / (t_1 * (x + 1.0))), 1.0);
double t_3 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_3 <= -100000.0) {
tmp = t_2;
} else if (t_3 <= 0.0001) {
tmp = x + ((y - (x / z)) / t);
} else if (t_3 <= ((double) INFINITY)) {
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 = fma(y, Float64(z / Float64(t_1 * Float64(x + 1.0))), 1.0) t_3 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_1)) / Float64(x + 1.0)) tmp = 0.0 if (t_3 <= -100000.0) tmp = t_2; elseif (t_3 <= 0.0001) tmp = Float64(x + Float64(Float64(y - Float64(x / z)) / t)); elseif (t_3 <= Inf) tmp = t_2; 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]}, Block[{t$95$2 = N[(y * N[(z / N[(t$95$1 * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $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, -100000.0], t$95$2, If[LessEqual[t$95$3, 0.0001], N[(x + N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], 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 := \mathsf{fma}\left(y, \frac{z}{t\_1 \cdot \left(x + 1\right)}, 1\right)\\
t_3 := \frac{x + \frac{y \cdot z - x}{t\_1}}{x + 1}\\
\mathbf{if}\;t\_3 \leq -100000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 0.0001:\\
\;\;\;\;x + \frac{y - \frac{x}{z}}{t}\\
\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 #s(literal 1 binary64))) < -1e5 or 1.00000000000000005e-4 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < +inf.0Initial program 91.7%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f6485.6
Simplified85.6%
Taylor expanded in y around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6492.8
Simplified92.8%
Taylor expanded in x around inf
Simplified98.4%
if -1e5 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1.00000000000000005e-4Initial program 93.9%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
/-lowering-/.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6499.1
Simplified99.1%
Taylor expanded in x around 0
Simplified96.7%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 0.0%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0
Simplified100.0%
Final simplification98.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0)))
(t_2 (- (* z t) x))
(t_3 (fma y (/ z (* t_2 (+ x 1.0))) 1.0))
(t_4 (/ (+ x (/ (- (* y z) x) t_2)) (+ x 1.0))))
(if (<= t_4 -100000.0)
t_3
(if (<= t_4 0.0001) t_1 (if (<= t_4 INFINITY) t_3 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 t_3 = fma(y, (z / (t_2 * (x + 1.0))), 1.0);
double t_4 = (x + (((y * z) - x) / t_2)) / (x + 1.0);
double tmp;
if (t_4 <= -100000.0) {
tmp = t_3;
} else if (t_4 <= 0.0001) {
tmp = t_1;
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_3;
} 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) t_3 = fma(y, Float64(z / Float64(t_2 * Float64(x + 1.0))), 1.0) t_4 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_2)) / Float64(x + 1.0)) tmp = 0.0 if (t_4 <= -100000.0) tmp = t_3; elseif (t_4 <= 0.0001) tmp = t_1; elseif (t_4 <= Inf) tmp = t_3; else tmp = t_1; end return 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]}, Block[{t$95$3 = N[(y * N[(z / N[(t$95$2 * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -100000.0], t$95$3, If[LessEqual[t$95$4, 0.0001], t$95$1, If[LessEqual[t$95$4, Infinity], t$95$3, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
t_2 := z \cdot t - x\\
t_3 := \mathsf{fma}\left(y, \frac{z}{t\_2 \cdot \left(x + 1\right)}, 1\right)\\
t_4 := \frac{x + \frac{y \cdot z - x}{t\_2}}{x + 1}\\
\mathbf{if}\;t\_4 \leq -100000:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq 0.0001:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < -1e5 or 1.00000000000000005e-4 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < +inf.0Initial program 91.7%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f6485.6
Simplified85.6%
Taylor expanded in y around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6492.8
Simplified92.8%
Taylor expanded in x around inf
Simplified98.4%
if -1e5 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1.00000000000000005e-4 or +inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 77.1%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6489.9
Simplified89.9%
Final simplification96.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0)))
(t_2 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t_1 -1e+195)
(fma (- 0.0 y) (/ z (fma x x x)) 1.0)
(if (<= t_1 0.0001) t_2 (if (<= t_1 1.002) 1.0 t_2)))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
double t_2 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t_1 <= -1e+195) {
tmp = fma((0.0 - y), (z / fma(x, x, x)), 1.0);
} else if (t_1 <= 0.0001) {
tmp = t_2;
} else if (t_1 <= 1.002) {
tmp = 1.0;
} else {
tmp = t_2;
}
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)) t_2 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (t_1 <= -1e+195) tmp = fma(Float64(0.0 - y), Float64(z / fma(x, x, x)), 1.0); elseif (t_1 <= 0.0001) tmp = t_2; elseif (t_1 <= 1.002) tmp = 1.0; else tmp = t_2; end return 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]}, Block[{t$95$2 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+195], N[(N[(0.0 - y), $MachinePrecision] * N[(z / N[(x * x + x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[t$95$1, 0.0001], t$95$2, If[LessEqual[t$95$1, 1.002], 1.0, t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\
t_2 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+195}:\\
\;\;\;\;\mathsf{fma}\left(0 - y, \frac{z}{\mathsf{fma}\left(x, x, x\right)}, 1\right)\\
\mathbf{elif}\;t\_1 \leq 0.0001:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 1.002:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < -9.99999999999999977e194Initial program 48.4%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
remove-double-negN/A
mul-1-negN/A
sub-negN/A
distribute-lft-out--N/A
distribute-lft-out--N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified67.2%
Taylor expanded in z around 0
+-commutativeN/A
associate-/r*N/A
associate-/r*N/A
div-subN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
div-subN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f6472.7
Simplified72.7%
Taylor expanded in t around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f6483.0
Simplified83.0%
if -9.99999999999999977e194 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1.00000000000000005e-4 or 1.002 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 82.5%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6473.0
Simplified73.0%
if 1.00000000000000005e-4 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1.002Initial program 100.0%
Taylor expanded in x around inf
Simplified99.0%
Final simplification86.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))))
(if (<= t_1 -2e+75)
(fma (- 0.0 y) (/ z (fma x x x)) 1.0)
(if (<= t_1 0.0001)
(+ x (/ y t))
(if (<= t_1 50000.0) 1.0 (/ (/ 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 <= -2e+75) {
tmp = fma((0.0 - y), (z / fma(x, x, x)), 1.0);
} else if (t_1 <= 0.0001) {
tmp = x + (y / t);
} else if (t_1 <= 50000.0) {
tmp = 1.0;
} else {
tmp = (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 <= -2e+75) tmp = fma(Float64(0.0 - y), Float64(z / fma(x, x, x)), 1.0); elseif (t_1 <= 0.0001) tmp = Float64(x + Float64(y / t)); elseif (t_1 <= 50000.0) tmp = 1.0; else tmp = Float64(Float64(y / t) / Float64(x + 1.0)); end return 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, -2e+75], N[(N[(0.0 - y), $MachinePrecision] * N[(z / N[(x * x + x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[t$95$1, 0.0001], N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 50000.0], 1.0, N[(N[(y / t), $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 -2 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{fma}\left(0 - y, \frac{z}{\mathsf{fma}\left(x, x, x\right)}, 1\right)\\
\mathbf{elif}\;t\_1 \leq 0.0001:\\
\;\;\;\;x + \frac{y}{t}\\
\mathbf{elif}\;t\_1 \leq 50000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < -1.99999999999999985e75Initial program 60.1%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
remove-double-negN/A
mul-1-negN/A
sub-negN/A
distribute-lft-out--N/A
distribute-lft-out--N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified61.8%
Taylor expanded in z around 0
+-commutativeN/A
associate-/r*N/A
associate-/r*N/A
div-subN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
div-subN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f6466.1
Simplified66.1%
Taylor expanded in t around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f6474.0
Simplified74.0%
if -1.99999999999999985e75 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1.00000000000000005e-4Initial program 94.3%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6484.8
Simplified84.8%
Taylor expanded in x around 0
Simplified82.5%
/-rgt-identityN/A
+-lowering-+.f64N/A
/-lowering-/.f6482.5
Applied egg-rr82.5%
if 1.00000000000000005e-4 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 5e4Initial program 100.0%
Taylor expanded in x around inf
Simplified97.7%
if 5e4 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 70.8%
Taylor expanded in x around 0
/-lowering-/.f6454.2
Simplified54.2%
Final simplification82.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))))
(if (<= t_1 -2e+75)
(fma z (/ (- t y) (fma x x x)) 1.0)
(if (<= t_1 0.0001)
(+ x (/ y t))
(if (<= t_1 50000.0) 1.0 (/ (/ 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 <= -2e+75) {
tmp = fma(z, ((t - y) / fma(x, x, x)), 1.0);
} else if (t_1 <= 0.0001) {
tmp = x + (y / t);
} else if (t_1 <= 50000.0) {
tmp = 1.0;
} else {
tmp = (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 <= -2e+75) tmp = fma(z, Float64(Float64(t - y) / fma(x, x, x)), 1.0); elseif (t_1 <= 0.0001) tmp = Float64(x + Float64(y / t)); elseif (t_1 <= 50000.0) tmp = 1.0; else tmp = Float64(Float64(y / t) / Float64(x + 1.0)); end return 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, -2e+75], N[(z * N[(N[(t - y), $MachinePrecision] / N[(x * x + x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[t$95$1, 0.0001], N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 50000.0], 1.0, N[(N[(y / t), $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 -2 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{t - y}{\mathsf{fma}\left(x, x, x\right)}, 1\right)\\
\mathbf{elif}\;t\_1 \leq 0.0001:\\
\;\;\;\;x + \frac{y}{t}\\
\mathbf{elif}\;t\_1 \leq 50000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < -1.99999999999999985e75Initial program 60.1%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
remove-double-negN/A
mul-1-negN/A
sub-negN/A
distribute-lft-out--N/A
distribute-lft-out--N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified61.8%
Taylor expanded in z around 0
+-commutativeN/A
associate-/r*N/A
associate-/r*N/A
div-subN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
div-subN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f6466.1
Simplified66.1%
Taylor expanded in t around 0
+-commutativeN/A
mul-1-negN/A
sub-negN/A
div-subN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f6461.6
Simplified61.6%
if -1.99999999999999985e75 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1.00000000000000005e-4Initial program 94.3%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6484.8
Simplified84.8%
Taylor expanded in x around 0
Simplified82.5%
/-rgt-identityN/A
+-lowering-+.f64N/A
/-lowering-/.f6482.5
Applied egg-rr82.5%
if 1.00000000000000005e-4 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 5e4Initial program 100.0%
Taylor expanded in x around inf
Simplified97.7%
if 5e4 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 70.8%
Taylor expanded in x around 0
/-lowering-/.f6454.2
Simplified54.2%
Final simplification81.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-48)
(/ y t)
(if (<= t_1 0.0001) x (if (<= t_1 50000.0) 1.0 (/ y t))))))
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-48) {
tmp = y / t;
} else if (t_1 <= 0.0001) {
tmp = x;
} else if (t_1 <= 50000.0) {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0d0)
if (t_1 <= (-5d-48)) then
tmp = y / t
else if (t_1 <= 0.0001d0) then
tmp = x
else if (t_1 <= 50000.0d0) then
tmp = 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 t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
double tmp;
if (t_1 <= -5e-48) {
tmp = y / t;
} else if (t_1 <= 0.0001) {
tmp = x;
} else if (t_1 <= 50000.0) {
tmp = 1.0;
} else {
tmp = y / t;
}
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-48: tmp = y / t elif t_1 <= 0.0001: tmp = x elif t_1 <= 50000.0: tmp = 1.0 else: tmp = y / t 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-48) tmp = Float64(y / t); elseif (t_1 <= 0.0001) tmp = x; elseif (t_1 <= 50000.0) tmp = 1.0; else tmp = Float64(y / t); 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-48) tmp = y / t; elseif (t_1 <= 0.0001) tmp = x; elseif (t_1 <= 50000.0) tmp = 1.0; else tmp = y / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-48], N[(y / t), $MachinePrecision], If[LessEqual[t$95$1, 0.0001], x, If[LessEqual[t$95$1, 50000.0], 1.0, N[(y / t), $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^{-48}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{elif}\;t\_1 \leq 0.0001:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_1 \leq 50000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < -4.9999999999999999e-48 or 5e4 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 70.4%
Taylor expanded in x around 0
/-lowering-/.f6447.9
Simplified47.9%
if -4.9999999999999999e-48 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1.00000000000000005e-4Initial program 93.5%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6486.8
Simplified86.8%
Taylor expanded in x around 0
Simplified84.2%
Taylor expanded in y around 0
Simplified66.3%
if 1.00000000000000005e-4 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 5e4Initial program 100.0%
Taylor expanded in x around inf
Simplified97.7%
Final simplification74.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0)))) (if (<= t_1 (- INFINITY)) 1.0 (if (<= t_1 0.0001) 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 <= -((double) INFINITY)) {
tmp = 1.0;
} else if (t_1 <= 0.0001) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
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 <= -Double.POSITIVE_INFINITY) {
tmp = 1.0;
} else if (t_1 <= 0.0001) {
tmp = x;
} else {
tmp = 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 <= -math.inf: tmp = 1.0 elif t_1 <= 0.0001: tmp = x else: tmp = 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 <= Float64(-Inf)) tmp = 1.0; elseif (t_1 <= 0.0001) tmp = x; else tmp = 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 <= -Inf) tmp = 1.0; elseif (t_1 <= 0.0001) tmp = x; else tmp = 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, (-Infinity)], 1.0, If[LessEqual[t$95$1, 0.0001], x, 1.0]]]
\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 -\infty:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_1 \leq 0.0001:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < -inf.0 or 1.00000000000000005e-4 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 86.5%
Taylor expanded in x around inf
Simplified69.1%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1.00000000000000005e-4Initial program 95.2%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6476.3
Simplified76.3%
Taylor expanded in x around 0
Simplified73.6%
Taylor expanded in y around 0
Simplified49.3%
Final simplification64.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x)))
(+
(fma y (/ z (* t_1 (+ x 1.0))) (/ x (+ x 1.0)))
(/ x (* t_1 (- -1.0 x))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
return fma(y, (z / (t_1 * (x + 1.0))), (x / (x + 1.0))) + (x / (t_1 * (-1.0 - x)));
}
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) return Float64(fma(y, Float64(z / Float64(t_1 * Float64(x + 1.0))), Float64(x / Float64(x + 1.0))) + Float64(x / Float64(t_1 * Float64(-1.0 - x)))) end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, N[(N[(y * N[(z / N[(t$95$1 * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / N[(t$95$1 * N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
\mathsf{fma}\left(y, \frac{z}{t\_1 \cdot \left(x + 1\right)}, \frac{x}{x + 1}\right) + \frac{x}{t\_1 \cdot \left(-1 - x\right)}
\end{array}
\end{array}
Initial program 88.5%
Taylor expanded in y around 0
--lowering--.f64N/A
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
Simplified96.5%
Final simplification96.5%
(FPCore (x y z t)
:precision binary64
(if (<= x -3900000.0)
(+ 1.0 (/ -1.0 x))
(if (<= x -1.8e-53)
(/ (* z (- t y)) (fma x x x))
(if (<= x 29000.0) (+ x (/ y t)) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3900000.0) {
tmp = 1.0 + (-1.0 / x);
} else if (x <= -1.8e-53) {
tmp = (z * (t - y)) / fma(x, x, x);
} else if (x <= 29000.0) {
tmp = x + (y / t);
} else {
tmp = 1.0;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (x <= -3900000.0) tmp = Float64(1.0 + Float64(-1.0 / x)); elseif (x <= -1.8e-53) tmp = Float64(Float64(z * Float64(t - y)) / fma(x, x, x)); elseif (x <= 29000.0) tmp = Float64(x + Float64(y / t)); else tmp = 1.0; end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, -3900000.0], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.8e-53], N[(N[(z * N[(t - y), $MachinePrecision]), $MachinePrecision] / N[(x * x + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 29000.0], N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision], 1.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3900000:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-53}:\\
\;\;\;\;\frac{z \cdot \left(t - y\right)}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{elif}\;x \leq 29000:\\
\;\;\;\;x + \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -3.9e6Initial program 86.1%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f6486.1
Simplified86.1%
Taylor expanded in x around inf
--lowering--.f64N/A
/-lowering-/.f6492.0
Simplified92.0%
if -3.9e6 < x < -1.7999999999999999e-53Initial program 92.4%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
remove-double-negN/A
mul-1-negN/A
sub-negN/A
distribute-lft-out--N/A
distribute-lft-out--N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified60.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-/r*N/A
associate-/r*N/A
div-subN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
div-subN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f6460.8
Simplified60.8%
Taylor expanded in z around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f6454.3
Simplified54.3%
if -1.7999999999999999e-53 < x < 29000Initial program 90.1%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6471.8
Simplified71.8%
Taylor expanded in x around 0
Simplified70.4%
/-rgt-identityN/A
+-lowering-+.f64N/A
/-lowering-/.f6470.4
Applied egg-rr70.4%
if 29000 < x Initial program 87.4%
Taylor expanded in x around inf
Simplified91.6%
Final simplification80.6%
(FPCore (x y z t) :precision binary64 (if (<= x -0.063) (/ x (+ x 1.0)) (if (<= x 115000.0) (+ x (/ y t)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -0.063) {
tmp = x / (x + 1.0);
} else if (x <= 115000.0) {
tmp = x + (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 <= (-0.063d0)) then
tmp = x / (x + 1.0d0)
else if (x <= 115000.0d0) then
tmp = x + (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 <= -0.063) {
tmp = x / (x + 1.0);
} else if (x <= 115000.0) {
tmp = x + (y / t);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -0.063: tmp = x / (x + 1.0) elif x <= 115000.0: tmp = x + (y / t) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -0.063) tmp = Float64(x / Float64(x + 1.0)); elseif (x <= 115000.0) tmp = Float64(x + Float64(y / t)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -0.063) tmp = x / (x + 1.0); elseif (x <= 115000.0) tmp = x + (y / t); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -0.063], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 115000.0], N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.063:\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{elif}\;x \leq 115000:\\
\;\;\;\;x + \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -0.063Initial program 86.5%
Taylor expanded in t around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6489.3
Simplified89.3%
if -0.063 < x < 115000Initial program 90.2%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6468.0
Simplified68.0%
Taylor expanded in x around 0
Simplified66.1%
/-rgt-identityN/A
+-lowering-+.f64N/A
/-lowering-/.f6466.1
Applied egg-rr66.1%
if 115000 < x Initial program 87.4%
Taylor expanded in x around inf
Simplified91.6%
Final simplification79.0%
(FPCore (x y z t) :precision binary64 (if (<= x -1.0) (+ 1.0 (/ -1.0 x)) (if (<= x 29000.0) (+ x (/ y t)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.0) {
tmp = 1.0 + (-1.0 / x);
} else if (x <= 29000.0) {
tmp = x + (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 <= (-1.0d0)) then
tmp = 1.0d0 + ((-1.0d0) / x)
else if (x <= 29000.0d0) then
tmp = x + (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 <= -1.0) {
tmp = 1.0 + (-1.0 / x);
} else if (x <= 29000.0) {
tmp = x + (y / t);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.0: tmp = 1.0 + (-1.0 / x) elif x <= 29000.0: tmp = x + (y / t) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.0) tmp = Float64(1.0 + Float64(-1.0 / x)); elseif (x <= 29000.0) tmp = Float64(x + Float64(y / t)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.0) tmp = 1.0 + (-1.0 / x); elseif (x <= 29000.0) tmp = x + (y / t); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.0], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 29000.0], N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{elif}\;x \leq 29000:\\
\;\;\;\;x + \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1Initial program 86.5%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f6486.5
Simplified86.5%
Taylor expanded in x around inf
--lowering--.f64N/A
/-lowering-/.f6489.3
Simplified89.3%
if -1 < x < 29000Initial program 90.2%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6468.0
Simplified68.0%
Taylor expanded in x around 0
Simplified66.1%
/-rgt-identityN/A
+-lowering-+.f64N/A
/-lowering-/.f6466.1
Applied egg-rr66.1%
if 29000 < x Initial program 87.4%
Taylor expanded in x around inf
Simplified91.6%
Final simplification79.0%
(FPCore (x y z t) :precision binary64 (if (<= x -0.62) 1.0 (if (<= x 29000.0) (+ x (/ y t)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -0.62) {
tmp = 1.0;
} else if (x <= 29000.0) {
tmp = x + (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 <= (-0.62d0)) then
tmp = 1.0d0
else if (x <= 29000.0d0) then
tmp = x + (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 <= -0.62) {
tmp = 1.0;
} else if (x <= 29000.0) {
tmp = x + (y / t);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -0.62: tmp = 1.0 elif x <= 29000.0: tmp = x + (y / t) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -0.62) tmp = 1.0; elseif (x <= 29000.0) tmp = Float64(x + Float64(y / t)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -0.62) tmp = 1.0; elseif (x <= 29000.0) tmp = x + (y / t); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -0.62], 1.0, If[LessEqual[x, 29000.0], N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.62:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 29000:\\
\;\;\;\;x + \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -0.619999999999999996 or 29000 < x Initial program 87.0%
Taylor expanded in x around inf
Simplified90.3%
if -0.619999999999999996 < x < 29000Initial program 90.2%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6468.0
Simplified68.0%
Taylor expanded in x around 0
Simplified66.1%
/-rgt-identityN/A
+-lowering-+.f64N/A
/-lowering-/.f6466.1
Applied egg-rr66.1%
Final simplification78.9%
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
return 1.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 88.5%
Taylor expanded in x around inf
Simplified54.1%
(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 2024195
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(! :herbie-platform default (/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1)))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))