
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(*
(pow x1 4.0)
(+ 6.0 (/ (- (/ (fma 4.0 (fma x2 2.0 -3.0) 9.0) x1) 3.0) x1))))
(t_1 (fma 2.0 x2 (fma x1 (* x1 3.0) (- x1))))
(t_2 (/ t_1 (fma x1 x1 1.0)))
(t_3 (* x1 (* x1 3.0))))
(if (<= x1 -1.8e+44)
t_0
(if (<= x1 2.35e+54)
(+
x1
(fma
(fma
x1
(* x1 (fma t_2 4.0 -6.0))
(/ (* (+ -3.0 t_2) (* (* x1 2.0) t_1)) (fma x1 x1 1.0)))
(fma x1 x1 1.0)
(+
(fma x1 (* x1 x1) (* t_3 t_2))
(fma 3.0 (/ (- t_3 (fma 2.0 x2 x1)) (fma x1 x1 1.0)) x1))))
t_0))))
double code(double x1, double x2) {
double t_0 = pow(x1, 4.0) * (6.0 + (((fma(4.0, fma(x2, 2.0, -3.0), 9.0) / x1) - 3.0) / x1));
double t_1 = fma(2.0, x2, fma(x1, (x1 * 3.0), -x1));
double t_2 = t_1 / fma(x1, x1, 1.0);
double t_3 = x1 * (x1 * 3.0);
double tmp;
if (x1 <= -1.8e+44) {
tmp = t_0;
} else if (x1 <= 2.35e+54) {
tmp = x1 + fma(fma(x1, (x1 * fma(t_2, 4.0, -6.0)), (((-3.0 + t_2) * ((x1 * 2.0) * t_1)) / fma(x1, x1, 1.0))), fma(x1, x1, 1.0), (fma(x1, (x1 * x1), (t_3 * t_2)) + fma(3.0, ((t_3 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), x1)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = Float64((x1 ^ 4.0) * Float64(6.0 + Float64(Float64(Float64(fma(4.0, fma(x2, 2.0, -3.0), 9.0) / x1) - 3.0) / x1))) t_1 = fma(2.0, x2, fma(x1, Float64(x1 * 3.0), Float64(-x1))) t_2 = Float64(t_1 / fma(x1, x1, 1.0)) t_3 = Float64(x1 * Float64(x1 * 3.0)) tmp = 0.0 if (x1 <= -1.8e+44) tmp = t_0; elseif (x1 <= 2.35e+54) tmp = Float64(x1 + fma(fma(x1, Float64(x1 * fma(t_2, 4.0, -6.0)), Float64(Float64(Float64(-3.0 + t_2) * Float64(Float64(x1 * 2.0) * t_1)) / fma(x1, x1, 1.0))), fma(x1, x1, 1.0), Float64(fma(x1, Float64(x1 * x1), Float64(t_3 * t_2)) + fma(3.0, Float64(Float64(t_3 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), x1)))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(N[(N[(N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + 9.0), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * x2 + N[(x1 * N[(x1 * 3.0), $MachinePrecision] + (-x1)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.8e+44], t$95$0, If[LessEqual[x1, 2.35e+54], N[(x1 + N[(N[(x1 * N[(x1 * N[(t$95$2 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(-3.0 + t$95$2), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x1 * x1 + 1.0), $MachinePrecision] + N[(N[(x1 * N[(x1 * x1), $MachinePrecision] + N[(t$95$3 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(t$95$3 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x1}^{4} \cdot \left(6 + \frac{\frac{\mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)}{x1} - 3}{x1}\right)\\
t_1 := \mathsf{fma}\left(2, x2, \mathsf{fma}\left(x1, x1 \cdot 3, -x1\right)\right)\\
t_2 := \frac{t\_1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
\mathbf{if}\;x1 \leq -1.8 \cdot 10^{+44}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 2.35 \cdot 10^{+54}:\\
\;\;\;\;x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_2, 4, -6\right), \frac{\left(-3 + t\_2\right) \cdot \left(\left(x1 \cdot 2\right) \cdot t\_1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right), \mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot x1, t\_3 \cdot t\_2\right) + \mathsf{fma}\left(3, \frac{t\_3 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -1.8e44 or 2.34999999999999996e54 < x1 Initial program 31.4%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f643.0
Applied rewrites3.0%
Taylor expanded in x1 around -inf
lower-*.f64N/A
lower-pow.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites100.0%
if -1.8e44 < x1 < 2.34999999999999996e54Initial program 99.3%
Applied rewrites99.6%
Final simplification99.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (fma x2 -6.0 (* 8.0 (* x2 (* x1 x2)))))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_3))
(t_5
(+
x1
(+
(+
x1
(+
(+
(*
t_3
(+
(* (* (* x1 2.0) t_4) (- t_4 3.0))
(* (* x1 x1) (- (* t_4 4.0) 6.0))))
(* t_1 t_4))
t_0))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_3))))))
(if (<= t_5 -500.0)
t_2
(if (<= t_5 1e-8)
(fma x2 -6.0 (* x1 (fma 9.0 x1 -1.0)))
(if (<= t_5 5e+289) t_2 (+ x1 (* x1 (* 6.0 t_0))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = fma(x2, -6.0, (8.0 * (x2 * (x1 * x2))));
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_5 = x1 + ((x1 + (((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_1 * t_4)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)));
double tmp;
if (t_5 <= -500.0) {
tmp = t_2;
} else if (t_5 <= 1e-8) {
tmp = fma(x2, -6.0, (x1 * fma(9.0, x1, -1.0)));
} else if (t_5 <= 5e+289) {
tmp = t_2;
} else {
tmp = x1 + (x1 * (6.0 * t_0));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = fma(x2, -6.0, Float64(8.0 * Float64(x2 * Float64(x1 * x2)))) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_3) t_5 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_3 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)))) + Float64(t_1 * t_4)) + t_0)) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_3)))) tmp = 0.0 if (t_5 <= -500.0) tmp = t_2; elseif (t_5 <= 1e-8) tmp = fma(x2, -6.0, Float64(x1 * fma(9.0, x1, -1.0))); elseif (t_5 <= 5e+289) tmp = t_2; else tmp = Float64(x1 + Float64(x1 * Float64(6.0 * t_0))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x2 * -6.0 + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$3 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$4), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, -500.0], t$95$2, If[LessEqual[t$95$5, 1e-8], N[(x2 * -6.0 + N[(x1 * N[(9.0 * x1 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, 5e+289], t$95$2, N[(x1 + N[(x1 * N[(6.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \mathsf{fma}\left(x2, -6, 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_3}\\
t_5 := x1 + \left(\left(x1 + \left(\left(t\_3 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_4\right) \cdot \left(t\_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_4 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_4\right) + t\_0\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_3}\right)\\
\mathbf{if}\;t\_5 \leq -500:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_5 \leq 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(9, x1, -1\right)\right)\\
\mathbf{elif}\;t\_5 \leq 5 \cdot 10^{+289}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(6 \cdot t\_0\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < -500 or 1e-8 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 5.00000000000000031e289Initial program 99.5%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6441.6
Applied rewrites41.6%
Taylor expanded in x1 around 0
Applied rewrites59.2%
Taylor expanded in x2 around inf
Applied rewrites78.5%
if -500 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 1e-8Initial program 98.7%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6441.1
Applied rewrites41.1%
Taylor expanded in x1 around 0
Applied rewrites99.8%
Taylor expanded in x2 around 0
Applied rewrites99.8%
if 5.00000000000000031e289 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 32.1%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f6488.5
Applied rewrites88.5%
Applied rewrites88.5%
Final simplification87.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (fma x2 -6.0 (* 8.0 (* x2 (* x1 x2)))))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_0 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))))))
(if (<= t_4 -500.0)
t_1
(if (<= t_4 1e-8)
(fma x2 -6.0 (* x1 (fma 9.0 x1 -1.0)))
(if (<= t_4 INFINITY) t_1 (+ x1 (* (* x1 x1) 9.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = fma(x2, -6.0, (8.0 * (x2 * (x1 * x2))));
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_4 <= -500.0) {
tmp = t_1;
} else if (t_4 <= 1e-8) {
tmp = fma(x2, -6.0, (x1 * fma(9.0, x1, -1.0)));
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x1 + ((x1 * x1) * 9.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = fma(x2, -6.0, Float64(8.0 * Float64(x2 * Float64(x1 * x2)))) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)))) tmp = 0.0 if (t_4 <= -500.0) tmp = t_1; elseif (t_4 <= 1e-8) tmp = fma(x2, -6.0, Float64(x1 * fma(9.0, x1, -1.0))); elseif (t_4 <= Inf) tmp = t_1; else tmp = Float64(x1 + Float64(Float64(x1 * x1) * 9.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x2 * -6.0 + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -500.0], t$95$1, If[LessEqual[t$95$4, 1e-8], N[(x2 * -6.0 + N[(x1 * N[(9.0 * x1 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$1, N[(x1 + N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := \mathsf{fma}\left(x2, -6, 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_2}\right)\\
\mathbf{if}\;t\_4 \leq -500:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_4 \leq 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(9, x1, -1\right)\right)\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot x1\right) \cdot 9\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < -500 or 1e-8 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.6%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6431.3
Applied rewrites31.3%
Taylor expanded in x1 around 0
Applied rewrites57.3%
Taylor expanded in x2 around inf
Applied rewrites70.8%
if -500 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 1e-8Initial program 98.7%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6441.1
Applied rewrites41.1%
Taylor expanded in x1 around 0
Applied rewrites99.8%
Taylor expanded in x2 around 0
Applied rewrites99.8%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around 0
Applied rewrites72.3%
Taylor expanded in x2 around 0
Applied rewrites88.7%
Taylor expanded in x1 around inf
Applied rewrites88.7%
Final simplification81.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ x1 (* 8.0 (* x2 (* x1 x2)))))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_0 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))))))
(if (<= t_4 -2e+197)
t_1
(if (<= t_4 5e+143)
(fma x2 -6.0 (* x1 (fma 9.0 x1 -1.0)))
(if (<= t_4 INFINITY) t_1 (+ x1 (* (* x1 x1) 9.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 + (8.0 * (x2 * (x1 * x2)));
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_4 <= -2e+197) {
tmp = t_1;
} else if (t_4 <= 5e+143) {
tmp = fma(x2, -6.0, (x1 * fma(9.0, x1, -1.0)));
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x1 + ((x1 * x1) * 9.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 + Float64(8.0 * Float64(x2 * Float64(x1 * x2)))) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)))) tmp = 0.0 if (t_4 <= -2e+197) tmp = t_1; elseif (t_4 <= 5e+143) tmp = fma(x2, -6.0, Float64(x1 * fma(9.0, x1, -1.0))); elseif (t_4 <= Inf) tmp = t_1; else tmp = Float64(x1 + Float64(Float64(x1 * x1) * 9.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -2e+197], t$95$1, If[LessEqual[t$95$4, 5e+143], N[(x2 * -6.0 + N[(x1 * N[(9.0 * x1 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$1, N[(x1 + N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_2}\right)\\
\mathbf{if}\;t\_4 \leq -2 \cdot 10^{+197}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{+143}:\\
\;\;\;\;\mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(9, x1, -1\right)\right)\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot x1\right) \cdot 9\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < -1.9999999999999999e197 or 5.00000000000000012e143 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.7%
Taylor expanded in x1 around 0
Applied rewrites45.5%
Taylor expanded in x2 around 0
Applied rewrites65.6%
Taylor expanded in x2 around inf
Applied rewrites55.3%
if -1.9999999999999999e197 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 5.00000000000000012e143Initial program 99.1%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6457.8
Applied rewrites57.8%
Taylor expanded in x1 around 0
Applied rewrites91.8%
Taylor expanded in x2 around 0
Applied rewrites90.0%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around 0
Applied rewrites72.3%
Taylor expanded in x2 around 0
Applied rewrites88.7%
Taylor expanded in x1 around inf
Applied rewrites88.7%
Final simplification77.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ x1 (* 8.0 (* x1 (* x2 x2)))))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_0 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))))))
(if (<= t_4 -2e+307)
t_1
(if (<= t_4 5e+143)
(fma x2 -6.0 (* x1 (fma 9.0 x1 -1.0)))
(if (<= t_4 INFINITY) t_1 (+ x1 (* (* x1 x1) 9.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 + (8.0 * (x1 * (x2 * x2)));
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_4 <= -2e+307) {
tmp = t_1;
} else if (t_4 <= 5e+143) {
tmp = fma(x2, -6.0, (x1 * fma(9.0, x1, -1.0)));
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x1 + ((x1 * x1) * 9.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 + Float64(8.0 * Float64(x1 * Float64(x2 * x2)))) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)))) tmp = 0.0 if (t_4 <= -2e+307) tmp = t_1; elseif (t_4 <= 5e+143) tmp = fma(x2, -6.0, Float64(x1 * fma(9.0, x1, -1.0))); elseif (t_4 <= Inf) tmp = t_1; else tmp = Float64(x1 + Float64(Float64(x1 * x1) * 9.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(8.0 * N[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -2e+307], t$95$1, If[LessEqual[t$95$4, 5e+143], N[(x2 * -6.0 + N[(x1 * N[(9.0 * x1 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$1, N[(x1 + N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 + 8 \cdot \left(x1 \cdot \left(x2 \cdot x2\right)\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_2}\right)\\
\mathbf{if}\;t\_4 \leq -2 \cdot 10^{+307}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{+143}:\\
\;\;\;\;\mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(9, x1, -1\right)\right)\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot x1\right) \cdot 9\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < -1.99999999999999997e307 or 5.00000000000000012e143 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.7%
Taylor expanded in x1 around 0
Applied rewrites47.9%
Taylor expanded in x2 around inf
Applied rewrites46.9%
if -1.99999999999999997e307 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 5.00000000000000012e143Initial program 99.1%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6455.7
Applied rewrites55.7%
Taylor expanded in x1 around 0
Applied rewrites85.9%
Taylor expanded in x2 around 0
Applied rewrites85.1%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around 0
Applied rewrites72.3%
Taylor expanded in x2 around 0
Applied rewrites88.7%
Taylor expanded in x1 around inf
Applied rewrites88.7%
Final simplification74.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
(if (<= t_3 -500.0)
(* x2 -6.0)
(if (<= t_3 1e-66)
(+ x1 (* x1 -2.0))
(if (<= t_3 5e+248) (* x2 -6.0) (+ x1 (* (* x1 x1) 9.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= -500.0) {
tmp = x2 * -6.0;
} else if (t_3 <= 1e-66) {
tmp = x1 + (x1 * -2.0);
} else if (t_3 <= 5e+248) {
tmp = x2 * -6.0;
} else {
tmp = x1 + ((x1 * x1) * 9.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
if (t_3 <= (-500.0d0)) then
tmp = x2 * (-6.0d0)
else if (t_3 <= 1d-66) then
tmp = x1 + (x1 * (-2.0d0))
else if (t_3 <= 5d+248) then
tmp = x2 * (-6.0d0)
else
tmp = x1 + ((x1 * x1) * 9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= -500.0) {
tmp = x2 * -6.0;
} else if (t_3 <= 1e-66) {
tmp = x1 + (x1 * -2.0);
} else if (t_3 <= 5e+248) {
tmp = x2 * -6.0;
} else {
tmp = x1 + ((x1 * x1) * 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) tmp = 0 if t_3 <= -500.0: tmp = x2 * -6.0 elif t_3 <= 1e-66: tmp = x1 + (x1 * -2.0) elif t_3 <= 5e+248: tmp = x2 * -6.0 else: tmp = x1 + ((x1 * x1) * 9.0) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) tmp = 0.0 if (t_3 <= -500.0) tmp = Float64(x2 * -6.0); elseif (t_3 <= 1e-66) tmp = Float64(x1 + Float64(x1 * -2.0)); elseif (t_3 <= 5e+248) tmp = Float64(x2 * -6.0); else tmp = Float64(x1 + Float64(Float64(x1 * x1) * 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); tmp = 0.0; if (t_3 <= -500.0) tmp = x2 * -6.0; elseif (t_3 <= 1e-66) tmp = x1 + (x1 * -2.0); elseif (t_3 <= 5e+248) tmp = x2 * -6.0; else tmp = x1 + ((x1 * x1) * 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -500.0], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[t$95$3, 1e-66], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+248], N[(x2 * -6.0), $MachinePrecision], N[(x1 + N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)\\
\mathbf{if}\;t\_3 \leq -500:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;t\_3 \leq 10^{-66}:\\
\;\;\;\;x1 + x1 \cdot -2\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+248}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot x1\right) \cdot 9\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < -500 or 9.9999999999999998e-67 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 4.9999999999999996e248Initial program 99.4%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6449.5
Applied rewrites49.5%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6449.6
Applied rewrites49.6%
if -500 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 9.9999999999999998e-67Initial program 98.7%
Taylor expanded in x1 around 0
Applied rewrites99.5%
Taylor expanded in x2 around 0
Applied rewrites62.7%
Taylor expanded in x1 around 0
Applied rewrites61.6%
if 4.9999999999999996e248 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 38.8%
Taylor expanded in x1 around 0
Applied rewrites60.8%
Taylor expanded in x2 around 0
Applied rewrites56.0%
Taylor expanded in x1 around inf
Applied rewrites56.2%
Final simplification54.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
t_0))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))))
(if (<= t_4 INFINITY) t_4 (+ x1 (* x1 (* 6.0 t_0))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_4 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = x1 + (x1 * (6.0 * t_0));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = t_4;
} else {
tmp = x1 + (x1 * (6.0 * t_0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2 t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2))) tmp = 0 if t_4 <= math.inf: tmp = t_4 else: tmp = x1 + (x1 * (6.0 * t_0)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + t_0)) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) tmp = 0.0 if (t_4 <= Inf) tmp = t_4; else tmp = Float64(x1 + Float64(x1 * Float64(6.0 * t_0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2; t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2))); tmp = 0.0; if (t_4 <= Inf) tmp = t_4; else tmp = x1 + (x1 * (6.0 * t_0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, Infinity], t$95$4, N[(x1 + N[(x1 * N[(6.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_3\right) + t\_0\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right)\\
\mathbf{if}\;t\_4 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(6 \cdot t\_0\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64100.0
Applied rewrites100.0%
Applied rewrites100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1
(*
(pow x1 4.0)
(+ 6.0 (/ (- (/ (fma 4.0 (fma x2 2.0 -3.0) 9.0) x1) 3.0) x1))))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2)))
(if (<= x1 -3.6e+40)
t_1
(if (<= x1 0.000155)
(+
x1
(fma x2 (fma x1 (fma x2 8.0 -12.0) -6.0) (* x1 (fma 9.0 x1 -2.0))))
(if (<= x1 2.35e+54)
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_0 t_3))
(* x1 (* x1 x1))))
(* 3.0 3.0)))
t_1)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = pow(x1, 4.0) * (6.0 + (((fma(4.0, fma(x2, 2.0, -3.0), 9.0) / x1) - 3.0) / x1));
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double tmp;
if (x1 <= -3.6e+40) {
tmp = t_1;
} else if (x1 <= 0.000155) {
tmp = x1 + fma(x2, fma(x1, fma(x2, 8.0, -12.0), -6.0), (x1 * fma(9.0, x1, -2.0)));
} else if (x1 <= 2.35e+54) {
tmp = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * 3.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64((x1 ^ 4.0) * Float64(6.0 + Float64(Float64(Float64(fma(4.0, fma(x2, 2.0, -3.0), 9.0) / x1) - 3.0) / x1))) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) tmp = 0.0 if (x1 <= -3.6e+40) tmp = t_1; elseif (x1 <= 0.000155) tmp = Float64(x1 + fma(x2, fma(x1, fma(x2, 8.0, -12.0), -6.0), Float64(x1 * fma(9.0, x1, -2.0)))); elseif (x1 <= 2.35e+54) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * 3.0))); else tmp = t_1; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(N[(N[(N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + 9.0), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[x1, -3.6e+40], t$95$1, If[LessEqual[x1, 0.000155], N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0 + -12.0), $MachinePrecision] + -6.0), $MachinePrecision] + N[(x1 * N[(9.0 * x1 + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.35e+54], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := {x1}^{4} \cdot \left(6 + \frac{\frac{\mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)}{x1} - 3}{x1}\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_2}\\
\mathbf{if}\;x1 \leq -3.6 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq 0.000155:\\
\;\;\;\;x1 + \mathsf{fma}\left(x2, \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, 8, -12\right), -6\right), x1 \cdot \mathsf{fma}\left(9, x1, -2\right)\right)\\
\mathbf{elif}\;x1 \leq 2.35 \cdot 10^{+54}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot 3\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -3.59999999999999996e40 or 2.34999999999999996e54 < x1 Initial program 31.4%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f643.0
Applied rewrites3.0%
Taylor expanded in x1 around -inf
lower-*.f64N/A
lower-pow.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites100.0%
if -3.59999999999999996e40 < x1 < 1.55e-4Initial program 99.3%
Taylor expanded in x1 around 0
Applied rewrites84.2%
Taylor expanded in x2 around 0
Applied rewrites98.2%
Taylor expanded in x1 around 0
Applied rewrites98.2%
if 1.55e-4 < x1 < 2.34999999999999996e54Initial program 99.4%
Taylor expanded in x1 around inf
Applied rewrites99.4%
Final simplification99.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(*
(pow x1 4.0)
(+ 6.0 (/ (- (/ (fma 4.0 (fma x2 2.0 -3.0) 9.0) x1) 3.0) x1))))
(t_1 (fma 2.0 x2 (fma x1 (* x1 3.0) (- x1))))
(t_2 (/ t_1 (fma x1 x1 1.0))))
(if (<= x1 -1.8e+44)
t_0
(if (<= x1 2.35e+54)
(+
x1
(fma
(/ (- (* x1 (* x1 3.0)) (fma 2.0 x2 x1)) (fma x1 x1 1.0))
3.0
(fma
(fma x1 x1 1.0)
(fma
x1
(* x1 (fma t_2 4.0 -6.0))
(/ (* (+ -3.0 t_2) (* (* x1 2.0) t_1)) (fma x1 x1 1.0)))
(fma x1 (* (* x1 3.0) t_2) (fma x1 (* x1 x1) x1)))))
t_0))))
double code(double x1, double x2) {
double t_0 = pow(x1, 4.0) * (6.0 + (((fma(4.0, fma(x2, 2.0, -3.0), 9.0) / x1) - 3.0) / x1));
double t_1 = fma(2.0, x2, fma(x1, (x1 * 3.0), -x1));
double t_2 = t_1 / fma(x1, x1, 1.0);
double tmp;
if (x1 <= -1.8e+44) {
tmp = t_0;
} else if (x1 <= 2.35e+54) {
tmp = x1 + fma((((x1 * (x1 * 3.0)) - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), 3.0, fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_2, 4.0, -6.0)), (((-3.0 + t_2) * ((x1 * 2.0) * t_1)) / fma(x1, x1, 1.0))), fma(x1, ((x1 * 3.0) * t_2), fma(x1, (x1 * x1), x1))));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = Float64((x1 ^ 4.0) * Float64(6.0 + Float64(Float64(Float64(fma(4.0, fma(x2, 2.0, -3.0), 9.0) / x1) - 3.0) / x1))) t_1 = fma(2.0, x2, fma(x1, Float64(x1 * 3.0), Float64(-x1))) t_2 = Float64(t_1 / fma(x1, x1, 1.0)) tmp = 0.0 if (x1 <= -1.8e+44) tmp = t_0; elseif (x1 <= 2.35e+54) tmp = Float64(x1 + fma(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), 3.0, fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_2, 4.0, -6.0)), Float64(Float64(Float64(-3.0 + t_2) * Float64(Float64(x1 * 2.0) * t_1)) / fma(x1, x1, 1.0))), fma(x1, Float64(Float64(x1 * 3.0) * t_2), fma(x1, Float64(x1 * x1), x1))))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(N[(N[(N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + 9.0), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * x2 + N[(x1 * N[(x1 * 3.0), $MachinePrecision] + (-x1)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.8e+44], t$95$0, If[LessEqual[x1, 2.35e+54], N[(x1 + N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] * 3.0 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$2 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(-3.0 + t$95$2), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] * t$95$2), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x1}^{4} \cdot \left(6 + \frac{\frac{\mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)}{x1} - 3}{x1}\right)\\
t_1 := \mathsf{fma}\left(2, x2, \mathsf{fma}\left(x1, x1 \cdot 3, -x1\right)\right)\\
t_2 := \frac{t\_1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 \leq -1.8 \cdot 10^{+44}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 2.35 \cdot 10^{+54}:\\
\;\;\;\;x1 + \mathsf{fma}\left(\frac{x1 \cdot \left(x1 \cdot 3\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, 3, \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_2, 4, -6\right), \frac{\left(-3 + t\_2\right) \cdot \left(\left(x1 \cdot 2\right) \cdot t\_1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right), \mathsf{fma}\left(x1, \left(x1 \cdot 3\right) \cdot t\_2, \mathsf{fma}\left(x1, x1 \cdot x1, x1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -1.8e44 or 2.34999999999999996e54 < x1 Initial program 31.4%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f643.0
Applied rewrites3.0%
Taylor expanded in x1 around -inf
lower-*.f64N/A
lower-pow.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites100.0%
if -1.8e44 < x1 < 2.34999999999999996e54Initial program 99.3%
Applied rewrites99.6%
Final simplification99.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(*
(pow x1 4.0)
(+ 6.0 (/ (- (/ (fma 4.0 (fma x2 2.0 -3.0) 9.0) x1) 3.0) x1)))))
(if (<= x1 -3.6e+40)
t_0
(if (<= x1 2.9e+26)
(+
x1
(fma x2 (fma x1 (fma x2 8.0 -12.0) -6.0) (* x1 (fma 9.0 x1 -2.0))))
t_0))))
double code(double x1, double x2) {
double t_0 = pow(x1, 4.0) * (6.0 + (((fma(4.0, fma(x2, 2.0, -3.0), 9.0) / x1) - 3.0) / x1));
double tmp;
if (x1 <= -3.6e+40) {
tmp = t_0;
} else if (x1 <= 2.9e+26) {
tmp = x1 + fma(x2, fma(x1, fma(x2, 8.0, -12.0), -6.0), (x1 * fma(9.0, x1, -2.0)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = Float64((x1 ^ 4.0) * Float64(6.0 + Float64(Float64(Float64(fma(4.0, fma(x2, 2.0, -3.0), 9.0) / x1) - 3.0) / x1))) tmp = 0.0 if (x1 <= -3.6e+40) tmp = t_0; elseif (x1 <= 2.9e+26) tmp = Float64(x1 + fma(x2, fma(x1, fma(x2, 8.0, -12.0), -6.0), Float64(x1 * fma(9.0, x1, -2.0)))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(N[(N[(N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + 9.0), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.6e+40], t$95$0, If[LessEqual[x1, 2.9e+26], N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0 + -12.0), $MachinePrecision] + -6.0), $MachinePrecision] + N[(x1 * N[(9.0 * x1 + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x1}^{4} \cdot \left(6 + \frac{\frac{\mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)}{x1} - 3}{x1}\right)\\
\mathbf{if}\;x1 \leq -3.6 \cdot 10^{+40}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 2.9 \cdot 10^{+26}:\\
\;\;\;\;x1 + \mathsf{fma}\left(x2, \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, 8, -12\right), -6\right), x1 \cdot \mathsf{fma}\left(9, x1, -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -3.59999999999999996e40 or 2.9e26 < x1 Initial program 35.5%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f643.1
Applied rewrites3.1%
Taylor expanded in x1 around -inf
lower-*.f64N/A
lower-pow.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites98.3%
if -3.59999999999999996e40 < x1 < 2.9e26Initial program 99.3%
Taylor expanded in x1 around 0
Applied rewrites82.7%
Taylor expanded in x2 around 0
Applied rewrites96.0%
Taylor expanded in x1 around 0
Applied rewrites96.0%
Final simplification97.1%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -3.6e+40)
(+ x1 (* 6.0 (* x1 (* x1 (* x1 x1)))))
(if (<= x1 2.9e+26)
(+ x1 (fma x2 (fma x1 (fma x2 8.0 -12.0) -6.0) (* x1 (fma 9.0 x1 -2.0))))
(+ x1 (* 6.0 (pow x1 4.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.6e+40) {
tmp = x1 + (6.0 * (x1 * (x1 * (x1 * x1))));
} else if (x1 <= 2.9e+26) {
tmp = x1 + fma(x2, fma(x1, fma(x2, 8.0, -12.0), -6.0), (x1 * fma(9.0, x1, -2.0)));
} else {
tmp = x1 + (6.0 * pow(x1, 4.0));
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if (x1 <= -3.6e+40) tmp = Float64(x1 + Float64(6.0 * Float64(x1 * Float64(x1 * Float64(x1 * x1))))); elseif (x1 <= 2.9e+26) tmp = Float64(x1 + fma(x2, fma(x1, fma(x2, 8.0, -12.0), -6.0), Float64(x1 * fma(9.0, x1, -2.0)))); else tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.0))); end return tmp end
code[x1_, x2_] := If[LessEqual[x1, -3.6e+40], N[(x1 + N[(6.0 * N[(x1 * N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.9e+26], N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0 + -12.0), $MachinePrecision] + -6.0), $MachinePrecision] + N[(x1 * N[(9.0 * x1 + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.6 \cdot 10^{+40}:\\
\;\;\;\;x1 + 6 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 \cdot x1\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2.9 \cdot 10^{+26}:\\
\;\;\;\;x1 + \mathsf{fma}\left(x2, \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, 8, -12\right), -6\right), x1 \cdot \mathsf{fma}\left(9, x1, -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if x1 < -3.59999999999999996e40Initial program 16.0%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f6498.0
Applied rewrites98.0%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites98.0%
if -3.59999999999999996e40 < x1 < 2.9e26Initial program 99.3%
Taylor expanded in x1 around 0
Applied rewrites82.7%
Taylor expanded in x2 around 0
Applied rewrites96.0%
Taylor expanded in x1 around 0
Applied rewrites96.0%
if 2.9e26 < x1 Initial program 50.6%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f6488.2
Applied rewrites88.2%
Final simplification94.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1))))
(if (<= x1 -3.6e+40)
(+ x1 (* 6.0 (* x1 t_0)))
(if (<= x1 2.9e+26)
(+
x1
(fma x2 (fma x1 (fma x2 8.0 -12.0) -6.0) (* x1 (fma 9.0 x1 -2.0))))
(+ x1 (* x1 (* 6.0 t_0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double tmp;
if (x1 <= -3.6e+40) {
tmp = x1 + (6.0 * (x1 * t_0));
} else if (x1 <= 2.9e+26) {
tmp = x1 + fma(x2, fma(x1, fma(x2, 8.0, -12.0), -6.0), (x1 * fma(9.0, x1, -2.0)));
} else {
tmp = x1 + (x1 * (6.0 * t_0));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -3.6e+40) tmp = Float64(x1 + Float64(6.0 * Float64(x1 * t_0))); elseif (x1 <= 2.9e+26) tmp = Float64(x1 + fma(x2, fma(x1, fma(x2, 8.0, -12.0), -6.0), Float64(x1 * fma(9.0, x1, -2.0)))); else tmp = Float64(x1 + Float64(x1 * Float64(6.0 * t_0))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.6e+40], N[(x1 + N[(6.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.9e+26], N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0 + -12.0), $MachinePrecision] + -6.0), $MachinePrecision] + N[(x1 * N[(9.0 * x1 + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(6.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -3.6 \cdot 10^{+40}:\\
\;\;\;\;x1 + 6 \cdot \left(x1 \cdot t\_0\right)\\
\mathbf{elif}\;x1 \leq 2.9 \cdot 10^{+26}:\\
\;\;\;\;x1 + \mathsf{fma}\left(x2, \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, 8, -12\right), -6\right), x1 \cdot \mathsf{fma}\left(9, x1, -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(6 \cdot t\_0\right)\\
\end{array}
\end{array}
if x1 < -3.59999999999999996e40Initial program 16.0%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f6498.0
Applied rewrites98.0%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites98.0%
if -3.59999999999999996e40 < x1 < 2.9e26Initial program 99.3%
Taylor expanded in x1 around 0
Applied rewrites82.7%
Taylor expanded in x2 around 0
Applied rewrites96.0%
Taylor expanded in x1 around 0
Applied rewrites96.0%
if 2.9e26 < x1 Initial program 50.6%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f6488.2
Applied rewrites88.2%
Applied rewrites88.2%
Final simplification94.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1))))
(if (<= x1 -3.6e+40)
(+ x1 (* 6.0 (* x1 t_0)))
(if (<= x1 2.9e+26)
(+ x1 (fma x2 (fma x1 (fma x2 8.0 -12.0) -6.0) (* x1 -2.0)))
(+ x1 (* x1 (* 6.0 t_0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double tmp;
if (x1 <= -3.6e+40) {
tmp = x1 + (6.0 * (x1 * t_0));
} else if (x1 <= 2.9e+26) {
tmp = x1 + fma(x2, fma(x1, fma(x2, 8.0, -12.0), -6.0), (x1 * -2.0));
} else {
tmp = x1 + (x1 * (6.0 * t_0));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -3.6e+40) tmp = Float64(x1 + Float64(6.0 * Float64(x1 * t_0))); elseif (x1 <= 2.9e+26) tmp = Float64(x1 + fma(x2, fma(x1, fma(x2, 8.0, -12.0), -6.0), Float64(x1 * -2.0))); else tmp = Float64(x1 + Float64(x1 * Float64(6.0 * t_0))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.6e+40], N[(x1 + N[(6.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.9e+26], N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0 + -12.0), $MachinePrecision] + -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(6.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -3.6 \cdot 10^{+40}:\\
\;\;\;\;x1 + 6 \cdot \left(x1 \cdot t\_0\right)\\
\mathbf{elif}\;x1 \leq 2.9 \cdot 10^{+26}:\\
\;\;\;\;x1 + \mathsf{fma}\left(x2, \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, 8, -12\right), -6\right), x1 \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(6 \cdot t\_0\right)\\
\end{array}
\end{array}
if x1 < -3.59999999999999996e40Initial program 16.0%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f6498.0
Applied rewrites98.0%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites98.0%
if -3.59999999999999996e40 < x1 < 2.9e26Initial program 99.3%
Taylor expanded in x1 around 0
Applied rewrites82.7%
Taylor expanded in x2 around 0
Applied rewrites96.0%
Taylor expanded in x1 around 0
Applied rewrites96.0%
Taylor expanded in x1 around 0
Applied rewrites95.4%
if 2.9e26 < x1 Initial program 50.6%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f6488.2
Applied rewrites88.2%
Applied rewrites88.2%
Final simplification94.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* x2 -6.0))))
(if (<= (* 2.0 x2) -1e-85)
t_0
(if (<= (* 2.0 x2) 5e-110) (+ x1 (* x1 -2.0)) t_0))))
double code(double x1, double x2) {
double t_0 = x1 + (x2 * -6.0);
double tmp;
if ((2.0 * x2) <= -1e-85) {
tmp = t_0;
} else if ((2.0 * x2) <= 5e-110) {
tmp = x1 + (x1 * -2.0);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + (x2 * (-6.0d0))
if ((2.0d0 * x2) <= (-1d-85)) then
tmp = t_0
else if ((2.0d0 * x2) <= 5d-110) then
tmp = x1 + (x1 * (-2.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x2 * -6.0);
double tmp;
if ((2.0 * x2) <= -1e-85) {
tmp = t_0;
} else if ((2.0 * x2) <= 5e-110) {
tmp = x1 + (x1 * -2.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x2 * -6.0) tmp = 0 if (2.0 * x2) <= -1e-85: tmp = t_0 elif (2.0 * x2) <= 5e-110: tmp = x1 + (x1 * -2.0) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x2 * -6.0)) tmp = 0.0 if (Float64(2.0 * x2) <= -1e-85) tmp = t_0; elseif (Float64(2.0 * x2) <= 5e-110) tmp = Float64(x1 + Float64(x1 * -2.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x2 * -6.0); tmp = 0.0; if ((2.0 * x2) <= -1e-85) tmp = t_0; elseif ((2.0 * x2) <= 5e-110) tmp = x1 + (x1 * -2.0); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(2.0 * x2), $MachinePrecision], -1e-85], t$95$0, If[LessEqual[N[(2.0 * x2), $MachinePrecision], 5e-110], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x2 \cdot -6\\
\mathbf{if}\;2 \cdot x2 \leq -1 \cdot 10^{-85}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;2 \cdot x2 \leq 5 \cdot 10^{-110}:\\
\;\;\;\;x1 + x1 \cdot -2\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) x2) < -9.9999999999999998e-86 or 5e-110 < (*.f64 #s(literal 2 binary64) x2) Initial program 73.3%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6430.8
Applied rewrites30.8%
if -9.9999999999999998e-86 < (*.f64 #s(literal 2 binary64) x2) < 5e-110Initial program 64.6%
Taylor expanded in x1 around 0
Applied rewrites75.9%
Taylor expanded in x2 around 0
Applied rewrites65.4%
Taylor expanded in x1 around 0
Applied rewrites33.1%
(FPCore (x1 x2) :precision binary64 (if (<= (* 2.0 x2) -1e-85) (* x2 -6.0) (if (<= (* 2.0 x2) 5e-110) (+ x1 (* x1 -2.0)) (* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if ((2.0 * x2) <= -1e-85) {
tmp = x2 * -6.0;
} else if ((2.0 * x2) <= 5e-110) {
tmp = x1 + (x1 * -2.0);
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((2.0d0 * x2) <= (-1d-85)) then
tmp = x2 * (-6.0d0)
else if ((2.0d0 * x2) <= 5d-110) then
tmp = x1 + (x1 * (-2.0d0))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((2.0 * x2) <= -1e-85) {
tmp = x2 * -6.0;
} else if ((2.0 * x2) <= 5e-110) {
tmp = x1 + (x1 * -2.0);
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (2.0 * x2) <= -1e-85: tmp = x2 * -6.0 elif (2.0 * x2) <= 5e-110: tmp = x1 + (x1 * -2.0) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if (Float64(2.0 * x2) <= -1e-85) tmp = Float64(x2 * -6.0); elseif (Float64(2.0 * x2) <= 5e-110) tmp = Float64(x1 + Float64(x1 * -2.0)); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((2.0 * x2) <= -1e-85) tmp = x2 * -6.0; elseif ((2.0 * x2) <= 5e-110) tmp = x1 + (x1 * -2.0); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[N[(2.0 * x2), $MachinePrecision], -1e-85], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[N[(2.0 * x2), $MachinePrecision], 5e-110], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot x2 \leq -1 \cdot 10^{-85}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;2 \cdot x2 \leq 5 \cdot 10^{-110}:\\
\;\;\;\;x1 + x1 \cdot -2\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) x2) < -9.9999999999999998e-86 or 5e-110 < (*.f64 #s(literal 2 binary64) x2) Initial program 73.3%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6430.8
Applied rewrites30.8%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6430.6
Applied rewrites30.6%
if -9.9999999999999998e-86 < (*.f64 #s(literal 2 binary64) x2) < 5e-110Initial program 64.6%
Taylor expanded in x1 around 0
Applied rewrites75.9%
Taylor expanded in x2 around 0
Applied rewrites65.4%
Taylor expanded in x1 around 0
Applied rewrites33.1%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -7.2e-135) (* x1 (fma x1 (fma x1 -19.0 9.0) -1.0)) (if (<= x1 1.52e-111) (* x2 -6.0) (+ x1 (* x1 (fma 9.0 x1 -2.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -7.2e-135) {
tmp = x1 * fma(x1, fma(x1, -19.0, 9.0), -1.0);
} else if (x1 <= 1.52e-111) {
tmp = x2 * -6.0;
} else {
tmp = x1 + (x1 * fma(9.0, x1, -2.0));
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if (x1 <= -7.2e-135) tmp = Float64(x1 * fma(x1, fma(x1, -19.0, 9.0), -1.0)); elseif (x1 <= 1.52e-111) tmp = Float64(x2 * -6.0); else tmp = Float64(x1 + Float64(x1 * fma(9.0, x1, -2.0))); end return tmp end
code[x1_, x2_] := If[LessEqual[x1, -7.2e-135], N[(x1 * N[(x1 * N[(x1 * -19.0 + 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.52e-111], N[(x2 * -6.0), $MachinePrecision], N[(x1 + N[(x1 * N[(9.0 * x1 + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -7.2 \cdot 10^{-135}:\\
\;\;\;\;x1 \cdot \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, -19, 9\right), -1\right)\\
\mathbf{elif}\;x1 \leq 1.52 \cdot 10^{-111}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \mathsf{fma}\left(9, x1, -2\right)\\
\end{array}
\end{array}
if x1 < -7.19999999999999955e-135Initial program 48.3%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f648.2
Applied rewrites8.2%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f649.3
Applied rewrites9.3%
Taylor expanded in x1 around 0
Applied rewrites66.6%
Taylor expanded in x2 around 0
Applied rewrites67.5%
if -7.19999999999999955e-135 < x1 < 1.51999999999999998e-111Initial program 99.6%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6467.7
Applied rewrites67.7%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6468.0
Applied rewrites68.0%
if 1.51999999999999998e-111 < x1 Initial program 67.2%
Taylor expanded in x1 around 0
Applied rewrites68.1%
Taylor expanded in x2 around 0
Applied rewrites42.7%
(FPCore (x1 x2) :precision binary64 (let* ((t_0 (+ x1 (* x1 (fma 9.0 x1 -2.0))))) (if (<= x1 -7.2e-135) t_0 (if (<= x1 1.52e-111) (* x2 -6.0) t_0))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 * fma(9.0, x1, -2.0));
double tmp;
if (x1 <= -7.2e-135) {
tmp = t_0;
} else if (x1 <= 1.52e-111) {
tmp = x2 * -6.0;
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 * fma(9.0, x1, -2.0))) tmp = 0.0 if (x1 <= -7.2e-135) tmp = t_0; elseif (x1 <= 1.52e-111) tmp = Float64(x2 * -6.0); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 * N[(9.0 * x1 + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -7.2e-135], t$95$0, If[LessEqual[x1, 1.52e-111], N[(x2 * -6.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x1 \cdot \mathsf{fma}\left(9, x1, -2\right)\\
\mathbf{if}\;x1 \leq -7.2 \cdot 10^{-135}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 1.52 \cdot 10^{-111}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -7.19999999999999955e-135 or 1.51999999999999998e-111 < x1 Initial program 58.7%
Taylor expanded in x1 around 0
Applied rewrites67.0%
Taylor expanded in x2 around 0
Applied rewrites49.2%
if -7.19999999999999955e-135 < x1 < 1.51999999999999998e-111Initial program 99.6%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6467.7
Applied rewrites67.7%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6468.0
Applied rewrites68.0%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -3.8e+40) (* x1 (fma x1 (fma x1 -19.0 9.0) -1.0)) (fma x2 -6.0 (* x1 (fma 9.0 x1 -1.0)))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.8e+40) {
tmp = x1 * fma(x1, fma(x1, -19.0, 9.0), -1.0);
} else {
tmp = fma(x2, -6.0, (x1 * fma(9.0, x1, -1.0)));
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if (x1 <= -3.8e+40) tmp = Float64(x1 * fma(x1, fma(x1, -19.0, 9.0), -1.0)); else tmp = fma(x2, -6.0, Float64(x1 * fma(9.0, x1, -1.0))); end return tmp end
code[x1_, x2_] := If[LessEqual[x1, -3.8e+40], N[(x1 * N[(x1 * N[(x1 * -19.0 + 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0 + N[(x1 * N[(9.0 * x1 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.8 \cdot 10^{+40}:\\
\;\;\;\;x1 \cdot \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, -19, 9\right), -1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(9, x1, -1\right)\right)\\
\end{array}
\end{array}
if x1 < -3.80000000000000004e40Initial program 16.0%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f640.8
Applied rewrites0.8%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f641.9
Applied rewrites1.9%
Taylor expanded in x1 around 0
Applied rewrites65.2%
Taylor expanded in x2 around 0
Applied rewrites85.2%
if -3.80000000000000004e40 < x1 Initial program 83.9%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6431.0
Applied rewrites31.0%
Taylor expanded in x1 around 0
Applied rewrites72.6%
Taylor expanded in x2 around 0
Applied rewrites60.4%
(FPCore (x1 x2) :precision binary64 (* x2 -6.0))
double code(double x1, double x2) {
return x2 * -6.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * (-6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * -6.0;
}
def code(x1, x2): return x2 * -6.0
function code(x1, x2) return Float64(x2 * -6.0) end
function tmp = code(x1, x2) tmp = x2 * -6.0; end
code[x1_, x2_] := N[(x2 * -6.0), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6
\end{array}
Initial program 70.7%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6425.1
Applied rewrites25.1%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6425.1
Applied rewrites25.1%
herbie shell --seed 2024232
(FPCore (x1 x2)
:name "Rosa's FloatVsDoubleBenchmark"
:precision binary64
(+ x1 (+ (+ (+ (+ (* (+ (* (* (* 2.0 x1) (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))) (- (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)) 3.0)) (* (* x1 x1) (- (* 4.0 (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))) 6.0))) (+ (* x1 x1) 1.0)) (* (* (* 3.0 x1) x1) (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))) (* (* x1 x1) x1)) x1) (* 3.0 (/ (- (- (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))))))