
(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 20 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 (fma z (- t a) (* x y)))
(t_2 (/ z t_1))
(t_3 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_4 (fma z (- b y) y))
(t_5 (/ (- t a) t_4)))
(if (<= t_3 (- INFINITY))
(fma z t_5 (/ x (- 1.0 z)))
(if (<= t_3 5e+275)
(/ 1.0 (- (fma b t_2 (/ y t_1)) (* y t_2)))
(if (<= t_3 INFINITY)
(fma z t_5 (* x (/ y t_4)))
(/ (- t a) (- b y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(z, (t - a), (x * y));
double t_2 = z / t_1;
double t_3 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_4 = fma(z, (b - y), y);
double t_5 = (t - a) / t_4;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = fma(z, t_5, (x / (1.0 - z)));
} else if (t_3 <= 5e+275) {
tmp = 1.0 / (fma(b, t_2, (y / t_1)) - (y * t_2));
} else if (t_3 <= ((double) INFINITY)) {
tmp = fma(z, t_5, (x * (y / t_4)));
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(z, Float64(t - a), Float64(x * y)) t_2 = Float64(z / t_1) t_3 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_4 = fma(z, Float64(b - y), y) t_5 = Float64(Float64(t - a) / t_4) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = fma(z, t_5, Float64(x / Float64(1.0 - z))); elseif (t_3 <= 5e+275) tmp = Float64(1.0 / Float64(fma(b, t_2, Float64(y / t_1)) - Float64(y * t_2))); elseif (t_3 <= Inf) tmp = fma(z, t_5, Float64(x * Float64(y / t_4))); else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(t - a), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z / t$95$1), $MachinePrecision]}, Block[{t$95$3 = 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]}, Block[{t$95$4 = N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t - a), $MachinePrecision] / t$95$4), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(z * t$95$5 + N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+275], N[(1.0 / N[(N[(b * t$95$2 + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(y * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(z * t$95$5 + N[(x * N[(y / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, t - a, x \cdot y\right)\\
t_2 := \frac{z}{t\_1}\\
t_3 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_4 := \mathsf{fma}\left(z, b - y, y\right)\\
t_5 := \frac{t - a}{t\_4}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(z, t\_5, \frac{x}{1 - z}\right)\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+275}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(b, t\_2, \frac{y}{t\_1}\right) - y \cdot t\_2}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(z, t\_5, x \cdot \frac{y}{t\_4}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\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 41.3%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f6499.8
Applied rewrites99.8%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 5.0000000000000003e275Initial program 92.4%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6492.2
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6492.2
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6492.2
Applied rewrites92.2%
Taylor expanded in b around 0
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
Applied rewrites98.5%
if 5.0000000000000003e275 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 34.0%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6499.8
Applied rewrites99.8%
if +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 0.0%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6478.0
Applied rewrites78.0%
Final simplification96.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2 (/ (fma z t (fma z (- a) (* x y))) t_1))
(t_3 (fma z (- b y) y))
(t_4 (/ (- t a) t_3))
(t_5 (/ (+ (* x y) (* z (- t a))) t_1))
(t_6 (/ (- t a) (- b y))))
(if (<= t_5 (- INFINITY))
(fma z t_4 (/ x (- 1.0 z)))
(if (<= t_5 -1e-277)
t_2
(if (<= t_5 0.0)
t_6
(if (<= t_5 2e+281)
t_2
(if (<= t_5 INFINITY) (fma z t_4 (* x (/ y t_3))) t_6)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = fma(z, t, fma(z, -a, (x * y))) / t_1;
double t_3 = fma(z, (b - y), y);
double t_4 = (t - a) / t_3;
double t_5 = ((x * y) + (z * (t - a))) / t_1;
double t_6 = (t - a) / (b - y);
double tmp;
if (t_5 <= -((double) INFINITY)) {
tmp = fma(z, t_4, (x / (1.0 - z)));
} else if (t_5 <= -1e-277) {
tmp = t_2;
} else if (t_5 <= 0.0) {
tmp = t_6;
} else if (t_5 <= 2e+281) {
tmp = t_2;
} else if (t_5 <= ((double) INFINITY)) {
tmp = fma(z, t_4, (x * (y / t_3)));
} else {
tmp = t_6;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(fma(z, t, fma(z, Float64(-a), Float64(x * y))) / t_1) t_3 = fma(z, Float64(b - y), y) t_4 = Float64(Float64(t - a) / t_3) t_5 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / t_1) t_6 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (t_5 <= Float64(-Inf)) tmp = fma(z, t_4, Float64(x / Float64(1.0 - z))); elseif (t_5 <= -1e-277) tmp = t_2; elseif (t_5 <= 0.0) tmp = t_6; elseif (t_5 <= 2e+281) tmp = t_2; elseif (t_5 <= Inf) tmp = fma(z, t_4, Float64(x * Float64(y / t_3))); else tmp = t_6; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t + N[(z * (-a) + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t - a), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$6 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, (-Infinity)], N[(z * t$95$4 + N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, -1e-277], t$95$2, If[LessEqual[t$95$5, 0.0], t$95$6, If[LessEqual[t$95$5, 2e+281], t$95$2, If[LessEqual[t$95$5, Infinity], N[(z * t$95$4 + N[(x * N[(y / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$6]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \frac{\mathsf{fma}\left(z, t, \mathsf{fma}\left(z, -a, x \cdot y\right)\right)}{t\_1}\\
t_3 := \mathsf{fma}\left(z, b - y, y\right)\\
t_4 := \frac{t - a}{t\_3}\\
t_5 := \frac{x \cdot y + z \cdot \left(t - a\right)}{t\_1}\\
t_6 := \frac{t - a}{b - y}\\
\mathbf{if}\;t\_5 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(z, t\_4, \frac{x}{1 - z}\right)\\
\mathbf{elif}\;t\_5 \leq -1 \cdot 10^{-277}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_5 \leq 0:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 \leq 2 \cdot 10^{+281}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_5 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(z, t\_4, x \cdot \frac{y}{t\_3}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_6\\
\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 41.3%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f6499.8
Applied rewrites99.8%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -9.99999999999999969e-278 or -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.0000000000000001e281Initial program 99.5%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift--.f64N/A
sub-negN/A
distribute-lft-inN/A
associate-+l+N/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-neg.f6499.5
Applied rewrites99.5%
if -9.99999999999999969e-278 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 10.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.5
Applied rewrites80.5%
if 2.0000000000000001e281 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 30.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6499.9
Applied rewrites99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2 (/ (fma z t (fma z (- a) (* x y))) t_1))
(t_3 (/ (+ (* x y) (* z (- t a))) t_1))
(t_4 (fma z (/ (- t a) (fma z (- b y) y)) (/ x (- 1.0 z))))
(t_5 (/ (- t a) (- b y))))
(if (<= t_3 (- INFINITY))
t_4
(if (<= t_3 -1e-277)
t_2
(if (<= t_3 0.0)
t_5
(if (<= t_3 2e+281) t_2 (if (<= t_3 INFINITY) t_4 t_5)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = fma(z, t, fma(z, -a, (x * y))) / t_1;
double t_3 = ((x * y) + (z * (t - a))) / t_1;
double t_4 = fma(z, ((t - a) / fma(z, (b - y), y)), (x / (1.0 - z)));
double t_5 = (t - a) / (b - y);
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_4;
} else if (t_3 <= -1e-277) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = t_5;
} else if (t_3 <= 2e+281) {
tmp = t_2;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = t_5;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(fma(z, t, fma(z, Float64(-a), Float64(x * y))) / t_1) t_3 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / t_1) t_4 = fma(z, Float64(Float64(t - a) / fma(z, Float64(b - y), y)), Float64(x / Float64(1.0 - z))) t_5 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_4; elseif (t_3 <= -1e-277) tmp = t_2; elseif (t_3 <= 0.0) tmp = t_5; elseif (t_3 <= 2e+281) tmp = t_2; elseif (t_3 <= Inf) tmp = t_4; else tmp = t_5; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t + N[(z * (-a) + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(N[(t - a), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$4, If[LessEqual[t$95$3, -1e-277], t$95$2, If[LessEqual[t$95$3, 0.0], t$95$5, If[LessEqual[t$95$3, 2e+281], t$95$2, If[LessEqual[t$95$3, Infinity], t$95$4, t$95$5]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \frac{\mathsf{fma}\left(z, t, \mathsf{fma}\left(z, -a, x \cdot y\right)\right)}{t\_1}\\
t_3 := \frac{x \cdot y + z \cdot \left(t - a\right)}{t\_1}\\
t_4 := \mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(z, b - y, y\right)}, \frac{x}{1 - z}\right)\\
t_5 := \frac{t - a}{b - y}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq -1 \cdot 10^{-277}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+281}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_5\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 2.0000000000000001e281 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 37.1%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f6496.1
Applied rewrites96.1%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -9.99999999999999969e-278 or -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.0000000000000001e281Initial program 99.5%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift--.f64N/A
sub-negN/A
distribute-lft-inN/A
associate-+l+N/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-neg.f6499.5
Applied rewrites99.5%
if -9.99999999999999969e-278 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 10.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.5
Applied rewrites80.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2 (/ (- t a) (- b y)))
(t_3 (/ (fma z t (fma z (- a) (* x y))) t_1))
(t_4 (/ (+ (* x y) (* z (- t a))) t_1))
(t_5 (fma z (/ (- t a) (fma z (- b y) y)) x)))
(if (<= t_4 (- INFINITY))
t_5
(if (<= t_4 -1e-277)
t_3
(if (<= t_4 0.0)
t_2
(if (<= t_4 2e+281) t_3 (if (<= t_4 INFINITY) t_5 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = (t - a) / (b - y);
double t_3 = fma(z, t, fma(z, -a, (x * y))) / t_1;
double t_4 = ((x * y) + (z * (t - a))) / t_1;
double t_5 = fma(z, ((t - a) / fma(z, (b - y), y)), x);
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = t_5;
} else if (t_4 <= -1e-277) {
tmp = t_3;
} else if (t_4 <= 0.0) {
tmp = t_2;
} else if (t_4 <= 2e+281) {
tmp = t_3;
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_5;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(Float64(t - a) / Float64(b - y)) t_3 = Float64(fma(z, t, fma(z, Float64(-a), Float64(x * y))) / t_1) t_4 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / t_1) t_5 = fma(z, Float64(Float64(t - a) / fma(z, Float64(b - y), y)), x) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = t_5; elseif (t_4 <= -1e-277) tmp = t_3; elseif (t_4 <= 0.0) tmp = t_2; elseif (t_4 <= 2e+281) tmp = t_3; elseif (t_4 <= Inf) tmp = t_5; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z * t + N[(z * (-a) + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(z * N[(N[(t - a), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], t$95$5, If[LessEqual[t$95$4, -1e-277], t$95$3, If[LessEqual[t$95$4, 0.0], t$95$2, If[LessEqual[t$95$4, 2e+281], t$95$3, If[LessEqual[t$95$4, Infinity], t$95$5, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \frac{t - a}{b - y}\\
t_3 := \frac{\mathsf{fma}\left(z, t, \mathsf{fma}\left(z, -a, x \cdot y\right)\right)}{t\_1}\\
t_4 := \frac{x \cdot y + z \cdot \left(t - a\right)}{t\_1}\\
t_5 := \mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(z, b - y, y\right)}, x\right)\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_4 \leq -1 \cdot 10^{-277}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+281}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 2.0000000000000001e281 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 37.1%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in z around 0
Applied rewrites85.5%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -9.99999999999999969e-278 or -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.0000000000000001e281Initial program 99.5%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift--.f64N/A
sub-negN/A
distribute-lft-inN/A
associate-+l+N/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-neg.f6499.5
Applied rewrites99.5%
if -9.99999999999999969e-278 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 10.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.5
Applied rewrites80.5%
Final simplification93.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y)))
(t_2 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_3 (fma z (/ (- t a) (fma z (- b y) y)) x)))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 -1e-277)
t_2
(if (<= t_2 0.0)
t_1
(if (<= t_2 5e+275) t_2 (if (<= t_2 INFINITY) t_3 t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double t_2 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_3 = fma(z, ((t - a) / fma(z, (b - y), y)), x);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= -1e-277) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= 5e+275) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) t_2 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_3 = fma(z, Float64(Float64(t - a) / fma(z, Float64(b - y), y)), x) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= -1e-277) tmp = t_2; elseif (t_2 <= 0.0) tmp = t_1; elseif (t_2 <= 5e+275) tmp = t_2; elseif (t_2 <= Inf) tmp = t_3; 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]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[(z * N[(N[(t - a), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -1e-277], t$95$2, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 5e+275], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$3, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_3 := \mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(z, b - y, y\right)}, x\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-277}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+275}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 5.0000000000000003e275 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 38.3%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in z around 0
Applied rewrites85.8%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -9.99999999999999969e-278 or -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 5.0000000000000003e275Initial program 99.5%
if -9.99999999999999969e-278 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 10.9%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.5
Applied rewrites80.5%
Final simplification93.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma z (- b y) y)) (t_2 (/ (- t a) (- b y))))
(if (<= z -5e+88)
t_2
(if (<= z 6.2e+19) (fma (/ y t_1) x (/ (* z (- t a)) t_1)) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(z, (b - y), y);
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -5e+88) {
tmp = t_2;
} else if (z <= 6.2e+19) {
tmp = fma((y / t_1), x, ((z * (t - a)) / t_1));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(z, Float64(b - y), y) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -5e+88) tmp = t_2; elseif (z <= 6.2e+19) tmp = fma(Float64(y / t_1), x, Float64(Float64(z * Float64(t - a)) / t_1)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e+88], t$95$2, If[LessEqual[z, 6.2e+19], N[(N[(y / t$95$1), $MachinePrecision] * x + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, b - y, y\right)\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -5 \cdot 10^{+88}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t\_1}, x, \frac{z \cdot \left(t - a\right)}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.99999999999999997e88 or 6.2e19 < z Initial program 45.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6485.0
Applied rewrites85.0%
if -4.99999999999999997e88 < z < 6.2e19Initial program 88.4%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6489.0
Applied rewrites89.0%
lift--.f64N/A
lift--.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
Applied rewrites97.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma z (- b y) y)) (t_2 (/ (- t a) (- b y))))
(if (<= z -4.9e+73)
t_2
(if (<= z -5.8e-33)
(/ (fma z t (* x y)) t_1)
(if (<= z -2.45e-209)
(/ (fma z (- a) (* x y)) t_1)
(if (<= z 265000.0) (+ x (/ (* z (- t a)) t_1)) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(z, (b - y), y);
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -4.9e+73) {
tmp = t_2;
} else if (z <= -5.8e-33) {
tmp = fma(z, t, (x * y)) / t_1;
} else if (z <= -2.45e-209) {
tmp = fma(z, -a, (x * y)) / t_1;
} else if (z <= 265000.0) {
tmp = x + ((z * (t - a)) / t_1);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(z, Float64(b - y), y) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -4.9e+73) tmp = t_2; elseif (z <= -5.8e-33) tmp = Float64(fma(z, t, Float64(x * y)) / t_1); elseif (z <= -2.45e-209) tmp = Float64(fma(z, Float64(-a), Float64(x * y)) / t_1); elseif (z <= 265000.0) tmp = Float64(x + Float64(Float64(z * Float64(t - a)) / t_1)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.9e+73], t$95$2, If[LessEqual[z, -5.8e-33], N[(N[(z * t + N[(x * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, -2.45e-209], N[(N[(z * (-a) + N[(x * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 265000.0], N[(x + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, b - y, y\right)\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -4.9 \cdot 10^{+73}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-33}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, t, x \cdot y\right)}{t\_1}\\
\mathbf{elif}\;z \leq -2.45 \cdot 10^{-209}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, -a, x \cdot y\right)}{t\_1}\\
\mathbf{elif}\;z \leq 265000:\\
\;\;\;\;x + \frac{z \cdot \left(t - a\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.8999999999999999e73 or 265000 < z Initial program 48.2%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6482.7
Applied rewrites82.7%
if -4.8999999999999999e73 < z < -5.80000000000000005e-33Initial program 90.3%
Taylor expanded in a around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6481.7
Applied rewrites81.7%
if -5.80000000000000005e-33 < z < -2.45000000000000018e-209Initial program 93.8%
Taylor expanded in t around 0
lower-/.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6482.5
Applied rewrites82.5%
if -2.45000000000000018e-209 < z < 265000Initial program 86.9%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6483.6
Applied rewrites83.6%
Taylor expanded in z around 0
Applied rewrites74.4%
lift--.f64N/A
lift--.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
*-rgt-identityN/A
lower-+.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
lift-/.f6487.5
Applied rewrites87.5%
Final simplification84.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma z (- b y) y)) (t_2 (/ (- t a) (- b y))))
(if (<= z -4.9e+73)
t_2
(if (<= z -7.4e-34)
(/ (fma z t (* x y)) t_1)
(if (<= z 265000.0) (+ x (/ (* z (- t a)) t_1)) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(z, (b - y), y);
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -4.9e+73) {
tmp = t_2;
} else if (z <= -7.4e-34) {
tmp = fma(z, t, (x * y)) / t_1;
} else if (z <= 265000.0) {
tmp = x + ((z * (t - a)) / t_1);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(z, Float64(b - y), y) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -4.9e+73) tmp = t_2; elseif (z <= -7.4e-34) tmp = Float64(fma(z, t, Float64(x * y)) / t_1); elseif (z <= 265000.0) tmp = Float64(x + Float64(Float64(z * Float64(t - a)) / t_1)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.9e+73], t$95$2, If[LessEqual[z, -7.4e-34], N[(N[(z * t + N[(x * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 265000.0], N[(x + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, b - y, y\right)\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -4.9 \cdot 10^{+73}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -7.4 \cdot 10^{-34}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, t, x \cdot y\right)}{t\_1}\\
\mathbf{elif}\;z \leq 265000:\\
\;\;\;\;x + \frac{z \cdot \left(t - a\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.8999999999999999e73 or 265000 < z Initial program 48.2%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6482.7
Applied rewrites82.7%
if -4.8999999999999999e73 < z < -7.39999999999999976e-34Initial program 90.7%
Taylor expanded in a around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6478.8
Applied rewrites78.8%
if -7.39999999999999976e-34 < z < 265000Initial program 88.7%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6487.1
Applied rewrites87.1%
Taylor expanded in z around 0
Applied rewrites72.5%
lift--.f64N/A
lift--.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
*-rgt-identityN/A
lower-+.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
lift-/.f6482.9
Applied rewrites82.9%
Final simplification82.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -9.6e-34)
t_1
(if (<= z 265000.0) (+ x (/ (* z (- t a)) (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 <= -9.6e-34) {
tmp = t_1;
} else if (z <= 265000.0) {
tmp = x + ((z * (t - a)) / 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 <= -9.6e-34) tmp = t_1; elseif (z <= 265000.0) tmp = Float64(x + Float64(Float64(z * Float64(t - a)) / 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, -9.6e-34], t$95$1, If[LessEqual[z, 265000.0], N[(x + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / 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 -9.6 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 265000:\\
\;\;\;\;x + \frac{z \cdot \left(t - a\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.59999999999999965e-34 or 265000 < z Initial program 55.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6478.6
Applied rewrites78.6%
if -9.59999999999999965e-34 < z < 265000Initial program 88.7%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6487.1
Applied rewrites87.1%
Taylor expanded in z around 0
Applied rewrites72.5%
lift--.f64N/A
lift--.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
*-rgt-identityN/A
lower-+.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
lift-/.f6482.9
Applied rewrites82.9%
Final simplification80.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -2.9e-43)
t_1
(if (<= z 1.2e-278)
(* x (/ y (fma z (- b y) y)))
(if (<= z 7.2e-25) (fma z (/ (- t a) y) 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.9e-43) {
tmp = t_1;
} else if (z <= 1.2e-278) {
tmp = x * (y / fma(z, (b - y), y));
} else if (z <= 7.2e-25) {
tmp = fma(z, ((t - a) / y), 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.9e-43) tmp = t_1; elseif (z <= 1.2e-278) tmp = Float64(x * Float64(y / fma(z, Float64(b - y), y))); elseif (z <= 7.2e-25) tmp = fma(z, Float64(Float64(t - a) / y), x); 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, -2.9e-43], t$95$1, If[LessEqual[z, 1.2e-278], N[(x * N[(y / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e-25], N[(z * N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{-43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-278}:\\
\;\;\;\;x \cdot \frac{y}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-25}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{t - a}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.9000000000000001e-43 or 7.1999999999999998e-25 < z Initial program 57.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6476.8
Applied rewrites76.8%
if -2.9000000000000001e-43 < z < 1.2e-278Initial program 91.8%
Taylor expanded in x around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6474.1
Applied rewrites74.1%
if 1.2e-278 < z < 7.1999999999999998e-25Initial program 84.4%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6488.3
Applied rewrites88.3%
Taylor expanded in z around 0
Applied rewrites82.3%
Taylor expanded in z around 0
div-subN/A
associate-/l*N/A
+-commutativeN/A
associate-/l*N/A
div-subN/A
lower-fma.f64N/A
div-subN/A
lower-/.f64N/A
lower--.f6475.4
Applied rewrites75.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -5.8e-19)
t_1
(if (<= y -3.1e-71)
(/ t (- b y))
(if (<= y 3.8e+24) (/ (- 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 <= -5.8e-19) {
tmp = t_1;
} else if (y <= -3.1e-71) {
tmp = t / (b - y);
} else if (y <= 3.8e+24) {
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 <= (-5.8d-19)) then
tmp = t_1
else if (y <= (-3.1d-71)) then
tmp = t / (b - y)
else if (y <= 3.8d+24) 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 <= -5.8e-19) {
tmp = t_1;
} else if (y <= -3.1e-71) {
tmp = t / (b - y);
} else if (y <= 3.8e+24) {
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 <= -5.8e-19: tmp = t_1 elif y <= -3.1e-71: tmp = t / (b - y) elif y <= 3.8e+24: 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 <= -5.8e-19) tmp = t_1; elseif (y <= -3.1e-71) tmp = Float64(t / Float64(b - y)); elseif (y <= 3.8e+24) 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 <= -5.8e-19) tmp = t_1; elseif (y <= -3.1e-71) tmp = t / (b - y); elseif (y <= 3.8e+24) 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, -5.8e-19], t$95$1, If[LessEqual[y, -3.1e-71], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e+24], 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 -5.8 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.1 \cdot 10^{-71}:\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+24}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.8e-19 or 3.80000000000000015e24 < y Initial program 57.8%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6458.5
Applied rewrites58.5%
if -5.8e-19 < y < -3.10000000000000002e-71Initial program 67.7%
Taylor expanded in a around 0
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6454.4
Applied rewrites54.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6461.4
Applied rewrites61.4%
if -3.10000000000000002e-71 < y < 3.80000000000000015e24Initial program 84.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6460.3
Applied rewrites60.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -2.25e-73) t_1 (if (<= z 7.2e-25) (fma z (/ (- t a) y) 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.25e-73) {
tmp = t_1;
} else if (z <= 7.2e-25) {
tmp = fma(z, ((t - a) / y), 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.25e-73) tmp = t_1; elseif (z <= 7.2e-25) tmp = fma(z, Float64(Float64(t - a) / y), x); 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, -2.25e-73], t$95$1, If[LessEqual[z, 7.2e-25], N[(z * N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2.25 \cdot 10^{-73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-25}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{t - a}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.25e-73 or 7.1999999999999998e-25 < z Initial program 59.3%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6474.9
Applied rewrites74.9%
if -2.25e-73 < z < 7.1999999999999998e-25Initial program 88.5%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6484.8
Applied rewrites84.8%
Taylor expanded in z around 0
Applied rewrites74.4%
Taylor expanded in z around 0
div-subN/A
associate-/l*N/A
+-commutativeN/A
associate-/l*N/A
div-subN/A
lower-fma.f64N/A
div-subN/A
lower-/.f64N/A
lower--.f6470.0
Applied rewrites70.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -5e-94) t_1 (if (<= z 6.4e-52) 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 <= -5e-94) {
tmp = t_1;
} else if (z <= 6.4e-52) {
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 <= (-5d-94)) then
tmp = t_1
else if (z <= 6.4d-52) 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 <= -5e-94) {
tmp = t_1;
} else if (z <= 6.4e-52) {
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 <= -5e-94: tmp = t_1 elif z <= 6.4e-52: 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 <= -5e-94) tmp = t_1; elseif (z <= 6.4e-52) 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 <= -5e-94) tmp = t_1; elseif (z <= 6.4e-52) 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, -5e-94], t$95$1, If[LessEqual[z, 6.4e-52], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -5 \cdot 10^{-94}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-52}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.9999999999999995e-94 or 6.4000000000000002e-52 < z Initial program 61.0%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6473.6
Applied rewrites73.6%
if -4.9999999999999995e-94 < z < 6.4000000000000002e-52Initial program 87.7%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6487.6
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6487.5
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6487.5
Applied rewrites87.5%
Taylor expanded in z around 0
lower-/.f6458.6
Applied rewrites58.6%
remove-double-div58.9
Applied rewrites58.9%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.25e-41) (/ t (- b y)) (if (<= z 6e+18) (/ x (- 1.0 z)) (/ a (- y b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.25e-41) {
tmp = t / (b - y);
} else if (z <= 6e+18) {
tmp = x / (1.0 - z);
} else {
tmp = a / (y - 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 <= (-1.25d-41)) then
tmp = t / (b - y)
else if (z <= 6d+18) then
tmp = x / (1.0d0 - z)
else
tmp = a / (y - 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 <= -1.25e-41) {
tmp = t / (b - y);
} else if (z <= 6e+18) {
tmp = x / (1.0 - z);
} else {
tmp = a / (y - b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.25e-41: tmp = t / (b - y) elif z <= 6e+18: tmp = x / (1.0 - z) else: tmp = a / (y - b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.25e-41) tmp = Float64(t / Float64(b - y)); elseif (z <= 6e+18) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(a / Float64(y - b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.25e-41) tmp = t / (b - y); elseif (z <= 6e+18) tmp = x / (1.0 - z); else tmp = a / (y - b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.25e-41], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+18], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-41}:\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+18}:\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{y - b}\\
\end{array}
\end{array}
if z < -1.2499999999999999e-41Initial program 54.7%
Taylor expanded in a around 0
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6443.6
Applied rewrites43.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6449.0
Applied rewrites49.0%
if -1.2499999999999999e-41 < z < 6e18Initial program 88.2%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6451.4
Applied rewrites51.4%
if 6e18 < z Initial program 54.9%
Taylor expanded in a around inf
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6430.7
Applied rewrites30.7%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6448.6
Applied rewrites48.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.25e-41) (/ t (- b y)) (if (<= z 1.58e-49) x (/ a (- y b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.25e-41) {
tmp = t / (b - y);
} else if (z <= 1.58e-49) {
tmp = x;
} else {
tmp = a / (y - 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 <= (-1.25d-41)) then
tmp = t / (b - y)
else if (z <= 1.58d-49) then
tmp = x
else
tmp = a / (y - 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 <= -1.25e-41) {
tmp = t / (b - y);
} else if (z <= 1.58e-49) {
tmp = x;
} else {
tmp = a / (y - b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.25e-41: tmp = t / (b - y) elif z <= 1.58e-49: tmp = x else: tmp = a / (y - b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.25e-41) tmp = Float64(t / Float64(b - y)); elseif (z <= 1.58e-49) tmp = x; else tmp = Float64(a / Float64(y - b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.25e-41) tmp = t / (b - y); elseif (z <= 1.58e-49) tmp = x; else tmp = a / (y - b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.25e-41], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.58e-49], x, N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-41}:\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{elif}\;z \leq 1.58 \cdot 10^{-49}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{y - b}\\
\end{array}
\end{array}
if z < -1.2499999999999999e-41Initial program 54.7%
Taylor expanded in a around 0
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6443.6
Applied rewrites43.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6449.0
Applied rewrites49.0%
if -1.2499999999999999e-41 < z < 1.58e-49Initial program 88.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6488.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6488.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6488.0
Applied rewrites88.0%
Taylor expanded in z around 0
lower-/.f6454.2
Applied rewrites54.2%
remove-double-div54.4
Applied rewrites54.4%
if 1.58e-49 < z Initial program 61.9%
Taylor expanded in a around inf
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6430.3
Applied rewrites30.3%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6444.1
Applied rewrites44.1%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.05e-73) (/ t b) (if (<= z 1.58e-49) x (/ a (- y b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.05e-73) {
tmp = t / b;
} else if (z <= 1.58e-49) {
tmp = x;
} else {
tmp = a / (y - 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 <= (-1.05d-73)) then
tmp = t / b
else if (z <= 1.58d-49) then
tmp = x
else
tmp = a / (y - 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 <= -1.05e-73) {
tmp = t / b;
} else if (z <= 1.58e-49) {
tmp = x;
} else {
tmp = a / (y - b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.05e-73: tmp = t / b elif z <= 1.58e-49: tmp = x else: tmp = a / (y - b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.05e-73) tmp = Float64(t / b); elseif (z <= 1.58e-49) tmp = x; else tmp = Float64(a / Float64(y - b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.05e-73) tmp = t / b; elseif (z <= 1.58e-49) tmp = x; else tmp = a / (y - b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.05e-73], N[(t / b), $MachinePrecision], If[LessEqual[z, 1.58e-49], x, N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-73}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 1.58 \cdot 10^{-49}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{y - b}\\
\end{array}
\end{array}
if z < -1.0499999999999999e-73Initial program 58.1%
Taylor expanded in a around 0
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6444.4
Applied rewrites44.4%
Taylor expanded in y around 0
lower-/.f6436.4
Applied rewrites36.4%
if -1.0499999999999999e-73 < z < 1.58e-49Initial program 88.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6488.1
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6488.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6488.0
Applied rewrites88.0%
Taylor expanded in z around 0
lower-/.f6457.4
Applied rewrites57.4%
remove-double-div57.6
Applied rewrites57.6%
if 1.58e-49 < z Initial program 61.9%
Taylor expanded in a around inf
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6430.3
Applied rewrites30.3%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6444.1
Applied rewrites44.1%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.05e-73) (/ t b) (if (<= z 3.8e-62) x (/ a (- b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.05e-73) {
tmp = t / b;
} else if (z <= 3.8e-62) {
tmp = x;
} else {
tmp = a / -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 <= (-1.05d-73)) then
tmp = t / b
else if (z <= 3.8d-62) then
tmp = x
else
tmp = a / -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 <= -1.05e-73) {
tmp = t / b;
} else if (z <= 3.8e-62) {
tmp = x;
} else {
tmp = a / -b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.05e-73: tmp = t / b elif z <= 3.8e-62: tmp = x else: tmp = a / -b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.05e-73) tmp = Float64(t / b); elseif (z <= 3.8e-62) tmp = x; else tmp = Float64(a / Float64(-b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.05e-73) tmp = t / b; elseif (z <= 3.8e-62) tmp = x; else tmp = a / -b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.05e-73], N[(t / b), $MachinePrecision], If[LessEqual[z, 3.8e-62], x, N[(a / (-b)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-73}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-62}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{-b}\\
\end{array}
\end{array}
if z < -1.0499999999999999e-73Initial program 58.1%
Taylor expanded in a around 0
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6444.4
Applied rewrites44.4%
Taylor expanded in y around 0
lower-/.f6436.4
Applied rewrites36.4%
if -1.0499999999999999e-73 < z < 3.80000000000000006e-62Initial program 88.0%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6487.8
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6487.8
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6487.8
Applied rewrites87.8%
Taylor expanded in z around 0
lower-/.f6458.5
Applied rewrites58.5%
remove-double-div58.7
Applied rewrites58.7%
if 3.80000000000000006e-62 < z Initial program 62.8%
Taylor expanded in a around inf
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-neg.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6430.8
Applied rewrites30.8%
Taylor expanded in b around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6425.0
Applied rewrites25.0%
Final simplification41.1%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.05e-73) (/ t b) (if (<= z 5.2e-62) x (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.05e-73) {
tmp = t / b;
} else if (z <= 5.2e-62) {
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 <= (-1.05d-73)) then
tmp = t / b
else if (z <= 5.2d-62) 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 <= -1.05e-73) {
tmp = t / b;
} else if (z <= 5.2e-62) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.05e-73: tmp = t / b elif z <= 5.2e-62: tmp = x else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.05e-73) tmp = Float64(t / b); elseif (z <= 5.2e-62) 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 <= -1.05e-73) tmp = t / b; elseif (z <= 5.2e-62) tmp = x; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.05e-73], N[(t / b), $MachinePrecision], If[LessEqual[z, 5.2e-62], x, N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-73}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-62}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -1.0499999999999999e-73 or 5.1999999999999999e-62 < z Initial program 60.5%
Taylor expanded in a around 0
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6441.1
Applied rewrites41.1%
Taylor expanded in y around 0
lower-/.f6429.2
Applied rewrites29.2%
if -1.0499999999999999e-73 < z < 5.1999999999999999e-62Initial program 88.0%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6487.8
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6487.8
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6487.8
Applied rewrites87.8%
Taylor expanded in z around 0
lower-/.f6458.5
Applied rewrites58.5%
remove-double-div58.7
Applied rewrites58.7%
(FPCore (x y z t a b) :precision binary64 (fma x z x))
double code(double x, double y, double z, double t, double a, double b) {
return fma(x, z, x);
}
function code(x, y, z, t, a, b) return fma(x, z, x) end
code[x_, y_, z_, t_, a_, b_] := N[(x * z + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, z, x\right)
\end{array}
Initial program 70.8%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6434.5
Applied rewrites34.5%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6426.2
Applied rewrites26.2%
(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 70.8%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6470.7
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6470.7
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6470.7
Applied rewrites70.7%
Taylor expanded in z around 0
lower-/.f6424.7
Applied rewrites24.7%
remove-double-div24.8
Applied rewrites24.8%
(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 2024219
(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)))))