
(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 20 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
(+
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))))))
(if (<= (+ x1 (+ t_3 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1)))) INFINITY)
(+
x1
(+
t_3
(*
3.0
(- (/ (+ t_0 (* x2 -2.0)) (fma x1 x1 1.0)) (/ x1 (fma x1 x1 1.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 = 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)));
double tmp;
if ((x1 + (t_3 + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= ((double) INFINITY)) {
tmp = x1 + (t_3 + (3.0 * (((t_0 + (x2 * -2.0)) / fma(x1, x1, 1.0)) - (x1 / fma(x1, x1, 1.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 = 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)))) tmp = 0.0 if (Float64(x1 + Float64(t_3 + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) <= Inf) tmp = Float64(x1 + Float64(t_3 + Float64(3.0 * Float64(Float64(Float64(t_0 + Float64(x2 * -2.0)) / fma(x1, x1, 1.0)) - Float64(x1 / fma(x1, x1, 1.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[(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]}, If[LessEqual[N[(x1 + N[(t$95$3 + 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[(t$95$3 + N[(3.0 * N[(N[(N[(t$95$0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] - N[(x1 / N[(x1 * x1 + 1.0), $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 := 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)\\
\mathbf{if}\;x1 + \left(t_3 + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right) \leq \infty:\\
\;\;\;\;x1 + \left(t_3 + 3 \cdot \left(\frac{t_0 + x2 \cdot -2}{\mathsf{fma}\left(x1, x1, 1\right)} - \frac{x1}{\mathsf{fma}\left(x1, x1, 1\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.4%
fma-def99.4%
div-sub99.5%
cancel-sign-sub-inv99.5%
*-commutative99.5%
*-commutative99.5%
metadata-eval99.5%
Applied egg-rr99.5%
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 14.3%
Taylor expanded in x1 around inf 98.7%
Final simplification99.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
(if (<= t_3 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.4%
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 14.3%
Taylor expanded in x1 around inf 98.7%
Final simplification99.2%
(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 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_4 (* t_0 t_3))
(t_5 (* (* x1 x1) (- (* t_3 4.0) 6.0)))
(t_6 (* (* x1 2.0) t_3))
(t_7 (* x1 (* x1 x1))))
(if (<= x1 -2.65e+32)
t_1
(if (<= x1 0.0001)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))
(+ x1 (+ t_7 (+ t_4 (* t_2 (+ t_5 (* t_6 (- (* 2.0 x2) 3.0)))))))))
(if (<= x1 4.5e+100)
(+
x1
(+
(+ x1 (+ (+ (* t_2 (+ (* t_6 (- t_3 3.0)) t_5)) t_4) t_7))
(* 3.0 (* x2 -2.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 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = t_0 * t_3;
double t_5 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double t_6 = (x1 * 2.0) * t_3;
double t_7 = x1 * (x1 * x1);
double tmp;
if (x1 <= -2.65e+32) {
tmp = t_1;
} else if (x1 <= 0.0001) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_7 + (t_4 + (t_2 * (t_5 + (t_6 * ((2.0 * x2) - 3.0))))))));
} else if (x1 <= 4.5e+100) {
tmp = x1 + ((x1 + (((t_2 * ((t_6 * (t_3 - 3.0)) + t_5)) + t_4) + t_7)) + (3.0 * (x2 * -2.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) :: t_5
real(8) :: t_6
real(8) :: t_7
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 = ((t_0 + (2.0d0 * x2)) - x1) / t_2
t_4 = t_0 * t_3
t_5 = (x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)
t_6 = (x1 * 2.0d0) * t_3
t_7 = x1 * (x1 * x1)
if (x1 <= (-2.65d+32)) then
tmp = t_1
else if (x1 <= 0.0001d0) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + (t_7 + (t_4 + (t_2 * (t_5 + (t_6 * ((2.0d0 * x2) - 3.0d0))))))))
else if (x1 <= 4.5d+100) then
tmp = x1 + ((x1 + (((t_2 * ((t_6 * (t_3 - 3.0d0)) + t_5)) + t_4) + t_7)) + (3.0d0 * (x2 * (-2.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 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = t_0 * t_3;
double t_5 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double t_6 = (x1 * 2.0) * t_3;
double t_7 = x1 * (x1 * x1);
double tmp;
if (x1 <= -2.65e+32) {
tmp = t_1;
} else if (x1 <= 0.0001) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_7 + (t_4 + (t_2 * (t_5 + (t_6 * ((2.0 * x2) - 3.0))))))));
} else if (x1 <= 4.5e+100) {
tmp = x1 + ((x1 + (((t_2 * ((t_6 * (t_3 - 3.0)) + t_5)) + t_4) + t_7)) + (3.0 * (x2 * -2.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 = ((t_0 + (2.0 * x2)) - x1) / t_2 t_4 = t_0 * t_3 t_5 = (x1 * x1) * ((t_3 * 4.0) - 6.0) t_6 = (x1 * 2.0) * t_3 t_7 = x1 * (x1 * x1) tmp = 0 if x1 <= -2.65e+32: tmp = t_1 elif x1 <= 0.0001: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_7 + (t_4 + (t_2 * (t_5 + (t_6 * ((2.0 * x2) - 3.0)))))))) elif x1 <= 4.5e+100: tmp = x1 + ((x1 + (((t_2 * ((t_6 * (t_3 - 3.0)) + t_5)) + t_4) + t_7)) + (3.0 * (x2 * -2.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(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(t_0 * t_3) t_5 = Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) t_6 = Float64(Float64(x1 * 2.0) * t_3) t_7 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -2.65e+32) tmp = t_1; elseif (x1 <= 0.0001) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(t_7 + Float64(t_4 + Float64(t_2 * Float64(t_5 + Float64(t_6 * Float64(Float64(2.0 * x2) - 3.0))))))))); elseif (x1 <= 4.5e+100) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(t_6 * Float64(t_3 - 3.0)) + t_5)) + t_4) + t_7)) + Float64(3.0 * Float64(x2 * -2.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 = ((t_0 + (2.0 * x2)) - x1) / t_2; t_4 = t_0 * t_3; t_5 = (x1 * x1) * ((t_3 * 4.0) - 6.0); t_6 = (x1 * 2.0) * t_3; t_7 = x1 * (x1 * x1); tmp = 0.0; if (x1 <= -2.65e+32) tmp = t_1; elseif (x1 <= 0.0001) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_7 + (t_4 + (t_2 * (t_5 + (t_6 * ((2.0 * x2) - 3.0)))))))); elseif (x1 <= 4.5e+100) tmp = x1 + ((x1 + (((t_2 * ((t_6 * (t_3 - 3.0)) + t_5)) + t_4) + t_7)) + (3.0 * (x2 * -2.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[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$0 * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision]}, Block[{t$95$7 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.65e+32], t$95$1, If[LessEqual[x1, 0.0001], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$7 + N[(t$95$4 + N[(t$95$2 * N[(t$95$5 + N[(t$95$6 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+100], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(t$95$6 * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision] + t$95$7), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $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 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_2}\\
t_4 := t_0 \cdot t_3\\
t_5 := \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\\
t_6 := \left(x1 \cdot 2\right) \cdot t_3\\
t_7 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -2.65 \cdot 10^{+32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 0.0001:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + \left(t_7 + \left(t_4 + t_2 \cdot \left(t_5 + t_6 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+100}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(t_6 \cdot \left(t_3 - 3\right) + t_5\right) + t_4\right) + t_7\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x1 < -2.65e32 or 4.50000000000000036e100 < x1 Initial program 23.7%
Taylor expanded in x1 around inf 33.6%
Taylor expanded in x1 around inf 98.0%
if -2.65e32 < x1 < 1.00000000000000005e-4Initial program 99.4%
Taylor expanded in x1 around 0 97.2%
if 1.00000000000000005e-4 < x1 < 4.50000000000000036e100Initial program 99.5%
Taylor expanded in x1 around 0 99.4%
*-commutative4.3%
Simplified99.4%
Final simplification97.7%
(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 -2.65e+32) (not (<= x1 2.5e+55)))
(+ 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 <= -2.65e+32) || !(x1 <= 2.5e+55)) {
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 <= (-2.65d+32)) .or. (.not. (x1 <= 2.5d+55))) 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 <= -2.65e+32) || !(x1 <= 2.5e+55)) {
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 <= -2.65e+32) or not (x1 <= 2.5e+55): 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 <= -2.65e+32) || !(x1 <= 2.5e+55)) 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 <= -2.65e+32) || ~((x1 <= 2.5e+55))) 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, -2.65e+32], N[Not[LessEqual[x1, 2.5e+55]], $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 -2.65 \cdot 10^{+32} \lor \neg \left(x1 \leq 2.5 \cdot 10^{+55}\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 < -2.65e32 or 2.50000000000000023e55 < x1 Initial program 29.3%
Taylor expanded in x1 around inf 37.6%
Taylor expanded in x1 around inf 97.2%
if -2.65e32 < x1 < 2.50000000000000023e55Initial program 99.4%
Taylor expanded in x1 around 0 94.2%
Final simplification95.5%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x1 -3100000000.0) (not (<= x1 1.1e+29)))
(+ 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 <= -3100000000.0) || !(x1 <= 1.1e+29)) {
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 <= (-3100000000.0d0)) .or. (.not. (x1 <= 1.1d+29))) 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 <= -3100000000.0) || !(x1 <= 1.1e+29)) {
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 <= -3100000000.0) or not (x1 <= 1.1e+29): 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 <= -3100000000.0) || !(x1 <= 1.1e+29)) 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 <= -3100000000.0) || ~((x1 <= 1.1e+29))) 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, -3100000000.0], N[Not[LessEqual[x1, 1.1e+29]], $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 -3100000000 \lor \neg \left(x1 \leq 1.1 \cdot 10^{+29}\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 < -3.1e9 or 1.1000000000000001e29 < x1 Initial program 38.3%
Taylor expanded in x1 around inf 40.8%
Taylor expanded in x1 around inf 92.7%
if -3.1e9 < x1 < 1.1000000000000001e29Initial program 99.4%
Taylor expanded in x1 around 0 95.0%
Final simplification93.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0))
(t_3
(+
x1
(+
(* 3.0 (* x2 -2.0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_1 t_2)
(*
t_0
(+
(* (* x1 x1) (- (* t_2 4.0) 6.0))
(* (* (* x1 2.0) t_2) (/ -1.0 x1)))))))))))
(if (<= x1 -5.6e+102)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x2 -12.0) 2.0))))
(if (<= x1 -560000.0)
t_3
(if (<= x1 1.1e+29)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))
(+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
(if (<= x1 7.6e+153)
t_3
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * (-1.0 / x1))))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x1 <= -560000.0) {
tmp = t_3;
} else if (x1 <= 1.1e+29) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 7.6e+153) {
tmp = t_3;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = ((t_1 + (2.0d0 * x2)) - x1) / t_0
t_3 = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * (((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * t_2) * ((-1.0d0) / x1))))))))
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) - 2.0d0)))
else if (x1 <= (-560000.0d0)) then
tmp = t_3
else if (x1 <= 1.1d+29) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
else if (x1 <= 7.6d+153) then
tmp = t_3
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * (-1.0 / x1))))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x1 <= -560000.0) {
tmp = t_3;
} else if (x1 <= 1.1e+29) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 7.6e+153) {
tmp = t_3;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0 t_3 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * (-1.0 / x1)))))))) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))) elif x1 <= -560000.0: tmp = t_3 elif x1 <= 1.1e+29: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) elif x1 <= 7.6e+153: tmp = t_3 else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) t_3 = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * t_2) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(-1.0 / x1))))))))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0)))); elseif (x1 <= -560000.0) tmp = t_3; elseif (x1 <= 1.1e+29) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); elseif (x1 <= 7.6e+153) tmp = t_3; else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0; t_3 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * (-1.0 / x1)))))))); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))); elseif (x1 <= -560000.0) tmp = t_3; elseif (x1 <= 1.1e+29) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); elseif (x1 <= 7.6e+153) tmp = t_3; else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * t$95$2), $MachinePrecision] + N[(t$95$0 * 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[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -560000.0], t$95$3, If[LessEqual[x1, 1.1e+29], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $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], If[LessEqual[x1, 7.6e+153], t$95$3, N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0}\\
t_3 := x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot t_2 + t_0 \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 \frac{-1}{x1}\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq -560000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x1 \leq 1.1 \cdot 10^{+29}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 7.6 \cdot 10^{+153}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 2.2%
Taylor expanded in x1 around 0 2.2%
Taylor expanded in x2 around 0 2.6%
*-commutative2.6%
associate-*l*2.6%
Simplified2.6%
Taylor expanded in x1 around 0 21.2%
if -5.60000000000000037e102 < x1 < -5.6e5 or 1.1000000000000001e29 < x1 < 7.59999999999999933e153Initial program 97.5%
Taylor expanded in x1 around inf 89.0%
Taylor expanded in x1 around 0 89.0%
*-commutative3.0%
Simplified89.0%
if -5.6e5 < x1 < 1.1000000000000001e29Initial program 99.4%
Taylor expanded in x1 around 0 95.0%
if 7.59999999999999933e153 < x1 Initial program 3.1%
Taylor expanded in x1 around 0 3.1%
Taylor expanded in x1 around 0 7.5%
*-commutative7.5%
Simplified7.5%
flip-+68.8%
Applied egg-rr68.8%
swap-sqr68.8%
metadata-eval68.8%
Simplified68.8%
Final simplification77.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))))
(if (<= x1 -3e+27)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x2 -12.0) 2.0))))
(if (<= x1 -2e-191)
t_0
(if (<= x1 1.32e-275)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 8.2e+194)
t_0
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double tmp;
if (x1 <= -3e+27) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x1 <= -2e-191) {
tmp = t_0;
} else if (x1 <= 1.32e-275) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 8.2e+194) {
tmp = t_0;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
if (x1 <= (-3d+27)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) - 2.0d0)))
else if (x1 <= (-2d-191)) then
tmp = t_0
else if (x1 <= 1.32d-275) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 8.2d+194) then
tmp = t_0
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double tmp;
if (x1 <= -3e+27) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x1 <= -2e-191) {
tmp = t_0;
} else if (x1 <= 1.32e-275) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 8.2e+194) {
tmp = t_0;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) tmp = 0 if x1 <= -3e+27: tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))) elif x1 <= -2e-191: tmp = t_0 elif x1 <= 1.32e-275: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 8.2e+194: tmp = t_0 else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))) tmp = 0.0 if (x1 <= -3e+27) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0)))); elseif (x1 <= -2e-191) tmp = t_0; elseif (x1 <= 1.32e-275) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 8.2e+194) tmp = t_0; else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); tmp = 0.0; if (x1 <= -3e+27) tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))); elseif (x1 <= -2e-191) tmp = t_0; elseif (x1 <= 1.32e-275) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 8.2e+194) tmp = t_0; else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3e+27], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2e-191], t$95$0, If[LessEqual[x1, 1.32e-275], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8.2e+194], t$95$0, N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{if}\;x1 \leq -3 \cdot 10^{+27}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq -2 \cdot 10^{-191}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 1.32 \cdot 10^{-275}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 8.2 \cdot 10^{+194}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -2.99999999999999976e27Initial program 21.0%
Taylor expanded in x1 around 0 2.1%
Taylor expanded in x2 around 0 2.5%
*-commutative2.5%
associate-*l*2.5%
Simplified2.5%
Taylor expanded in x1 around 0 18.1%
if -2.99999999999999976e27 < x1 < -2e-191 or 1.31999999999999996e-275 < x1 < 8.2000000000000001e194Initial program 95.5%
Taylor expanded in x1 around 0 75.5%
Taylor expanded in x1 around 0 71.6%
if -2e-191 < x1 < 1.31999999999999996e-275Initial program 99.6%
Taylor expanded in x1 around inf 98.7%
Taylor expanded in x1 around 0 98.9%
if 8.2000000000000001e194 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 8.1%
*-commutative8.1%
Simplified8.1%
flip-+73.1%
Applied egg-rr73.1%
swap-sqr73.1%
metadata-eval73.1%
Simplified73.1%
Final simplification62.0%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -3e+27)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x2 -12.0) 2.0))))
(if (<= x1 2e+193)
(+
x1
(+
(+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))
(+ (* x2 -6.0) (* x1 -3.0))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3e+27) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x1 <= 2e+193) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + ((x2 * -6.0) + (x1 * -3.0)));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (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 <= (-3d+27)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) - 2.0d0)))
else if (x1 <= 2d+193) then
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))) + ((x2 * (-6.0d0)) + (x1 * (-3.0d0))))
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -3e+27) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x1 <= 2e+193) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + ((x2 * -6.0) + (x1 * -3.0)));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3e+27: tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))) elif x1 <= 2e+193: tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + ((x2 * -6.0) + (x1 * -3.0))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3e+27) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0)))); elseif (x1 <= 2e+193) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(Float64(x2 * -6.0) + Float64(x1 * -3.0)))); else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -3e+27) tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))); elseif (x1 <= 2e+193) tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + ((x2 * -6.0) + (x1 * -3.0))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3e+27], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+193], 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[(x2 * -6.0), $MachinePrecision] + N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3 \cdot 10^{+27}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+193}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + \left(x2 \cdot -6 + x1 \cdot -3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -2.99999999999999976e27Initial program 21.0%
Taylor expanded in x1 around 0 2.1%
Taylor expanded in x2 around 0 2.5%
*-commutative2.5%
associate-*l*2.5%
Simplified2.5%
Taylor expanded in x1 around 0 18.1%
if -2.99999999999999976e27 < x1 < 2.00000000000000013e193Initial program 96.0%
Taylor expanded in x1 around 0 78.3%
Taylor expanded in x1 around 0 79.4%
if 2.00000000000000013e193 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 8.1%
*-commutative8.1%
Simplified8.1%
flip-+73.1%
Applied egg-rr73.1%
swap-sqr73.1%
metadata-eval73.1%
Simplified73.1%
Final simplification65.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ (+ x1 (* 4.0 (* x2 (* 2.0 (* x1 x2))))) 9.0))))
(if (<= x2 -1.55e+106)
t_0
(if (<= x2 9e-18)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x2 -12.0) 2.0))))
(if (<= x2 1.3e+99)
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))
(if (<= x2 3.8e+131)
(+ x1 (+ (* 3.0 (* x2 -2.0)) (+ x1 (* 4.0 (* x2 (* x1 -3.0))))))
t_0))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x1 + (4.0 * (x2 * (2.0 * (x1 * x2))))) + 9.0);
double tmp;
if (x2 <= -1.55e+106) {
tmp = t_0;
} else if (x2 <= 9e-18) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x2 <= 1.3e+99) {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
} else if (x2 <= 3.8e+131) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + ((x1 + (4.0d0 * (x2 * (2.0d0 * (x1 * x2))))) + 9.0d0)
if (x2 <= (-1.55d+106)) then
tmp = t_0
else if (x2 <= 9d-18) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) - 2.0d0)))
else if (x2 <= 1.3d+99) then
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
else if (x2 <= 3.8d+131) then
tmp = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x1 + (4.0 * (x2 * (2.0 * (x1 * x2))))) + 9.0);
double tmp;
if (x2 <= -1.55e+106) {
tmp = t_0;
} else if (x2 <= 9e-18) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x2 <= 1.3e+99) {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
} else if (x2 <= 3.8e+131) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x1 + (4.0 * (x2 * (2.0 * (x1 * x2))))) + 9.0) tmp = 0 if x2 <= -1.55e+106: tmp = t_0 elif x2 <= 9e-18: tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))) elif x2 <= 1.3e+99: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) elif x2 <= 3.8e+131: tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (4.0 * (x2 * (x1 * -3.0))))) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(2.0 * Float64(x1 * x2))))) + 9.0)) tmp = 0.0 if (x2 <= -1.55e+106) tmp = t_0; elseif (x2 <= 9e-18) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0)))); elseif (x2 <= 1.3e+99) tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); elseif (x2 <= 3.8e+131) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x1 + (4.0 * (x2 * (2.0 * (x1 * x2))))) + 9.0); tmp = 0.0; if (x2 <= -1.55e+106) tmp = t_0; elseif (x2 <= 9e-18) tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))); elseif (x2 <= 1.3e+99) tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); elseif (x2 <= 3.8e+131) tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (4.0 * (x2 * (x1 * -3.0))))); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(2.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -1.55e+106], t$95$0, If[LessEqual[x2, 9e-18], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x2, 1.3e+99], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x2, 3.8e+131], N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(2 \cdot \left(x1 \cdot x2\right)\right)\right)\right) + 9\right)\\
\mathbf{if}\;x2 \leq -1.55 \cdot 10^{+106}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x2 \leq 9 \cdot 10^{-18}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\
\mathbf{elif}\;x2 \leq 1.3 \cdot 10^{+99}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\mathbf{elif}\;x2 \leq 3.8 \cdot 10^{+131}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x2 < -1.55e106 or 3.8000000000000004e131 < x2 Initial program 72.8%
Taylor expanded in x1 around 0 69.5%
Taylor expanded in x1 around inf 69.9%
Taylor expanded in x2 around inf 69.9%
if -1.55e106 < x2 < 8.99999999999999987e-18Initial program 71.1%
Taylor expanded in x1 around 0 47.8%
Taylor expanded in x2 around 0 46.2%
*-commutative46.2%
associate-*l*46.2%
Simplified46.2%
Taylor expanded in x1 around 0 49.1%
if 8.99999999999999987e-18 < x2 < 1.3e99Initial program 44.3%
Taylor expanded in x1 around 0 28.1%
Taylor expanded in x1 around 0 30.0%
*-commutative30.0%
Simplified30.0%
flip-+55.8%
Applied egg-rr55.8%
swap-sqr55.7%
metadata-eval55.7%
Simplified55.7%
if 1.3e99 < x2 < 3.8000000000000004e131Initial program 62.5%
Taylor expanded in x1 around 0 38.3%
Taylor expanded in x2 around 0 34.0%
*-commutative34.0%
associate-*l*34.0%
Simplified34.0%
Taylor expanded in x1 around 0 59.0%
*-commutative59.0%
Simplified59.0%
Final simplification56.7%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x2 -1e-54) (not (<= x2 1e+30)))
(+
x1
(+ (* 3.0 (* x2 -2.0)) (+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x2 -12.0) 2.0))))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -1e-54) || !(x2 <= 1e+30)) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-1d-54)) .or. (.not. (x2 <= 1d+30))) then
tmp = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -1e-54) || !(x2 <= 1e+30)) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -1e-54) or not (x2 <= 1e+30): tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -1e-54) || !(x2 <= 1e+30)) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -1e-54) || ~((x2 <= 1e+30))) tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); else tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -1e-54], N[Not[LessEqual[x2, 1e+30]], $MachinePrecision]], N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $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], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1 \cdot 10^{-54} \lor \neg \left(x2 \leq 10^{+30}\right):\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\
\end{array}
\end{array}
if x2 < -1e-54 or 1e30 < x2 Initial program 70.8%
Taylor expanded in x1 around 0 59.0%
Taylor expanded in x1 around 0 71.3%
*-commutative33.1%
Simplified71.3%
if -1e-54 < x2 < 1e30Initial program 68.2%
Taylor expanded in x1 around 0 47.5%
Taylor expanded in x2 around 0 47.5%
*-commutative47.5%
associate-*l*47.5%
Simplified47.5%
Taylor expanded in x1 around 0 49.4%
Final simplification60.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ (* x2 -6.0) (* x1 (- (* x2 -12.0) 2.0)))))
(t_1 (+ x1 (+ (+ x1 (* 4.0 (* x2 (* 2.0 (* x1 x2))))) 9.0))))
(if (<= x2 -1.75e+106)
t_1
(if (<= x2 6.8e-18)
t_0
(if (<= x2 2.1e+94)
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))
(if (<= x2 1.42e+134) t_0 t_1))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
double t_1 = x1 + ((x1 + (4.0 * (x2 * (2.0 * (x1 * x2))))) + 9.0);
double tmp;
if (x2 <= -1.75e+106) {
tmp = t_1;
} else if (x2 <= 6.8e-18) {
tmp = t_0;
} else if (x2 <= 2.1e+94) {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
} else if (x2 <= 1.42e+134) {
tmp = t_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 + ((x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) - 2.0d0)))
t_1 = x1 + ((x1 + (4.0d0 * (x2 * (2.0d0 * (x1 * x2))))) + 9.0d0)
if (x2 <= (-1.75d+106)) then
tmp = t_1
else if (x2 <= 6.8d-18) then
tmp = t_0
else if (x2 <= 2.1d+94) then
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
else if (x2 <= 1.42d+134) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
double t_1 = x1 + ((x1 + (4.0 * (x2 * (2.0 * (x1 * x2))))) + 9.0);
double tmp;
if (x2 <= -1.75e+106) {
tmp = t_1;
} else if (x2 <= 6.8e-18) {
tmp = t_0;
} else if (x2 <= 2.1e+94) {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
} else if (x2 <= 1.42e+134) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))) t_1 = x1 + ((x1 + (4.0 * (x2 * (2.0 * (x1 * x2))))) + 9.0) tmp = 0 if x2 <= -1.75e+106: tmp = t_1 elif x2 <= 6.8e-18: tmp = t_0 elif x2 <= 2.1e+94: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) elif x2 <= 1.42e+134: tmp = t_0 else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0)))) t_1 = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(2.0 * Float64(x1 * x2))))) + 9.0)) tmp = 0.0 if (x2 <= -1.75e+106) tmp = t_1; elseif (x2 <= 6.8e-18) tmp = t_0; elseif (x2 <= 2.1e+94) tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); elseif (x2 <= 1.42e+134) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))); t_1 = x1 + ((x1 + (4.0 * (x2 * (2.0 * (x1 * x2))))) + 9.0); tmp = 0.0; if (x2 <= -1.75e+106) tmp = t_1; elseif (x2 <= 6.8e-18) tmp = t_0; elseif (x2 <= 2.1e+94) tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); elseif (x2 <= 1.42e+134) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(2.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -1.75e+106], t$95$1, If[LessEqual[x2, 6.8e-18], t$95$0, If[LessEqual[x2, 2.1e+94], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x2, 1.42e+134], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\
t_1 := x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(2 \cdot \left(x1 \cdot x2\right)\right)\right)\right) + 9\right)\\
\mathbf{if}\;x2 \leq -1.75 \cdot 10^{+106}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x2 \leq 6.8 \cdot 10^{-18}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x2 \leq 2.1 \cdot 10^{+94}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\mathbf{elif}\;x2 \leq 1.42 \cdot 10^{+134}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x2 < -1.7499999999999999e106 or 1.42000000000000002e134 < x2 Initial program 72.8%
Taylor expanded in x1 around 0 69.5%
Taylor expanded in x1 around inf 69.9%
Taylor expanded in x2 around inf 69.9%
if -1.7499999999999999e106 < x2 < 6.80000000000000002e-18 or 2.09999999999999989e94 < x2 < 1.42000000000000002e134Initial program 70.7%
Taylor expanded in x1 around 0 47.3%
Taylor expanded in x2 around 0 45.6%
*-commutative45.6%
associate-*l*45.6%
Simplified45.6%
Taylor expanded in x1 around 0 49.6%
if 6.80000000000000002e-18 < x2 < 2.09999999999999989e94Initial program 44.3%
Taylor expanded in x1 around 0 28.1%
Taylor expanded in x1 around 0 30.0%
*-commutative30.0%
Simplified30.0%
flip-+55.8%
Applied egg-rr55.8%
swap-sqr55.7%
metadata-eval55.7%
Simplified55.7%
Final simplification56.7%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -1.05e+106) (not (<= x2 4.2e+132))) (+ x1 (+ (+ x1 (* 4.0 (* x2 (* 2.0 (* x1 x2))))) 9.0)) (+ x1 (+ (* x2 -6.0) (* x1 (- (* x2 -12.0) 2.0))))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.05e+106) || !(x2 <= 4.2e+132)) {
tmp = x1 + ((x1 + (4.0 * (x2 * (2.0 * (x1 * x2))))) + 9.0);
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-1.05d+106)) .or. (.not. (x2 <= 4.2d+132))) then
tmp = x1 + ((x1 + (4.0d0 * (x2 * (2.0d0 * (x1 * x2))))) + 9.0d0)
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.05e+106) || !(x2 <= 4.2e+132)) {
tmp = x1 + ((x1 + (4.0 * (x2 * (2.0 * (x1 * x2))))) + 9.0);
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -1.05e+106) or not (x2 <= 4.2e+132): tmp = x1 + ((x1 + (4.0 * (x2 * (2.0 * (x1 * x2))))) + 9.0) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -1.05e+106) || !(x2 <= 4.2e+132)) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(2.0 * Float64(x1 * x2))))) + 9.0)); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -1.05e+106) || ~((x2 <= 4.2e+132))) tmp = x1 + ((x1 + (4.0 * (x2 * (2.0 * (x1 * x2))))) + 9.0); else tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -1.05e+106], N[Not[LessEqual[x2, 4.2e+132]], $MachinePrecision]], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(2.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.05 \cdot 10^{+106} \lor \neg \left(x2 \leq 4.2 \cdot 10^{+132}\right):\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(2 \cdot \left(x1 \cdot x2\right)\right)\right)\right) + 9\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\
\end{array}
\end{array}
if x2 < -1.05000000000000002e106 or 4.19999999999999987e132 < x2 Initial program 72.8%
Taylor expanded in x1 around 0 69.5%
Taylor expanded in x1 around inf 69.9%
Taylor expanded in x2 around inf 69.9%
if -1.05000000000000002e106 < x2 < 4.19999999999999987e132Initial program 67.9%
Taylor expanded in x1 around 0 45.3%
Taylor expanded in x2 around 0 43.8%
*-commutative43.8%
associate-*l*43.8%
Simplified43.8%
Taylor expanded in x1 around 0 47.5%
Final simplification54.9%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -3e+27)
(+ x1 (* x1 (+ 1.0 (* x2 -12.0))))
(if (or (<= x1 -1.3e-89) (not (<= x1 1e-92)))
(+ x1 (* x1 (* (* x2 x2) 8.0)))
(* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3e+27) {
tmp = x1 + (x1 * (1.0 + (x2 * -12.0)));
} else if ((x1 <= -1.3e-89) || !(x1 <= 1e-92)) {
tmp = x1 + (x1 * ((x2 * x2) * 8.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-3d+27)) then
tmp = x1 + (x1 * (1.0d0 + (x2 * (-12.0d0))))
else if ((x1 <= (-1.3d-89)) .or. (.not. (x1 <= 1d-92))) then
tmp = x1 + (x1 * ((x2 * x2) * 8.0d0))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -3e+27) {
tmp = x1 + (x1 * (1.0 + (x2 * -12.0)));
} else if ((x1 <= -1.3e-89) || !(x1 <= 1e-92)) {
tmp = x1 + (x1 * ((x2 * x2) * 8.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3e+27: tmp = x1 + (x1 * (1.0 + (x2 * -12.0))) elif (x1 <= -1.3e-89) or not (x1 <= 1e-92): tmp = x1 + (x1 * ((x2 * x2) * 8.0)) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3e+27) tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(x2 * -12.0)))); elseif ((x1 <= -1.3e-89) || !(x1 <= 1e-92)) tmp = Float64(x1 + Float64(x1 * Float64(Float64(x2 * x2) * 8.0))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -3e+27) tmp = x1 + (x1 * (1.0 + (x2 * -12.0))); elseif ((x1 <= -1.3e-89) || ~((x1 <= 1e-92))) tmp = x1 + (x1 * ((x2 * x2) * 8.0)); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3e+27], N[(x1 + N[(x1 * N[(1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -1.3e-89], N[Not[LessEqual[x1, 1e-92]], $MachinePrecision]], N[(x1 + N[(x1 * N[(N[(x2 * x2), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3 \cdot 10^{+27}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + x2 \cdot -12\right)\\
\mathbf{elif}\;x1 \leq -1.3 \cdot 10^{-89} \lor \neg \left(x1 \leq 10^{-92}\right):\\
\;\;\;\;x1 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -2.99999999999999976e27Initial program 21.0%
Taylor expanded in x1 around 0 2.1%
Taylor expanded in x2 around 0 2.5%
*-commutative2.5%
associate-*l*2.5%
Simplified2.5%
Taylor expanded in x1 around inf 13.3%
*-commutative13.3%
Simplified13.3%
if -2.99999999999999976e27 < x1 < -1.2999999999999999e-89 or 9.99999999999999988e-93 < x1 Initial program 71.6%
Taylor expanded in x1 around 0 44.7%
Taylor expanded in x2 around inf 45.1%
associate-*r*45.1%
unpow245.1%
Simplified45.1%
if -1.2999999999999999e-89 < x1 < 9.99999999999999988e-93Initial program 99.3%
Taylor expanded in x1 around 0 99.3%
Taylor expanded in x1 around 0 54.5%
*-commutative54.5%
Simplified54.5%
Taylor expanded in x1 around 0 55.1%
*-commutative55.1%
Simplified55.1%
Final simplification41.4%
(FPCore (x1 x2) :precision binary64 (if (<= x1 7.8e-60) (+ x1 (+ (* x2 -6.0) (* x1 -2.0))) (* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= 7.8e-60) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((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 <= 7.8d-60) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 7.8e-60) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 7.8e-60: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) else: tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 7.8e-60) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 7.8e-60) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); else tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 7.8e-60], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 7.8 \cdot 10^{-60}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < 7.8000000000000004e-60Initial program 73.8%
Taylor expanded in x1 around inf 62.0%
Taylor expanded in x1 around 0 49.9%
if 7.8000000000000004e-60 < x1 Initial program 60.3%
Taylor expanded in x1 around 0 30.7%
Taylor expanded in x1 around inf 50.3%
Taylor expanded in x1 around inf 49.2%
Final simplification49.7%
(FPCore (x1 x2) :precision binary64 (if (<= x1 7.2e-60) (+ x1 (+ (* x2 -6.0) (* x1 (- (* x2 -12.0) 2.0)))) (* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= 7.2e-60) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((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 <= 7.2d-60) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) - 2.0d0)))
else
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 7.2e-60) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 7.2e-60: tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))) else: tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 7.2e-60) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0)))); else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 7.2e-60) tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))); else tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 7.2e-60], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 7.2 \cdot 10^{-60}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < 7.2e-60Initial program 73.8%
Taylor expanded in x1 around 0 63.8%
Taylor expanded in x2 around 0 48.2%
*-commutative48.2%
associate-*l*48.2%
Simplified48.2%
Taylor expanded in x1 around 0 53.5%
if 7.2e-60 < x1 Initial program 60.3%
Taylor expanded in x1 around 0 30.7%
Taylor expanded in x1 around inf 50.3%
Taylor expanded in x1 around inf 49.2%
Final simplification52.1%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -2.8e+95) (not (<= x1 1.35))) (+ x1 (* x1 (+ 1.0 (* x2 -12.0)))) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.8e+95) || !(x1 <= 1.35)) {
tmp = x1 + (x1 * (1.0 + (x2 * -12.0)));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-2.8d+95)) .or. (.not. (x1 <= 1.35d0))) then
tmp = x1 + (x1 * (1.0d0 + (x2 * (-12.0d0))))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.8e+95) || !(x1 <= 1.35)) {
tmp = x1 + (x1 * (1.0 + (x2 * -12.0)));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -2.8e+95) or not (x1 <= 1.35): tmp = x1 + (x1 * (1.0 + (x2 * -12.0))) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -2.8e+95) || !(x1 <= 1.35)) tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(x2 * -12.0)))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -2.8e+95) || ~((x1 <= 1.35))) tmp = x1 + (x1 * (1.0 + (x2 * -12.0))); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -2.8e+95], N[Not[LessEqual[x1, 1.35]], $MachinePrecision]], N[(x1 + N[(x1 * N[(1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.8 \cdot 10^{+95} \lor \neg \left(x1 \leq 1.35\right):\\
\;\;\;\;x1 + x1 \cdot \left(1 + x2 \cdot -12\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -2.7999999999999998e95 or 1.3500000000000001 < x1 Initial program 34.7%
Taylor expanded in x1 around 0 11.3%
Taylor expanded in x2 around 0 3.2%
*-commutative3.2%
associate-*l*3.2%
Simplified3.2%
Taylor expanded in x1 around inf 16.1%
*-commutative16.1%
Simplified16.1%
if -2.7999999999999998e95 < x1 < 1.3500000000000001Initial program 99.3%
Taylor expanded in x1 around 0 89.3%
Taylor expanded in x1 around 0 36.7%
*-commutative36.7%
Simplified36.7%
Taylor expanded in x1 around 0 37.4%
*-commutative37.4%
Simplified37.4%
Final simplification27.6%
(FPCore (x1 x2) :precision binary64 (if (<= x1 8.2e-60) (+ x1 (+ (* x2 -6.0) (* x1 -2.0))) (+ x1 (* x1 (* (* x2 x2) 8.0)))))
double code(double x1, double x2) {
double tmp;
if (x1 <= 8.2e-60) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else {
tmp = x1 + (x1 * ((x2 * x2) * 8.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.2d-60) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else
tmp = x1 + (x1 * ((x2 * x2) * 8.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 8.2e-60) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else {
tmp = x1 + (x1 * ((x2 * x2) * 8.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 8.2e-60: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) else: tmp = x1 + (x1 * ((x2 * x2) * 8.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 8.2e-60) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); else tmp = Float64(x1 + Float64(x1 * Float64(Float64(x2 * x2) * 8.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 8.2e-60) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); else tmp = x1 + (x1 * ((x2 * x2) * 8.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 8.2e-60], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(N[(x2 * x2), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 8.2 \cdot 10^{-60}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\\
\end{array}
\end{array}
if x1 < 8.20000000000000025e-60Initial program 73.8%
Taylor expanded in x1 around inf 62.0%
Taylor expanded in x1 around 0 49.9%
if 8.20000000000000025e-60 < x1 Initial program 60.3%
Taylor expanded in x1 around 0 30.7%
Taylor expanded in x2 around inf 49.2%
associate-*r*49.2%
unpow249.2%
Simplified49.2%
Final simplification49.7%
(FPCore (x1 x2) :precision binary64 (+ x1 (* x2 -6.0)))
double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + (x2 * (-6.0d0))
end function
public static double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
def code(x1, x2): return x1 + (x2 * -6.0)
function code(x1, x2) return Float64(x1 + Float64(x2 * -6.0)) end
function tmp = code(x1, x2) tmp = x1 + (x2 * -6.0); end
code[x1_, x2_] := N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + x2 \cdot -6
\end{array}
Initial program 69.5%
Taylor expanded in x1 around 0 53.3%
Taylor expanded in x1 around 0 21.5%
*-commutative21.5%
Simplified21.5%
Final simplification21.5%
(FPCore (x1 x2) :precision binary64 (* x2 -6.0))
double code(double x1, double x2) {
return x2 * -6.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * (-6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * -6.0;
}
def code(x1, x2): return x2 * -6.0
function code(x1, x2) return Float64(x2 * -6.0) end
function tmp = code(x1, x2) tmp = x2 * -6.0; end
code[x1_, x2_] := N[(x2 * -6.0), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6
\end{array}
Initial program 69.5%
Taylor expanded in x1 around 0 53.3%
Taylor expanded in x1 around 0 21.5%
*-commutative21.5%
Simplified21.5%
Taylor expanded in x1 around 0 21.2%
*-commutative21.2%
Simplified21.2%
Final simplification21.2%
(FPCore (x1 x2) :precision binary64 9.0)
double code(double x1, double x2) {
return 9.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = 9.0d0
end function
public static double code(double x1, double x2) {
return 9.0;
}
def code(x1, x2): return 9.0
function code(x1, x2) return 9.0 end
function tmp = code(x1, x2) tmp = 9.0; end
code[x1_, x2_] := 9.0
\begin{array}{l}
\\
9
\end{array}
Initial program 69.5%
Taylor expanded in x1 around 0 53.3%
Taylor expanded in x1 around inf 29.0%
Taylor expanded in x1 around 0 3.6%
Final simplification3.6%
herbie shell --seed 2023207
(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))))))