
(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 21 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 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3 (fma x1 (* x1 3.0) (fma 2.0 x2 (- x1)))))
(if (<=
(+
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))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_0 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(fma
x1
(* x1 (* 3.0 (/ (- t_0 x1) (fma x1 x1 1.0))))
(*
(fma x1 x1 1.0)
(+
x1
(+
(* x1 (* x1 -6.0))
(*
(/ t_3 (fma x1 x1 1.0))
(+
(* x1 (+ -6.0 (/ t_3 (/ (fma x1 x1 1.0) 2.0))))
(* (* x1 x1) 4.0)))))))))
(+ x1 (* 6.0 (pow x1 4.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 = fma(x1, (x1 * 3.0), fma(2.0, x2, -x1));
double tmp;
if ((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) INFINITY)) {
tmp = x1 + fma(3.0, ((t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), fma(x1, (x1 * (3.0 * ((t_0 - x1) / fma(x1, x1, 1.0)))), (fma(x1, x1, 1.0) * (x1 + ((x1 * (x1 * -6.0)) + ((t_3 / fma(x1, x1, 1.0)) * ((x1 * (-6.0 + (t_3 / (fma(x1, x1, 1.0) / 2.0)))) + ((x1 * x1) * 4.0))))))));
} else {
tmp = x1 + (6.0 * pow(x1, 4.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 = fma(x1, Float64(x1 * 3.0), fma(2.0, x2, Float64(-x1))) tmp = 0.0 if (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)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), fma(x1, Float64(x1 * Float64(3.0 * Float64(Float64(t_0 - x1) / fma(x1, x1, 1.0)))), Float64(fma(x1, x1, 1.0) * Float64(x1 + Float64(Float64(x1 * Float64(x1 * -6.0)) + Float64(Float64(t_3 / fma(x1, x1, 1.0)) * Float64(Float64(x1 * Float64(-6.0 + Float64(t_3 / Float64(fma(x1, x1, 1.0) / 2.0)))) + Float64(Float64(x1 * x1) * 4.0))))))))); else tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.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[(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[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2 + (-x1)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[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], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$0 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * N[(3.0 * N[(N[(t$95$0 - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(N[(x1 * N[(x1 * -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(x1 * N[(-6.0 + N[(t$95$3 / N[(N[(x1 * x1 + 1.0), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $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 := \mathsf{fma}\left(x1, x1 \cdot 3, \mathsf{fma}\left(2, x2, -x1\right)\right)\\
\mathbf{if}\;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) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_0 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, \mathsf{fma}\left(x1, x1 \cdot \left(3 \cdot \frac{t_0 - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right), \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \left(x1 \cdot \left(x1 \cdot -6\right) + \frac{t_3}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(x1 \cdot \left(-6 + \frac{t_3}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{2}}\right) + \left(x1 \cdot x1\right) \cdot 4\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.2%
Simplified99.6%
Taylor expanded in x2 around 0 99.6%
*-commutative99.6%
unpow299.6%
associate-*r*99.6%
+-commutative99.6%
unpow299.6%
fma-udef99.6%
Simplified99.6%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 13.3%
Taylor expanded in x1 around inf 98.9%
Final simplification99.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (cbrt (/ (- (fma (* x1 3.0) x1 (* 2.0 x2)) x1) (fma x1 x1 1.0))))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_3))
(t_5 (* t_1 t_4))
(t_6 (* (* x1 x1) (- (* t_4 4.0) 6.0)))
(t_7 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_3))))
(if (<=
(+
x1
(+
(+
x1
(+ (+ (* t_3 (+ (* (* (* x1 2.0) t_4) (- t_4 3.0)) t_6)) t_5) t_0))
t_7))
INFINITY)
(+
x1
(+
t_7
(+
x1
(+
t_0
(+
t_5
(*
t_3
(+
t_6
(*
(*
(* x1 2.0)
(/ (- (+ (* 2.0 x2) (+ (exp (log1p t_1)) -1.0)) x1) t_3))
(- (* t_2 (* t_2 t_2)) 3.0)))))))))
(+ x1 (* 6.0 (pow x1 4.0))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = cbrt(((fma((x1 * 3.0), x1, (2.0 * x2)) - x1) / fma(x1, x1, 1.0)));
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_5 = t_1 * t_4;
double t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_7 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3);
double tmp;
if ((x1 + ((x1 + (((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + t_6)) + t_5) + t_0)) + t_7)) <= ((double) INFINITY)) {
tmp = x1 + (t_7 + (x1 + (t_0 + (t_5 + (t_3 * (t_6 + (((x1 * 2.0) * ((((2.0 * x2) + (exp(log1p(t_1)) + -1.0)) - x1) / t_3)) * ((t_2 * (t_2 * t_2)) - 3.0))))))));
} else {
tmp = x1 + (6.0 * pow(x1, 4.0));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = cbrt(Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0))) 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(t_1 * t_4) t_6 = Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) t_7 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_3)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_3 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + t_6)) + t_5) + t_0)) + t_7)) <= Inf) tmp = Float64(x1 + Float64(t_7 + Float64(x1 + Float64(t_0 + Float64(t_5 + Float64(t_3 * Float64(t_6 + Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(Float64(Float64(2.0 * x2) + Float64(exp(log1p(t_1)) + -1.0)) - x1) / t_3)) * Float64(Float64(t_2 * Float64(t_2 * t_2)) - 3.0))))))))); else tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.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[Power[N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision], 1/3], $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[(t$95$1 * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[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] + t$95$6), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + t$95$7), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$7 + N[(x1 + N[(t$95$0 + N[(t$95$5 + N[(t$95$3 * N[(t$95$6 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(N[(N[(2.0 * x2), $MachinePrecision] + N[(N[Exp[N[Log[1 + t$95$1], $MachinePrecision]], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$2 * N[(t$95$2 * t$95$2), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(6.0 * N[Power[x1, 4.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 := \sqrt[3]{\frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}}\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_3}\\
t_5 := t_1 \cdot t_4\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\\
t_7 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_3}\\
\mathbf{if}\;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) + t_6\right) + t_5\right) + t_0\right)\right) + t_7\right) \leq \infty:\\
\;\;\;\;x1 + \left(t_7 + \left(x1 + \left(t_0 + \left(t_5 + t_3 \cdot \left(t_6 + \left(\left(x1 \cdot 2\right) \cdot \frac{\left(2 \cdot x2 + \left(e^{\mathsf{log1p}\left(t_1\right)} + -1\right)\right) - x1}{t_3}\right) \cdot \left(t_2 \cdot \left(t_2 \cdot t_2\right) - 3\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.2%
fma-def99.2%
*-commutative99.2%
fma-def99.2%
add-cube-cbrt99.2%
Applied egg-rr99.2%
expm1-log1p-u99.2%
expm1-udef99.2%
*-commutative99.2%
*-commutative99.2%
Applied egg-rr99.2%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 13.3%
Taylor expanded in x1 around inf 98.9%
Final simplification99.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x1 (* x1 x1)))
(t_3 (cbrt (/ (- (fma (* x1 3.0) x1 (* 2.0 x2)) x1) (fma x1 x1 1.0))))
(t_4 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_5 (* (* x1 2.0) t_4))
(t_6 (* (* x1 x1) (- (* t_4 4.0) 6.0)))
(t_7 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))
(if (<=
(+
x1
(+
(+ x1 (+ (+ (* t_1 (+ (* t_5 (- t_4 3.0)) t_6)) (* t_0 t_4)) t_2))
t_7))
INFINITY)
(+
x1
(+
t_7
(+
x1
(+
t_2
(+
(* t_1 (+ t_6 (* t_5 (- (* t_3 (* t_3 t_3)) 3.0))))
(* t_0 (/ (- (+ (* 2.0 x2) (* 3.0 (pow x1 2.0))) x1) t_1)))))))
(+ x1 (* 6.0 (pow x1 4.0))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * x1);
double t_3 = cbrt(((fma((x1 * 3.0), x1, (2.0 * x2)) - x1) / fma(x1, x1, 1.0)));
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_5 = (x1 * 2.0) * t_4;
double t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_7 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double tmp;
if ((x1 + ((x1 + (((t_1 * ((t_5 * (t_4 - 3.0)) + t_6)) + (t_0 * t_4)) + t_2)) + t_7)) <= ((double) INFINITY)) {
tmp = x1 + (t_7 + (x1 + (t_2 + ((t_1 * (t_6 + (t_5 * ((t_3 * (t_3 * t_3)) - 3.0)))) + (t_0 * ((((2.0 * x2) + (3.0 * pow(x1, 2.0))) - x1) / t_1))))));
} else {
tmp = x1 + (6.0 * pow(x1, 4.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(x1 * Float64(x1 * x1)) t_3 = cbrt(Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0))) t_4 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_5 = Float64(Float64(x1 * 2.0) * t_4) t_6 = Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) t_7 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(t_5 * Float64(t_4 - 3.0)) + t_6)) + Float64(t_0 * t_4)) + t_2)) + t_7)) <= Inf) tmp = Float64(x1 + Float64(t_7 + Float64(x1 + Float64(t_2 + Float64(Float64(t_1 * Float64(t_6 + Float64(t_5 * Float64(Float64(t_3 * Float64(t_3 * t_3)) - 3.0)))) + Float64(t_0 * Float64(Float64(Float64(Float64(2.0 * x2) + Float64(3.0 * (x1 ^ 2.0))) - x1) / t_1))))))); else tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.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[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(t$95$5 * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$4), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + t$95$7), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$7 + N[(x1 + N[(t$95$2 + N[(N[(t$95$1 * N[(t$95$6 + N[(t$95$5 * N[(N[(t$95$3 * N[(t$95$3 * t$95$3), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(N[(2.0 * x2), $MachinePrecision] + N[(3.0 * N[Power[x1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $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 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := \sqrt[3]{\frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}}\\
t_4 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_5 := \left(x1 \cdot 2\right) \cdot t_4\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\\
t_7 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(t_5 \cdot \left(t_4 - 3\right) + t_6\right) + t_0 \cdot t_4\right) + t_2\right)\right) + t_7\right) \leq \infty:\\
\;\;\;\;x1 + \left(t_7 + \left(x1 + \left(t_2 + \left(t_1 \cdot \left(t_6 + t_5 \cdot \left(t_3 \cdot \left(t_3 \cdot t_3\right) - 3\right)\right) + t_0 \cdot \frac{\left(2 \cdot x2 + 3 \cdot {x1}^{2}\right) - x1}{t_1}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.2%
fma-def99.2%
*-commutative99.2%
fma-def99.2%
add-cube-cbrt99.2%
Applied egg-rr99.2%
Taylor expanded in x1 around 0 99.2%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 13.3%
Taylor expanded in x1 around inf 98.9%
Final simplification99.1%
(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 INFINITY) t_3 (+ x1 (* 6.0 (pow x1 4.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 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + (6.0 * pow(x1, 4.0));
}
return tmp;
}
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 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + (6.0 * Math.pow(x1, 4.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 <= math.inf: tmp = t_3 else: tmp = x1 + (6.0 * math.pow(x1, 4.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 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.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 <= Inf) tmp = t_3; else tmp = x1 + (6.0 * (x1 ^ 4.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, Infinity], t$95$3, N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $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 \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.2%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 13.3%
Taylor expanded in x1 around inf 98.9%
Final simplification99.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ x1 (* 6.0 (pow x1 4.0))))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2)))
(t_4 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_5 (* t_0 t_4))
(t_6 (* (* x1 x1) (- (* t_4 4.0) 6.0)))
(t_7 (* (* x1 2.0) t_4))
(t_8 (* x1 (* x1 x1))))
(if (<= x1 -4.4e+102)
t_1
(if (<= x1 1.1)
(+
x1
(+
t_3
(+ x1 (+ t_8 (+ t_5 (* t_2 (+ t_6 (* t_7 (- (* 2.0 x2) 3.0)))))))))
(if (<= x1 4e+100)
(+
x1
(+
t_3
(+
x1
(+
t_8
(+
t_5
(*
t_2
(+
t_6
(*
t_7
(+
(* 2.0 (/ x2 (* x1 x1)))
(- (/ -1.0 x1) (/ 3.0 (* x1 x1))))))))))))
t_1)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 + (6.0 * pow(x1, 4.0));
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_5 = t_0 * t_4;
double t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_7 = (x1 * 2.0) * t_4;
double t_8 = x1 * (x1 * x1);
double tmp;
if (x1 <= -4.4e+102) {
tmp = t_1;
} else if (x1 <= 1.1) {
tmp = x1 + (t_3 + (x1 + (t_8 + (t_5 + (t_2 * (t_6 + (t_7 * ((2.0 * x2) - 3.0))))))));
} else if (x1 <= 4e+100) {
tmp = x1 + (t_3 + (x1 + (t_8 + (t_5 + (t_2 * (t_6 + (t_7 * ((2.0 * (x2 / (x1 * x1))) + ((-1.0 / x1) - (3.0 / (x1 * x1)))))))))));
} else {
tmp = t_1;
}
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) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = x1 + (6.0d0 * (x1 ** 4.0d0))
t_2 = (x1 * x1) + 1.0d0
t_3 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_2)
t_4 = ((t_0 + (2.0d0 * x2)) - x1) / t_2
t_5 = t_0 * t_4
t_6 = (x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)
t_7 = (x1 * 2.0d0) * t_4
t_8 = x1 * (x1 * x1)
if (x1 <= (-4.4d+102)) then
tmp = t_1
else if (x1 <= 1.1d0) then
tmp = x1 + (t_3 + (x1 + (t_8 + (t_5 + (t_2 * (t_6 + (t_7 * ((2.0d0 * x2) - 3.0d0))))))))
else if (x1 <= 4d+100) then
tmp = x1 + (t_3 + (x1 + (t_8 + (t_5 + (t_2 * (t_6 + (t_7 * ((2.0d0 * (x2 / (x1 * x1))) + (((-1.0d0) / x1) - (3.0d0 / (x1 * x1)))))))))))
else
tmp = t_1
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 + (6.0 * Math.pow(x1, 4.0));
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_5 = t_0 * t_4;
double t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_7 = (x1 * 2.0) * t_4;
double t_8 = x1 * (x1 * x1);
double tmp;
if (x1 <= -4.4e+102) {
tmp = t_1;
} else if (x1 <= 1.1) {
tmp = x1 + (t_3 + (x1 + (t_8 + (t_5 + (t_2 * (t_6 + (t_7 * ((2.0 * x2) - 3.0))))))));
} else if (x1 <= 4e+100) {
tmp = x1 + (t_3 + (x1 + (t_8 + (t_5 + (t_2 * (t_6 + (t_7 * ((2.0 * (x2 / (x1 * x1))) + ((-1.0 / x1) - (3.0 / (x1 * x1)))))))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = x1 + (6.0 * math.pow(x1, 4.0)) t_2 = (x1 * x1) + 1.0 t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2) t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2 t_5 = t_0 * t_4 t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0) t_7 = (x1 * 2.0) * t_4 t_8 = x1 * (x1 * x1) tmp = 0 if x1 <= -4.4e+102: tmp = t_1 elif x1 <= 1.1: tmp = x1 + (t_3 + (x1 + (t_8 + (t_5 + (t_2 * (t_6 + (t_7 * ((2.0 * x2) - 3.0)))))))) elif x1 <= 4e+100: tmp = x1 + (t_3 + (x1 + (t_8 + (t_5 + (t_2 * (t_6 + (t_7 * ((2.0 * (x2 / (x1 * x1))) + ((-1.0 / x1) - (3.0 / (x1 * x1))))))))))) else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)) t_4 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_5 = Float64(t_0 * t_4) t_6 = Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) t_7 = Float64(Float64(x1 * 2.0) * t_4) t_8 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -4.4e+102) tmp = t_1; elseif (x1 <= 1.1) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_8 + Float64(t_5 + Float64(t_2 * Float64(t_6 + Float64(t_7 * Float64(Float64(2.0 * x2) - 3.0))))))))); elseif (x1 <= 4e+100) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_8 + Float64(t_5 + Float64(t_2 * Float64(t_6 + Float64(t_7 * Float64(Float64(2.0 * Float64(x2 / Float64(x1 * x1))) + Float64(Float64(-1.0 / x1) - Float64(3.0 / Float64(x1 * x1)))))))))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = x1 + (6.0 * (x1 ^ 4.0)); t_2 = (x1 * x1) + 1.0; t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2); t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2; t_5 = t_0 * t_4; t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0); t_7 = (x1 * 2.0) * t_4; t_8 = x1 * (x1 * x1); tmp = 0.0; if (x1 <= -4.4e+102) tmp = t_1; elseif (x1 <= 1.1) tmp = x1 + (t_3 + (x1 + (t_8 + (t_5 + (t_2 * (t_6 + (t_7 * ((2.0 * x2) - 3.0)))))))); elseif (x1 <= 4e+100) tmp = x1 + (t_3 + (x1 + (t_8 + (t_5 + (t_2 * (t_6 + (t_7 * ((2.0 * (x2 / (x1 * x1))) + ((-1.0 / x1) - (3.0 / (x1 * x1))))))))))); else tmp = t_1; 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[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$0 * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision]}, Block[{t$95$8 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.4e+102], t$95$1, If[LessEqual[x1, 1.1], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$8 + N[(t$95$5 + N[(t$95$2 * N[(t$95$6 + N[(t$95$7 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4e+100], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$8 + N[(t$95$5 + N[(t$95$2 * N[(t$95$6 + N[(t$95$7 * N[(N[(2.0 * N[(x2 / N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / x1), $MachinePrecision] - N[(3.0 / N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 + 6 \cdot {x1}^{4}\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_2}\\
t_4 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_2}\\
t_5 := t_0 \cdot t_4\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\\
t_7 := \left(x1 \cdot 2\right) \cdot t_4\\
t_8 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -4.4 \cdot 10^{+102}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 1.1:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_8 + \left(t_5 + t_2 \cdot \left(t_6 + t_7 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{+100}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_8 + \left(t_5 + t_2 \cdot \left(t_6 + t_7 \cdot \left(2 \cdot \frac{x2}{x1 \cdot x1} + \left(\frac{-1}{x1} - \frac{3}{x1 \cdot x1}\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x1 < -4.40000000000000015e102 or 4.00000000000000006e100 < x1 Initial program 9.1%
Taylor expanded in x1 around inf 20.2%
Taylor expanded in x1 around inf 98.0%
if -4.40000000000000015e102 < x1 < 1.1000000000000001Initial program 99.2%
Taylor expanded in x1 around 0 95.7%
if 1.1000000000000001 < x1 < 4.00000000000000006e100Initial program 98.8%
Taylor expanded in x1 around inf 95.4%
unpow295.4%
associate-*r/95.4%
metadata-eval95.4%
unpow295.4%
Simplified95.4%
Final simplification96.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ x1 (* 6.0 (pow x1 4.0))))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2)))
(t_4 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2)))
(if (<= x1 -8.8e+51)
t_1
(if (<= x1 1300.0)
(+ x1 (+ t_3 (+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
(if (<= x1 1.9e+101)
(+
x1
(+
t_3
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_4)
(*
t_2
(+
(* (* x1 x1) (- (* t_4 4.0) 6.0))
(* (- t_4 3.0) (* (* x1 2.0) 3.0)))))))))
t_1)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 + (6.0 * pow(x1, 4.0));
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double tmp;
if (x1 <= -8.8e+51) {
tmp = t_1;
} else if (x1 <= 1300.0) {
tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 1.9e+101) {
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_4) + (t_2 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + ((t_4 - 3.0) * ((x1 * 2.0) * 3.0))))))));
} else {
tmp = t_1;
}
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) :: t_4
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = x1 + (6.0d0 * (x1 ** 4.0d0))
t_2 = (x1 * x1) + 1.0d0
t_3 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_2)
t_4 = ((t_0 + (2.0d0 * x2)) - x1) / t_2
if (x1 <= (-8.8d+51)) then
tmp = t_1
else if (x1 <= 1300.0d0) then
tmp = x1 + (t_3 + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
else if (x1 <= 1.9d+101) then
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_4) + (t_2 * (((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)) + ((t_4 - 3.0d0) * ((x1 * 2.0d0) * 3.0d0))))))))
else
tmp = t_1
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 + (6.0 * Math.pow(x1, 4.0));
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double tmp;
if (x1 <= -8.8e+51) {
tmp = t_1;
} else if (x1 <= 1300.0) {
tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 1.9e+101) {
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_4) + (t_2 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + ((t_4 - 3.0) * ((x1 * 2.0) * 3.0))))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = x1 + (6.0 * math.pow(x1, 4.0)) t_2 = (x1 * x1) + 1.0 t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2) t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2 tmp = 0 if x1 <= -8.8e+51: tmp = t_1 elif x1 <= 1300.0: tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) elif x1 <= 1.9e+101: tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_4) + (t_2 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + ((t_4 - 3.0) * ((x1 * 2.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 + Float64(6.0 * (x1 ^ 4.0))) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)) t_4 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) tmp = 0.0 if (x1 <= -8.8e+51) tmp = t_1; elseif (x1 <= 1300.0) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); elseif (x1 <= 1.9e+101) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_4) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) + Float64(Float64(t_4 - 3.0) * Float64(Float64(x1 * 2.0) * 3.0))))))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = x1 + (6.0 * (x1 ^ 4.0)); t_2 = (x1 * x1) + 1.0; t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2); t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2; tmp = 0.0; if (x1 <= -8.8e+51) tmp = t_1; elseif (x1 <= 1300.0) tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); elseif (x1 <= 1.9e+101) tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_4) + (t_2 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + ((t_4 - 3.0) * ((x1 * 2.0) * 3.0)))))))); else tmp = t_1; 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[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[x1, -8.8e+51], t$95$1, If[LessEqual[x1, 1300.0], N[(x1 + N[(t$95$3 + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.9e+101], N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$4), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$4 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 + 6 \cdot {x1}^{4}\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_2}\\
t_4 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 \leq -8.8 \cdot 10^{+51}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 1300:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.9 \cdot 10^{+101}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot t_4 + t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right) + \left(t_4 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot 3\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x1 < -8.79999999999999967e51 or 1.8999999999999999e101 < x1 Initial program 15.0%
Taylor expanded in x1 around inf 23.6%
Taylor expanded in x1 around inf 96.2%
if -8.79999999999999967e51 < x1 < 1300Initial program 99.2%
Taylor expanded in x1 around 0 93.7%
if 1300 < x1 < 1.8999999999999999e101Initial program 99.0%
fma-def99.0%
*-commutative99.0%
fma-def99.0%
add-log-exp87.1%
Applied egg-rr87.1%
Taylor expanded in x2 around 0 82.7%
unpow282.7%
+-commutative82.7%
unpow282.7%
fma-udef82.7%
Simplified82.7%
Taylor expanded in x1 around inf 81.2%
Final simplification93.6%
(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)))
(if (or (<= x1 -7.4e+101) (not (<= x1 4.7e+52)))
(+ x1 (* 6.0 (pow x1 4.0)))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_2)
(*
t_1
(+
(* (* x1 x1) (- (* t_2 4.0) 6.0))
(* (* (* x1 2.0) t_2) (- (* 2.0 x2) 3.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 tmp;
if ((x1 <= -7.4e+101) || !(x1 <= 4.7e+52)) {
tmp = x1 + (6.0 * pow(x1, 4.0));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * ((2.0 * x2) - 3.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) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 <= (-7.4d+101)) .or. (.not. (x1 <= 4.7d+52))) then
tmp = x1 + (6.0d0 * (x1 ** 4.0d0))
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * t_2) * ((2.0d0 * x2) - 3.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 tmp;
if ((x1 <= -7.4e+101) || !(x1 <= 4.7e+52)) {
tmp = x1 + (6.0 * Math.pow(x1, 4.0));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * ((2.0 * x2) - 3.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 tmp = 0 if (x1 <= -7.4e+101) or not (x1 <= 4.7e+52): tmp = x1 + (6.0 * math.pow(x1, 4.0)) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * ((2.0 * x2) - 3.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) tmp = 0.0 if ((x1 <= -7.4e+101) || !(x1 <= 4.7e+52)) tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.0))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(Float64(2.0 * x2) - 3.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; tmp = 0.0; if ((x1 <= -7.4e+101) || ~((x1 <= 4.7e+52))) tmp = x1 + (6.0 * (x1 ^ 4.0)); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * ((2.0 * x2) - 3.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]}, If[Or[LessEqual[x1, -7.4e+101], N[Not[LessEqual[x1, 4.7e+52]], $MachinePrecision]], N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}\\
\mathbf{if}\;x1 \leq -7.4 \cdot 10^{+101} \lor \neg \left(x1 \leq 4.7 \cdot 10^{+52}\right):\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot t_2 + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -7.3999999999999995e101 or 4.7e52 < x1 Initial program 18.9%
Taylor expanded in x1 around inf 25.4%
Taylor expanded in x1 around inf 94.8%
if -7.3999999999999995e101 < x1 < 4.7e52Initial program 99.1%
Taylor expanded in x1 around 0 93.9%
Final simplification94.3%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x1 -8.8e+51) (not (<= x1 1500.0)))
(+ x1 (* 6.0 (pow x1 4.0)))
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -8.8e+51) || !(x1 <= 1500.0)) {
tmp = x1 + (6.0 * pow(x1, 4.0));
} else {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-8.8d+51)) .or. (.not. (x1 <= 1500.0d0))) then
tmp = x1 + (6.0d0 * (x1 ** 4.0d0))
else
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -8.8e+51) || !(x1 <= 1500.0)) {
tmp = x1 + (6.0 * Math.pow(x1, 4.0));
} else {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -8.8e+51) or not (x1 <= 1500.0): tmp = x1 + (6.0 * math.pow(x1, 4.0)) else: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -8.8e+51) || !(x1 <= 1500.0)) tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.0))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -8.8e+51) || ~((x1 <= 1500.0))) tmp = x1 + (6.0 * (x1 ^ 4.0)); else tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -8.8e+51], N[Not[LessEqual[x1, 1500.0]], $MachinePrecision]], N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -8.8 \cdot 10^{+51} \lor \neg \left(x1 \leq 1500\right):\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -8.79999999999999967e51 or 1500 < x1 Initial program 30.5%
Taylor expanded in x1 around inf 30.9%
Taylor expanded in x1 around inf 90.1%
if -8.79999999999999967e51 < x1 < 1500Initial program 99.2%
Taylor expanded in x1 around 0 93.7%
Final simplification91.9%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x1 -6.5e+127) (not (<= x1 4.5e+153)))
(+ x1 (* x1 (+ -2.0 (* x1 9.0))))
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -6.5e+127) || !(x1 <= 4.5e+153)) {
tmp = x1 + (x1 * (-2.0 + (x1 * 9.0)));
} else {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-6.5d+127)) .or. (.not. (x1 <= 4.5d+153))) then
tmp = x1 + (x1 * ((-2.0d0) + (x1 * 9.0d0)))
else
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -6.5e+127) || !(x1 <= 4.5e+153)) {
tmp = x1 + (x1 * (-2.0 + (x1 * 9.0)));
} else {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -6.5e+127) or not (x1 <= 4.5e+153): tmp = x1 + (x1 * (-2.0 + (x1 * 9.0))) else: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -6.5e+127) || !(x1 <= 4.5e+153)) tmp = Float64(x1 + Float64(x1 * Float64(-2.0 + Float64(x1 * 9.0)))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -6.5e+127) || ~((x1 <= 4.5e+153))) tmp = x1 + (x1 * (-2.0 + (x1 * 9.0))); else tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -6.5e+127], N[Not[LessEqual[x1, 4.5e+153]], $MachinePrecision]], N[(x1 + N[(x1 * N[(-2.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -6.5 \cdot 10^{+127} \lor \neg \left(x1 \leq 4.5 \cdot 10^{+153}\right):\\
\;\;\;\;x1 + x1 \cdot \left(-2 + x1 \cdot 9\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -6.5e127 or 4.5000000000000001e153 < x1 Initial program 0.0%
Taylor expanded in x1 around inf 10.5%
Taylor expanded in x1 around 0 60.8%
Taylor expanded in x2 around 0 90.6%
+-commutative90.6%
*-commutative90.6%
*-commutative90.6%
unpow290.6%
associate-*l*90.6%
distribute-lft-out90.6%
Simplified90.6%
if -6.5e127 < x1 < 4.5000000000000001e153Initial program 96.9%
Taylor expanded in x1 around 0 77.9%
Final simplification82.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* x1 (+ -2.0 (* x1 9.0)))))
(t_1
(+
x1
(+ (+ (* x1 -3.0) (* x2 -6.0)) (+ x1 (* 8.0 (* x1 (* x2 x2))))))))
(if (<= x1 -6.2e+130)
t_0
(if (<= x1 -5.5e-138)
t_1
(if (<= x1 1.75e-287)
(+ x1 (+ (+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0))))) (* x2 -6.0)))
(if (<= x1 4.5e+153) t_1 t_0))))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 * (-2.0 + (x1 * 9.0)));
double t_1 = x1 + (((x1 * -3.0) + (x2 * -6.0)) + (x1 + (8.0 * (x1 * (x2 * x2)))));
double tmp;
if (x1 <= -6.2e+130) {
tmp = t_0;
} else if (x1 <= -5.5e-138) {
tmp = t_1;
} else if (x1 <= 1.75e-287) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (x2 * -6.0));
} else if (x1 <= 4.5e+153) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = x1 + (x1 * ((-2.0d0) + (x1 * 9.0d0)))
t_1 = x1 + (((x1 * (-3.0d0)) + (x2 * (-6.0d0))) + (x1 + (8.0d0 * (x1 * (x2 * x2)))))
if (x1 <= (-6.2d+130)) then
tmp = t_0
else if (x1 <= (-5.5d-138)) then
tmp = t_1
else if (x1 <= 1.75d-287) then
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))) + (x2 * (-6.0d0)))
else if (x1 <= 4.5d+153) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 * (-2.0 + (x1 * 9.0)));
double t_1 = x1 + (((x1 * -3.0) + (x2 * -6.0)) + (x1 + (8.0 * (x1 * (x2 * x2)))));
double tmp;
if (x1 <= -6.2e+130) {
tmp = t_0;
} else if (x1 <= -5.5e-138) {
tmp = t_1;
} else if (x1 <= 1.75e-287) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (x2 * -6.0));
} else if (x1 <= 4.5e+153) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 * (-2.0 + (x1 * 9.0))) t_1 = x1 + (((x1 * -3.0) + (x2 * -6.0)) + (x1 + (8.0 * (x1 * (x2 * x2))))) tmp = 0 if x1 <= -6.2e+130: tmp = t_0 elif x1 <= -5.5e-138: tmp = t_1 elif x1 <= 1.75e-287: tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (x2 * -6.0)) elif x1 <= 4.5e+153: tmp = t_1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 * Float64(-2.0 + Float64(x1 * 9.0)))) t_1 = Float64(x1 + Float64(Float64(Float64(x1 * -3.0) + Float64(x2 * -6.0)) + Float64(x1 + Float64(8.0 * Float64(x1 * Float64(x2 * x2)))))) tmp = 0.0 if (x1 <= -6.2e+130) tmp = t_0; elseif (x1 <= -5.5e-138) tmp = t_1; elseif (x1 <= 1.75e-287) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(x2 * -6.0))); elseif (x1 <= 4.5e+153) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 * (-2.0 + (x1 * 9.0))); t_1 = x1 + (((x1 * -3.0) + (x2 * -6.0)) + (x1 + (8.0 * (x1 * (x2 * x2))))); tmp = 0.0; if (x1 <= -6.2e+130) tmp = t_0; elseif (x1 <= -5.5e-138) tmp = t_1; elseif (x1 <= 1.75e-287) tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (x2 * -6.0)); elseif (x1 <= 4.5e+153) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 * N[(-2.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(8.0 * N[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -6.2e+130], t$95$0, If[LessEqual[x1, -5.5e-138], t$95$1, If[LessEqual[x1, 1.75e-287], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x1 \cdot \left(-2 + x1 \cdot 9\right)\\
t_1 := x1 + \left(\left(x1 \cdot -3 + x2 \cdot -6\right) + \left(x1 + 8 \cdot \left(x1 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -6.2 \cdot 10^{+130}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -5.5 \cdot 10^{-138}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 1.75 \cdot 10^{-287}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -6.1999999999999999e130 or 4.5000000000000001e153 < x1 Initial program 0.0%
Taylor expanded in x1 around inf 10.5%
Taylor expanded in x1 around 0 60.8%
Taylor expanded in x2 around 0 90.6%
+-commutative90.6%
*-commutative90.6%
*-commutative90.6%
unpow290.6%
associate-*l*90.6%
distribute-lft-out90.6%
Simplified90.6%
if -6.1999999999999999e130 < x1 < -5.5000000000000003e-138 or 1.75e-287 < x1 < 4.5000000000000001e153Initial program 95.8%
Taylor expanded in x2 around inf 69.0%
associate-/l*66.8%
unpow266.8%
+-commutative66.8%
unpow266.8%
fma-udef66.8%
Simplified66.8%
Taylor expanded in x1 around 0 67.6%
unpow267.6%
*-commutative67.6%
Simplified67.6%
Taylor expanded in x1 around 0 66.9%
if -5.5000000000000003e-138 < x1 < 1.75e-287Initial program 99.4%
Taylor expanded in x1 around 0 99.4%
Taylor expanded in x1 around 0 91.8%
*-commutative74.7%
Simplified91.8%
Final simplification79.6%
(FPCore (x1 x2) :precision binary64 (if (or (<= (* 2.0 x2) -1e+86) (not (<= (* 2.0 x2) 5e+94))) (+ x1 (+ (+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0))))) (* x2 -6.0))) (+ x1 (+ (* x1 -2.0) (+ (* x2 -6.0) (* 3.0 (* x1 (* x1 3.0))))))))
double code(double x1, double x2) {
double tmp;
if (((2.0 * x2) <= -1e+86) || !((2.0 * x2) <= 5e+94)) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (x2 * -6.0));
} else {
tmp = x1 + ((x1 * -2.0) + ((x2 * -6.0) + (3.0 * (x1 * (x1 * 3.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+86)) .or. (.not. ((2.0d0 * x2) <= 5d+94))) then
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))) + (x2 * (-6.0d0)))
else
tmp = x1 + ((x1 * (-2.0d0)) + ((x2 * (-6.0d0)) + (3.0d0 * (x1 * (x1 * 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (((2.0 * x2) <= -1e+86) || !((2.0 * x2) <= 5e+94)) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (x2 * -6.0));
} else {
tmp = x1 + ((x1 * -2.0) + ((x2 * -6.0) + (3.0 * (x1 * (x1 * 3.0)))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if ((2.0 * x2) <= -1e+86) or not ((2.0 * x2) <= 5e+94): tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (x2 * -6.0)) else: tmp = x1 + ((x1 * -2.0) + ((x2 * -6.0) + (3.0 * (x1 * (x1 * 3.0))))) return tmp
function code(x1, x2) tmp = 0.0 if ((Float64(2.0 * x2) <= -1e+86) || !(Float64(2.0 * x2) <= 5e+94)) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(x2 * -6.0))); else tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(Float64(x2 * -6.0) + Float64(3.0 * Float64(x1 * Float64(x1 * 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (((2.0 * x2) <= -1e+86) || ~(((2.0 * x2) <= 5e+94))) tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (x2 * -6.0)); else tmp = x1 + ((x1 * -2.0) + ((x2 * -6.0) + (3.0 * (x1 * (x1 * 3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[N[(2.0 * x2), $MachinePrecision], -1e+86], N[Not[LessEqual[N[(2.0 * x2), $MachinePrecision], 5e+94]], $MachinePrecision]], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(N[(x2 * -6.0), $MachinePrecision] + N[(3.0 * N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot x2 \leq -1 \cdot 10^{+86} \lor \neg \left(2 \cdot x2 \leq 5 \cdot 10^{+94}\right):\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + x2 \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + \left(x2 \cdot -6 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 2 x2) < -1e86 or 5.0000000000000001e94 < (*.f64 2 x2) Initial program 64.5%
Taylor expanded in x1 around 0 58.9%
Taylor expanded in x1 around 0 80.1%
*-commutative69.8%
Simplified80.1%
if -1e86 < (*.f64 2 x2) < 5.0000000000000001e94Initial program 64.2%
Taylor expanded in x1 around inf 64.8%
Taylor expanded in x1 around 0 72.8%
Taylor expanded in x2 around 0 77.5%
*-commutative77.5%
unpow277.5%
associate-*r*77.5%
Simplified77.5%
Final simplification78.5%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x1 -2.6e+130) (not (<= x1 4.5e+153)))
(+ x1 (* x1 (+ -2.0 (* x1 9.0))))
(+
x1
(+
(+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))
(+ (* x1 -3.0) (* x2 -6.0))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.6e+130) || !(x1 <= 4.5e+153)) {
tmp = x1 + (x1 * (-2.0 + (x1 * 9.0)));
} else {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + ((x1 * -3.0) + (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 ((x1 <= (-2.6d+130)) .or. (.not. (x1 <= 4.5d+153))) then
tmp = x1 + (x1 * ((-2.0d0) + (x1 * 9.0d0)))
else
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))) + ((x1 * (-3.0d0)) + (x2 * (-6.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.6e+130) || !(x1 <= 4.5e+153)) {
tmp = x1 + (x1 * (-2.0 + (x1 * 9.0)));
} else {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + ((x1 * -3.0) + (x2 * -6.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -2.6e+130) or not (x1 <= 4.5e+153): tmp = x1 + (x1 * (-2.0 + (x1 * 9.0))) else: tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + ((x1 * -3.0) + (x2 * -6.0))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -2.6e+130) || !(x1 <= 4.5e+153)) tmp = Float64(x1 + Float64(x1 * Float64(-2.0 + Float64(x1 * 9.0)))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(Float64(x1 * -3.0) + Float64(x2 * -6.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -2.6e+130) || ~((x1 <= 4.5e+153))) tmp = x1 + (x1 * (-2.0 + (x1 * 9.0))); else tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + ((x1 * -3.0) + (x2 * -6.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -2.6e+130], N[Not[LessEqual[x1, 4.5e+153]], $MachinePrecision]], N[(x1 + N[(x1 * N[(-2.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.6 \cdot 10^{+130} \lor \neg \left(x1 \leq 4.5 \cdot 10^{+153}\right):\\
\;\;\;\;x1 + x1 \cdot \left(-2 + x1 \cdot 9\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + \left(x1 \cdot -3 + x2 \cdot -6\right)\right)\\
\end{array}
\end{array}
if x1 < -2.5999999999999998e130 or 4.5000000000000001e153 < x1 Initial program 0.0%
Taylor expanded in x1 around inf 10.5%
Taylor expanded in x1 around 0 60.8%
Taylor expanded in x2 around 0 90.6%
+-commutative90.6%
*-commutative90.6%
*-commutative90.6%
unpow290.6%
associate-*l*90.6%
distribute-lft-out90.6%
Simplified90.6%
if -2.5999999999999998e130 < x1 < 4.5000000000000001e153Initial program 96.9%
Taylor expanded in x1 around 0 77.9%
Taylor expanded in x1 around 0 77.3%
Final simplification81.8%
(FPCore (x1 x2) :precision binary64 (if (or (<= (* 2.0 x2) -1e+86) (not (<= (* 2.0 x2) 5e+94))) (+ x1 (+ (+ x1 (* 8.0 (* x1 (* x2 x2)))) (* x2 -6.0))) (+ x1 (+ (* x1 -2.0) (+ (* x2 -6.0) (* 3.0 (* x1 (* x1 3.0))))))))
double code(double x1, double x2) {
double tmp;
if (((2.0 * x2) <= -1e+86) || !((2.0 * x2) <= 5e+94)) {
tmp = x1 + ((x1 + (8.0 * (x1 * (x2 * x2)))) + (x2 * -6.0));
} else {
tmp = x1 + ((x1 * -2.0) + ((x2 * -6.0) + (3.0 * (x1 * (x1 * 3.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+86)) .or. (.not. ((2.0d0 * x2) <= 5d+94))) then
tmp = x1 + ((x1 + (8.0d0 * (x1 * (x2 * x2)))) + (x2 * (-6.0d0)))
else
tmp = x1 + ((x1 * (-2.0d0)) + ((x2 * (-6.0d0)) + (3.0d0 * (x1 * (x1 * 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (((2.0 * x2) <= -1e+86) || !((2.0 * x2) <= 5e+94)) {
tmp = x1 + ((x1 + (8.0 * (x1 * (x2 * x2)))) + (x2 * -6.0));
} else {
tmp = x1 + ((x1 * -2.0) + ((x2 * -6.0) + (3.0 * (x1 * (x1 * 3.0)))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if ((2.0 * x2) <= -1e+86) or not ((2.0 * x2) <= 5e+94): tmp = x1 + ((x1 + (8.0 * (x1 * (x2 * x2)))) + (x2 * -6.0)) else: tmp = x1 + ((x1 * -2.0) + ((x2 * -6.0) + (3.0 * (x1 * (x1 * 3.0))))) return tmp
function code(x1, x2) tmp = 0.0 if ((Float64(2.0 * x2) <= -1e+86) || !(Float64(2.0 * x2) <= 5e+94)) tmp = Float64(x1 + Float64(Float64(x1 + Float64(8.0 * Float64(x1 * Float64(x2 * x2)))) + Float64(x2 * -6.0))); else tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(Float64(x2 * -6.0) + Float64(3.0 * Float64(x1 * Float64(x1 * 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (((2.0 * x2) <= -1e+86) || ~(((2.0 * x2) <= 5e+94))) tmp = x1 + ((x1 + (8.0 * (x1 * (x2 * x2)))) + (x2 * -6.0)); else tmp = x1 + ((x1 * -2.0) + ((x2 * -6.0) + (3.0 * (x1 * (x1 * 3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[N[(2.0 * x2), $MachinePrecision], -1e+86], N[Not[LessEqual[N[(2.0 * x2), $MachinePrecision], 5e+94]], $MachinePrecision]], N[(x1 + N[(N[(x1 + N[(8.0 * N[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(N[(x2 * -6.0), $MachinePrecision] + N[(3.0 * N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot x2 \leq -1 \cdot 10^{+86} \lor \neg \left(2 \cdot x2 \leq 5 \cdot 10^{+94}\right):\\
\;\;\;\;x1 + \left(\left(x1 + 8 \cdot \left(x1 \cdot \left(x2 \cdot x2\right)\right)\right) + x2 \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + \left(x2 \cdot -6 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 2 x2) < -1e86 or 5.0000000000000001e94 < (*.f64 2 x2) Initial program 64.5%
Taylor expanded in x2 around inf 50.4%
associate-/l*47.6%
unpow247.6%
+-commutative47.6%
unpow247.6%
fma-udef47.6%
Simplified47.6%
Taylor expanded in x1 around 0 48.6%
unpow248.6%
*-commutative48.6%
Simplified48.6%
Taylor expanded in x1 around 0 69.8%
*-commutative69.8%
Simplified69.8%
if -1e86 < (*.f64 2 x2) < 5.0000000000000001e94Initial program 64.2%
Taylor expanded in x1 around inf 64.8%
Taylor expanded in x1 around 0 72.8%
Taylor expanded in x2 around 0 77.5%
*-commutative77.5%
unpow277.5%
associate-*r*77.5%
Simplified77.5%
Final simplification74.5%
(FPCore (x1 x2) :precision binary64 (if (or (<= (* 2.0 x2) -5e+180) (not (<= (* 2.0 x2) 1e+133))) (+ x1 (+ (+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0))))) 9.0)) (+ x1 (+ (* x1 -2.0) (+ (* x2 -6.0) (* 3.0 (* x1 (* x1 3.0))))))))
double code(double x1, double x2) {
double tmp;
if (((2.0 * x2) <= -5e+180) || !((2.0 * x2) <= 1e+133)) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + 9.0);
} else {
tmp = x1 + ((x1 * -2.0) + ((x2 * -6.0) + (3.0 * (x1 * (x1 * 3.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) <= (-5d+180)) .or. (.not. ((2.0d0 * x2) <= 1d+133))) then
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))) + 9.0d0)
else
tmp = x1 + ((x1 * (-2.0d0)) + ((x2 * (-6.0d0)) + (3.0d0 * (x1 * (x1 * 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (((2.0 * x2) <= -5e+180) || !((2.0 * x2) <= 1e+133)) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + 9.0);
} else {
tmp = x1 + ((x1 * -2.0) + ((x2 * -6.0) + (3.0 * (x1 * (x1 * 3.0)))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if ((2.0 * x2) <= -5e+180) or not ((2.0 * x2) <= 1e+133): tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + 9.0) else: tmp = x1 + ((x1 * -2.0) + ((x2 * -6.0) + (3.0 * (x1 * (x1 * 3.0))))) return tmp
function code(x1, x2) tmp = 0.0 if ((Float64(2.0 * x2) <= -5e+180) || !(Float64(2.0 * x2) <= 1e+133)) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))) + 9.0)); else tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(Float64(x2 * -6.0) + Float64(3.0 * Float64(x1 * Float64(x1 * 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (((2.0 * x2) <= -5e+180) || ~(((2.0 * x2) <= 1e+133))) tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + 9.0); else tmp = x1 + ((x1 * -2.0) + ((x2 * -6.0) + (3.0 * (x1 * (x1 * 3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[N[(2.0 * x2), $MachinePrecision], -5e+180], N[Not[LessEqual[N[(2.0 * x2), $MachinePrecision], 1e+133]], $MachinePrecision]], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(N[(x2 * -6.0), $MachinePrecision] + N[(3.0 * N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot x2 \leq -5 \cdot 10^{+180} \lor \neg \left(2 \cdot x2 \leq 10^{+133}\right):\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + 9\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + \left(x2 \cdot -6 + 3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 2 x2) < -4.9999999999999996e180 or 1e133 < (*.f64 2 x2) Initial program 63.6%
Taylor expanded in x1 around 0 62.2%
Taylor expanded in x1 around inf 78.3%
if -4.9999999999999996e180 < (*.f64 2 x2) < 1e133Initial program 64.6%
Taylor expanded in x1 around inf 61.3%
Taylor expanded in x1 around 0 66.6%
Taylor expanded in x2 around 0 74.7%
*-commutative74.7%
unpow274.7%
associate-*r*74.7%
Simplified74.7%
Final simplification75.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* 8.0 (* x1 (* x2 x2)))))
(t_1 (+ x1 (* x1 (+ -2.0 (* x1 9.0))))))
(if (<= x1 -5.8e+124)
t_1
(if (<= x1 -6.6e-15)
(+ x1 (+ 9.0 t_0))
(if (<= x1 6.2e-138)
(- (* x2 -6.0) x1)
(if (<= x1 4.5e+153) (+ x1 (+ t_0 (* x2 -6.0))) t_1))))))
double code(double x1, double x2) {
double t_0 = x1 + (8.0 * (x1 * (x2 * x2)));
double t_1 = x1 + (x1 * (-2.0 + (x1 * 9.0)));
double tmp;
if (x1 <= -5.8e+124) {
tmp = t_1;
} else if (x1 <= -6.6e-15) {
tmp = x1 + (9.0 + t_0);
} else if (x1 <= 6.2e-138) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 4.5e+153) {
tmp = x1 + (t_0 + (x2 * -6.0));
} else {
tmp = t_1;
}
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) :: tmp
t_0 = x1 + (8.0d0 * (x1 * (x2 * x2)))
t_1 = x1 + (x1 * ((-2.0d0) + (x1 * 9.0d0)))
if (x1 <= (-5.8d+124)) then
tmp = t_1
else if (x1 <= (-6.6d-15)) then
tmp = x1 + (9.0d0 + t_0)
else if (x1 <= 6.2d-138) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 4.5d+153) then
tmp = x1 + (t_0 + (x2 * (-6.0d0)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (8.0 * (x1 * (x2 * x2)));
double t_1 = x1 + (x1 * (-2.0 + (x1 * 9.0)));
double tmp;
if (x1 <= -5.8e+124) {
tmp = t_1;
} else if (x1 <= -6.6e-15) {
tmp = x1 + (9.0 + t_0);
} else if (x1 <= 6.2e-138) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 4.5e+153) {
tmp = x1 + (t_0 + (x2 * -6.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (8.0 * (x1 * (x2 * x2))) t_1 = x1 + (x1 * (-2.0 + (x1 * 9.0))) tmp = 0 if x1 <= -5.8e+124: tmp = t_1 elif x1 <= -6.6e-15: tmp = x1 + (9.0 + t_0) elif x1 <= 6.2e-138: tmp = (x2 * -6.0) - x1 elif x1 <= 4.5e+153: tmp = x1 + (t_0 + (x2 * -6.0)) else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(8.0 * Float64(x1 * Float64(x2 * x2)))) t_1 = Float64(x1 + Float64(x1 * Float64(-2.0 + Float64(x1 * 9.0)))) tmp = 0.0 if (x1 <= -5.8e+124) tmp = t_1; elseif (x1 <= -6.6e-15) tmp = Float64(x1 + Float64(9.0 + t_0)); elseif (x1 <= 6.2e-138) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 4.5e+153) tmp = Float64(x1 + Float64(t_0 + Float64(x2 * -6.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (8.0 * (x1 * (x2 * x2))); t_1 = x1 + (x1 * (-2.0 + (x1 * 9.0))); tmp = 0.0; if (x1 <= -5.8e+124) tmp = t_1; elseif (x1 <= -6.6e-15) tmp = x1 + (9.0 + t_0); elseif (x1 <= 6.2e-138) tmp = (x2 * -6.0) - x1; elseif (x1 <= 4.5e+153) tmp = x1 + (t_0 + (x2 * -6.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(8.0 * N[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x1 * N[(-2.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+124], t$95$1, If[LessEqual[x1, -6.6e-15], N[(x1 + N[(9.0 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 6.2e-138], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 4.5e+153], N[(x1 + N[(t$95$0 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + 8 \cdot \left(x1 \cdot \left(x2 \cdot x2\right)\right)\\
t_1 := x1 + x1 \cdot \left(-2 + x1 \cdot 9\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+124}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq -6.6 \cdot 10^{-15}:\\
\;\;\;\;x1 + \left(9 + t_0\right)\\
\mathbf{elif}\;x1 \leq 6.2 \cdot 10^{-138}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(t_0 + x2 \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x1 < -5.80000000000000043e124 or 4.5000000000000001e153 < x1 Initial program 0.0%
Taylor expanded in x1 around inf 10.5%
Taylor expanded in x1 around 0 60.8%
Taylor expanded in x2 around 0 90.6%
+-commutative90.6%
*-commutative90.6%
*-commutative90.6%
unpow290.6%
associate-*l*90.6%
distribute-lft-out90.6%
Simplified90.6%
if -5.80000000000000043e124 < x1 < -6.6e-15Initial program 86.4%
Taylor expanded in x2 around inf 50.5%
associate-/l*50.8%
unpow250.8%
+-commutative50.8%
unpow250.8%
fma-udef50.8%
Simplified50.8%
Taylor expanded in x1 around 0 46.5%
unpow246.5%
*-commutative46.5%
Simplified46.5%
Taylor expanded in x1 around inf 44.9%
if -6.6e-15 < x1 < 6.1999999999999996e-138Initial program 99.2%
Taylor expanded in x1 around inf 81.9%
Taylor expanded in x1 around 0 82.2%
Taylor expanded in x1 around 0 82.2%
neg-mul-182.2%
*-commutative82.2%
+-commutative82.2%
unsub-neg82.2%
Simplified82.2%
if 6.1999999999999996e-138 < x1 < 4.5000000000000001e153Initial program 97.4%
Taylor expanded in x2 around inf 58.0%
associate-/l*53.2%
unpow253.2%
+-commutative53.2%
unpow253.2%
fma-udef53.2%
Simplified53.2%
Taylor expanded in x1 around 0 56.7%
unpow256.7%
*-commutative56.7%
Simplified56.7%
Taylor expanded in x1 around 0 44.9%
*-commutative44.9%
Simplified44.9%
Final simplification73.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* x1 (+ -2.0 (* x1 9.0)))))
(t_1 (+ x1 (+ 9.0 (+ x1 (* 8.0 (* x1 (* x2 x2))))))))
(if (<= x1 -4.4e+125)
t_0
(if (<= x1 -2.75e-9)
t_1
(if (<= x1 1.5e-98)
(- (* x2 -6.0) x1)
(if (<= x1 4.2e+153) t_1 t_0))))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 * (-2.0 + (x1 * 9.0)));
double t_1 = x1 + (9.0 + (x1 + (8.0 * (x1 * (x2 * x2)))));
double tmp;
if (x1 <= -4.4e+125) {
tmp = t_0;
} else if (x1 <= -2.75e-9) {
tmp = t_1;
} else if (x1 <= 1.5e-98) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 4.2e+153) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = x1 + (x1 * ((-2.0d0) + (x1 * 9.0d0)))
t_1 = x1 + (9.0d0 + (x1 + (8.0d0 * (x1 * (x2 * x2)))))
if (x1 <= (-4.4d+125)) then
tmp = t_0
else if (x1 <= (-2.75d-9)) then
tmp = t_1
else if (x1 <= 1.5d-98) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 4.2d+153) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 * (-2.0 + (x1 * 9.0)));
double t_1 = x1 + (9.0 + (x1 + (8.0 * (x1 * (x2 * x2)))));
double tmp;
if (x1 <= -4.4e+125) {
tmp = t_0;
} else if (x1 <= -2.75e-9) {
tmp = t_1;
} else if (x1 <= 1.5e-98) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 4.2e+153) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 * (-2.0 + (x1 * 9.0))) t_1 = x1 + (9.0 + (x1 + (8.0 * (x1 * (x2 * x2))))) tmp = 0 if x1 <= -4.4e+125: tmp = t_0 elif x1 <= -2.75e-9: tmp = t_1 elif x1 <= 1.5e-98: tmp = (x2 * -6.0) - x1 elif x1 <= 4.2e+153: tmp = t_1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 * Float64(-2.0 + Float64(x1 * 9.0)))) t_1 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(8.0 * Float64(x1 * Float64(x2 * x2)))))) tmp = 0.0 if (x1 <= -4.4e+125) tmp = t_0; elseif (x1 <= -2.75e-9) tmp = t_1; elseif (x1 <= 1.5e-98) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 4.2e+153) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 * (-2.0 + (x1 * 9.0))); t_1 = x1 + (9.0 + (x1 + (8.0 * (x1 * (x2 * x2))))); tmp = 0.0; if (x1 <= -4.4e+125) tmp = t_0; elseif (x1 <= -2.75e-9) tmp = t_1; elseif (x1 <= 1.5e-98) tmp = (x2 * -6.0) - x1; elseif (x1 <= 4.2e+153) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 * N[(-2.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(9.0 + N[(x1 + N[(8.0 * N[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.4e+125], t$95$0, If[LessEqual[x1, -2.75e-9], t$95$1, If[LessEqual[x1, 1.5e-98], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 4.2e+153], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x1 \cdot \left(-2 + x1 \cdot 9\right)\\
t_1 := x1 + \left(9 + \left(x1 + 8 \cdot \left(x1 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -4.4 \cdot 10^{+125}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -2.75 \cdot 10^{-9}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 1.5 \cdot 10^{-98}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 4.2 \cdot 10^{+153}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -4.39999999999999982e125 or 4.20000000000000033e153 < x1 Initial program 0.0%
Taylor expanded in x1 around inf 10.5%
Taylor expanded in x1 around 0 60.8%
Taylor expanded in x2 around 0 90.6%
+-commutative90.6%
*-commutative90.6%
*-commutative90.6%
unpow290.6%
associate-*l*90.6%
distribute-lft-out90.6%
Simplified90.6%
if -4.39999999999999982e125 < x1 < -2.7499999999999998e-9 or 1.5e-98 < x1 < 4.20000000000000033e153Initial program 93.9%
Taylor expanded in x2 around inf 52.5%
associate-/l*48.9%
unpow248.9%
+-commutative48.9%
unpow248.9%
fma-udef48.9%
Simplified48.9%
Taylor expanded in x1 around 0 50.3%
unpow250.3%
*-commutative50.3%
Simplified50.3%
Taylor expanded in x1 around inf 42.0%
if -2.7499999999999998e-9 < x1 < 1.5e-98Initial program 99.2%
Taylor expanded in x1 around inf 80.9%
Taylor expanded in x1 around 0 81.1%
Taylor expanded in x1 around 0 81.2%
neg-mul-181.2%
*-commutative81.2%
+-commutative81.2%
unsub-neg81.2%
Simplified81.2%
Final simplification72.7%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -5.5e-48) (not (<= x1 9.2e-45))) (+ x1 (* x1 (+ -2.0 (* x1 9.0)))) (- (* x2 -6.0) x1)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -5.5e-48) || !(x1 <= 9.2e-45)) {
tmp = x1 + (x1 * (-2.0 + (x1 * 9.0)));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-5.5d-48)) .or. (.not. (x1 <= 9.2d-45))) then
tmp = x1 + (x1 * ((-2.0d0) + (x1 * 9.0d0)))
else
tmp = (x2 * (-6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -5.5e-48) || !(x1 <= 9.2e-45)) {
tmp = x1 + (x1 * (-2.0 + (x1 * 9.0)));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -5.5e-48) or not (x1 <= 9.2e-45): tmp = x1 + (x1 * (-2.0 + (x1 * 9.0))) else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -5.5e-48) || !(x1 <= 9.2e-45)) tmp = Float64(x1 + Float64(x1 * Float64(-2.0 + Float64(x1 * 9.0)))); else tmp = Float64(Float64(x2 * -6.0) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -5.5e-48) || ~((x1 <= 9.2e-45))) tmp = x1 + (x1 * (-2.0 + (x1 * 9.0))); else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -5.5e-48], N[Not[LessEqual[x1, 9.2e-45]], $MachinePrecision]], N[(x1 + N[(x1 * N[(-2.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{-48} \lor \neg \left(x1 \leq 9.2 \cdot 10^{-45}\right):\\
\;\;\;\;x1 + x1 \cdot \left(-2 + x1 \cdot 9\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x1 < -5.50000000000000047e-48 or 9.19999999999999967e-45 < x1 Initial program 41.9%
Taylor expanded in x1 around inf 30.8%
Taylor expanded in x1 around 0 45.7%
Taylor expanded in x2 around 0 55.3%
+-commutative55.3%
*-commutative55.3%
*-commutative55.3%
unpow255.3%
associate-*l*55.3%
distribute-lft-out55.3%
Simplified55.3%
if -5.50000000000000047e-48 < x1 < 9.19999999999999967e-45Initial program 99.2%
Taylor expanded in x1 around inf 77.2%
Taylor expanded in x1 around 0 77.6%
Taylor expanded in x1 around 0 77.7%
neg-mul-177.7%
*-commutative77.7%
+-commutative77.7%
unsub-neg77.7%
Simplified77.7%
Final simplification64.0%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -5.5e-48) (+ x1 (+ (* x1 -2.0) (* (* x1 x1) 9.0))) (if (<= x1 9.2e-45) (- (* x2 -6.0) x1) (+ x1 (* x1 (+ -2.0 (* x1 9.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -5.5e-48) {
tmp = x1 + ((x1 * -2.0) + ((x1 * x1) * 9.0));
} else if (x1 <= 9.2e-45) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = x1 + (x1 * (-2.0 + (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-5.5d-48)) then
tmp = x1 + ((x1 * (-2.0d0)) + ((x1 * x1) * 9.0d0))
else if (x1 <= 9.2d-45) then
tmp = (x2 * (-6.0d0)) - x1
else
tmp = x1 + (x1 * ((-2.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -5.5e-48) {
tmp = x1 + ((x1 * -2.0) + ((x1 * x1) * 9.0));
} else if (x1 <= 9.2e-45) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = x1 + (x1 * (-2.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -5.5e-48: tmp = x1 + ((x1 * -2.0) + ((x1 * x1) * 9.0)) elif x1 <= 9.2e-45: tmp = (x2 * -6.0) - x1 else: tmp = x1 + (x1 * (-2.0 + (x1 * 9.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -5.5e-48) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(Float64(x1 * x1) * 9.0))); elseif (x1 <= 9.2e-45) tmp = Float64(Float64(x2 * -6.0) - x1); else tmp = Float64(x1 + Float64(x1 * Float64(-2.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -5.5e-48) tmp = x1 + ((x1 * -2.0) + ((x1 * x1) * 9.0)); elseif (x1 <= 9.2e-45) tmp = (x2 * -6.0) - x1; else tmp = x1 + (x1 * (-2.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -5.5e-48], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9.2e-45], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], N[(x1 + N[(x1 * N[(-2.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{-48}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + \left(x1 \cdot x1\right) \cdot 9\right)\\
\mathbf{elif}\;x1 \leq 9.2 \cdot 10^{-45}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(-2 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -5.50000000000000047e-48Initial program 35.1%
Taylor expanded in x1 around inf 33.2%
Taylor expanded in x1 around 0 47.1%
Taylor expanded in x2 around 0 52.4%
*-commutative52.4%
unpow252.4%
Simplified52.4%
if -5.50000000000000047e-48 < x1 < 9.19999999999999967e-45Initial program 99.2%
Taylor expanded in x1 around inf 77.2%
Taylor expanded in x1 around 0 77.6%
Taylor expanded in x1 around 0 77.7%
neg-mul-177.7%
*-commutative77.7%
+-commutative77.7%
unsub-neg77.7%
Simplified77.7%
if 9.19999999999999967e-45 < x1 Initial program 46.8%
Taylor expanded in x1 around inf 29.0%
Taylor expanded in x1 around 0 44.7%
Taylor expanded in x2 around 0 57.4%
+-commutative57.4%
*-commutative57.4%
*-commutative57.4%
unpow257.4%
associate-*l*57.4%
distribute-lft-out57.4%
Simplified57.4%
Final simplification64.0%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -2.5e-132) (and (not (<= x1 5.2e-145)) (<= x1 1.4))) (- x1) (+ x1 (* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.5e-132) || (!(x1 <= 5.2e-145) && (x1 <= 1.4))) {
tmp = -x1;
} else {
tmp = x1 + (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 ((x1 <= (-2.5d-132)) .or. (.not. (x1 <= 5.2d-145)) .and. (x1 <= 1.4d0)) then
tmp = -x1
else
tmp = x1 + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.5e-132) || (!(x1 <= 5.2e-145) && (x1 <= 1.4))) {
tmp = -x1;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -2.5e-132) or (not (x1 <= 5.2e-145) and (x1 <= 1.4)): tmp = -x1 else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -2.5e-132) || (!(x1 <= 5.2e-145) && (x1 <= 1.4))) tmp = Float64(-x1); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -2.5e-132) || (~((x1 <= 5.2e-145)) && (x1 <= 1.4))) tmp = -x1; else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -2.5e-132], And[N[Not[LessEqual[x1, 5.2e-145]], $MachinePrecision], LessEqual[x1, 1.4]]], (-x1), N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.5 \cdot 10^{-132} \lor \neg \left(x1 \leq 5.2 \cdot 10^{-145}\right) \land x1 \leq 1.4:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -2.5e-132 or 5.1999999999999999e-145 < x1 < 1.3999999999999999Initial program 60.1%
Taylor expanded in x1 around inf 41.0%
Taylor expanded in x1 around 0 26.0%
Taylor expanded in x1 around inf 20.3%
neg-mul-120.3%
Simplified20.3%
if -2.5e-132 < x1 < 5.1999999999999999e-145 or 1.3999999999999999 < x1 Initial program 67.3%
Taylor expanded in x1 around inf 54.6%
Taylor expanded in x1 around 0 39.8%
Taylor expanded in x1 around 0 37.9%
*-commutative37.9%
Simplified37.9%
Final simplification30.5%
(FPCore (x1 x2) :precision binary64 (- (* x2 -6.0) x1))
double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x2 * (-6.0d0)) - x1
end function
public static double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
def code(x1, x2): return (x2 * -6.0) - x1
function code(x1, x2) return Float64(Float64(x2 * -6.0) - x1) end
function tmp = code(x1, x2) tmp = (x2 * -6.0) - x1; end
code[x1_, x2_] := N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6 - x1
\end{array}
Initial program 64.3%
Taylor expanded in x1 around inf 48.9%
Taylor expanded in x1 around 0 34.0%
Taylor expanded in x1 around 0 34.0%
neg-mul-134.0%
*-commutative34.0%
+-commutative34.0%
unsub-neg34.0%
Simplified34.0%
Final simplification34.0%
(FPCore (x1 x2) :precision binary64 (- x1))
double code(double x1, double x2) {
return -x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = -x1
end function
public static double code(double x1, double x2) {
return -x1;
}
def code(x1, x2): return -x1
function code(x1, x2) return Float64(-x1) end
function tmp = code(x1, x2) tmp = -x1; end
code[x1_, x2_] := (-x1)
\begin{array}{l}
\\
-x1
\end{array}
Initial program 64.3%
Taylor expanded in x1 around inf 48.9%
Taylor expanded in x1 around 0 34.0%
Taylor expanded in x1 around inf 12.0%
neg-mul-112.0%
Simplified12.0%
Final simplification12.0%
herbie shell --seed 2023208
(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))))))