
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* i (* (+ (* c b) a) c))))
(if (<= t_1 5e+270)
(* (- (+ (* t z) (* y x)) t_1) 2.0)
(* (fma z t (fma y x (* (- c) (* (fma c b a) i)))) 2.0))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = i * (((c * b) + a) * c);
double tmp;
if (t_1 <= 5e+270) {
tmp = (((t * z) + (y * x)) - t_1) * 2.0;
} else {
tmp = fma(z, t, fma(y, x, (-c * (fma(c, b, a) * i)))) * 2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if (t_1 <= 5e+270) tmp = Float64(Float64(Float64(Float64(t * z) + Float64(y * x)) - t_1) * 2.0); else tmp = Float64(fma(z, t, fma(y, x, Float64(Float64(-c) * Float64(fma(c, b, a) * i)))) * 2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+270], N[(N[(N[(N[(t * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(z * t + N[(y * x + N[((-c) * N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+270}:\\
\;\;\;\;\left(\left(t \cdot z + y \cdot x\right) - t\_1\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \left(-c\right) \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right)\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.99999999999999976e270Initial program 97.6%
if 4.99999999999999976e270 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 72.7%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
lower-fma.f64N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites98.1%
Final simplification97.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (fma (- i) (* (fma c b a) c) (* t z)) 2.0))
(t_2 (* i (* (+ (* c b) a) c))))
(if (<= t_2 -2e+85)
t_1
(if (<= t_2 1e-25)
(* (fma (* (- a) c) i (fma t z (* y x))) 2.0)
(if (<= t_2 5e+298)
t_1
(* (fma (- c) (* (fma b c a) i) (* y x)) 2.0))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(-i, (fma(c, b, a) * c), (t * z)) * 2.0;
double t_2 = i * (((c * b) + a) * c);
double tmp;
if (t_2 <= -2e+85) {
tmp = t_1;
} else if (t_2 <= 1e-25) {
tmp = fma((-a * c), i, fma(t, z, (y * x))) * 2.0;
} else if (t_2 <= 5e+298) {
tmp = t_1;
} else {
tmp = fma(-c, (fma(b, c, a) * i), (y * x)) * 2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(fma(Float64(-i), Float64(fma(c, b, a) * c), Float64(t * z)) * 2.0) t_2 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if (t_2 <= -2e+85) tmp = t_1; elseif (t_2 <= 1e-25) tmp = Float64(fma(Float64(Float64(-a) * c), i, fma(t, z, Float64(y * x))) * 2.0); elseif (t_2 <= 5e+298) tmp = t_1; else tmp = Float64(fma(Float64(-c), Float64(fma(b, c, a) * i), Float64(y * x)) * 2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[((-i) * N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+85], t$95$1, If[LessEqual[t$95$2, 1e-25], N[(N[(N[((-a) * c), $MachinePrecision] * i + N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$2, 5e+298], t$95$1, N[(N[((-c) * N[(N[(b * c + a), $MachinePrecision] * i), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, \mathsf{fma}\left(c, b, a\right) \cdot c, t \cdot z\right) \cdot 2\\
t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{-25}:\\
\;\;\;\;\mathsf{fma}\left(\left(-a\right) \cdot c, i, \mathsf{fma}\left(t, z, y \cdot x\right)\right) \cdot 2\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+298}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, y \cdot x\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2e85 or 1.00000000000000004e-25 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000003e298Initial program 95.8%
Taylor expanded in x around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6491.9
Applied rewrites91.9%
if -2e85 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000004e-25Initial program 99.1%
Taylor expanded in b around 0
sub-negN/A
+-commutativeN/A
associate-*r*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6498.0
Applied rewrites98.0%
if 5.0000000000000003e298 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 70.5%
Taylor expanded in a around inf
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f6432.8
Applied rewrites32.8%
Taylor expanded in z around 0
sub-negN/A
mul-1-negN/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6488.1
Applied rewrites88.1%
Final simplification93.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (fma (- i) (* (fma c b a) c) (* t z)) 2.0))
(t_2 (* i (* (+ (* c b) a) c))))
(if (<= t_2 -2e+85)
t_1
(if (<= t_2 1e-25)
(* (fma t z (* y x)) 2.0)
(if (<= t_2 5e+298)
t_1
(* (fma (- c) (* (fma b c a) i) (* y x)) 2.0))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(-i, (fma(c, b, a) * c), (t * z)) * 2.0;
double t_2 = i * (((c * b) + a) * c);
double tmp;
if (t_2 <= -2e+85) {
tmp = t_1;
} else if (t_2 <= 1e-25) {
tmp = fma(t, z, (y * x)) * 2.0;
} else if (t_2 <= 5e+298) {
tmp = t_1;
} else {
tmp = fma(-c, (fma(b, c, a) * i), (y * x)) * 2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(fma(Float64(-i), Float64(fma(c, b, a) * c), Float64(t * z)) * 2.0) t_2 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if (t_2 <= -2e+85) tmp = t_1; elseif (t_2 <= 1e-25) tmp = Float64(fma(t, z, Float64(y * x)) * 2.0); elseif (t_2 <= 5e+298) tmp = t_1; else tmp = Float64(fma(Float64(-c), Float64(fma(b, c, a) * i), Float64(y * x)) * 2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[((-i) * N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+85], t$95$1, If[LessEqual[t$95$2, 1e-25], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$2, 5e+298], t$95$1, N[(N[((-c) * N[(N[(b * c + a), $MachinePrecision] * i), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, \mathsf{fma}\left(c, b, a\right) \cdot c, t \cdot z\right) \cdot 2\\
t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{-25}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+298}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, y \cdot x\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2e85 or 1.00000000000000004e-25 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000003e298Initial program 95.8%
Taylor expanded in x around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6491.9
Applied rewrites91.9%
if -2e85 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000004e-25Initial program 99.1%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6494.0
Applied rewrites94.0%
if 5.0000000000000003e298 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 70.5%
Taylor expanded in a around inf
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f6432.8
Applied rewrites32.8%
Taylor expanded in z around 0
sub-negN/A
mul-1-negN/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6488.1
Applied rewrites88.1%
Final simplification92.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* c b) a) c)))
(if (<= t_1 (- INFINITY))
(* (* (* (* c c) b) -2.0) i)
(if (<= t_1 -2e+185)
(* (* (* i c) a) -2.0)
(if (<= t_1 2e+179)
(* (fma t z (* y x)) 2.0)
(* (* (* (* c c) i) b) -2.0))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((c * b) + a) * c;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (((c * c) * b) * -2.0) * i;
} else if (t_1 <= -2e+185) {
tmp = ((i * c) * a) * -2.0;
} else if (t_1 <= 2e+179) {
tmp = fma(t, z, (y * x)) * 2.0;
} else {
tmp = (((c * c) * i) * b) * -2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(c * b) + a) * c) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(Float64(Float64(c * c) * b) * -2.0) * i); elseif (t_1 <= -2e+185) tmp = Float64(Float64(Float64(i * c) * a) * -2.0); elseif (t_1 <= 2e+179) tmp = Float64(fma(t, z, Float64(y * x)) * 2.0); else tmp = Float64(Float64(Float64(Float64(c * c) * i) * b) * -2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(N[(c * c), $MachinePrecision] * b), $MachinePrecision] * -2.0), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t$95$1, -2e+185], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, 2e+179], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(c * c), $MachinePrecision] * i), $MachinePrecision] * b), $MachinePrecision] * -2.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot b + a\right) \cdot c\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(\left(\left(c \cdot c\right) \cdot b\right) \cdot -2\right) \cdot i\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+185}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+179}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -inf.0Initial program 70.3%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6484.4
Applied rewrites84.4%
Applied rewrites84.2%
Taylor expanded in a around 0
Applied rewrites70.3%
if -inf.0 < (*.f64 (+.f64 a (*.f64 b c)) c) < -2e185Initial program 99.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6458.6
Applied rewrites58.6%
if -2e185 < (*.f64 (+.f64 a (*.f64 b c)) c) < 1.99999999999999996e179Initial program 98.8%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6476.1
Applied rewrites76.1%
if 1.99999999999999996e179 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 82.3%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6484.6
Applied rewrites84.6%
Taylor expanded in a around 0
Applied rewrites71.5%
Final simplification73.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (* (* c c) i) b) -2.0)) (t_2 (* (+ (* c b) a) c)))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -2e+185)
(* (* (* i c) a) -2.0)
(if (<= t_2 2e+179) (* (fma t z (* y x)) 2.0) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (((c * c) * i) * b) * -2.0;
double t_2 = ((c * b) + a) * c;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -2e+185) {
tmp = ((i * c) * a) * -2.0;
} else if (t_2 <= 2e+179) {
tmp = fma(t, z, (y * x)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(c * c) * i) * b) * -2.0) t_2 = Float64(Float64(Float64(c * b) + a) * c) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -2e+185) tmp = Float64(Float64(Float64(i * c) * a) * -2.0); elseif (t_2 <= 2e+179) tmp = Float64(fma(t, z, Float64(y * x)) * 2.0); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(c * c), $MachinePrecision] * i), $MachinePrecision] * b), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -2e+185], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$2, 2e+179], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2\\
t_2 := \left(c \cdot b + a\right) \cdot c\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+185}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+179}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -inf.0 or 1.99999999999999996e179 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 76.4%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6484.5
Applied rewrites84.5%
Taylor expanded in a around 0
Applied rewrites69.6%
if -inf.0 < (*.f64 (+.f64 a (*.f64 b c)) c) < -2e185Initial program 99.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6458.6
Applied rewrites58.6%
if -2e185 < (*.f64 (+.f64 a (*.f64 b c)) c) < 1.99999999999999996e179Initial program 98.8%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6476.1
Applied rewrites76.1%
Final simplification73.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* i (* (+ (* c b) a) c))))
(if (<= t_1 -2e+85)
(* (* (* -2.0 (fma b c a)) c) i)
(if (<= t_1 2e-42)
(* (fma t z (* y x)) 2.0)
(* (fma (- c) (* (fma b c a) i) (* y x)) 2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = i * (((c * b) + a) * c);
double tmp;
if (t_1 <= -2e+85) {
tmp = ((-2.0 * fma(b, c, a)) * c) * i;
} else if (t_1 <= 2e-42) {
tmp = fma(t, z, (y * x)) * 2.0;
} else {
tmp = fma(-c, (fma(b, c, a) * i), (y * x)) * 2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if (t_1 <= -2e+85) tmp = Float64(Float64(Float64(-2.0 * fma(b, c, a)) * c) * i); elseif (t_1 <= 2e-42) tmp = Float64(fma(t, z, Float64(y * x)) * 2.0); else tmp = Float64(fma(Float64(-c), Float64(fma(b, c, a) * i), Float64(y * x)) * 2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+85], N[(N[(N[(-2.0 * N[(b * c + a), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t$95$1, 2e-42], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[((-c) * N[(N[(b * c + a), $MachinePrecision] * i), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+85}:\\
\;\;\;\;\left(\left(-2 \cdot \mathsf{fma}\left(b, c, a\right)\right) \cdot c\right) \cdot i\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-42}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-c, \mathsf{fma}\left(b, c, a\right) \cdot i, y \cdot x\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2e85Initial program 93.3%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6473.0
Applied rewrites73.0%
Applied rewrites81.8%
if -2e85 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000008e-42Initial program 99.1%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6494.8
Applied rewrites94.8%
if 2.00000000000000008e-42 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 83.1%
Taylor expanded in a around inf
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f6433.8
Applied rewrites33.8%
Taylor expanded in z around 0
sub-negN/A
mul-1-negN/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6479.0
Applied rewrites79.0%
Final simplification86.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* i (* (+ (* c b) a) c))))
(if (<= t_1 -2e+85)
(* (* (* -2.0 (fma b c a)) c) i)
(if (<= t_1 1e-25)
(* (fma t z (* y x)) 2.0)
(* (* -2.0 (* (fma c b a) i)) c)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = i * (((c * b) + a) * c);
double tmp;
if (t_1 <= -2e+85) {
tmp = ((-2.0 * fma(b, c, a)) * c) * i;
} else if (t_1 <= 1e-25) {
tmp = fma(t, z, (y * x)) * 2.0;
} else {
tmp = (-2.0 * (fma(c, b, a) * i)) * c;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if (t_1 <= -2e+85) tmp = Float64(Float64(Float64(-2.0 * fma(b, c, a)) * c) * i); elseif (t_1 <= 1e-25) tmp = Float64(fma(t, z, Float64(y * x)) * 2.0); else tmp = Float64(Float64(-2.0 * Float64(fma(c, b, a) * i)) * c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+85], N[(N[(N[(-2.0 * N[(b * c + a), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t$95$1, 1e-25], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(-2.0 * N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+85}:\\
\;\;\;\;\left(\left(-2 \cdot \mathsf{fma}\left(b, c, a\right)\right) \cdot c\right) \cdot i\\
\mathbf{elif}\;t\_1 \leq 10^{-25}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2e85Initial program 93.3%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6473.0
Applied rewrites73.0%
Applied rewrites81.8%
if -2e85 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000004e-25Initial program 99.1%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6494.0
Applied rewrites94.0%
if 1.00000000000000004e-25 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 82.7%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6476.3
Applied rewrites76.3%
Final simplification85.5%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (* (* -2.0 (* (fma c b a) i)) c)) (t_2 (* i (* (+ (* c b) a) c)))) (if (<= t_2 -2e+85) t_1 (if (<= t_2 1e-25) (* (fma t z (* y x)) 2.0) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (-2.0 * (fma(c, b, a) * i)) * c;
double t_2 = i * (((c * b) + a) * c);
double tmp;
if (t_2 <= -2e+85) {
tmp = t_1;
} else if (t_2 <= 1e-25) {
tmp = fma(t, z, (y * x)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(-2.0 * Float64(fma(c, b, a) * i)) * c) t_2 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if (t_2 <= -2e+85) tmp = t_1; elseif (t_2 <= 1e-25) tmp = Float64(fma(t, z, Float64(y * x)) * 2.0); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(-2.0 * N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+85], t$95$1, If[LessEqual[t$95$2, 1e-25], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c\\
t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{-25}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2e85 or 1.00000000000000004e-25 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 87.0%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6475.0
Applied rewrites75.0%
if -2e85 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000004e-25Initial program 99.1%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6494.0
Applied rewrites94.0%
Final simplification83.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (* -2.0 (* c b)) i) c)) (t_2 (* i (* (+ (* c b) a) c))))
(if (<= t_2 -2e+233)
t_1
(if (<= t_2 1e+254) (* (fma t z (* y x)) 2.0) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((-2.0 * (c * b)) * i) * c;
double t_2 = i * (((c * b) + a) * c);
double tmp;
if (t_2 <= -2e+233) {
tmp = t_1;
} else if (t_2 <= 1e+254) {
tmp = fma(t, z, (y * x)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(-2.0 * Float64(c * b)) * i) * c) t_2 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if (t_2 <= -2e+233) tmp = t_1; elseif (t_2 <= 1e+254) tmp = Float64(fma(t, z, Float64(y * x)) * 2.0); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(-2.0 * N[(c * b), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+233], t$95$1, If[LessEqual[t$95$2, 1e+254], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(-2 \cdot \left(c \cdot b\right)\right) \cdot i\right) \cdot c\\
t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+233}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+254}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.99999999999999995e233 or 9.9999999999999994e253 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 81.1%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6484.7
Applied rewrites84.7%
Applied rewrites83.7%
Taylor expanded in a around 0
Applied rewrites60.3%
Applied rewrites61.3%
if -1.99999999999999995e233 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999994e253Initial program 99.3%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6478.6
Applied rewrites78.6%
Final simplification72.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* i (* (+ (* c b) a) c))))
(if (<= t_1 -2e+233)
(* (* (* -2.0 (* c b)) c) i)
(if (<= t_1 1e+254)
(* (fma t z (* y x)) 2.0)
(* (* (* (* c c) i) b) -2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = i * (((c * b) + a) * c);
double tmp;
if (t_1 <= -2e+233) {
tmp = ((-2.0 * (c * b)) * c) * i;
} else if (t_1 <= 1e+254) {
tmp = fma(t, z, (y * x)) * 2.0;
} else {
tmp = (((c * c) * i) * b) * -2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if (t_1 <= -2e+233) tmp = Float64(Float64(Float64(-2.0 * Float64(c * b)) * c) * i); elseif (t_1 <= 1e+254) tmp = Float64(fma(t, z, Float64(y * x)) * 2.0); else tmp = Float64(Float64(Float64(Float64(c * c) * i) * b) * -2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+233], N[(N[(N[(-2.0 * N[(c * b), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t$95$1, 1e+254], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(c * c), $MachinePrecision] * i), $MachinePrecision] * b), $MachinePrecision] * -2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+233}:\\
\;\;\;\;\left(\left(-2 \cdot \left(c \cdot b\right)\right) \cdot c\right) \cdot i\\
\mathbf{elif}\;t\_1 \leq 10^{+254}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.99999999999999995e233Initial program 91.0%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6484.2
Applied rewrites84.2%
Applied rewrites88.6%
Taylor expanded in a around 0
Applied rewrites65.4%
if -1.99999999999999995e233 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999994e253Initial program 99.3%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6478.6
Applied rewrites78.6%
if 9.9999999999999994e253 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 73.7%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6485.1
Applied rewrites85.1%
Taylor expanded in a around 0
Applied rewrites58.0%
Final simplification72.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* i (* (+ (* c b) a) c))))
(if (<= t_1 -4e+163)
(* (* (* -2.0 a) c) i)
(if (<= t_1 3e+140) (* (fma t z (* y x)) 2.0) (* (* (* i c) a) -2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = i * (((c * b) + a) * c);
double tmp;
if (t_1 <= -4e+163) {
tmp = ((-2.0 * a) * c) * i;
} else if (t_1 <= 3e+140) {
tmp = fma(t, z, (y * x)) * 2.0;
} else {
tmp = ((i * c) * a) * -2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if (t_1 <= -4e+163) tmp = Float64(Float64(Float64(-2.0 * a) * c) * i); elseif (t_1 <= 3e+140) tmp = Float64(fma(t, z, Float64(y * x)) * 2.0); else tmp = Float64(Float64(Float64(i * c) * a) * -2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+163], N[(N[(N[(-2.0 * a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t$95$1, 3e+140], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+163}:\\
\;\;\;\;\left(\left(-2 \cdot a\right) \cdot c\right) \cdot i\\
\mathbf{elif}\;t\_1 \leq 3 \cdot 10^{+140}:\\
\;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -3.9999999999999998e163Initial program 92.6%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6476.0
Applied rewrites76.0%
Applied rewrites83.2%
Taylor expanded in a around inf
Applied rewrites37.9%
if -3.9999999999999998e163 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.99999999999999997e140Initial program 99.2%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6485.6
Applied rewrites85.6%
if 2.99999999999999997e140 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 79.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6441.2
Applied rewrites41.2%
Final simplification64.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* y x) 2.0)))
(if (<= (* y x) -4e+62)
t_1
(if (<= (* y x) 1e-67)
(* (* t z) 2.0)
(if (<= (* y x) 5e+49) (* (* (* i c) a) -2.0) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y * x) * 2.0;
double tmp;
if ((y * x) <= -4e+62) {
tmp = t_1;
} else if ((y * x) <= 1e-67) {
tmp = (t * z) * 2.0;
} else if ((y * x) <= 5e+49) {
tmp = ((i * c) * a) * -2.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (y * x) * 2.0d0
if ((y * x) <= (-4d+62)) then
tmp = t_1
else if ((y * x) <= 1d-67) then
tmp = (t * z) * 2.0d0
else if ((y * x) <= 5d+49) then
tmp = ((i * c) * a) * (-2.0d0)
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 c, double i) {
double t_1 = (y * x) * 2.0;
double tmp;
if ((y * x) <= -4e+62) {
tmp = t_1;
} else if ((y * x) <= 1e-67) {
tmp = (t * z) * 2.0;
} else if ((y * x) <= 5e+49) {
tmp = ((i * c) * a) * -2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (y * x) * 2.0 tmp = 0 if (y * x) <= -4e+62: tmp = t_1 elif (y * x) <= 1e-67: tmp = (t * z) * 2.0 elif (y * x) <= 5e+49: tmp = ((i * c) * a) * -2.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(y * x) * 2.0) tmp = 0.0 if (Float64(y * x) <= -4e+62) tmp = t_1; elseif (Float64(y * x) <= 1e-67) tmp = Float64(Float64(t * z) * 2.0); elseif (Float64(y * x) <= 5e+49) tmp = Float64(Float64(Float64(i * c) * a) * -2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (y * x) * 2.0; tmp = 0.0; if ((y * x) <= -4e+62) tmp = t_1; elseif ((y * x) <= 1e-67) tmp = (t * z) * 2.0; elseif ((y * x) <= 5e+49) tmp = ((i * c) * a) * -2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(y * x), $MachinePrecision], -4e+62], t$95$1, If[LessEqual[N[(y * x), $MachinePrecision], 1e-67], N[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 5e+49], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y \cdot x\right) \cdot 2\\
\mathbf{if}\;y \cdot x \leq -4 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \cdot x \leq 10^{-67}:\\
\;\;\;\;\left(t \cdot z\right) \cdot 2\\
\mathbf{elif}\;y \cdot x \leq 5 \cdot 10^{+49}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -4.00000000000000014e62 or 5.0000000000000004e49 < (*.f64 x y) Initial program 89.3%
Taylor expanded in x around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6460.0
Applied rewrites60.0%
if -4.00000000000000014e62 < (*.f64 x y) < 9.99999999999999943e-68Initial program 94.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6442.9
Applied rewrites42.9%
if 9.99999999999999943e-68 < (*.f64 x y) < 5.0000000000000004e49Initial program 95.5%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6448.8
Applied rewrites48.8%
Final simplification50.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* y x) 2.0)))
(if (<= (* y x) -4e+62)
t_1
(if (<= (* y x) 1e-67)
(* (* t z) 2.0)
(if (<= (* y x) 1e+41) (* (* (* -2.0 a) c) i) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y * x) * 2.0;
double tmp;
if ((y * x) <= -4e+62) {
tmp = t_1;
} else if ((y * x) <= 1e-67) {
tmp = (t * z) * 2.0;
} else if ((y * x) <= 1e+41) {
tmp = ((-2.0 * a) * c) * i;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (y * x) * 2.0d0
if ((y * x) <= (-4d+62)) then
tmp = t_1
else if ((y * x) <= 1d-67) then
tmp = (t * z) * 2.0d0
else if ((y * x) <= 1d+41) then
tmp = (((-2.0d0) * a) * c) * i
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 c, double i) {
double t_1 = (y * x) * 2.0;
double tmp;
if ((y * x) <= -4e+62) {
tmp = t_1;
} else if ((y * x) <= 1e-67) {
tmp = (t * z) * 2.0;
} else if ((y * x) <= 1e+41) {
tmp = ((-2.0 * a) * c) * i;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (y * x) * 2.0 tmp = 0 if (y * x) <= -4e+62: tmp = t_1 elif (y * x) <= 1e-67: tmp = (t * z) * 2.0 elif (y * x) <= 1e+41: tmp = ((-2.0 * a) * c) * i else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(y * x) * 2.0) tmp = 0.0 if (Float64(y * x) <= -4e+62) tmp = t_1; elseif (Float64(y * x) <= 1e-67) tmp = Float64(Float64(t * z) * 2.0); elseif (Float64(y * x) <= 1e+41) tmp = Float64(Float64(Float64(-2.0 * a) * c) * i); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (y * x) * 2.0; tmp = 0.0; if ((y * x) <= -4e+62) tmp = t_1; elseif ((y * x) <= 1e-67) tmp = (t * z) * 2.0; elseif ((y * x) <= 1e+41) tmp = ((-2.0 * a) * c) * i; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(y * x), $MachinePrecision], -4e+62], t$95$1, If[LessEqual[N[(y * x), $MachinePrecision], 1e-67], N[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 1e+41], N[(N[(N[(-2.0 * a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y \cdot x\right) \cdot 2\\
\mathbf{if}\;y \cdot x \leq -4 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \cdot x \leq 10^{-67}:\\
\;\;\;\;\left(t \cdot z\right) \cdot 2\\
\mathbf{elif}\;y \cdot x \leq 10^{+41}:\\
\;\;\;\;\left(\left(-2 \cdot a\right) \cdot c\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -4.00000000000000014e62 or 1.00000000000000001e41 < (*.f64 x y) Initial program 89.6%
Taylor expanded in x around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6459.2
Applied rewrites59.2%
if -4.00000000000000014e62 < (*.f64 x y) < 9.99999999999999943e-68Initial program 94.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6442.9
Applied rewrites42.9%
if 9.99999999999999943e-68 < (*.f64 x y) < 1.00000000000000001e41Initial program 94.7%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6462.4
Applied rewrites62.4%
Applied rewrites73.2%
Taylor expanded in a around inf
Applied rewrites45.9%
Final simplification49.7%
(FPCore (x y z t a b c i) :precision binary64 (* (fma z t (fma y x (* (- c) (* (fma c b a) i)))) 2.0))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(z, t, fma(y, x, (-c * (fma(c, b, a) * i)))) * 2.0;
}
function code(x, y, z, t, a, b, c, i) return Float64(fma(z, t, fma(y, x, Float64(Float64(-c) * Float64(fma(c, b, a) * i)))) * 2.0) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(z * t + N[(y * x + N[((-c) * N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \left(-c\right) \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right)\right) \cdot 2
\end{array}
Initial program 92.4%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
lower-fma.f64N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites95.8%
Final simplification95.8%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (* (* y x) 2.0))) (if (<= (* y x) -4e+62) t_1 (if (<= (* y x) 2e-47) (* (* t z) 2.0) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y * x) * 2.0;
double tmp;
if ((y * x) <= -4e+62) {
tmp = t_1;
} else if ((y * x) <= 2e-47) {
tmp = (t * z) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (y * x) * 2.0d0
if ((y * x) <= (-4d+62)) then
tmp = t_1
else if ((y * x) <= 2d-47) then
tmp = (t * z) * 2.0d0
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 c, double i) {
double t_1 = (y * x) * 2.0;
double tmp;
if ((y * x) <= -4e+62) {
tmp = t_1;
} else if ((y * x) <= 2e-47) {
tmp = (t * z) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (y * x) * 2.0 tmp = 0 if (y * x) <= -4e+62: tmp = t_1 elif (y * x) <= 2e-47: tmp = (t * z) * 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(y * x) * 2.0) tmp = 0.0 if (Float64(y * x) <= -4e+62) tmp = t_1; elseif (Float64(y * x) <= 2e-47) tmp = Float64(Float64(t * z) * 2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (y * x) * 2.0; tmp = 0.0; if ((y * x) <= -4e+62) tmp = t_1; elseif ((y * x) <= 2e-47) tmp = (t * z) * 2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(y * x), $MachinePrecision], -4e+62], t$95$1, If[LessEqual[N[(y * x), $MachinePrecision], 2e-47], N[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y \cdot x\right) \cdot 2\\
\mathbf{if}\;y \cdot x \leq -4 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \cdot x \leq 2 \cdot 10^{-47}:\\
\;\;\;\;\left(t \cdot z\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -4.00000000000000014e62 or 1.9999999999999999e-47 < (*.f64 x y) Initial program 90.0%
Taylor expanded in x around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6454.8
Applied rewrites54.8%
if -4.00000000000000014e62 < (*.f64 x y) < 1.9999999999999999e-47Initial program 94.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6441.8
Applied rewrites41.8%
Final simplification47.8%
(FPCore (x y z t a b c i) :precision binary64 (* (* t z) 2.0))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (t * z) * 2.0;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = (t * z) * 2.0d0
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (t * z) * 2.0;
}
def code(x, y, z, t, a, b, c, i): return (t * z) * 2.0
function code(x, y, z, t, a, b, c, i) return Float64(Float64(t * z) * 2.0) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (t * z) * 2.0; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision]
\begin{array}{l}
\\
\left(t \cdot z\right) \cdot 2
\end{array}
Initial program 92.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6429.4
Applied rewrites29.4%
Final simplification29.4%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
herbie shell --seed 2024284
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(! :herbie-platform default (* 2 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))