
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* x y) (* z (- t a))))
(t_2 (fma z (- b y) y))
(t_3 (/ t_1 (+ y (* z (- b y)))))
(t_4 (/ (- t a) (- b y))))
(if (<= t_3 (- INFINITY))
(* x (fma z (/ (- t a) (* x t_2)) (/ y t_2)))
(if (<= t_3 -5e-283)
(/ t_1 (fma z b (fma z (- 0.0 y) y)))
(if (<= t_3 0.0) t_4 (if (<= t_3 2e+269) t_3 t_4))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * y) + (z * (t - a));
double t_2 = fma(z, (b - y), y);
double t_3 = t_1 / (y + (z * (b - y)));
double t_4 = (t - a) / (b - y);
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = x * fma(z, ((t - a) / (x * t_2)), (y / t_2));
} else if (t_3 <= -5e-283) {
tmp = t_1 / fma(z, b, fma(z, (0.0 - y), y));
} else if (t_3 <= 0.0) {
tmp = t_4;
} else if (t_3 <= 2e+269) {
tmp = t_3;
} else {
tmp = t_4;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * y) + Float64(z * Float64(t - a))) t_2 = fma(z, Float64(b - y), y) t_3 = Float64(t_1 / Float64(y + Float64(z * Float64(b - y)))) t_4 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(x * fma(z, Float64(Float64(t - a) / Float64(x * t_2)), Float64(y / t_2))); elseif (t_3 <= -5e-283) tmp = Float64(t_1 / fma(z, b, fma(z, Float64(0.0 - y), y))); elseif (t_3 <= 0.0) tmp = t_4; elseif (t_3 <= 2e+269) tmp = t_3; else tmp = t_4; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(x * N[(z * N[(N[(t - a), $MachinePrecision] / N[(x * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(y / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -5e-283], N[(t$95$1 / N[(z * b + N[(z * N[(0.0 - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 0.0], t$95$4, If[LessEqual[t$95$3, 2e+269], t$95$3, t$95$4]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot \left(t - a\right)\\
t_2 := \mathsf{fma}\left(z, b - y, y\right)\\
t_3 := \frac{t\_1}{y + z \cdot \left(b - y\right)}\\
t_4 := \frac{t - a}{b - y}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;x \cdot \mathsf{fma}\left(z, \frac{t - a}{x \cdot t\_2}, \frac{y}{t\_2}\right)\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-283}:\\
\;\;\;\;\frac{t\_1}{\mathsf{fma}\left(z, b, \mathsf{fma}\left(z, 0 - y, y\right)\right)}\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+269}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0Initial program 37.5%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6484.6
Simplified84.6%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -5.0000000000000001e-283Initial program 99.5%
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6499.6
Applied egg-rr99.6%
if -5.0000000000000001e-283 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0 or 2.0000000000000001e269 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 17.6%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6477.3
Simplified77.3%
if -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.0000000000000001e269Initial program 99.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -4000000.0)
t_1
(if (<= z 8.5e+17)
(/ (+ (* x y) (* z (- t a))) (fma z b (fma z (- 0.0 y) y)))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -4000000.0) {
tmp = t_1;
} else if (z <= 8.5e+17) {
tmp = ((x * y) + (z * (t - a))) / fma(z, b, fma(z, (0.0 - y), y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -4000000.0) tmp = t_1; elseif (z <= 8.5e+17) tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / fma(z, b, fma(z, Float64(0.0 - y), y))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4000000.0], t$95$1, If[LessEqual[z, 8.5e+17], N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * b + N[(z * N[(0.0 - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -4000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+17}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{\mathsf{fma}\left(z, b, \mathsf{fma}\left(z, 0 - y, y\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4e6 or 8.5e17 < z Initial program 41.9%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6483.6
Simplified83.6%
if -4e6 < z < 8.5e17Initial program 88.4%
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6488.4
Applied egg-rr88.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -4000000.0)
t_1
(if (<= z 2.5e+18)
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y))))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -4000000.0) {
tmp = t_1;
} else if (z <= 2.5e+18) {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-4000000.0d0)) then
tmp = t_1
else if (z <= 2.5d+18) then
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -4000000.0) {
tmp = t_1;
} else if (z <= 2.5e+18) {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -4000000.0: tmp = t_1 elif z <= 2.5e+18: tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -4000000.0) tmp = t_1; elseif (z <= 2.5e+18) tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -4000000.0) tmp = t_1; elseif (z <= 2.5e+18) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4000000.0], t$95$1, If[LessEqual[z, 2.5e+18], N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -4000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+18}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4e6 or 2.5e18 < z Initial program 41.9%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6483.6
Simplified83.6%
if -4e6 < z < 2.5e18Initial program 88.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -1.18e-85)
t_1
(if (<= z -1.75e-302)
(* x (/ y (fma z (- b y) y)))
(if (<= z 4.3e-33) (/ (+ (* x y) (* z (- t a))) y) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -1.18e-85) {
tmp = t_1;
} else if (z <= -1.75e-302) {
tmp = x * (y / fma(z, (b - y), y));
} else if (z <= 4.3e-33) {
tmp = ((x * y) + (z * (t - a))) / y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1.18e-85) tmp = t_1; elseif (z <= -1.75e-302) tmp = Float64(x * Float64(y / fma(z, Float64(b - y), y))); elseif (z <= 4.3e-33) tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.18e-85], t$95$1, If[LessEqual[z, -1.75e-302], N[(x * N[(y / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.3e-33], N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.18 \cdot 10^{-85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{-302}:\\
\;\;\;\;x \cdot \frac{y}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{-33}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.18e-85 or 4.30000000000000031e-33 < z Initial program 49.0%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6480.2
Simplified80.2%
if -1.18e-85 < z < -1.7500000000000001e-302Initial program 82.9%
div-invN/A
flip3-+N/A
clear-numN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
clear-numN/A
flip3-+N/A
/-lowering-/.f64N/A
+-commutativeN/A
Applied egg-rr82.8%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6448.5
Simplified48.5%
un-div-invN/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-fma.f64N/A
--lowering--.f6465.5
Applied egg-rr65.5%
if -1.7500000000000001e-302 < z < 4.30000000000000031e-33Initial program 91.7%
Taylor expanded in z around 0
Simplified72.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -2e-85) t_1 (if (<= z 9e-89) (* x (/ y (fma z (- b y) y))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -2e-85) {
tmp = t_1;
} else if (z <= 9e-89) {
tmp = x * (y / fma(z, (b - y), y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -2e-85) tmp = t_1; elseif (z <= 9e-89) tmp = Float64(x * Float64(y / fma(z, Float64(b - y), y))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e-85], t$95$1, If[LessEqual[z, 9e-89], N[(x * N[(y / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2 \cdot 10^{-85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-89}:\\
\;\;\;\;x \cdot \frac{y}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2e-85 or 8.9999999999999998e-89 < z Initial program 51.5%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6478.1
Simplified78.1%
if -2e-85 < z < 8.9999999999999998e-89Initial program 86.9%
div-invN/A
flip3-+N/A
clear-numN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
clear-numN/A
flip3-+N/A
/-lowering-/.f64N/A
+-commutativeN/A
Applied egg-rr86.7%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6452.2
Simplified52.2%
un-div-invN/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-fma.f64N/A
--lowering--.f6465.2
Applied egg-rr65.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ t (- b y))))
(if (<= z -5.5e+131)
t_1
(if (<= z -82000000.0)
(/ a (- y b))
(if (<= z 5.8e-9) (/ x (- 1.0 z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -5.5e+131) {
tmp = t_1;
} else if (z <= -82000000.0) {
tmp = a / (y - b);
} else if (z <= 5.8e-9) {
tmp = x / (1.0 - z);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t / (b - y)
if (z <= (-5.5d+131)) then
tmp = t_1
else if (z <= (-82000000.0d0)) then
tmp = a / (y - b)
else if (z <= 5.8d-9) then
tmp = x / (1.0d0 - z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -5.5e+131) {
tmp = t_1;
} else if (z <= -82000000.0) {
tmp = a / (y - b);
} else if (z <= 5.8e-9) {
tmp = x / (1.0 - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) tmp = 0 if z <= -5.5e+131: tmp = t_1 elif z <= -82000000.0: tmp = a / (y - b) elif z <= 5.8e-9: tmp = x / (1.0 - z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) tmp = 0.0 if (z <= -5.5e+131) tmp = t_1; elseif (z <= -82000000.0) tmp = Float64(a / Float64(y - b)); elseif (z <= 5.8e-9) tmp = Float64(x / Float64(1.0 - z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (b - y); tmp = 0.0; if (z <= -5.5e+131) tmp = t_1; elseif (z <= -82000000.0) tmp = a / (y - b); elseif (z <= 5.8e-9) tmp = x / (1.0 - z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.5e+131], t$95$1, If[LessEqual[z, -82000000.0], N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e-9], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+131}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -82000000:\\
\;\;\;\;\frac{a}{y - b}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-9}:\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.49999999999999971e131 or 5.79999999999999982e-9 < z Initial program 35.3%
Taylor expanded in t around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6423.5
Simplified23.5%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f6450.8
Simplified50.8%
if -5.49999999999999971e131 < z < -8.2e7Initial program 79.7%
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6479.9
Applied egg-rr79.9%
Taylor expanded in a around inf
associate-*r/N/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
mul-1-negN/A
sub-negN/A
associate-*r/N/A
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
neg-lowering-neg.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6446.8
Simplified46.8%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f6460.1
Simplified60.1%
if -8.2e7 < z < 5.79999999999999982e-9Initial program 87.1%
Taylor expanded in y around inf
/-lowering-/.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6445.2
Simplified45.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -2.8e-214) t_1 (if (<= z 2.05e-89) x t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -2.8e-214) {
tmp = t_1;
} else if (z <= 2.05e-89) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-2.8d-214)) then
tmp = t_1
else if (z <= 2.05d-89) then
tmp = x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -2.8e-214) {
tmp = t_1;
} else if (z <= 2.05e-89) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -2.8e-214: tmp = t_1 elif z <= 2.05e-89: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -2.8e-214) tmp = t_1; elseif (z <= 2.05e-89) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -2.8e-214) tmp = t_1; elseif (z <= 2.05e-89) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.8e-214], t$95$1, If[LessEqual[z, 2.05e-89], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{-214}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{-89}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.8000000000000002e-214 or 2.0499999999999999e-89 < z Initial program 56.3%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6472.6
Simplified72.6%
if -2.8000000000000002e-214 < z < 2.0499999999999999e-89Initial program 84.7%
Taylor expanded in z around 0
Simplified55.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- 1.0 z)))) (if (<= y -8.6e-40) t_1 (if (<= y 4e+63) (/ (- t a) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -8.6e-40) {
tmp = t_1;
} else if (y <= 4e+63) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (1.0d0 - z)
if (y <= (-8.6d-40)) then
tmp = t_1
else if (y <= 4d+63) then
tmp = (t - a) / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -8.6e-40) {
tmp = t_1;
} else if (y <= 4e+63) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -8.6e-40: tmp = t_1 elif y <= 4e+63: tmp = (t - a) / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -8.6e-40) tmp = t_1; elseif (y <= 4e+63) tmp = Float64(Float64(t - a) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 - z); tmp = 0.0; if (y <= -8.6e-40) tmp = t_1; elseif (y <= 4e+63) tmp = (t - a) / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.6e-40], t$95$1, If[LessEqual[y, 4e+63], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -8.6 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+63}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.6000000000000005e-40 or 4.00000000000000023e63 < y Initial program 47.1%
Taylor expanded in y around inf
/-lowering-/.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6445.2
Simplified45.2%
if -8.6000000000000005e-40 < y < 4.00000000000000023e63Initial program 80.6%
Taylor expanded in y around 0
/-lowering-/.f64N/A
--lowering--.f6456.4
Simplified56.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ t (- b y)))) (if (<= t -4.6e-5) t_1 (if (<= t 4.8e+112) (/ a (- y b)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (t <= -4.6e-5) {
tmp = t_1;
} else if (t <= 4.8e+112) {
tmp = a / (y - b);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t / (b - y)
if (t <= (-4.6d-5)) then
tmp = t_1
else if (t <= 4.8d+112) then
tmp = a / (y - b)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (t <= -4.6e-5) {
tmp = t_1;
} else if (t <= 4.8e+112) {
tmp = a / (y - b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) tmp = 0 if t <= -4.6e-5: tmp = t_1 elif t <= 4.8e+112: tmp = a / (y - b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) tmp = 0.0 if (t <= -4.6e-5) tmp = t_1; elseif (t <= 4.8e+112) tmp = Float64(a / Float64(y - b)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (b - y); tmp = 0.0; if (t <= -4.6e-5) tmp = t_1; elseif (t <= 4.8e+112) tmp = a / (y - b); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.6e-5], t$95$1, If[LessEqual[t, 4.8e+112], N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;t \leq -4.6 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{+112}:\\
\;\;\;\;\frac{a}{y - b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.6e-5 or 4.8e112 < t Initial program 64.3%
Taylor expanded in t around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6439.5
Simplified39.5%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f6454.2
Simplified54.2%
if -4.6e-5 < t < 4.8e112Initial program 64.9%
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6464.9
Applied egg-rr64.9%
Taylor expanded in a around inf
associate-*r/N/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
mul-1-negN/A
sub-negN/A
associate-*r/N/A
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
neg-lowering-neg.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6431.1
Simplified31.1%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f6441.8
Simplified41.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ a (- y b)))) (if (<= z -7e-61) t_1 (if (<= z 8.8e-57) x t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a / (y - b);
double tmp;
if (z <= -7e-61) {
tmp = t_1;
} else if (z <= 8.8e-57) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a / (y - b)
if (z <= (-7d-61)) then
tmp = t_1
else if (z <= 8.8d-57) then
tmp = x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a / (y - b);
double tmp;
if (z <= -7e-61) {
tmp = t_1;
} else if (z <= 8.8e-57) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a / (y - b) tmp = 0 if z <= -7e-61: tmp = t_1 elif z <= 8.8e-57: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a / Float64(y - b)) tmp = 0.0 if (z <= -7e-61) tmp = t_1; elseif (z <= 8.8e-57) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a / (y - b); tmp = 0.0; if (z <= -7e-61) tmp = t_1; elseif (z <= 8.8e-57) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7e-61], t$95$1, If[LessEqual[z, 8.8e-57], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{y - b}\\
\mathbf{if}\;z \leq -7 \cdot 10^{-61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{-57}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.0000000000000006e-61 or 8.79999999999999994e-57 < z Initial program 48.3%
+-commutativeN/A
sub-negN/A
distribute-lft-inN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f6448.3
Applied egg-rr48.3%
Taylor expanded in a around inf
associate-*r/N/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
mul-1-negN/A
sub-negN/A
associate-*r/N/A
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
neg-lowering-neg.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6423.7
Simplified23.7%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f6442.8
Simplified42.8%
if -7.0000000000000006e-61 < z < 8.79999999999999994e-57Initial program 88.1%
Taylor expanded in z around 0
Simplified47.5%
(FPCore (x y z t a b) :precision binary64 (if (<= z -3.8e-107) (/ t b) (if (<= z 7.5e-89) x (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.8e-107) {
tmp = t / b;
} else if (z <= 7.5e-89) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-3.8d-107)) then
tmp = t / b
else if (z <= 7.5d-89) then
tmp = x
else
tmp = t / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.8e-107) {
tmp = t / b;
} else if (z <= 7.5e-89) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3.8e-107: tmp = t / b elif z <= 7.5e-89: tmp = x else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.8e-107) tmp = Float64(t / b); elseif (z <= 7.5e-89) tmp = x; else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -3.8e-107) tmp = t / b; elseif (z <= 7.5e-89) tmp = x; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.8e-107], N[(t / b), $MachinePrecision], If[LessEqual[z, 7.5e-89], x, N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{-107}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-89}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -3.8000000000000002e-107 or 7.4999999999999999e-89 < z Initial program 52.4%
Taylor expanded in t around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6427.3
Simplified27.3%
Taylor expanded in b around inf
/-lowering-/.f6428.2
Simplified28.2%
if -3.8000000000000002e-107 < z < 7.4999999999999999e-89Initial program 86.5%
Taylor expanded in z around 0
Simplified51.6%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 64.6%
Taylor expanded in z around 0
Simplified22.0%
(FPCore (x y z t a b) :precision binary64 (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
def code(x, y, z, t, a, b): return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(z * t) + Float64(y * x)) / Float64(y + Float64(z * Float64(b - y)))) - Float64(a / Float64(Float64(b - y) + Float64(y / z)))) end
function tmp = code(x, y, z, t, a, b) tmp = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(z * t), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(N[(b - y), $MachinePrecision] + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}}
\end{array}
herbie shell --seed 2024196
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:alt
(! :herbie-platform default (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))