
(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 14 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 (if (<= (- (+ (* t z) (* y x)) (* i (* (+ (* c b) a) c))) INFINITY) (* (fma z t (fma (* (- i) (fma c b a)) c (* y x))) 2.0) (* (fma z t (* (* (* (- b) c) c) i)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((((t * z) + (y * x)) - (i * (((c * b) + a) * c))) <= ((double) INFINITY)) {
tmp = fma(z, t, fma((-i * fma(c, b, a)), c, (y * x))) * 2.0;
} else {
tmp = fma(z, t, (((-b * c) * c) * i)) * 2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(Float64(t * z) + Float64(y * x)) - Float64(i * Float64(Float64(Float64(c * b) + a) * c))) <= Inf) tmp = Float64(fma(z, t, fma(Float64(Float64(-i) * fma(c, b, a)), c, Float64(y * x))) * 2.0); else tmp = Float64(fma(z, t, Float64(Float64(Float64(Float64(-b) * c) * c) * i)) * 2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(N[(t * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] - N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(z * t + N[(N[((-i) * N[(c * b + a), $MachinePrecision]), $MachinePrecision] * c + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(z * t + N[(N[(N[((-b) * c), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(t \cdot z + y \cdot x\right) - i \cdot \left(\left(c \cdot b + a\right) \cdot c\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(\left(-i\right) \cdot \mathsf{fma}\left(c, b, a\right), c, y \cdot x\right)\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t, \left(\left(\left(-b\right) \cdot c\right) \cdot c\right) \cdot i\right) \cdot 2\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 94.4%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites96.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites28.6%
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.f6450.7
Applied rewrites50.7%
Taylor expanded in c around inf
mul-1-negN/A
associate-*r*N/A
distribute-rgt-neg-inN/A
unpow2N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f6457.1
Applied rewrites57.1%
Final simplification93.9%
(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 -1e+138)
t_1
(if (<= t_2 4e+73)
(* (fma y x (* t z)) 2.0)
(if (<= t_2 2e+228)
(* (fma (- i) (* (fma c b a) c) (* 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 = -2.0 * ((fma(c, b, a) * i) * c);
double t_2 = i * (((c * b) + a) * c);
double tmp;
if (t_2 <= -1e+138) {
tmp = t_1;
} else if (t_2 <= 4e+73) {
tmp = fma(y, x, (t * z)) * 2.0;
} else if (t_2 <= 2e+228) {
tmp = fma(-i, (fma(c, b, a) * c), (t * z)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c)) t_2 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if (t_2 <= -1e+138) tmp = t_1; elseif (t_2 <= 4e+73) tmp = Float64(fma(y, x, Float64(t * z)) * 2.0); elseif (t_2 <= 2e+228) tmp = Float64(fma(Float64(-i), Float64(fma(c, b, a) * c), Float64(t * z)) * 2.0); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+138], t$95$1, If[LessEqual[t$95$2, 4e+73], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$2, 2e+228], N[(N[((-i) * N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+138}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+73}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+228}:\\
\;\;\;\;\mathsf{fma}\left(-i, \mathsf{fma}\left(c, b, a\right) \cdot c, t \cdot z\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1e138 or 1.9999999999999998e228 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 79.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6489.3
Applied rewrites89.3%
if -1e138 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 3.99999999999999993e73Initial program 97.3%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6493.2
Applied rewrites93.2%
if 3.99999999999999993e73 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999998e228Initial program 99.8%
Taylor expanded in x around 0
sub-negN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/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
*-commutativeN/A
lower-*.f6479.3
Applied rewrites79.3%
Final simplification90.0%
(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 -1e+138)
t_1
(if (<= t_2 1e+35)
(* (fma y x (* t z)) 2.0)
(if (<= t_2 2e+228)
(* (fma (- i) (* (fma c b a) c) (* 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 <= -1e+138) {
tmp = t_1;
} else if (t_2 <= 1e+35) {
tmp = fma(y, x, (t * z)) * 2.0;
} else if (t_2 <= 2e+228) {
tmp = fma(-i, (fma(c, b, a) * c), (y * x)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c)) t_2 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if (t_2 <= -1e+138) tmp = t_1; elseif (t_2 <= 1e+35) tmp = Float64(fma(y, x, Float64(t * z)) * 2.0); elseif (t_2 <= 2e+228) tmp = Float64(fma(Float64(-i), Float64(fma(c, b, a) * c), 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[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+138], t$95$1, If[LessEqual[t$95$2, 1e+35], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$2, 2e+228], N[(N[((-i) * N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+138}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+35}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+228}:\\
\;\;\;\;\mathsf{fma}\left(-i, \mathsf{fma}\left(c, b, a\right) \cdot c, y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1e138 or 1.9999999999999998e228 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 79.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6489.3
Applied rewrites89.3%
if -1e138 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999997e34Initial program 97.2%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6493.9
Applied rewrites93.9%
if 9.9999999999999997e34 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999998e228Initial program 99.7%
Taylor expanded in t around 0
sub-negN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/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
*-commutativeN/A
lower-*.f6474.3
Applied rewrites74.3%
Final simplification89.6%
(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 -1e+138)
t_1
(if (<= t_2 4e+73)
(* (fma y x (* t z)) 2.0)
(if (<= t_2 2e+228) (* (fma z t (* (* (- a) c) i)) 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 <= -1e+138) {
tmp = t_1;
} else if (t_2 <= 4e+73) {
tmp = fma(y, x, (t * z)) * 2.0;
} else if (t_2 <= 2e+228) {
tmp = fma(z, t, ((-a * c) * i)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c)) t_2 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if (t_2 <= -1e+138) tmp = t_1; elseif (t_2 <= 4e+73) tmp = Float64(fma(y, x, Float64(t * z)) * 2.0); elseif (t_2 <= 2e+228) tmp = Float64(fma(z, t, Float64(Float64(Float64(-a) * c) * i)) * 2.0); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+138], t$95$1, If[LessEqual[t$95$2, 4e+73], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$2, 2e+228], N[(N[(z * t + N[(N[((-a) * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+138}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+73}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+228}:\\
\;\;\;\;\mathsf{fma}\left(z, t, \left(\left(-a\right) \cdot c\right) \cdot i\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1e138 or 1.9999999999999998e228 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 79.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6489.3
Applied rewrites89.3%
if -1e138 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 3.99999999999999993e73Initial program 97.3%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6493.2
Applied rewrites93.2%
if 3.99999999999999993e73 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999998e228Initial program 99.8%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites77.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.f6471.8
Applied rewrites71.8%
Final simplification89.2%
(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+223)
t_1
(if (<= t_2 2e+228) (* (- (+ (* t z) (* y x)) (* (* 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 = -2.0 * ((fma(c, b, a) * i) * c);
double t_2 = i * (((c * b) + a) * c);
double tmp;
if (t_2 <= -2e+223) {
tmp = t_1;
} else if (t_2 <= 2e+228) {
tmp = (((t * z) + (y * x)) - ((i * c) * a)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(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+223) tmp = t_1; elseif (t_2 <= 2e+228) tmp = Float64(Float64(Float64(Float64(t * z) + Float64(y * x)) - Float64(Float64(i * c) * a)) * 2.0); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+223], t$95$1, If[LessEqual[t$95$2, 2e+228], N[(N[(N[(N[(t * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] - N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+223}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+228}:\\
\;\;\;\;\left(\left(t \cdot z + y \cdot x\right) - \left(i \cdot c\right) \cdot a\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.00000000000000009e223 or 1.9999999999999998e228 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 77.9%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6490.7
Applied rewrites90.7%
if -2.00000000000000009e223 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999998e228Initial program 97.8%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6491.6
Applied rewrites91.6%
Final simplification91.2%
(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 -1e+138)
t_1
(if (<= t_2 2e+188) (* (fma y x (* 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 = -2.0 * ((fma(c, b, a) * i) * c);
double t_2 = i * (((c * b) + a) * c);
double tmp;
if (t_2 <= -1e+138) {
tmp = t_1;
} else if (t_2 <= 2e+188) {
tmp = fma(y, x, (t * z)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c)) t_2 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if (t_2 <= -1e+138) tmp = t_1; elseif (t_2 <= 2e+188) tmp = Float64(fma(y, x, Float64(t * z)) * 2.0); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+138], t$95$1, If[LessEqual[t$95$2, 2e+188], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+138}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+188}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1e138 or 2e188 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 80.2%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6488.5
Applied rewrites88.5%
if -1e138 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e188Initial program 97.7%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6486.3
Applied rewrites86.3%
Final simplification87.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* i (* (+ (* c b) a) c))))
(if (<= t_1 -2e+223)
(* (* (* i (* c b)) c) -2.0)
(if (<= t_1 2e+228)
(* (fma y x (* t z)) 2.0)
(* (* (* (* i c) b) c) -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+223) {
tmp = ((i * (c * b)) * c) * -2.0;
} else if (t_1 <= 2e+228) {
tmp = fma(y, x, (t * z)) * 2.0;
} else {
tmp = (((i * c) * b) * c) * -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+223) tmp = Float64(Float64(Float64(i * Float64(c * b)) * c) * -2.0); elseif (t_1 <= 2e+228) tmp = Float64(fma(y, x, Float64(t * z)) * 2.0); else tmp = Float64(Float64(Float64(Float64(i * c) * b) * c) * -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+223], N[(N[(N[(i * N[(c * b), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, 2e+228], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(i * c), $MachinePrecision] * b), $MachinePrecision] * c), $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^{+223}:\\
\;\;\;\;\left(\left(i \cdot \left(c \cdot b\right)\right) \cdot c\right) \cdot -2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+228}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(i \cdot c\right) \cdot b\right) \cdot c\right) \cdot -2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.00000000000000009e223Initial program 79.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f646.5
Applied rewrites6.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6489.0
Applied rewrites89.0%
Taylor expanded in c around inf
Applied rewrites61.9%
Applied rewrites61.9%
if -2.00000000000000009e223 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999998e228Initial program 97.8%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6481.2
Applied rewrites81.2%
if 1.9999999999999998e228 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 75.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f644.5
Applied rewrites4.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6493.3
Applied rewrites93.3%
Taylor expanded in c around inf
Applied rewrites84.6%
Final simplification76.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (* (* i c) b) c) -2.0)) (t_2 (* i (* (+ (* c b) a) c))))
(if (<= t_2 -2e+223)
t_1
(if (<= t_2 2e+228) (* (fma y x (* 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 = (((i * c) * b) * c) * -2.0;
double t_2 = i * (((c * b) + a) * c);
double tmp;
if (t_2 <= -2e+223) {
tmp = t_1;
} else if (t_2 <= 2e+228) {
tmp = fma(y, x, (t * z)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(i * c) * b) * c) * -2.0) t_2 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if (t_2 <= -2e+223) tmp = t_1; elseif (t_2 <= 2e+228) tmp = Float64(fma(y, x, Float64(t * z)) * 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[(i * c), $MachinePrecision] * b), $MachinePrecision] * c), $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+223], t$95$1, If[LessEqual[t$95$2, 2e+228], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(\left(i \cdot c\right) \cdot b\right) \cdot c\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^{+223}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+228}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.00000000000000009e223 or 1.9999999999999998e228 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 77.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f645.7
Applied rewrites5.7%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6490.7
Applied rewrites90.7%
Taylor expanded in c around inf
Applied rewrites70.7%
if -2.00000000000000009e223 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999998e228Initial program 97.8%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6481.2
Applied rewrites81.2%
Final simplification76.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* i (* (+ (* c b) a) c))))
(if (<= t_1 -1e+138)
(* (* (* (- a) c) i) 2.0)
(if (<= t_1 2e+188) (* (fma y x (* t z)) 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 <= -1e+138) {
tmp = ((-a * c) * i) * 2.0;
} else if (t_1 <= 2e+188) {
tmp = fma(y, x, (t * z)) * 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 <= -1e+138) tmp = Float64(Float64(Float64(Float64(-a) * c) * i) * 2.0); elseif (t_1 <= 2e+188) tmp = Float64(fma(y, x, Float64(t * z)) * 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, -1e+138], N[(N[(N[((-a) * c), $MachinePrecision] * i), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$1, 2e+188], N[(N[(y * x + N[(t * z), $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 -1 \cdot 10^{+138}:\\
\;\;\;\;\left(\left(\left(-a\right) \cdot c\right) \cdot i\right) \cdot 2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+188}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\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) < -1e138Initial program 82.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f648.6
Applied rewrites8.6%
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.f6448.5
Applied rewrites48.5%
if -1e138 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e188Initial program 97.7%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6486.3
Applied rewrites86.3%
if 2e188 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 77.4%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6430.4
Applied rewrites30.4%
Final simplification64.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* i (* (+ (* c b) a) c))))
(if (<= t_1 -1e+138)
(* (* (* i a) c) -2.0)
(if (<= t_1 2e+188) (* (fma y x (* t z)) 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 <= -1e+138) {
tmp = ((i * a) * c) * -2.0;
} else if (t_1 <= 2e+188) {
tmp = fma(y, x, (t * z)) * 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 <= -1e+138) tmp = Float64(Float64(Float64(i * a) * c) * -2.0); elseif (t_1 <= 2e+188) tmp = Float64(fma(y, x, Float64(t * z)) * 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, -1e+138], N[(N[(N[(i * a), $MachinePrecision] * c), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, 2e+188], N[(N[(y * x + N[(t * z), $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 -1 \cdot 10^{+138}:\\
\;\;\;\;\left(\left(i \cdot a\right) \cdot c\right) \cdot -2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+188}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\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) < -1e138Initial program 82.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f648.6
Applied rewrites8.6%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6487.1
Applied rewrites87.1%
Taylor expanded in c around 0
Applied rewrites46.6%
if -1e138 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e188Initial program 97.7%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6486.3
Applied rewrites86.3%
if 2e188 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 77.4%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6430.4
Applied rewrites30.4%
Final simplification64.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* y x) 2.0)))
(if (<= (* y x) -2e+171)
t_1
(if (<= (* y x) -5e-53)
(* (* (* i a) c) -2.0)
(if (<= (* y x) 5e-125)
(* (* t z) 2.0)
(if (<= (* y x) 2e+15) (* (* (* 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) <= -2e+171) {
tmp = t_1;
} else if ((y * x) <= -5e-53) {
tmp = ((i * a) * c) * -2.0;
} else if ((y * x) <= 5e-125) {
tmp = (t * z) * 2.0;
} else if ((y * x) <= 2e+15) {
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) <= (-2d+171)) then
tmp = t_1
else if ((y * x) <= (-5d-53)) then
tmp = ((i * a) * c) * (-2.0d0)
else if ((y * x) <= 5d-125) then
tmp = (t * z) * 2.0d0
else if ((y * x) <= 2d+15) 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) <= -2e+171) {
tmp = t_1;
} else if ((y * x) <= -5e-53) {
tmp = ((i * a) * c) * -2.0;
} else if ((y * x) <= 5e-125) {
tmp = (t * z) * 2.0;
} else if ((y * x) <= 2e+15) {
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) <= -2e+171: tmp = t_1 elif (y * x) <= -5e-53: tmp = ((i * a) * c) * -2.0 elif (y * x) <= 5e-125: tmp = (t * z) * 2.0 elif (y * x) <= 2e+15: 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) <= -2e+171) tmp = t_1; elseif (Float64(y * x) <= -5e-53) tmp = Float64(Float64(Float64(i * a) * c) * -2.0); elseif (Float64(y * x) <= 5e-125) tmp = Float64(Float64(t * z) * 2.0); elseif (Float64(y * x) <= 2e+15) 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) <= -2e+171) tmp = t_1; elseif ((y * x) <= -5e-53) tmp = ((i * a) * c) * -2.0; elseif ((y * x) <= 5e-125) tmp = (t * z) * 2.0; elseif ((y * x) <= 2e+15) 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], -2e+171], t$95$1, If[LessEqual[N[(y * x), $MachinePrecision], -5e-53], N[(N[(N[(i * a), $MachinePrecision] * c), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 5e-125], N[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 2e+15], 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 -2 \cdot 10^{+171}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \cdot x \leq -5 \cdot 10^{-53}:\\
\;\;\;\;\left(\left(i \cdot a\right) \cdot c\right) \cdot -2\\
\mathbf{elif}\;y \cdot x \leq 5 \cdot 10^{-125}:\\
\;\;\;\;\left(t \cdot z\right) \cdot 2\\
\mathbf{elif}\;y \cdot x \leq 2 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999991e171 or 2e15 < (*.f64 x y) Initial program 88.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6455.1
Applied rewrites55.1%
if -1.99999999999999991e171 < (*.f64 x y) < -5e-53Initial program 97.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6413.5
Applied rewrites13.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6457.2
Applied rewrites57.2%
Taylor expanded in c around 0
Applied rewrites38.7%
if -5e-53 < (*.f64 x y) < 4.99999999999999967e-125Initial program 89.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f6444.3
Applied rewrites44.3%
if 4.99999999999999967e-125 < (*.f64 x y) < 2e15Initial program 83.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6444.4
Applied rewrites44.4%
Final simplification47.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* y x) 2.0)))
(if (<= (* y x) -2e+171)
t_1
(if (<= (* y x) -5e-53)
(* (* (* i a) c) -2.0)
(if (<= (* y x) 2e+36) (* (* 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) <= -2e+171) {
tmp = t_1;
} else if ((y * x) <= -5e-53) {
tmp = ((i * a) * c) * -2.0;
} else if ((y * x) <= 2e+36) {
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) <= (-2d+171)) then
tmp = t_1
else if ((y * x) <= (-5d-53)) then
tmp = ((i * a) * c) * (-2.0d0)
else if ((y * x) <= 2d+36) 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) <= -2e+171) {
tmp = t_1;
} else if ((y * x) <= -5e-53) {
tmp = ((i * a) * c) * -2.0;
} else if ((y * x) <= 2e+36) {
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) <= -2e+171: tmp = t_1 elif (y * x) <= -5e-53: tmp = ((i * a) * c) * -2.0 elif (y * x) <= 2e+36: 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) <= -2e+171) tmp = t_1; elseif (Float64(y * x) <= -5e-53) tmp = Float64(Float64(Float64(i * a) * c) * -2.0); elseif (Float64(y * x) <= 2e+36) 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) <= -2e+171) tmp = t_1; elseif ((y * x) <= -5e-53) tmp = ((i * a) * c) * -2.0; elseif ((y * x) <= 2e+36) 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], -2e+171], t$95$1, If[LessEqual[N[(y * x), $MachinePrecision], -5e-53], N[(N[(N[(i * a), $MachinePrecision] * c), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 2e+36], 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 -2 \cdot 10^{+171}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \cdot x \leq -5 \cdot 10^{-53}:\\
\;\;\;\;\left(\left(i \cdot a\right) \cdot c\right) \cdot -2\\
\mathbf{elif}\;y \cdot x \leq 2 \cdot 10^{+36}:\\
\;\;\;\;\left(t \cdot z\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999991e171 or 2.00000000000000008e36 < (*.f64 x y) Initial program 88.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6457.7
Applied rewrites57.7%
if -1.99999999999999991e171 < (*.f64 x y) < -5e-53Initial program 97.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6413.5
Applied rewrites13.5%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6457.2
Applied rewrites57.2%
Taylor expanded in c around 0
Applied rewrites38.7%
if -5e-53 < (*.f64 x y) < 2.00000000000000008e36Initial program 87.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f6439.6
Applied rewrites39.6%
Final simplification46.4%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (* (* y x) 2.0))) (if (<= (* y x) -2e+171) t_1 (if (<= (* y x) 2e+36) (* (* 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) <= -2e+171) {
tmp = t_1;
} else if ((y * x) <= 2e+36) {
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) <= (-2d+171)) then
tmp = t_1
else if ((y * x) <= 2d+36) 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) <= -2e+171) {
tmp = t_1;
} else if ((y * x) <= 2e+36) {
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) <= -2e+171: tmp = t_1 elif (y * x) <= 2e+36: 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) <= -2e+171) tmp = t_1; elseif (Float64(y * x) <= 2e+36) 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) <= -2e+171) tmp = t_1; elseif ((y * x) <= 2e+36) 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], -2e+171], t$95$1, If[LessEqual[N[(y * x), $MachinePrecision], 2e+36], 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 -2 \cdot 10^{+171}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \cdot x \leq 2 \cdot 10^{+36}:\\
\;\;\;\;\left(t \cdot z\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999991e171 or 2.00000000000000008e36 < (*.f64 x y) Initial program 88.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6457.7
Applied rewrites57.7%
if -1.99999999999999991e171 < (*.f64 x y) < 2.00000000000000008e36Initial program 89.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f6436.8
Applied rewrites36.8%
Final simplification44.8%
(FPCore (x y z t a b c i) :precision binary64 (* (* y x) 2.0))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * x) * 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 = (y * x) * 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 (y * x) * 2.0;
}
def code(x, y, z, t, a, b, c, i): return (y * x) * 2.0
function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * x) * 2.0) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (y * x) * 2.0; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * x), $MachinePrecision] * 2.0), $MachinePrecision]
\begin{array}{l}
\\
\left(y \cdot x\right) \cdot 2
\end{array}
Initial program 89.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6426.7
Applied rewrites26.7%
Final simplification26.7%
(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 2024276
(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))))