
(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 15 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 (* z (- b y)))
(t_2 (+ (* x y) (* z (- t a))))
(t_3 (fma z (- b y) y))
(t_4 (* y (- t a)))
(t_5 (/ t_2 (fma z b (fma z (- y) y))))
(t_6 (* (- b y) (- b y)))
(t_7 (/ t_2 (+ y t_1)))
(t_8 (fma z (/ (- t a) t_3) (* x (/ y t_3)))))
(if (<= t_7 (- INFINITY))
t_8
(if (<= t_7 -1e-262)
t_5
(if (<= t_7 0.0)
(+
(/ (- t a) (- b y))
(/
(+
(fma
y
(/ (+ (/ t_4 t_6) (* x (/ y (- y b)))) t_1)
(* x (/ y (- b y))))
(/ t_4 (* (- b y) (- y b))))
z))
(if (<= t_7 1e+308)
t_5
(if (<= t_7 INFINITY)
t_8
(-
(fma x (/ y t_1) (/ t (- b y)))
(fma y (/ (- t a) (* z t_6)) (/ a (- b y)))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (b - y);
double t_2 = (x * y) + (z * (t - a));
double t_3 = fma(z, (b - y), y);
double t_4 = y * (t - a);
double t_5 = t_2 / fma(z, b, fma(z, -y, y));
double t_6 = (b - y) * (b - y);
double t_7 = t_2 / (y + t_1);
double t_8 = fma(z, ((t - a) / t_3), (x * (y / t_3)));
double tmp;
if (t_7 <= -((double) INFINITY)) {
tmp = t_8;
} else if (t_7 <= -1e-262) {
tmp = t_5;
} else if (t_7 <= 0.0) {
tmp = ((t - a) / (b - y)) + ((fma(y, (((t_4 / t_6) + (x * (y / (y - b)))) / t_1), (x * (y / (b - y)))) + (t_4 / ((b - y) * (y - b)))) / z);
} else if (t_7 <= 1e+308) {
tmp = t_5;
} else if (t_7 <= ((double) INFINITY)) {
tmp = t_8;
} else {
tmp = fma(x, (y / t_1), (t / (b - y))) - fma(y, ((t - a) / (z * t_6)), (a / (b - y)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(b - y)) t_2 = Float64(Float64(x * y) + Float64(z * Float64(t - a))) t_3 = fma(z, Float64(b - y), y) t_4 = Float64(y * Float64(t - a)) t_5 = Float64(t_2 / fma(z, b, fma(z, Float64(-y), y))) t_6 = Float64(Float64(b - y) * Float64(b - y)) t_7 = Float64(t_2 / Float64(y + t_1)) t_8 = fma(z, Float64(Float64(t - a) / t_3), Float64(x * Float64(y / t_3))) tmp = 0.0 if (t_7 <= Float64(-Inf)) tmp = t_8; elseif (t_7 <= -1e-262) tmp = t_5; elseif (t_7 <= 0.0) tmp = Float64(Float64(Float64(t - a) / Float64(b - y)) + Float64(Float64(fma(y, Float64(Float64(Float64(t_4 / t_6) + Float64(x * Float64(y / Float64(y - b)))) / t_1), Float64(x * Float64(y / Float64(b - y)))) + Float64(t_4 / Float64(Float64(b - y) * Float64(y - b)))) / z)); elseif (t_7 <= 1e+308) tmp = t_5; elseif (t_7 <= Inf) tmp = t_8; else tmp = Float64(fma(x, Float64(y / t_1), Float64(t / Float64(b - y))) - fma(y, Float64(Float64(t - a) / Float64(z * t_6)), Float64(a / Float64(b - y)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$4 = N[(y * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / N[(z * b + N[(z * (-y) + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(b - y), $MachinePrecision] * N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$2 / N[(y + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(z * N[(N[(t - a), $MachinePrecision] / t$95$3), $MachinePrecision] + N[(x * N[(y / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$7, (-Infinity)], t$95$8, If[LessEqual[t$95$7, -1e-262], t$95$5, If[LessEqual[t$95$7, 0.0], N[(N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y * N[(N[(N[(t$95$4 / t$95$6), $MachinePrecision] + N[(x * N[(y / N[(y - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(x * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 / N[(N[(b - y), $MachinePrecision] * N[(y - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$7, 1e+308], t$95$5, If[LessEqual[t$95$7, Infinity], t$95$8, N[(N[(x * N[(y / t$95$1), $MachinePrecision] + N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(N[(t - a), $MachinePrecision] / N[(z * t$95$6), $MachinePrecision]), $MachinePrecision] + N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(b - y\right)\\
t_2 := x \cdot y + z \cdot \left(t - a\right)\\
t_3 := \mathsf{fma}\left(z, b - y, y\right)\\
t_4 := y \cdot \left(t - a\right)\\
t_5 := \frac{t\_2}{\mathsf{fma}\left(z, b, \mathsf{fma}\left(z, -y, y\right)\right)}\\
t_6 := \left(b - y\right) \cdot \left(b - y\right)\\
t_7 := \frac{t\_2}{y + t\_1}\\
t_8 := \mathsf{fma}\left(z, \frac{t - a}{t\_3}, x \cdot \frac{y}{t\_3}\right)\\
\mathbf{if}\;t\_7 \leq -\infty:\\
\;\;\;\;t\_8\\
\mathbf{elif}\;t\_7 \leq -1 \cdot 10^{-262}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_7 \leq 0:\\
\;\;\;\;\frac{t - a}{b - y} + \frac{\mathsf{fma}\left(y, \frac{\frac{t\_4}{t\_6} + x \cdot \frac{y}{y - b}}{t\_1}, x \cdot \frac{y}{b - y}\right) + \frac{t\_4}{\left(b - y\right) \cdot \left(y - b\right)}}{z}\\
\mathbf{elif}\;t\_7 \leq 10^{+308}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_7 \leq \infty:\\
\;\;\;\;t\_8\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{y}{t\_1}, \frac{t}{b - y}\right) - \mathsf{fma}\left(y, \frac{t - a}{z \cdot t\_6}, \frac{a}{b - y}\right)\\
\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 1e308 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 20.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--.f6499.6
Applied rewrites99.6%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.00000000000000001e-262 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1e308Initial program 99.5%
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 -1.00000000000000001e-262 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0Initial program 21.9%
Taylor expanded in z around -inf
Applied rewrites87.9%
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 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--.f643.2
Applied rewrites3.2%
Taylor expanded in z around inf
lower--.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites71.3%
Final simplification95.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- b y)))
(t_2 (+ (* x y) (* z (- t a))))
(t_3 (/ t_2 (fma z b (fma z (- y) y))))
(t_4 (fma z (- b y) y))
(t_5 (/ t_2 (+ y t_1)))
(t_6 (fma z (/ (- t a) t_4) (* x (/ y t_4)))))
(if (<= t_5 (- INFINITY))
t_6
(if (<= t_5 -1e-262)
t_3
(if (<= t_5 0.0)
(/ (+ (- t a) (/ (* x y) z)) b)
(if (<= t_5 1e+308)
t_3
(if (<= t_5 INFINITY)
t_6
(-
(fma x (/ y t_1) (/ t (- b y)))
(fma
y
(/ (- t a) (* z (* (- b y) (- b y))))
(/ a (- b y)))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (b - y);
double t_2 = (x * y) + (z * (t - a));
double t_3 = t_2 / fma(z, b, fma(z, -y, y));
double t_4 = fma(z, (b - y), y);
double t_5 = t_2 / (y + t_1);
double t_6 = fma(z, ((t - a) / t_4), (x * (y / t_4)));
double tmp;
if (t_5 <= -((double) INFINITY)) {
tmp = t_6;
} else if (t_5 <= -1e-262) {
tmp = t_3;
} else if (t_5 <= 0.0) {
tmp = ((t - a) + ((x * y) / z)) / b;
} else if (t_5 <= 1e+308) {
tmp = t_3;
} else if (t_5 <= ((double) INFINITY)) {
tmp = t_6;
} else {
tmp = fma(x, (y / t_1), (t / (b - y))) - fma(y, ((t - a) / (z * ((b - y) * (b - y)))), (a / (b - y)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(b - y)) t_2 = Float64(Float64(x * y) + Float64(z * Float64(t - a))) t_3 = Float64(t_2 / fma(z, b, fma(z, Float64(-y), y))) t_4 = fma(z, Float64(b - y), y) t_5 = Float64(t_2 / Float64(y + t_1)) t_6 = fma(z, Float64(Float64(t - a) / t_4), Float64(x * Float64(y / t_4))) tmp = 0.0 if (t_5 <= Float64(-Inf)) tmp = t_6; elseif (t_5 <= -1e-262) tmp = t_3; elseif (t_5 <= 0.0) tmp = Float64(Float64(Float64(t - a) + Float64(Float64(x * y) / z)) / b); elseif (t_5 <= 1e+308) tmp = t_3; elseif (t_5 <= Inf) tmp = t_6; else tmp = Float64(fma(x, Float64(y / t_1), Float64(t / Float64(b - y))) - fma(y, Float64(Float64(t - a) / Float64(z * Float64(Float64(b - y) * Float64(b - y)))), Float64(a / Float64(b - y)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / N[(z * b + N[(z * (-y) + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / N[(y + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(z * N[(N[(t - a), $MachinePrecision] / t$95$4), $MachinePrecision] + N[(x * N[(y / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, (-Infinity)], t$95$6, If[LessEqual[t$95$5, -1e-262], t$95$3, If[LessEqual[t$95$5, 0.0], N[(N[(N[(t - a), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$5, 1e+308], t$95$3, If[LessEqual[t$95$5, Infinity], t$95$6, N[(N[(x * N[(y / t$95$1), $MachinePrecision] + N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(N[(t - a), $MachinePrecision] / N[(z * N[(N[(b - y), $MachinePrecision] * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(b - y\right)\\
t_2 := x \cdot y + z \cdot \left(t - a\right)\\
t_3 := \frac{t\_2}{\mathsf{fma}\left(z, b, \mathsf{fma}\left(z, -y, y\right)\right)}\\
t_4 := \mathsf{fma}\left(z, b - y, y\right)\\
t_5 := \frac{t\_2}{y + t\_1}\\
t_6 := \mathsf{fma}\left(z, \frac{t - a}{t\_4}, x \cdot \frac{y}{t\_4}\right)\\
\mathbf{if}\;t\_5 \leq -\infty:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 \leq -1 \cdot 10^{-262}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_5 \leq 0:\\
\;\;\;\;\frac{\left(t - a\right) + \frac{x \cdot y}{z}}{b}\\
\mathbf{elif}\;t\_5 \leq 10^{+308}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_5 \leq \infty:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{y}{t\_1}, \frac{t}{b - y}\right) - \mathsf{fma}\left(y, \frac{t - a}{z \cdot \left(\left(b - y\right) \cdot \left(b - y\right)\right)}, \frac{a}{b - y}\right)\\
\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 1e308 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 20.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--.f6499.6
Applied rewrites99.6%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.00000000000000001e-262 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1e308Initial program 99.5%
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 -1.00000000000000001e-262 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0Initial program 21.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--.f6426.4
Applied rewrites26.4%
Taylor expanded in b around -inf
Applied rewrites87.6%
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 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--.f643.2
Applied rewrites3.2%
Taylor expanded in z around inf
lower--.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites71.3%
Final simplification95.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* x y) (* z (- t a))))
(t_2 (/ t_1 (fma z b (fma z (- y) y))))
(t_3 (fma z (- b y) y))
(t_4 (/ t_1 (+ y (* z (- b y)))))
(t_5 (fma z (/ (- t a) t_3) (* x (/ y t_3)))))
(if (<= t_4 (- INFINITY))
t_5
(if (<= t_4 -1e-262)
t_2
(if (<= t_4 0.0)
(/ (+ (- t a) (/ (* x y) z)) b)
(if (<= t_4 1e+308)
t_2
(if (<= t_4 INFINITY) t_5 (/ (- t a) (- b y)))))))))
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 = t_1 / fma(z, b, fma(z, -y, y));
double t_3 = fma(z, (b - y), y);
double t_4 = t_1 / (y + (z * (b - y)));
double t_5 = fma(z, ((t - a) / t_3), (x * (y / t_3)));
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = t_5;
} else if (t_4 <= -1e-262) {
tmp = t_2;
} else if (t_4 <= 0.0) {
tmp = ((t - a) + ((x * y) / z)) / b;
} else if (t_4 <= 1e+308) {
tmp = t_2;
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_5;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * y) + Float64(z * Float64(t - a))) t_2 = Float64(t_1 / fma(z, b, fma(z, Float64(-y), y))) t_3 = fma(z, Float64(b - y), y) t_4 = Float64(t_1 / Float64(y + Float64(z * Float64(b - y)))) t_5 = fma(z, Float64(Float64(t - a) / t_3), Float64(x * Float64(y / t_3))) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = t_5; elseif (t_4 <= -1e-262) tmp = t_2; elseif (t_4 <= 0.0) tmp = Float64(Float64(Float64(t - a) + Float64(Float64(x * y) / z)) / b); elseif (t_4 <= 1e+308) tmp = t_2; elseif (t_4 <= Inf) tmp = t_5; 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[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(z * b + N[(z * (-y) + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(z * N[(N[(t - a), $MachinePrecision] / t$95$3), $MachinePrecision] + N[(x * N[(y / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], t$95$5, If[LessEqual[t$95$4, -1e-262], t$95$2, If[LessEqual[t$95$4, 0.0], N[(N[(N[(t - a), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$4, 1e+308], t$95$2, If[LessEqual[t$95$4, Infinity], t$95$5, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot \left(t - a\right)\\
t_2 := \frac{t\_1}{\mathsf{fma}\left(z, b, \mathsf{fma}\left(z, -y, y\right)\right)}\\
t_3 := \mathsf{fma}\left(z, b - y, y\right)\\
t_4 := \frac{t\_1}{y + z \cdot \left(b - y\right)}\\
t_5 := \mathsf{fma}\left(z, \frac{t - a}{t\_3}, x \cdot \frac{y}{t\_3}\right)\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_4 \leq -1 \cdot 10^{-262}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;\frac{\left(t - a\right) + \frac{x \cdot y}{z}}{b}\\
\mathbf{elif}\;t\_4 \leq 10^{+308}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_5\\
\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.0 or 1e308 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 20.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--.f6499.6
Applied rewrites99.6%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.00000000000000001e-262 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1e308Initial program 99.5%
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 -1.00000000000000001e-262 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0Initial program 21.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--.f6426.4
Applied rewrites26.4%
Taylor expanded in b around -inf
Applied rewrites87.6%
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--.f6471.2
Applied rewrites71.2%
Final simplification95.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* x y) (* z (- t a))))
(t_2 (/ t_1 (fma z b (fma z (- y) y))))
(t_3 (/ t_1 (+ y (* z (- b y)))))
(t_4 (fma z (/ (- t a) (fma z (- b y) y)) (* x 1.0))))
(if (<= t_3 (- INFINITY))
t_4
(if (<= t_3 -1e-262)
t_2
(if (<= t_3 0.0)
(/ (+ (- t a) (/ (* x y) z)) b)
(if (<= t_3 1e+308)
t_2
(if (<= t_3 INFINITY) t_4 (/ (- t a) (- b y)))))))))
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 = t_1 / fma(z, b, fma(z, -y, y));
double t_3 = t_1 / (y + (z * (b - y)));
double t_4 = fma(z, ((t - a) / fma(z, (b - y), y)), (x * 1.0));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_4;
} else if (t_3 <= -1e-262) {
tmp = t_2;
} else if (t_3 <= 0.0) {
tmp = ((t - a) + ((x * y) / z)) / b;
} else if (t_3 <= 1e+308) {
tmp = t_2;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * y) + Float64(z * Float64(t - a))) t_2 = Float64(t_1 / fma(z, b, fma(z, Float64(-y), y))) t_3 = Float64(t_1 / Float64(y + Float64(z * Float64(b - y)))) t_4 = fma(z, Float64(Float64(t - a) / fma(z, Float64(b - y), y)), Float64(x * 1.0)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_4; elseif (t_3 <= -1e-262) tmp = t_2; elseif (t_3 <= 0.0) tmp = Float64(Float64(Float64(t - a) + Float64(Float64(x * y) / z)) / b); elseif (t_3 <= 1e+308) tmp = t_2; elseif (t_3 <= Inf) tmp = 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[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(z * b + N[(z * (-y) + y), $MachinePrecision]), $MachinePrecision]), $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[(z * N[(N[(t - a), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x * 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$4, If[LessEqual[t$95$3, -1e-262], t$95$2, If[LessEqual[t$95$3, 0.0], N[(N[(N[(t - a), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$3, 1e+308], t$95$2, If[LessEqual[t$95$3, Infinity], t$95$4, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot \left(t - a\right)\\
t_2 := \frac{t\_1}{\mathsf{fma}\left(z, b, \mathsf{fma}\left(z, -y, y\right)\right)}\\
t_3 := \frac{t\_1}{y + z \cdot \left(b - y\right)}\\
t_4 := \mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(z, b - y, y\right)}, x \cdot 1\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq -1 \cdot 10^{-262}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{\left(t - a\right) + \frac{x \cdot y}{z}}{b}\\
\mathbf{elif}\;t\_3 \leq 10^{+308}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_4\\
\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.0 or 1e308 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 20.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--.f6499.6
Applied rewrites99.6%
Taylor expanded in z around 0
Applied rewrites79.9%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.00000000000000001e-262 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1e308Initial program 99.5%
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 -1.00000000000000001e-262 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0Initial program 21.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--.f6426.4
Applied rewrites26.4%
Taylor expanded in b around -inf
Applied rewrites87.6%
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--.f6471.2
Applied rewrites71.2%
Final simplification90.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_2 (fma z (/ (- t a) (fma z (- b y) y)) (* x 1.0))))
(if (<= t_1 (- INFINITY))
t_2
(if (<= t_1 -1e-262)
t_1
(if (<= t_1 0.0)
(/ (+ (- t a) (/ (* x y) z)) b)
(if (<= t_1 1e+308)
t_1
(if (<= t_1 INFINITY) t_2 (/ (- t a) (- b y)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_2 = fma(z, ((t - a) / fma(z, (b - y), y)), (x * 1.0));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= -1e-262) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((t - a) + ((x * y) / z)) / b;
} else if (t_1 <= 1e+308) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_2 = fma(z, Float64(Float64(t - a) / fma(z, Float64(b - y), y)), Float64(x * 1.0)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= -1e-262) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(t - a) + Float64(Float64(x * y) / z)) / b); elseif (t_1 <= 1e+308) tmp = t_1; elseif (t_1 <= Inf) tmp = t_2; 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[(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$2 = N[(z * N[(N[(t - a), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x * 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -1e-262], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(t - a), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$1, 1e+308], t$95$1, If[LessEqual[t$95$1, Infinity], t$95$2, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_2 := \mathsf{fma}\left(z, \frac{t - a}{\mathsf{fma}\left(z, b - y, y\right)}, x \cdot 1\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-262}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\left(t - a\right) + \frac{x \cdot y}{z}}{b}\\
\mathbf{elif}\;t\_1 \leq 10^{+308}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_2\\
\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.0 or 1e308 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 20.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--.f6499.6
Applied rewrites99.6%
Taylor expanded in z around 0
Applied rewrites79.9%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.00000000000000001e-262 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1e308Initial program 99.5%
if -1.00000000000000001e-262 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0Initial program 21.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--.f6426.4
Applied rewrites26.4%
Taylor expanded in b around -inf
Applied rewrites87.6%
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--.f6471.2
Applied rewrites71.2%
Final simplification90.6%
(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 -2.1e+56)
t_2
(if (<= z -320000000.0)
(* x (/ y t_1))
(if (<= z 2.6e-11) (fma z (/ (- t a) t_1) (* x 1.0)) 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 <= -2.1e+56) {
tmp = t_2;
} else if (z <= -320000000.0) {
tmp = x * (y / t_1);
} else if (z <= 2.6e-11) {
tmp = fma(z, ((t - a) / t_1), (x * 1.0));
} 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 <= -2.1e+56) tmp = t_2; elseif (z <= -320000000.0) tmp = Float64(x * Float64(y / t_1)); elseif (z <= 2.6e-11) tmp = fma(z, Float64(Float64(t - a) / t_1), Float64(x * 1.0)); 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, -2.1e+56], t$95$2, If[LessEqual[z, -320000000.0], N[(x * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e-11], N[(z * N[(N[(t - a), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(x * 1.0), $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 -2.1 \cdot 10^{+56}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -320000000:\\
\;\;\;\;x \cdot \frac{y}{t\_1}\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{t - a}{t\_1}, x \cdot 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -2.10000000000000017e56 or 2.6000000000000001e-11 < z Initial program 43.3%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6481.2
Applied rewrites81.2%
if -2.10000000000000017e56 < z < -3.2e8Initial program 46.7%
Taylor expanded in x around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6485.6
Applied rewrites85.6%
if -3.2e8 < z < 2.6000000000000001e-11Initial program 81.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--.f6488.4
Applied rewrites88.4%
Taylor expanded in z around 0
Applied rewrites74.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -1.32e-48)
t_1
(if (<= z 1.6e-11) (* 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 <= -1.32e-48) {
tmp = t_1;
} else if (z <= 1.6e-11) {
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 <= -1.32e-48) tmp = t_1; elseif (z <= 1.6e-11) 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, -1.32e-48], t$95$1, If[LessEqual[z, 1.6e-11], 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 -1.32 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-11}:\\
\;\;\;\;x \cdot \frac{y}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.32e-48 or 1.59999999999999997e-11 < z Initial program 47.2%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6477.2
Applied rewrites77.2%
if -1.32e-48 < z < 1.59999999999999997e-11Initial program 80.0%
Taylor expanded in x around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6468.6
Applied rewrites68.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ t (- b y))))
(if (<= z -2.1e+215)
t_1
(if (<= z -4.4e-47) (/ a (- b)) (if (<= z 1.65e-11) (fma x z x) 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 <= -2.1e+215) {
tmp = t_1;
} else if (z <= -4.4e-47) {
tmp = a / -b;
} else if (z <= 1.65e-11) {
tmp = fma(x, z, x);
} 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 <= -2.1e+215) tmp = t_1; elseif (z <= -4.4e-47) tmp = Float64(a / Float64(-b)); elseif (z <= 1.65e-11) tmp = fma(x, z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+215], t$95$1, If[LessEqual[z, -4.4e-47], N[(a / (-b)), $MachinePrecision], If[LessEqual[z, 1.65e-11], N[(x * z + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+215}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.4 \cdot 10^{-47}:\\
\;\;\;\;\frac{a}{-b}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.1000000000000002e215 or 1.6500000000000001e-11 < z Initial program 42.5%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6426.8
Applied rewrites26.8%
Taylor expanded in z around inf
Applied rewrites49.3%
if -2.1000000000000002e215 < z < -4.40000000000000037e-47Initial program 55.1%
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--.f6440.4
Applied rewrites40.4%
Taylor expanded in y around 0
Applied rewrites35.8%
if -4.40000000000000037e-47 < z < 1.6500000000000001e-11Initial program 80.0%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6457.1
Applied rewrites57.1%
Taylor expanded in z around 0
Applied rewrites57.1%
Final simplification50.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- t a) (- b y)))) (if (<= z -1.32e-48) t_1 (if (<= z 7.2e-13) (fma x z 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 <= -1.32e-48) {
tmp = t_1;
} else if (z <= 7.2e-13) {
tmp = fma(x, z, 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 <= -1.32e-48) tmp = t_1; elseif (z <= 7.2e-13) tmp = fma(x, z, 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, -1.32e-48], t$95$1, If[LessEqual[z, 7.2e-13], N[(x * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.32 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.32e-48 or 7.1999999999999996e-13 < z Initial program 47.2%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower--.f6477.2
Applied rewrites77.2%
if -1.32e-48 < z < 7.1999999999999996e-13Initial program 80.0%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6457.1
Applied rewrites57.1%
Taylor expanded in z around 0
Applied rewrites57.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (- 1.0 z)))) (if (<= y -1.26e-70) t_1 (if (<= y 250000000000.0) (/ (- 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 <= -1.26e-70) {
tmp = t_1;
} else if (y <= 250000000000.0) {
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 <= (-1.26d-70)) then
tmp = t_1
else if (y <= 250000000000.0d0) 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 <= -1.26e-70) {
tmp = t_1;
} else if (y <= 250000000000.0) {
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 <= -1.26e-70: tmp = t_1 elif y <= 250000000000.0: 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 <= -1.26e-70) tmp = t_1; elseif (y <= 250000000000.0) 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 <= -1.26e-70) tmp = t_1; elseif (y <= 250000000000.0) 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, -1.26e-70], t$95$1, If[LessEqual[y, 250000000000.0], 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 -1.26 \cdot 10^{-70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 250000000000:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.2600000000000001e-70 or 2.5e11 < y Initial program 53.9%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6454.7
Applied rewrites54.7%
if -1.2600000000000001e-70 < y < 2.5e11Initial program 76.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6459.7
Applied rewrites59.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ t (- b y)))) (if (<= z -6.35e+147) t_1 (if (<= z 1.65e-11) (/ 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 <= -6.35e+147) {
tmp = t_1;
} else if (z <= 1.65e-11) {
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 <= (-6.35d+147)) then
tmp = t_1
else if (z <= 1.65d-11) 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 <= -6.35e+147) {
tmp = t_1;
} else if (z <= 1.65e-11) {
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 <= -6.35e+147: tmp = t_1 elif z <= 1.65e-11: 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 <= -6.35e+147) tmp = t_1; elseif (z <= 1.65e-11) 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 <= -6.35e+147) tmp = t_1; elseif (z <= 1.65e-11) 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, -6.35e+147], t$95$1, If[LessEqual[z, 1.65e-11], 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 -6.35 \cdot 10^{+147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-11}:\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.3500000000000001e147 or 1.6500000000000001e-11 < z Initial program 41.8%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower--.f6425.8
Applied rewrites25.8%
Taylor expanded in z around inf
Applied rewrites46.8%
if -6.3500000000000001e147 < z < 1.6500000000000001e-11Initial program 76.3%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6451.1
Applied rewrites51.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ a (- b)))) (if (<= z -4.4e-47) t_1 (if (<= z 1e-12) (fma x z x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a / -b;
double tmp;
if (z <= -4.4e-47) {
tmp = t_1;
} else if (z <= 1e-12) {
tmp = fma(x, z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(a / Float64(-b)) tmp = 0.0 if (z <= -4.4e-47) tmp = t_1; elseif (z <= 1e-12) tmp = fma(x, z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a / (-b)), $MachinePrecision]}, If[LessEqual[z, -4.4e-47], t$95$1, If[LessEqual[z, 1e-12], N[(x * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{-b}\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{-47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 10^{-12}:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.40000000000000037e-47 or 9.9999999999999998e-13 < z Initial program 47.2%
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--.f6427.4
Applied rewrites27.4%
Taylor expanded in y around 0
Applied rewrites33.0%
if -4.40000000000000037e-47 < z < 9.9999999999999998e-13Initial program 80.0%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6457.1
Applied rewrites57.1%
Taylor expanded in z around 0
Applied rewrites57.1%
Final simplification44.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z -5.2e-23) (/ t b) (if (<= z 1.65e-11) (fma x z x) (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.2e-23) {
tmp = t / b;
} else if (z <= 1.65e-11) {
tmp = fma(x, z, x);
} else {
tmp = t / b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5.2e-23) tmp = Float64(t / b); elseif (z <= 1.65e-11) tmp = fma(x, z, x); else tmp = Float64(t / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.2e-23], N[(t / b), $MachinePrecision], If[LessEqual[z, 1.65e-11], N[(x * z + x), $MachinePrecision], N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-23}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -5.2e-23 or 1.6500000000000001e-11 < z Initial program 46.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--.f6464.0
Applied rewrites64.0%
Taylor expanded in b around -inf
Applied rewrites54.8%
Taylor expanded in t around inf
Applied rewrites25.2%
if -5.2e-23 < z < 1.6500000000000001e-11Initial program 80.5%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6455.9
Applied rewrites55.9%
Taylor expanded in z around 0
Applied rewrites55.9%
(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 63.0%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6437.1
Applied rewrites37.1%
Taylor expanded in z around 0
Applied rewrites29.5%
(FPCore (x y z t a b) :precision binary64 (* x z))
double code(double x, double y, double z, double t, double a, double b) {
return x * 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 = x * z
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * z;
}
def code(x, y, z, t, a, b): return x * z
function code(x, y, z, t, a, b) return Float64(x * z) end
function tmp = code(x, y, z, t, a, b) tmp = x * z; end
code[x_, y_, z_, t_, a_, b_] := N[(x * z), $MachinePrecision]
\begin{array}{l}
\\
x \cdot z
\end{array}
Initial program 63.0%
Taylor expanded in y around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6437.1
Applied rewrites37.1%
Taylor expanded in z around 0
Applied rewrites29.5%
Taylor expanded in z around inf
Applied rewrites4.3%
Final simplification4.3%
(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 2024238
(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)))))