
(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 (fma x1 (* x1 3.0) (* 2.0 x2)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- x1 t_0) (fma x1 x1 1.0)))
(t_3 (* 3.0 (* x1 x1)))
(t_4 (* x1 (* x1 3.0)))
(t_5 (/ (- (+ t_4 (* 2.0 x2)) x1) t_1))
(t_6 (/ (- t_0 x1) (fma x1 x1 1.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_5) (- t_5 3.0))
(* (* x1 x1) (- (* t_5 4.0) 6.0))))
(* t_4 t_5))
(* x1 (* x1 x1))))
(* 3.0 (/ (+ x1 (- (* 2.0 x2) t_4)) (- -1.0 (* x1 x1))))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_3 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_6 4.0 -6.0)) (* (* x1 (* 2.0 t_2)) (- t_2 -3.0)))
(fma t_3 t_6 (pow x1 3.0))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = fma(x1, (x1 * 3.0), (2.0 * x2));
double t_1 = (x1 * x1) + 1.0;
double t_2 = (x1 - t_0) / fma(x1, x1, 1.0);
double t_3 = 3.0 * (x1 * x1);
double t_4 = x1 * (x1 * 3.0);
double t_5 = ((t_4 + (2.0 * x2)) - x1) / t_1;
double t_6 = (t_0 - x1) / fma(x1, x1, 1.0);
double tmp;
if ((x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_5) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_4 * t_5)) + (x1 * (x1 * x1)))) + (3.0 * ((x1 + ((2.0 * x2) - t_4)) / (-1.0 - (x1 * x1)))))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_3 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_6, 4.0, -6.0)), ((x1 * (2.0 * t_2)) * (t_2 - -3.0))), fma(t_3, t_6, pow(x1, 3.0)))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
function code(x1, x2) t_0 = fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(x1 - t_0) / fma(x1, x1, 1.0)) t_3 = Float64(3.0 * Float64(x1 * x1)) t_4 = Float64(x1 * Float64(x1 * 3.0)) t_5 = Float64(Float64(Float64(t_4 + Float64(2.0 * x2)) - x1) / t_1) t_6 = Float64(Float64(t_0 - x1) / fma(x1, x1, 1.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_5) * Float64(t_5 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)))) + Float64(t_4 * t_5)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(x1 + Float64(Float64(2.0 * x2) - t_4)) / Float64(-1.0 - Float64(x1 * x1)))))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_3 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_6, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_2)) * Float64(t_2 - -3.0))), fma(t_3, t_6, (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 - t$95$0), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$4 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$6 = N[(N[(t$95$0 - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $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$5), $MachinePrecision] * N[(t$95$5 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * t$95$5), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x1 + N[(N[(2.0 * x2), $MachinePrecision] - t$95$4), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$3 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$6 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$2), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 - -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * t$95$6 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{x1 - t\_0}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_3 := 3 \cdot \left(x1 \cdot x1\right)\\
t_4 := x1 \cdot \left(x1 \cdot 3\right)\\
t_5 := \frac{\left(t\_4 + 2 \cdot x2\right) - x1}{t\_1}\\
t_6 := \frac{t\_0 - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_5\right) \cdot \left(t\_5 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_5 \cdot 4 - 6\right)\right) + t\_4 \cdot t\_5\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{x1 + \left(2 \cdot x2 - t\_4\right)}{-1 - x1 \cdot x1}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_3 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_6, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_2\right)\right) \cdot \left(t\_2 - -3\right)\right), \mathsf{fma}\left(t\_3, t\_6, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\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%
Simplified99.7%
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 10.7%
Taylor expanded in x1 around inf 100.0%
Final simplification99.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- (+ t_1 (* 2.0 x2)) x1))
(t_3 (- -1.0 (* x1 x1)))
(t_4 (+ (* x1 x1) 1.0))
(t_5 (/ t_2 t_4))
(t_6 (* (* x1 2.0) t_5))
(t_7 (* t_5 4.0)))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(* t_4 (+ (* t_6 (- t_5 3.0)) (* (* x1 x1) (- t_7 6.0))))
(* t_1 t_5))
t_0))
(* 3.0 (/ (+ x1 (- (* 2.0 x2) t_1)) t_3))))
INFINITY)
(-
x1
(-
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_3))
(-
x1
(-
(+
(* t_1 (/ t_2 t_3))
(*
t_4
(+
(* (* x1 x1) (- 6.0 t_7))
(*
t_6
(+
3.0
(-
(/ (- x1 (* 3.0 (pow x1 2.0))) (fma x1 x1 1.0))
(/ (* 2.0 x2) (fma x1 x1 1.0))))))))
t_0))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = -1.0 - (x1 * x1);
double t_4 = (x1 * x1) + 1.0;
double t_5 = t_2 / t_4;
double t_6 = (x1 * 2.0) * t_5;
double t_7 = t_5 * 4.0;
double tmp;
if ((x1 + ((x1 + (((t_4 * ((t_6 * (t_5 - 3.0)) + ((x1 * x1) * (t_7 - 6.0)))) + (t_1 * t_5)) + t_0)) + (3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)))) <= ((double) INFINITY)) {
tmp = x1 - ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) - (x1 - (((t_1 * (t_2 / t_3)) + (t_4 * (((x1 * x1) * (6.0 - t_7)) + (t_6 * (3.0 + (((x1 - (3.0 * pow(x1, 2.0))) / fma(x1, x1, 1.0)) - ((2.0 * x2) / fma(x1, x1, 1.0)))))))) - t_0)));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) t_3 = Float64(-1.0 - Float64(x1 * x1)) t_4 = Float64(Float64(x1 * x1) + 1.0) t_5 = Float64(t_2 / t_4) t_6 = Float64(Float64(x1 * 2.0) * t_5) t_7 = Float64(t_5 * 4.0) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_4 * Float64(Float64(t_6 * Float64(t_5 - 3.0)) + Float64(Float64(x1 * x1) * Float64(t_7 - 6.0)))) + Float64(t_1 * t_5)) + t_0)) + Float64(3.0 * Float64(Float64(x1 + Float64(Float64(2.0 * x2) - t_1)) / t_3)))) <= Inf) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_3)) - Float64(x1 - Float64(Float64(Float64(t_1 * Float64(t_2 / t_3)) + Float64(t_4 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 - t_7)) + Float64(t_6 * Float64(3.0 + Float64(Float64(Float64(x1 - Float64(3.0 * (x1 ^ 2.0))) / fma(x1, x1, 1.0)) - Float64(Float64(2.0 * x2) / fma(x1, x1, 1.0)))))))) - t_0)))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.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[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$5 * 4.0), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$4 * N[(N[(t$95$6 * N[(t$95$5 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(t$95$7 - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$5), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x1 + N[(N[(2.0 * x2), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 - N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] - N[(x1 - N[(N[(N[(t$95$1 * N[(t$95$2 / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - t$95$7), $MachinePrecision]), $MachinePrecision] + N[(t$95$6 * N[(3.0 + N[(N[(N[(x1 - N[(3.0 * N[Power[x1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(2.0 * x2), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $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 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := -1 - x1 \cdot x1\\
t_4 := x1 \cdot x1 + 1\\
t_5 := \frac{t\_2}{t\_4}\\
t_6 := \left(x1 \cdot 2\right) \cdot t\_5\\
t_7 := t\_5 \cdot 4\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_4 \cdot \left(t\_6 \cdot \left(t\_5 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_7 - 6\right)\right) + t\_1 \cdot t\_5\right) + t\_0\right)\right) + 3 \cdot \frac{x1 + \left(2 \cdot x2 - t\_1\right)}{t\_3}\right) \leq \infty:\\
\;\;\;\;x1 - \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_3} - \left(x1 - \left(\left(t\_1 \cdot \frac{t\_2}{t\_3} + t\_4 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 - t\_7\right) + t\_6 \cdot \left(3 + \left(\frac{x1 - 3 \cdot {x1}^{2}}{\mathsf{fma}\left(x1, x1, 1\right)} - \frac{2 \cdot x2}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\right)\right) - t\_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\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%
Taylor expanded in x2 around 0 99.4%
associate--l+99.5%
associate-*r/99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
associate-*r/99.5%
div-sub99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.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 10.7%
Taylor expanded in x1 around inf 100.0%
Final simplification99.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))
(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 (/ (+ x1 (- (* 2.0 x2) t_0)) (- -1.0 (* x1 x1))))))))
(if (<= t_3 INFINITY) t_3 (+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * ((x1 + ((2.0 * x2) - t_0)) / (-1.0 - (x1 * x1)))));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.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 * ((x1 + ((2.0 * x2) - t_0)) / (-1.0 - (x1 * x1)))));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * ((x1 + ((2.0 * x2) - t_0)) / (-1.0 - (x1 * x1))))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(x1 + Float64(Float64(2.0 * x2) - t_0)) / Float64(-1.0 - Float64(x1 * x1)))))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * ((x1 + ((2.0 * x2) - t_0)) / (-1.0 - (x1 * x1))))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x1 + N[(N[(2.0 * x2), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{x1 + \left(2 \cdot x2 - t\_0\right)}{-1 - x1 \cdot x1}\right)\\
\mathbf{if}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\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 10.7%
Taylor expanded in x1 around inf 100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (- (+ t_0 (* 2.0 x2)) x1))
(t_2 (+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (- -1.0 (* x1 x1)))
(t_5 (/ t_1 t_3))
(t_6 (* (* x1 2.0) t_5))
(t_7 (* x1 (* x1 x1))))
(if (<= x1 -5e+103)
t_2
(if (<= x1 -1.7)
(+
x1
(+
(+
x1
(+
(+
(* t_3 (+ (* t_6 (- t_5 3.0)) (* (* x1 x1) (- (* t_5 4.0) 6.0))))
(* t_0 t_5))
t_7))
9.0))
(if (<= x1 1.8e-12)
(+
x1
(+
(* x2 -6.0)
(+
(* x1 (- (* x1 9.0) 2.0))
(* x2 (+ (* 8.0 (* x1 x2)) (* x1 (- (* x1 6.0) 12.0)))))))
(if (<= x1 4e+82)
(+
x1
(+
(* 3.0 (/ (+ x1 (- (* 2.0 x2) t_0)) t_4))
(+
x1
(-
t_7
(+
(* t_0 (/ t_1 t_4))
(*
t_3
(+
(+ (* 4.0 (- 3.0 (* 2.0 x2))) (* x1 (- 4.0 (* x1 6.0))))
(* t_6 (- 3.0 t_5)))))))))
t_2))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (t_0 + (2.0 * x2)) - x1;
double t_2 = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = -1.0 - (x1 * x1);
double t_5 = t_1 / t_3;
double t_6 = (x1 * 2.0) * t_5;
double t_7 = x1 * (x1 * x1);
double tmp;
if (x1 <= -5e+103) {
tmp = t_2;
} else if (x1 <= -1.7) {
tmp = x1 + ((x1 + (((t_3 * ((t_6 * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_0 * t_5)) + t_7)) + 9.0);
} else if (x1 <= 1.8e-12) {
tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0))))));
} else if (x1 <= 4e+82) {
tmp = x1 + ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_4)) + (x1 + (t_7 - ((t_0 * (t_1 / t_4)) + (t_3 * (((4.0 * (3.0 - (2.0 * x2))) + (x1 * (4.0 - (x1 * 6.0)))) + (t_6 * (3.0 - t_5))))))));
} else {
tmp = t_2;
}
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 = (t_0 + (2.0d0 * x2)) - x1
t_2 = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
t_3 = (x1 * x1) + 1.0d0
t_4 = (-1.0d0) - (x1 * x1)
t_5 = t_1 / t_3
t_6 = (x1 * 2.0d0) * t_5
t_7 = x1 * (x1 * x1)
if (x1 <= (-5d+103)) then
tmp = t_2
else if (x1 <= (-1.7d0)) then
tmp = x1 + ((x1 + (((t_3 * ((t_6 * (t_5 - 3.0d0)) + ((x1 * x1) * ((t_5 * 4.0d0) - 6.0d0)))) + (t_0 * t_5)) + t_7)) + 9.0d0)
else if (x1 <= 1.8d-12) then
tmp = x1 + ((x2 * (-6.0d0)) + ((x1 * ((x1 * 9.0d0) - 2.0d0)) + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * ((x1 * 6.0d0) - 12.0d0))))))
else if (x1 <= 4d+82) then
tmp = x1 + ((3.0d0 * ((x1 + ((2.0d0 * x2) - t_0)) / t_4)) + (x1 + (t_7 - ((t_0 * (t_1 / t_4)) + (t_3 * (((4.0d0 * (3.0d0 - (2.0d0 * x2))) + (x1 * (4.0d0 - (x1 * 6.0d0)))) + (t_6 * (3.0d0 - t_5))))))))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (t_0 + (2.0 * x2)) - x1;
double t_2 = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = -1.0 - (x1 * x1);
double t_5 = t_1 / t_3;
double t_6 = (x1 * 2.0) * t_5;
double t_7 = x1 * (x1 * x1);
double tmp;
if (x1 <= -5e+103) {
tmp = t_2;
} else if (x1 <= -1.7) {
tmp = x1 + ((x1 + (((t_3 * ((t_6 * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_0 * t_5)) + t_7)) + 9.0);
} else if (x1 <= 1.8e-12) {
tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0))))));
} else if (x1 <= 4e+82) {
tmp = x1 + ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_4)) + (x1 + (t_7 - ((t_0 * (t_1 / t_4)) + (t_3 * (((4.0 * (3.0 - (2.0 * x2))) + (x1 * (4.0 - (x1 * 6.0)))) + (t_6 * (3.0 - t_5))))))));
} else {
tmp = t_2;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (t_0 + (2.0 * x2)) - x1 t_2 = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) t_3 = (x1 * x1) + 1.0 t_4 = -1.0 - (x1 * x1) t_5 = t_1 / t_3 t_6 = (x1 * 2.0) * t_5 t_7 = x1 * (x1 * x1) tmp = 0 if x1 <= -5e+103: tmp = t_2 elif x1 <= -1.7: tmp = x1 + ((x1 + (((t_3 * ((t_6 * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_0 * t_5)) + t_7)) + 9.0) elif x1 <= 1.8e-12: tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0)))))) elif x1 <= 4e+82: tmp = x1 + ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_4)) + (x1 + (t_7 - ((t_0 * (t_1 / t_4)) + (t_3 * (((4.0 * (3.0 - (2.0 * x2))) + (x1 * (4.0 - (x1 * 6.0)))) + (t_6 * (3.0 - t_5)))))))) else: tmp = t_2 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) t_2 = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(-1.0 - Float64(x1 * x1)) t_5 = Float64(t_1 / t_3) t_6 = Float64(Float64(x1 * 2.0) * t_5) t_7 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -5e+103) tmp = t_2; elseif (x1 <= -1.7) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_3 * Float64(Float64(t_6 * Float64(t_5 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)))) + Float64(t_0 * t_5)) + t_7)) + 9.0)); elseif (x1 <= 1.8e-12) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(x1 * 6.0) - 12.0))))))); elseif (x1 <= 4e+82) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x1 + Float64(Float64(2.0 * x2) - t_0)) / t_4)) + Float64(x1 + Float64(t_7 - Float64(Float64(t_0 * Float64(t_1 / t_4)) + Float64(t_3 * Float64(Float64(Float64(4.0 * Float64(3.0 - Float64(2.0 * x2))) + Float64(x1 * Float64(4.0 - Float64(x1 * 6.0)))) + Float64(t_6 * Float64(3.0 - t_5))))))))); else tmp = t_2; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (t_0 + (2.0 * x2)) - x1; t_2 = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); t_3 = (x1 * x1) + 1.0; t_4 = -1.0 - (x1 * x1); t_5 = t_1 / t_3; t_6 = (x1 * 2.0) * t_5; t_7 = x1 * (x1 * x1); tmp = 0.0; if (x1 <= -5e+103) tmp = t_2; elseif (x1 <= -1.7) tmp = x1 + ((x1 + (((t_3 * ((t_6 * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_0 * t_5)) + t_7)) + 9.0); elseif (x1 <= 1.8e-12) tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0)))))); elseif (x1 <= 4e+82) tmp = x1 + ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_4)) + (x1 + (t_7 - ((t_0 * (t_1 / t_4)) + (t_3 * (((4.0 * (3.0 - (2.0 * x2))) + (x1 * (4.0 - (x1 * 6.0)))) + (t_6 * (3.0 - t_5)))))))); else tmp = t_2; 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[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$1 / t$95$3), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+103], t$95$2, If[LessEqual[x1, -1.7], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$3 * N[(N[(t$95$6 * N[(t$95$5 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$5), $MachinePrecision]), $MachinePrecision] + t$95$7), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.8e-12], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4e+82], N[(x1 + N[(N[(3.0 * N[(N[(x1 + N[(N[(2.0 * x2), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$7 - N[(N[(t$95$0 * N[(t$95$1 / t$95$4), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[(N[(N[(4.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(4.0 - N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$6 * N[(3.0 - t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := \left(t\_0 + 2 \cdot x2\right) - x1\\
t_2 := x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := -1 - x1 \cdot x1\\
t_5 := \frac{t\_1}{t\_3}\\
t_6 := \left(x1 \cdot 2\right) \cdot t\_5\\
t_7 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+103}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x1 \leq -1.7:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t\_3 \cdot \left(t\_6 \cdot \left(t\_5 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_5 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_5\right) + t\_7\right)\right) + 9\right)\\
\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{-12}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 \cdot \left(x1 \cdot 9 - 2\right) + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(x1 \cdot 6 - 12\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{+82}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t\_0\right)}{t\_4} + \left(x1 + \left(t\_7 - \left(t\_0 \cdot \frac{t\_1}{t\_4} + t\_3 \cdot \left(\left(4 \cdot \left(3 - 2 \cdot x2\right) + x1 \cdot \left(4 - x1 \cdot 6\right)\right) + t\_6 \cdot \left(3 - t\_5\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x1 < -5e103 or 3.9999999999999999e82 < x1 Initial program 13.8%
Taylor expanded in x1 around inf 23.0%
Taylor expanded in x1 around inf 100.0%
if -5e103 < x1 < -1.69999999999999996Initial program 99.5%
Taylor expanded in x1 around inf 99.5%
if -1.69999999999999996 < x1 < 1.8e-12Initial program 99.4%
Taylor expanded in x1 around 0 86.7%
Taylor expanded in x1 around 0 86.7%
Taylor expanded in x1 around 0 87.1%
Taylor expanded in x2 around 0 99.2%
if 1.8e-12 < x1 < 3.9999999999999999e82Initial program 98.9%
Taylor expanded in x1 around -inf 99.0%
Taylor expanded in x1 around 0 99.4%
Final simplification99.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_0 t_3))
(* x1 (* x1 x1))))
9.0))))
(if (<= x1 -5.6e+102)
t_1
(if (<= x1 -1.7)
t_4
(if (<= x1 1.8e-12)
(+
x1
(+
(* x2 -6.0)
(+
(* x1 (- (* x1 9.0) 2.0))
(* x2 (+ (* 8.0 (* x1 x2)) (* x1 (- (* x1 6.0) 12.0)))))))
(if (<= x1 1e+81) t_4 t_1))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + 9.0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = t_1;
} else if (x1 <= -1.7) {
tmp = t_4;
} else if (x1 <= 1.8e-12) {
tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0))))));
} else if (x1 <= 1e+81) {
tmp = t_4;
} 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 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_0 + (2.0d0 * x2)) - x1) / t_2
t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0d0) * t_3) * (t_3 - 3.0d0)) + ((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + 9.0d0)
if (x1 <= (-5.6d+102)) then
tmp = t_1
else if (x1 <= (-1.7d0)) then
tmp = t_4
else if (x1 <= 1.8d-12) then
tmp = x1 + ((x2 * (-6.0d0)) + ((x1 * ((x1 * 9.0d0) - 2.0d0)) + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * ((x1 * 6.0d0) - 12.0d0))))))
else if (x1 <= 1d+81) then
tmp = t_4
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 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + 9.0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = t_1;
} else if (x1 <= -1.7) {
tmp = t_4;
} else if (x1 <= 1.8e-12) {
tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0))))));
} else if (x1 <= 1e+81) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2 t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + 9.0) tmp = 0 if x1 <= -5.6e+102: tmp = t_1 elif x1 <= -1.7: tmp = t_4 elif x1 <= 1.8e-12: tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0)))))) elif x1 <= 1e+81: tmp = t_4 else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.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(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + 9.0)) tmp = 0.0 if (x1 <= -5.6e+102) tmp = t_1; elseif (x1 <= -1.7) tmp = t_4; elseif (x1 <= 1.8e-12) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(x1 * 6.0) - 12.0))))))); elseif (x1 <= 1e+81) tmp = t_4; else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2; t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + 9.0); tmp = 0.0; if (x1 <= -5.6e+102) tmp = t_1; elseif (x1 <= -1.7) tmp = t_4; elseif (x1 <= 1.8e-12) tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0)))))); elseif (x1 <= 1e+81) tmp = t_4; 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[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], t$95$1, If[LessEqual[x1, -1.7], t$95$4, If[LessEqual[x1, 1.8e-12], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+81], t$95$4, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 9\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -1.7:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{-12}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 \cdot \left(x1 \cdot 9 - 2\right) + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(x1 \cdot 6 - 12\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+81}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102 or 9.99999999999999921e80 < x1 Initial program 13.8%
Taylor expanded in x1 around inf 23.0%
Taylor expanded in x1 around inf 100.0%
if -5.60000000000000037e102 < x1 < -1.69999999999999996 or 1.8e-12 < x1 < 9.99999999999999921e80Initial program 99.2%
Taylor expanded in x1 around inf 99.2%
if -1.69999999999999996 < x1 < 1.8e-12Initial program 99.4%
Taylor expanded in x1 around 0 86.7%
Taylor expanded in x1 around 0 86.7%
Taylor expanded in x1 around 0 87.1%
Taylor expanded in x2 around 0 99.2%
Final simplification99.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- -1.0 (* x1 x1)))
(t_3 (+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))
(t_4 (- (+ t_1 (* 2.0 x2)) x1))
(t_5 (/ t_4 t_0)))
(if (<= x1 -1.1e+74)
t_3
(if (<= x1 -1.7)
(+
x1
(+
(* 3.0 (/ (+ x1 (- (* 2.0 x2) t_1)) t_2))
(+
x1
(-
(* x1 (* x1 x1))
(+
(* t_1 (/ t_4 t_2))
(* t_0 (- (* (* (* x1 2.0) t_5) (- 3.0 t_5)) (* x2 8.0))))))))
(if (<= x1 8.5e+34)
(+
x1
(+
(* x2 -6.0)
(+
(* x1 (- (* x1 9.0) 2.0))
(* x2 (+ (* 8.0 (* x1 x2)) (* x1 (- (* x1 6.0) 12.0)))))))
t_3)))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = -1.0 - (x1 * x1);
double t_3 = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
double t_4 = (t_1 + (2.0 * x2)) - x1;
double t_5 = t_4 / t_0;
double tmp;
if (x1 <= -1.1e+74) {
tmp = t_3;
} else if (x1 <= -1.7) {
tmp = x1 + ((3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_2)) + (x1 + ((x1 * (x1 * x1)) - ((t_1 * (t_4 / t_2)) + (t_0 * ((((x1 * 2.0) * t_5) * (3.0 - t_5)) - (x2 * 8.0)))))));
} else if (x1 <= 8.5e+34) {
tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0))))));
} else {
tmp = t_3;
}
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) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = (-1.0d0) - (x1 * x1)
t_3 = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
t_4 = (t_1 + (2.0d0 * x2)) - x1
t_5 = t_4 / t_0
if (x1 <= (-1.1d+74)) then
tmp = t_3
else if (x1 <= (-1.7d0)) then
tmp = x1 + ((3.0d0 * ((x1 + ((2.0d0 * x2) - t_1)) / t_2)) + (x1 + ((x1 * (x1 * x1)) - ((t_1 * (t_4 / t_2)) + (t_0 * ((((x1 * 2.0d0) * t_5) * (3.0d0 - t_5)) - (x2 * 8.0d0)))))))
else if (x1 <= 8.5d+34) then
tmp = x1 + ((x2 * (-6.0d0)) + ((x1 * ((x1 * 9.0d0) - 2.0d0)) + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * ((x1 * 6.0d0) - 12.0d0))))))
else
tmp = t_3
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 = -1.0 - (x1 * x1);
double t_3 = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
double t_4 = (t_1 + (2.0 * x2)) - x1;
double t_5 = t_4 / t_0;
double tmp;
if (x1 <= -1.1e+74) {
tmp = t_3;
} else if (x1 <= -1.7) {
tmp = x1 + ((3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_2)) + (x1 + ((x1 * (x1 * x1)) - ((t_1 * (t_4 / t_2)) + (t_0 * ((((x1 * 2.0) * t_5) * (3.0 - t_5)) - (x2 * 8.0)))))));
} else if (x1 <= 8.5e+34) {
tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0))))));
} else {
tmp = t_3;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = -1.0 - (x1 * x1) t_3 = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) t_4 = (t_1 + (2.0 * x2)) - x1 t_5 = t_4 / t_0 tmp = 0 if x1 <= -1.1e+74: tmp = t_3 elif x1 <= -1.7: tmp = x1 + ((3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_2)) + (x1 + ((x1 * (x1 * x1)) - ((t_1 * (t_4 / t_2)) + (t_0 * ((((x1 * 2.0) * t_5) * (3.0 - t_5)) - (x2 * 8.0))))))) elif x1 <= 8.5e+34: tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0)))))) else: tmp = t_3 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(-1.0 - Float64(x1 * x1)) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)) t_4 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) t_5 = Float64(t_4 / t_0) tmp = 0.0 if (x1 <= -1.1e+74) tmp = t_3; elseif (x1 <= -1.7) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x1 + Float64(Float64(2.0 * x2) - t_1)) / t_2)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) - Float64(Float64(t_1 * Float64(t_4 / t_2)) + Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_5) * Float64(3.0 - t_5)) - Float64(x2 * 8.0)))))))); elseif (x1 <= 8.5e+34) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(x1 * 6.0) - 12.0))))))); else tmp = t_3; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = -1.0 - (x1 * x1); t_3 = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); t_4 = (t_1 + (2.0 * x2)) - x1; t_5 = t_4 / t_0; tmp = 0.0; if (x1 <= -1.1e+74) tmp = t_3; elseif (x1 <= -1.7) tmp = x1 + ((3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_2)) + (x1 + ((x1 * (x1 * x1)) - ((t_1 * (t_4 / t_2)) + (t_0 * ((((x1 * 2.0) * t_5) * (3.0 - t_5)) - (x2 * 8.0))))))); elseif (x1 <= 8.5e+34) tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0)))))); else tmp = t_3; 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[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / t$95$0), $MachinePrecision]}, If[LessEqual[x1, -1.1e+74], t$95$3, If[LessEqual[x1, -1.7], N[(x1 + N[(N[(3.0 * N[(N[(x1 + N[(N[(2.0 * x2), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$1 * N[(t$95$4 / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision] * N[(3.0 - t$95$5), $MachinePrecision]), $MachinePrecision] - N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8.5e+34], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := -1 - x1 \cdot x1\\
t_3 := x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
t_4 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_5 := \frac{t\_4}{t\_0}\\
\mathbf{if}\;x1 \leq -1.1 \cdot 10^{+74}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x1 \leq -1.7:\\
\;\;\;\;x1 + \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t\_1\right)}{t\_2} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) - \left(t\_1 \cdot \frac{t\_4}{t\_2} + t\_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_5\right) \cdot \left(3 - t\_5\right) - x2 \cdot 8\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 8.5 \cdot 10^{+34}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 \cdot \left(x1 \cdot 9 - 2\right) + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(x1 \cdot 6 - 12\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if x1 < -1.1000000000000001e74 or 8.5000000000000003e34 < x1 Initial program 26.4%
Taylor expanded in x1 around inf 30.6%
Taylor expanded in x1 around inf 96.3%
if -1.1000000000000001e74 < x1 < -1.69999999999999996Initial program 99.1%
Taylor expanded in x1 around -inf 98.0%
Taylor expanded in x2 around inf 67.7%
*-commutative67.7%
Simplified67.7%
if -1.69999999999999996 < x1 < 8.5000000000000003e34Initial program 99.4%
Taylor expanded in x1 around 0 84.9%
Taylor expanded in x1 around 0 84.9%
Taylor expanded in x1 around 0 85.2%
Taylor expanded in x2 around 0 96.5%
Final simplification95.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (- 3.0 (* 2.0 x2)))
(t_3 (* 4.0 (* x2 t_2)))
(t_4 (* x1 (* x1 3.0)))
(t_5 (/ (- (+ t_4 (* 2.0 x2)) x1) t_1))
(t_6 (* (* x1 x1) (- 6.0 (* t_5 4.0)))))
(if (<= x1 -5e+153)
(+ x1 (- (* x2 -6.0) (* x1 (- 2.0 (* x1 9.0)))))
(if (<= x1 -5.6e+102)
(+
x1
(+
9.0
(-
x1
(*
x1
(+
(*
x1
(+
6.0
(+
(* 2.0 (- (- (* 2.0 x2) 3.0) (* x2 -2.0)))
(-
(-
(*
x1
(+
6.0
(+
t_3
(* 2.0 (- -1.0 (* 2.0 (* x2 (+ 3.0 (* x2 -2.0)))))))))
(* x2 8.0))
(* x2 6.0)))))
t_3)))))
(if (<= x1 -4e-5)
(+
x1
(-
9.0
(-
(-
(+
(* t_4 (- (/ (+ 1.0 (/ t_2 x1)) x1) 3.0))
(* t_1 (+ t_6 (* (- t_5 3.0) (* (* x1 2.0) (- x1 (* 2.0 x2)))))))
t_0)
x1)))
(if (<= x1 9.2e+34)
(+
x1
(+
(* x2 -6.0)
(+
(* x1 (- (* x1 9.0) 2.0))
(* x2 (+ (* 8.0 (* x1 x2)) (* x1 (- (* x1 6.0) 12.0)))))))
(if (<= x1 5e+102)
(+
x1
(+
9.0
(+
x1
(+
t_0
(+ (* t_4 t_5) (* (- t_6 (* x1 2.0)) (- -1.0 (* x1 x1))))))))
(+ x1 (+ x1 (* 3.0 (* x1 (+ -1.0 (* x1 (+ x1 3.0))))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 - (2.0 * x2);
double t_3 = 4.0 * (x2 * t_2);
double t_4 = x1 * (x1 * 3.0);
double t_5 = ((t_4 + (2.0 * x2)) - x1) / t_1;
double t_6 = (x1 * x1) * (6.0 - (t_5 * 4.0));
double tmp;
if (x1 <= -5e+153) {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0))));
} else if (x1 <= -5.6e+102) {
tmp = x1 + (9.0 + (x1 - (x1 * ((x1 * (6.0 + ((2.0 * (((2.0 * x2) - 3.0) - (x2 * -2.0))) + (((x1 * (6.0 + (t_3 + (2.0 * (-1.0 - (2.0 * (x2 * (3.0 + (x2 * -2.0))))))))) - (x2 * 8.0)) - (x2 * 6.0))))) + t_3))));
} else if (x1 <= -4e-5) {
tmp = x1 + (9.0 - ((((t_4 * (((1.0 + (t_2 / x1)) / x1) - 3.0)) + (t_1 * (t_6 + ((t_5 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2))))))) - t_0) - x1));
} else if (x1 <= 9.2e+34) {
tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0))))));
} else if (x1 <= 5e+102) {
tmp = x1 + (9.0 + (x1 + (t_0 + ((t_4 * t_5) + ((t_6 - (x1 * 2.0)) * (-1.0 - (x1 * x1)))))));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * (-1.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) :: 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) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = (x1 * x1) + 1.0d0
t_2 = 3.0d0 - (2.0d0 * x2)
t_3 = 4.0d0 * (x2 * t_2)
t_4 = x1 * (x1 * 3.0d0)
t_5 = ((t_4 + (2.0d0 * x2)) - x1) / t_1
t_6 = (x1 * x1) * (6.0d0 - (t_5 * 4.0d0))
if (x1 <= (-5d+153)) then
tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 - (x1 * 9.0d0))))
else if (x1 <= (-5.6d+102)) then
tmp = x1 + (9.0d0 + (x1 - (x1 * ((x1 * (6.0d0 + ((2.0d0 * (((2.0d0 * x2) - 3.0d0) - (x2 * (-2.0d0)))) + (((x1 * (6.0d0 + (t_3 + (2.0d0 * ((-1.0d0) - (2.0d0 * (x2 * (3.0d0 + (x2 * (-2.0d0)))))))))) - (x2 * 8.0d0)) - (x2 * 6.0d0))))) + t_3))))
else if (x1 <= (-4d-5)) then
tmp = x1 + (9.0d0 - ((((t_4 * (((1.0d0 + (t_2 / x1)) / x1) - 3.0d0)) + (t_1 * (t_6 + ((t_5 - 3.0d0) * ((x1 * 2.0d0) * (x1 - (2.0d0 * x2))))))) - t_0) - x1))
else if (x1 <= 9.2d+34) then
tmp = x1 + ((x2 * (-6.0d0)) + ((x1 * ((x1 * 9.0d0) - 2.0d0)) + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * ((x1 * 6.0d0) - 12.0d0))))))
else if (x1 <= 5d+102) then
tmp = x1 + (9.0d0 + (x1 + (t_0 + ((t_4 * t_5) + ((t_6 - (x1 * 2.0d0)) * ((-1.0d0) - (x1 * x1)))))))
else
tmp = x1 + (x1 + (3.0d0 * (x1 * ((-1.0d0) + (x1 * (x1 + 3.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 - (2.0 * x2);
double t_3 = 4.0 * (x2 * t_2);
double t_4 = x1 * (x1 * 3.0);
double t_5 = ((t_4 + (2.0 * x2)) - x1) / t_1;
double t_6 = (x1 * x1) * (6.0 - (t_5 * 4.0));
double tmp;
if (x1 <= -5e+153) {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0))));
} else if (x1 <= -5.6e+102) {
tmp = x1 + (9.0 + (x1 - (x1 * ((x1 * (6.0 + ((2.0 * (((2.0 * x2) - 3.0) - (x2 * -2.0))) + (((x1 * (6.0 + (t_3 + (2.0 * (-1.0 - (2.0 * (x2 * (3.0 + (x2 * -2.0))))))))) - (x2 * 8.0)) - (x2 * 6.0))))) + t_3))));
} else if (x1 <= -4e-5) {
tmp = x1 + (9.0 - ((((t_4 * (((1.0 + (t_2 / x1)) / x1) - 3.0)) + (t_1 * (t_6 + ((t_5 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2))))))) - t_0) - x1));
} else if (x1 <= 9.2e+34) {
tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0))))));
} else if (x1 <= 5e+102) {
tmp = x1 + (9.0 + (x1 + (t_0 + ((t_4 * t_5) + ((t_6 - (x1 * 2.0)) * (-1.0 - (x1 * x1)))))));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 3.0))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = (x1 * x1) + 1.0 t_2 = 3.0 - (2.0 * x2) t_3 = 4.0 * (x2 * t_2) t_4 = x1 * (x1 * 3.0) t_5 = ((t_4 + (2.0 * x2)) - x1) / t_1 t_6 = (x1 * x1) * (6.0 - (t_5 * 4.0)) tmp = 0 if x1 <= -5e+153: tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0)))) elif x1 <= -5.6e+102: tmp = x1 + (9.0 + (x1 - (x1 * ((x1 * (6.0 + ((2.0 * (((2.0 * x2) - 3.0) - (x2 * -2.0))) + (((x1 * (6.0 + (t_3 + (2.0 * (-1.0 - (2.0 * (x2 * (3.0 + (x2 * -2.0))))))))) - (x2 * 8.0)) - (x2 * 6.0))))) + t_3)))) elif x1 <= -4e-5: tmp = x1 + (9.0 - ((((t_4 * (((1.0 + (t_2 / x1)) / x1) - 3.0)) + (t_1 * (t_6 + ((t_5 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2))))))) - t_0) - x1)) elif x1 <= 9.2e+34: tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0)))))) elif x1 <= 5e+102: tmp = x1 + (9.0 + (x1 + (t_0 + ((t_4 * t_5) + ((t_6 - (x1 * 2.0)) * (-1.0 - (x1 * x1))))))) else: tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 3.0)))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(3.0 - Float64(2.0 * x2)) t_3 = Float64(4.0 * Float64(x2 * t_2)) t_4 = Float64(x1 * Float64(x1 * 3.0)) t_5 = Float64(Float64(Float64(t_4 + Float64(2.0 * x2)) - x1) / t_1) t_6 = Float64(Float64(x1 * x1) * Float64(6.0 - Float64(t_5 * 4.0))) tmp = 0.0 if (x1 <= -5e+153) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 - Float64(x1 * 9.0))))); elseif (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(9.0 + Float64(x1 - Float64(x1 * Float64(Float64(x1 * Float64(6.0 + Float64(Float64(2.0 * Float64(Float64(Float64(2.0 * x2) - 3.0) - Float64(x2 * -2.0))) + Float64(Float64(Float64(x1 * Float64(6.0 + Float64(t_3 + Float64(2.0 * Float64(-1.0 - Float64(2.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0))))))))) - Float64(x2 * 8.0)) - Float64(x2 * 6.0))))) + t_3))))); elseif (x1 <= -4e-5) tmp = Float64(x1 + Float64(9.0 - Float64(Float64(Float64(Float64(t_4 * Float64(Float64(Float64(1.0 + Float64(t_2 / x1)) / x1) - 3.0)) + Float64(t_1 * Float64(t_6 + Float64(Float64(t_5 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(x1 - Float64(2.0 * x2))))))) - t_0) - x1))); elseif (x1 <= 9.2e+34) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(x1 * 6.0) - 12.0))))))); elseif (x1 <= 5e+102) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_0 + Float64(Float64(t_4 * t_5) + Float64(Float64(t_6 - Float64(x1 * 2.0)) * Float64(-1.0 - Float64(x1 * x1)))))))); else tmp = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(x1 + 3.0))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = (x1 * x1) + 1.0; t_2 = 3.0 - (2.0 * x2); t_3 = 4.0 * (x2 * t_2); t_4 = x1 * (x1 * 3.0); t_5 = ((t_4 + (2.0 * x2)) - x1) / t_1; t_6 = (x1 * x1) * (6.0 - (t_5 * 4.0)); tmp = 0.0; if (x1 <= -5e+153) tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0)))); elseif (x1 <= -5.6e+102) tmp = x1 + (9.0 + (x1 - (x1 * ((x1 * (6.0 + ((2.0 * (((2.0 * x2) - 3.0) - (x2 * -2.0))) + (((x1 * (6.0 + (t_3 + (2.0 * (-1.0 - (2.0 * (x2 * (3.0 + (x2 * -2.0))))))))) - (x2 * 8.0)) - (x2 * 6.0))))) + t_3)))); elseif (x1 <= -4e-5) tmp = x1 + (9.0 - ((((t_4 * (((1.0 + (t_2 / x1)) / x1) - 3.0)) + (t_1 * (t_6 + ((t_5 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2))))))) - t_0) - x1)); elseif (x1 <= 9.2e+34) tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0)))))); elseif (x1 <= 5e+102) tmp = x1 + (9.0 + (x1 + (t_0 + ((t_4 * t_5) + ((t_6 - (x1 * 2.0)) * (-1.0 - (x1 * x1))))))); else tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 3.0)))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(4.0 * N[(x2 * t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$4 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(t$95$5 * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+153], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5.6e+102], N[(x1 + N[(9.0 + N[(x1 - N[(x1 * N[(N[(x1 * N[(6.0 + N[(N[(2.0 * N[(N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision] - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * N[(6.0 + N[(t$95$3 + N[(2.0 * N[(-1.0 - N[(2.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision] - N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -4e-5], N[(x1 + N[(9.0 - N[(N[(N[(N[(t$95$4 * N[(N[(N[(1.0 + N[(t$95$2 / x1), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(t$95$6 + N[(N[(t$95$5 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(x1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9.2e+34], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+102], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$0 + N[(N[(t$95$4 * t$95$5), $MachinePrecision] + N[(N[(t$95$6 - N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(-1.0 + N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := 3 - 2 \cdot x2\\
t_3 := 4 \cdot \left(x2 \cdot t\_2\right)\\
t_4 := x1 \cdot \left(x1 \cdot 3\right)\\
t_5 := \frac{\left(t\_4 + 2 \cdot x2\right) - x1}{t\_1}\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(6 - t\_5 \cdot 4\right)\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - x1 \cdot 9\right)\right)\\
\mathbf{elif}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(9 + \left(x1 - x1 \cdot \left(x1 \cdot \left(6 + \left(2 \cdot \left(\left(2 \cdot x2 - 3\right) - x2 \cdot -2\right) + \left(\left(x1 \cdot \left(6 + \left(t\_3 + 2 \cdot \left(-1 - 2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right)\right)\right)\right) - x2 \cdot 8\right) - x2 \cdot 6\right)\right)\right) + t\_3\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -4 \cdot 10^{-5}:\\
\;\;\;\;x1 + \left(9 - \left(\left(\left(t\_4 \cdot \left(\frac{1 + \frac{t\_2}{x1}}{x1} - 3\right) + t\_1 \cdot \left(t\_6 + \left(t\_5 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x1 - 2 \cdot x2\right)\right)\right)\right) - t\_0\right) - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 9.2 \cdot 10^{+34}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 \cdot \left(x1 \cdot 9 - 2\right) + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(x1 \cdot 6 - 12\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_0 + \left(t\_4 \cdot t\_5 + \left(t\_6 - x1 \cdot 2\right) \cdot \left(-1 - x1 \cdot x1\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(-1 + x1 \cdot \left(x1 + 3\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.00000000000000018e153Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 73.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -5.00000000000000018e153 < x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
+-commutative0.0%
mul-1-neg0.0%
sub-neg0.0%
Simplified0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 100.0%
if -5.60000000000000037e102 < x1 < -4.00000000000000033e-5Initial program 99.5%
Taylor expanded in x1 around 0 65.7%
+-commutative65.7%
mul-1-neg65.7%
sub-neg65.7%
Simplified65.7%
Taylor expanded in x1 around inf 65.3%
Taylor expanded in x1 around -inf 65.7%
if -4.00000000000000033e-5 < x1 < 9.1999999999999993e34Initial program 99.4%
Taylor expanded in x1 around 0 85.2%
Taylor expanded in x1 around 0 85.2%
Taylor expanded in x1 around 0 85.5%
Taylor expanded in x2 around 0 97.0%
if 9.1999999999999993e34 < x1 < 5e102Initial program 99.1%
Taylor expanded in x1 around 0 63.3%
+-commutative63.3%
mul-1-neg63.3%
sub-neg63.3%
Simplified63.3%
Taylor expanded in x1 around inf 63.3%
Taylor expanded in x1 around inf 99.1%
*-commutative99.1%
Simplified99.1%
if 5e102 < x1 Initial program 21.3%
Taylor expanded in x1 around 0 5.0%
Taylor expanded in x1 around 0 85.1%
Taylor expanded in x2 around 0 100.0%
Final simplification95.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (/ (- (+ t_0 (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(t_2 (* 4.0 (* x2 (- 3.0 (* 2.0 x2)))))
(t_3
(+
x1
(+
9.0
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_1)
(*
(- (* (* x1 x1) (- 6.0 (* t_1 4.0))) (* x1 2.0))
(- -1.0 (* x1 x1))))))))))
(if (<= x1 -4.5e+153)
(+ x1 (- (* x2 -6.0) (* x1 (- 2.0 (* x1 9.0)))))
(if (<= x1 -5.6e+102)
(+
x1
(+
9.0
(-
x1
(*
x1
(+
(*
x1
(+
6.0
(+
(* 2.0 (- (- (* 2.0 x2) 3.0) (* x2 -2.0)))
(-
(-
(*
x1
(+
6.0
(+
t_2
(* 2.0 (- -1.0 (* 2.0 (* x2 (+ 3.0 (* x2 -2.0)))))))))
(* x2 8.0))
(* x2 6.0)))))
t_2)))))
(if (<= x1 -1.25e+31)
t_3
(if (<= x1 8.5e+34)
(+
x1
(+
(* x2 -6.0)
(+
(* x1 (- (* x1 9.0) 2.0))
(* x2 (+ (* 8.0 (* x1 x2)) (* x1 (- (* x1 6.0) 12.0)))))))
(if (<= x1 5e+102)
t_3
(+ x1 (+ x1 (* 3.0 (* x1 (+ -1.0 (* x1 (+ x1 3.0))))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = ((t_0 + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0);
double t_2 = 4.0 * (x2 * (3.0 - (2.0 * x2)));
double t_3 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_1) + ((((x1 * x1) * (6.0 - (t_1 * 4.0))) - (x1 * 2.0)) * (-1.0 - (x1 * x1)))))));
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0))));
} else if (x1 <= -5.6e+102) {
tmp = x1 + (9.0 + (x1 - (x1 * ((x1 * (6.0 + ((2.0 * (((2.0 * x2) - 3.0) - (x2 * -2.0))) + (((x1 * (6.0 + (t_2 + (2.0 * (-1.0 - (2.0 * (x2 * (3.0 + (x2 * -2.0))))))))) - (x2 * 8.0)) - (x2 * 6.0))))) + t_2))));
} else if (x1 <= -1.25e+31) {
tmp = t_3;
} else if (x1 <= 8.5e+34) {
tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0))))));
} else if (x1 <= 5e+102) {
tmp = t_3;
} else {
tmp = x1 + (x1 + (3.0 * (x1 * (-1.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) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = ((t_0 + (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0)
t_2 = 4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2)))
t_3 = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_1) + ((((x1 * x1) * (6.0d0 - (t_1 * 4.0d0))) - (x1 * 2.0d0)) * ((-1.0d0) - (x1 * x1)))))))
if (x1 <= (-4.5d+153)) then
tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 - (x1 * 9.0d0))))
else if (x1 <= (-5.6d+102)) then
tmp = x1 + (9.0d0 + (x1 - (x1 * ((x1 * (6.0d0 + ((2.0d0 * (((2.0d0 * x2) - 3.0d0) - (x2 * (-2.0d0)))) + (((x1 * (6.0d0 + (t_2 + (2.0d0 * ((-1.0d0) - (2.0d0 * (x2 * (3.0d0 + (x2 * (-2.0d0)))))))))) - (x2 * 8.0d0)) - (x2 * 6.0d0))))) + t_2))))
else if (x1 <= (-1.25d+31)) then
tmp = t_3
else if (x1 <= 8.5d+34) then
tmp = x1 + ((x2 * (-6.0d0)) + ((x1 * ((x1 * 9.0d0) - 2.0d0)) + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * ((x1 * 6.0d0) - 12.0d0))))))
else if (x1 <= 5d+102) then
tmp = t_3
else
tmp = x1 + (x1 + (3.0d0 * (x1 * ((-1.0d0) + (x1 * (x1 + 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 = ((t_0 + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0);
double t_2 = 4.0 * (x2 * (3.0 - (2.0 * x2)));
double t_3 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_1) + ((((x1 * x1) * (6.0 - (t_1 * 4.0))) - (x1 * 2.0)) * (-1.0 - (x1 * x1)))))));
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0))));
} else if (x1 <= -5.6e+102) {
tmp = x1 + (9.0 + (x1 - (x1 * ((x1 * (6.0 + ((2.0 * (((2.0 * x2) - 3.0) - (x2 * -2.0))) + (((x1 * (6.0 + (t_2 + (2.0 * (-1.0 - (2.0 * (x2 * (3.0 + (x2 * -2.0))))))))) - (x2 * 8.0)) - (x2 * 6.0))))) + t_2))));
} else if (x1 <= -1.25e+31) {
tmp = t_3;
} else if (x1 <= 8.5e+34) {
tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0))))));
} else if (x1 <= 5e+102) {
tmp = t_3;
} else {
tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 3.0))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = ((t_0 + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0) t_2 = 4.0 * (x2 * (3.0 - (2.0 * x2))) t_3 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_1) + ((((x1 * x1) * (6.0 - (t_1 * 4.0))) - (x1 * 2.0)) * (-1.0 - (x1 * x1))))))) tmp = 0 if x1 <= -4.5e+153: tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0)))) elif x1 <= -5.6e+102: tmp = x1 + (9.0 + (x1 - (x1 * ((x1 * (6.0 + ((2.0 * (((2.0 * x2) - 3.0) - (x2 * -2.0))) + (((x1 * (6.0 + (t_2 + (2.0 * (-1.0 - (2.0 * (x2 * (3.0 + (x2 * -2.0))))))))) - (x2 * 8.0)) - (x2 * 6.0))))) + t_2)))) elif x1 <= -1.25e+31: tmp = t_3 elif x1 <= 8.5e+34: tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0)))))) elif x1 <= 5e+102: tmp = t_3 else: tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 3.0)))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0)) t_2 = Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))) t_3 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_1) + Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 - Float64(t_1 * 4.0))) - Float64(x1 * 2.0)) * Float64(-1.0 - Float64(x1 * x1)))))))) tmp = 0.0 if (x1 <= -4.5e+153) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 - Float64(x1 * 9.0))))); elseif (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(9.0 + Float64(x1 - Float64(x1 * Float64(Float64(x1 * Float64(6.0 + Float64(Float64(2.0 * Float64(Float64(Float64(2.0 * x2) - 3.0) - Float64(x2 * -2.0))) + Float64(Float64(Float64(x1 * Float64(6.0 + Float64(t_2 + Float64(2.0 * Float64(-1.0 - Float64(2.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0))))))))) - Float64(x2 * 8.0)) - Float64(x2 * 6.0))))) + t_2))))); elseif (x1 <= -1.25e+31) tmp = t_3; elseif (x1 <= 8.5e+34) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(x1 * 6.0) - 12.0))))))); elseif (x1 <= 5e+102) tmp = t_3; else tmp = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(x1 + 3.0))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = ((t_0 + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0); t_2 = 4.0 * (x2 * (3.0 - (2.0 * x2))); t_3 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_1) + ((((x1 * x1) * (6.0 - (t_1 * 4.0))) - (x1 * 2.0)) * (-1.0 - (x1 * x1))))))); tmp = 0.0; if (x1 <= -4.5e+153) tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0)))); elseif (x1 <= -5.6e+102) tmp = x1 + (9.0 + (x1 - (x1 * ((x1 * (6.0 + ((2.0 * (((2.0 * x2) - 3.0) - (x2 * -2.0))) + (((x1 * (6.0 + (t_2 + (2.0 * (-1.0 - (2.0 * (x2 * (3.0 + (x2 * -2.0))))))))) - (x2 * 8.0)) - (x2 * 6.0))))) + t_2)))); elseif (x1 <= -1.25e+31) tmp = t_3; elseif (x1 <= 8.5e+34) tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0)))))); elseif (x1 <= 5e+102) tmp = t_3; else tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 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[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(9.0 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$1), $MachinePrecision] + N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(t$95$1 * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5.6e+102], N[(x1 + N[(9.0 + N[(x1 - N[(x1 * N[(N[(x1 * N[(6.0 + N[(N[(2.0 * N[(N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision] - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * N[(6.0 + N[(t$95$2 + N[(2.0 * N[(-1.0 - N[(2.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision] - N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.25e+31], t$95$3, If[LessEqual[x1, 8.5e+34], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+102], t$95$3, N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(-1.0 + N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\\
t_2 := 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\\
t_3 := x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot t\_1 + \left(\left(x1 \cdot x1\right) \cdot \left(6 - t\_1 \cdot 4\right) - x1 \cdot 2\right) \cdot \left(-1 - x1 \cdot x1\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - x1 \cdot 9\right)\right)\\
\mathbf{elif}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(9 + \left(x1 - x1 \cdot \left(x1 \cdot \left(6 + \left(2 \cdot \left(\left(2 \cdot x2 - 3\right) - x2 \cdot -2\right) + \left(\left(x1 \cdot \left(6 + \left(t\_2 + 2 \cdot \left(-1 - 2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right)\right)\right)\right) - x2 \cdot 8\right) - x2 \cdot 6\right)\right)\right) + t\_2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -1.25 \cdot 10^{+31}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x1 \leq 8.5 \cdot 10^{+34}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 \cdot \left(x1 \cdot 9 - 2\right) + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(x1 \cdot 6 - 12\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+102}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(-1 + x1 \cdot \left(x1 + 3\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 73.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -4.5000000000000001e153 < x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
+-commutative0.0%
mul-1-neg0.0%
sub-neg0.0%
Simplified0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 100.0%
if -5.60000000000000037e102 < x1 < -1.25000000000000007e31 or 8.5000000000000003e34 < x1 < 5e102Initial program 99.5%
Taylor expanded in x1 around 0 73.8%
+-commutative73.8%
mul-1-neg73.8%
sub-neg73.8%
Simplified73.8%
Taylor expanded in x1 around inf 73.8%
Taylor expanded in x1 around inf 80.4%
*-commutative80.4%
Simplified80.4%
if -1.25000000000000007e31 < x1 < 8.5000000000000003e34Initial program 99.4%
Taylor expanded in x1 around 0 82.8%
Taylor expanded in x1 around 0 82.8%
Taylor expanded in x1 around 0 83.1%
Taylor expanded in x2 around 0 94.1%
if 5e102 < x1 Initial program 21.3%
Taylor expanded in x1 around 0 5.0%
Taylor expanded in x1 around 0 85.1%
Taylor expanded in x2 around 0 100.0%
Final simplification94.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 4.0 (* x2 (- 3.0 (* 2.0 x2))))))
(if (<= x1 -4.5e+153)
(+ x1 (- (* x2 -6.0) (* x1 (- 2.0 (* x1 9.0)))))
(if (<= x1 -1.45e+87)
(+
x1
(+
9.0
(-
x1
(*
x1
(+
(*
x1
(+
6.0
(+
(* 2.0 (- (- (* 2.0 x2) 3.0) (* x2 -2.0)))
(-
(-
(*
x1
(+
6.0
(+
t_0
(* 2.0 (- -1.0 (* 2.0 (* x2 (+ 3.0 (* x2 -2.0)))))))))
(* x2 8.0))
(* x2 6.0)))))
t_0)))))
(if (<= x1 6e+82)
(+
x1
(+
(* x2 -6.0)
(+
(* x1 (- (* x1 9.0) 2.0))
(* x2 (+ (* 8.0 (* x1 x2)) (* x1 (- (* x1 6.0) 12.0)))))))
(+ x1 (+ x1 (* 3.0 (* x1 (+ -1.0 (* x1 (+ x1 3.0))))))))))))
double code(double x1, double x2) {
double t_0 = 4.0 * (x2 * (3.0 - (2.0 * x2)));
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0))));
} else if (x1 <= -1.45e+87) {
tmp = x1 + (9.0 + (x1 - (x1 * ((x1 * (6.0 + ((2.0 * (((2.0 * x2) - 3.0) - (x2 * -2.0))) + (((x1 * (6.0 + (t_0 + (2.0 * (-1.0 - (2.0 * (x2 * (3.0 + (x2 * -2.0))))))))) - (x2 * 8.0)) - (x2 * 6.0))))) + t_0))));
} else if (x1 <= 6e+82) {
tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0))))));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * (-1.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) :: t_0
real(8) :: tmp
t_0 = 4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2)))
if (x1 <= (-4.5d+153)) then
tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 - (x1 * 9.0d0))))
else if (x1 <= (-1.45d+87)) then
tmp = x1 + (9.0d0 + (x1 - (x1 * ((x1 * (6.0d0 + ((2.0d0 * (((2.0d0 * x2) - 3.0d0) - (x2 * (-2.0d0)))) + (((x1 * (6.0d0 + (t_0 + (2.0d0 * ((-1.0d0) - (2.0d0 * (x2 * (3.0d0 + (x2 * (-2.0d0)))))))))) - (x2 * 8.0d0)) - (x2 * 6.0d0))))) + t_0))))
else if (x1 <= 6d+82) then
tmp = x1 + ((x2 * (-6.0d0)) + ((x1 * ((x1 * 9.0d0) - 2.0d0)) + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * ((x1 * 6.0d0) - 12.0d0))))))
else
tmp = x1 + (x1 + (3.0d0 * (x1 * ((-1.0d0) + (x1 * (x1 + 3.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 4.0 * (x2 * (3.0 - (2.0 * x2)));
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0))));
} else if (x1 <= -1.45e+87) {
tmp = x1 + (9.0 + (x1 - (x1 * ((x1 * (6.0 + ((2.0 * (((2.0 * x2) - 3.0) - (x2 * -2.0))) + (((x1 * (6.0 + (t_0 + (2.0 * (-1.0 - (2.0 * (x2 * (3.0 + (x2 * -2.0))))))))) - (x2 * 8.0)) - (x2 * 6.0))))) + t_0))));
} else if (x1 <= 6e+82) {
tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0))))));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 3.0))))));
}
return tmp;
}
def code(x1, x2): t_0 = 4.0 * (x2 * (3.0 - (2.0 * x2))) tmp = 0 if x1 <= -4.5e+153: tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0)))) elif x1 <= -1.45e+87: tmp = x1 + (9.0 + (x1 - (x1 * ((x1 * (6.0 + ((2.0 * (((2.0 * x2) - 3.0) - (x2 * -2.0))) + (((x1 * (6.0 + (t_0 + (2.0 * (-1.0 - (2.0 * (x2 * (3.0 + (x2 * -2.0))))))))) - (x2 * 8.0)) - (x2 * 6.0))))) + t_0)))) elif x1 <= 6e+82: tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0)))))) else: tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 3.0)))))) return tmp
function code(x1, x2) t_0 = Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))) tmp = 0.0 if (x1 <= -4.5e+153) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 - Float64(x1 * 9.0))))); elseif (x1 <= -1.45e+87) tmp = Float64(x1 + Float64(9.0 + Float64(x1 - Float64(x1 * Float64(Float64(x1 * Float64(6.0 + Float64(Float64(2.0 * Float64(Float64(Float64(2.0 * x2) - 3.0) - Float64(x2 * -2.0))) + Float64(Float64(Float64(x1 * Float64(6.0 + Float64(t_0 + Float64(2.0 * Float64(-1.0 - Float64(2.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0))))))))) - Float64(x2 * 8.0)) - Float64(x2 * 6.0))))) + t_0))))); elseif (x1 <= 6e+82) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(x1 * 6.0) - 12.0))))))); else tmp = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(x1 + 3.0))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 4.0 * (x2 * (3.0 - (2.0 * x2))); tmp = 0.0; if (x1 <= -4.5e+153) tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0)))); elseif (x1 <= -1.45e+87) tmp = x1 + (9.0 + (x1 - (x1 * ((x1 * (6.0 + ((2.0 * (((2.0 * x2) - 3.0) - (x2 * -2.0))) + (((x1 * (6.0 + (t_0 + (2.0 * (-1.0 - (2.0 * (x2 * (3.0 + (x2 * -2.0))))))))) - (x2 * 8.0)) - (x2 * 6.0))))) + t_0)))); elseif (x1 <= 6e+82) tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0)))))); else tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 3.0)))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.45e+87], N[(x1 + N[(9.0 + N[(x1 - N[(x1 * N[(N[(x1 * N[(6.0 + N[(N[(2.0 * N[(N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision] - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * N[(6.0 + N[(t$95$0 + N[(2.0 * N[(-1.0 - N[(2.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision] - N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 6e+82], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(-1.0 + N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - x1 \cdot 9\right)\right)\\
\mathbf{elif}\;x1 \leq -1.45 \cdot 10^{+87}:\\
\;\;\;\;x1 + \left(9 + \left(x1 - x1 \cdot \left(x1 \cdot \left(6 + \left(2 \cdot \left(\left(2 \cdot x2 - 3\right) - x2 \cdot -2\right) + \left(\left(x1 \cdot \left(6 + \left(t\_0 + 2 \cdot \left(-1 - 2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right)\right)\right)\right) - x2 \cdot 8\right) - x2 \cdot 6\right)\right)\right) + t\_0\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 6 \cdot 10^{+82}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 \cdot \left(x1 \cdot 9 - 2\right) + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(x1 \cdot 6 - 12\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(-1 + x1 \cdot \left(x1 + 3\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 73.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -4.5000000000000001e153 < x1 < -1.4499999999999999e87Initial program 33.3%
Taylor expanded in x1 around 0 33.3%
+-commutative33.3%
mul-1-neg33.3%
sub-neg33.3%
Simplified33.3%
Taylor expanded in x1 around inf 33.3%
Taylor expanded in x1 around 0 69.6%
if -1.4499999999999999e87 < x1 < 5.99999999999999978e82Initial program 99.4%
Taylor expanded in x1 around 0 76.1%
Taylor expanded in x1 around 0 74.3%
Taylor expanded in x1 around 0 75.3%
Taylor expanded in x2 around 0 86.2%
if 5.99999999999999978e82 < x1 Initial program 24.5%
Taylor expanded in x1 around 0 5.0%
Taylor expanded in x1 around 0 81.9%
Taylor expanded in x2 around 0 96.2%
Final simplification89.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (- (* x2 -6.0) (* x1 (- 2.0 (* x1 9.0))))))
(t_1 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))
(if (<= x1 -2.6e+83)
t_0
(if (<= x1 -1.7e-209)
(+ x1 (+ (* x2 -6.0) (* x1 (- t_1 2.0))))
(if (<= x1 3.6e-231)
t_0
(if (<= x1 6e+82)
(+
x1
(+
(* x2 -6.0)
(* x1 (- (- t_1 (* 3.0 (* x1 (- (* x2 -2.0) 3.0)))) 2.0))))
(+ x1 (+ x1 (* 3.0 (* x1 (+ -1.0 (* x1 (+ x1 3.0)))))))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0))));
double t_1 = 4.0 * (x2 * ((2.0 * x2) - 3.0));
double tmp;
if (x1 <= -2.6e+83) {
tmp = t_0;
} else if (x1 <= -1.7e-209) {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_1 - 2.0)));
} else if (x1 <= 3.6e-231) {
tmp = t_0;
} else if (x1 <= 6e+82) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((t_1 - (3.0 * (x1 * ((x2 * -2.0) - 3.0)))) - 2.0)));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * (-1.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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 - (x1 * 9.0d0))))
t_1 = 4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))
if (x1 <= (-2.6d+83)) then
tmp = t_0
else if (x1 <= (-1.7d-209)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (t_1 - 2.0d0)))
else if (x1 <= 3.6d-231) then
tmp = t_0
else if (x1 <= 6d+82) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((t_1 - (3.0d0 * (x1 * ((x2 * (-2.0d0)) - 3.0d0)))) - 2.0d0)))
else
tmp = x1 + (x1 + (3.0d0 * (x1 * ((-1.0d0) + (x1 * (x1 + 3.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0))));
double t_1 = 4.0 * (x2 * ((2.0 * x2) - 3.0));
double tmp;
if (x1 <= -2.6e+83) {
tmp = t_0;
} else if (x1 <= -1.7e-209) {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_1 - 2.0)));
} else if (x1 <= 3.6e-231) {
tmp = t_0;
} else if (x1 <= 6e+82) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((t_1 - (3.0 * (x1 * ((x2 * -2.0) - 3.0)))) - 2.0)));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 3.0))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0)))) t_1 = 4.0 * (x2 * ((2.0 * x2) - 3.0)) tmp = 0 if x1 <= -2.6e+83: tmp = t_0 elif x1 <= -1.7e-209: tmp = x1 + ((x2 * -6.0) + (x1 * (t_1 - 2.0))) elif x1 <= 3.6e-231: tmp = t_0 elif x1 <= 6e+82: tmp = x1 + ((x2 * -6.0) + (x1 * ((t_1 - (3.0 * (x1 * ((x2 * -2.0) - 3.0)))) - 2.0))) else: tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 3.0)))))) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 - Float64(x1 * 9.0))))) t_1 = Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) tmp = 0.0 if (x1 <= -2.6e+83) tmp = t_0; elseif (x1 <= -1.7e-209) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(t_1 - 2.0)))); elseif (x1 <= 3.6e-231) tmp = t_0; elseif (x1 <= 6e+82) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(t_1 - Float64(3.0 * Float64(x1 * Float64(Float64(x2 * -2.0) - 3.0)))) - 2.0)))); else tmp = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(x1 + 3.0))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0)))); t_1 = 4.0 * (x2 * ((2.0 * x2) - 3.0)); tmp = 0.0; if (x1 <= -2.6e+83) tmp = t_0; elseif (x1 <= -1.7e-209) tmp = x1 + ((x2 * -6.0) + (x1 * (t_1 - 2.0))); elseif (x1 <= 3.6e-231) tmp = t_0; elseif (x1 <= 6e+82) tmp = x1 + ((x2 * -6.0) + (x1 * ((t_1 - (3.0 * (x1 * ((x2 * -2.0) - 3.0)))) - 2.0))); else tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 3.0)))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.6e+83], t$95$0, If[LessEqual[x1, -1.7e-209], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(t$95$1 - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.6e-231], t$95$0, If[LessEqual[x1, 6e+82], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$1 - N[(3.0 * N[(x1 * N[(N[(x2 * -2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(-1.0 + N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - x1 \cdot 9\right)\right)\\
t_1 := 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\\
\mathbf{if}\;x1 \leq -2.6 \cdot 10^{+83}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq -1.7 \cdot 10^{-209}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(t\_1 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 3.6 \cdot 10^{-231}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 6 \cdot 10^{+82}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(t\_1 - 3 \cdot \left(x1 \cdot \left(x2 \cdot -2 - 3\right)\right)\right) - 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(-1 + x1 \cdot \left(x1 + 3\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.6000000000000001e83 or -1.69999999999999994e-209 < x1 < 3.59999999999999973e-231Initial program 47.9%
Taylor expanded in x1 around 0 32.0%
Taylor expanded in x1 around 0 31.9%
Taylor expanded in x1 around 0 64.5%
Taylor expanded in x2 around 0 83.7%
*-commutative83.7%
Simplified83.7%
if -2.6000000000000001e83 < x1 < -1.69999999999999994e-209Initial program 99.1%
Taylor expanded in x1 around 0 75.1%
Taylor expanded in x1 around 0 70.8%
Taylor expanded in x1 around 0 75.8%
if 3.59999999999999973e-231 < x1 < 5.99999999999999978e82Initial program 99.4%
Taylor expanded in x1 around 0 77.6%
Taylor expanded in x1 around 0 77.7%
Taylor expanded in x1 around 0 77.8%
if 5.99999999999999978e82 < x1 Initial program 24.5%
Taylor expanded in x1 around 0 5.0%
Taylor expanded in x1 around 0 81.9%
Taylor expanded in x2 around 0 96.2%
Final simplification82.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (- (* x2 -6.0) (* x1 (- 2.0 (* x1 9.0)))))))
(if (<= x1 -2.6e+83)
t_0
(if (<= x1 -5.5e-209)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))
(if (<= x1 1.15e-229)
t_0
(if (<= x1 6e+82)
(+
x1
(-
(* x2 -6.0)
(*
x1
(+
2.0
(- (* 4.0 (* x2 (- 3.0 (* 2.0 x2)))) (* x2 (* x1 6.0)))))))
(+ x1 (+ x1 (* 3.0 (* x1 (+ -1.0 (* x1 (+ x1 3.0)))))))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0))));
double tmp;
if (x1 <= -2.6e+83) {
tmp = t_0;
} else if (x1 <= -5.5e-209) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else if (x1 <= 1.15e-229) {
tmp = t_0;
} else if (x1 <= 6e+82) {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((4.0 * (x2 * (3.0 - (2.0 * x2)))) - (x2 * (x1 * 6.0))))));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * (-1.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) :: t_0
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 - (x1 * 9.0d0))))
if (x1 <= (-2.6d+83)) then
tmp = t_0
else if (x1 <= (-5.5d-209)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
else if (x1 <= 1.15d-229) then
tmp = t_0
else if (x1 <= 6d+82) then
tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 + ((4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2)))) - (x2 * (x1 * 6.0d0))))))
else
tmp = x1 + (x1 + (3.0d0 * (x1 * ((-1.0d0) + (x1 * (x1 + 3.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0))));
double tmp;
if (x1 <= -2.6e+83) {
tmp = t_0;
} else if (x1 <= -5.5e-209) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else if (x1 <= 1.15e-229) {
tmp = t_0;
} else if (x1 <= 6e+82) {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((4.0 * (x2 * (3.0 - (2.0 * x2)))) - (x2 * (x1 * 6.0))))));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 3.0))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0)))) tmp = 0 if x1 <= -2.6e+83: tmp = t_0 elif x1 <= -5.5e-209: tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) elif x1 <= 1.15e-229: tmp = t_0 elif x1 <= 6e+82: tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((4.0 * (x2 * (3.0 - (2.0 * x2)))) - (x2 * (x1 * 6.0)))))) else: tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 3.0)))))) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 - Float64(x1 * 9.0))))) tmp = 0.0 if (x1 <= -2.6e+83) tmp = t_0; elseif (x1 <= -5.5e-209) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))); elseif (x1 <= 1.15e-229) tmp = t_0; elseif (x1 <= 6e+82) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 + Float64(Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))) - Float64(x2 * Float64(x1 * 6.0))))))); else tmp = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(x1 + 3.0))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0)))); tmp = 0.0; if (x1 <= -2.6e+83) tmp = t_0; elseif (x1 <= -5.5e-209) tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); elseif (x1 <= 1.15e-229) tmp = t_0; elseif (x1 <= 6e+82) tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((4.0 * (x2 * (3.0 - (2.0 * x2)))) - (x2 * (x1 * 6.0)))))); else tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 3.0)))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.6e+83], t$95$0, If[LessEqual[x1, -5.5e-209], 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, 1.15e-229], t$95$0, If[LessEqual[x1, 6e+82], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 + N[(N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(-1.0 + N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - x1 \cdot 9\right)\right)\\
\mathbf{if}\;x1 \leq -2.6 \cdot 10^{+83}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq -5.5 \cdot 10^{-209}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 1.15 \cdot 10^{-229}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 6 \cdot 10^{+82}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - x2 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(-1 + x1 \cdot \left(x1 + 3\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.6000000000000001e83 or -5.5000000000000001e-209 < x1 < 1.14999999999999998e-229Initial program 47.9%
Taylor expanded in x1 around 0 32.0%
Taylor expanded in x1 around 0 31.9%
Taylor expanded in x1 around 0 64.5%
Taylor expanded in x2 around 0 83.7%
*-commutative83.7%
Simplified83.7%
if -2.6000000000000001e83 < x1 < -5.5000000000000001e-209Initial program 99.1%
Taylor expanded in x1 around 0 75.1%
Taylor expanded in x1 around 0 70.8%
Taylor expanded in x1 around 0 75.8%
if 1.14999999999999998e-229 < x1 < 5.99999999999999978e82Initial program 99.4%
Taylor expanded in x1 around 0 77.6%
Taylor expanded in x1 around 0 77.7%
Taylor expanded in x1 around 0 77.8%
Taylor expanded in x2 around inf 77.3%
associate-*r*77.3%
*-commutative77.3%
Simplified77.3%
if 5.99999999999999978e82 < x1 Initial program 24.5%
Taylor expanded in x1 around 0 5.0%
Taylor expanded in x1 around 0 81.9%
Taylor expanded in x2 around 0 96.2%
Final simplification82.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)))))
(t_1 (+ x1 (- (* x2 -6.0) (* x1 (- 2.0 (* x1 9.0)))))))
(if (<= x1 -2.6e+83)
t_1
(if (<= x1 -2.8e-209)
t_0
(if (<= x1 4.8e-228)
t_1
(if (<= x1 6e+82)
t_0
(+ x1 (+ x1 (* 3.0 (* x1 (+ -1.0 (* x1 (+ x1 3.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 t_1 = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0))));
double tmp;
if (x1 <= -2.6e+83) {
tmp = t_1;
} else if (x1 <= -2.8e-209) {
tmp = t_0;
} else if (x1 <= 4.8e-228) {
tmp = t_1;
} else if (x1 <= 6e+82) {
tmp = t_0;
} else {
tmp = x1 + (x1 + (3.0 * (x1 * (-1.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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
t_1 = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 - (x1 * 9.0d0))))
if (x1 <= (-2.6d+83)) then
tmp = t_1
else if (x1 <= (-2.8d-209)) then
tmp = t_0
else if (x1 <= 4.8d-228) then
tmp = t_1
else if (x1 <= 6d+82) then
tmp = t_0
else
tmp = x1 + (x1 + (3.0d0 * (x1 * ((-1.0d0) + (x1 * (x1 + 3.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 t_1 = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0))));
double tmp;
if (x1 <= -2.6e+83) {
tmp = t_1;
} else if (x1 <= -2.8e-209) {
tmp = t_0;
} else if (x1 <= 4.8e-228) {
tmp = t_1;
} else if (x1 <= 6e+82) {
tmp = t_0;
} else {
tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 3.0))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) t_1 = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0)))) tmp = 0 if x1 <= -2.6e+83: tmp = t_1 elif x1 <= -2.8e-209: tmp = t_0 elif x1 <= 4.8e-228: tmp = t_1 elif x1 <= 6e+82: tmp = t_0 else: tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 3.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)))) t_1 = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 - Float64(x1 * 9.0))))) tmp = 0.0 if (x1 <= -2.6e+83) tmp = t_1; elseif (x1 <= -2.8e-209) tmp = t_0; elseif (x1 <= 4.8e-228) tmp = t_1; elseif (x1 <= 6e+82) tmp = t_0; else tmp = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(x1 + 3.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))); t_1 = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0)))); tmp = 0.0; if (x1 <= -2.6e+83) tmp = t_1; elseif (x1 <= -2.8e-209) tmp = t_0; elseif (x1 <= 4.8e-228) tmp = t_1; elseif (x1 <= 6e+82) tmp = t_0; else tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 3.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]}, Block[{t$95$1 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.6e+83], t$95$1, If[LessEqual[x1, -2.8e-209], t$95$0, If[LessEqual[x1, 4.8e-228], t$95$1, If[LessEqual[x1, 6e+82], t$95$0, N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(-1.0 + N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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)\\
t_1 := x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - x1 \cdot 9\right)\right)\\
\mathbf{if}\;x1 \leq -2.6 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -2.8 \cdot 10^{-209}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 4.8 \cdot 10^{-228}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq 6 \cdot 10^{+82}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(-1 + x1 \cdot \left(x1 + 3\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.6000000000000001e83 or -2.80000000000000012e-209 < x1 < 4.80000000000000004e-228Initial program 47.9%
Taylor expanded in x1 around 0 32.0%
Taylor expanded in x1 around 0 31.9%
Taylor expanded in x1 around 0 64.5%
Taylor expanded in x2 around 0 83.7%
*-commutative83.7%
Simplified83.7%
if -2.6000000000000001e83 < x1 < -2.80000000000000012e-209 or 4.80000000000000004e-228 < x1 < 5.99999999999999978e82Initial program 99.3%
Taylor expanded in x1 around 0 76.3%
Taylor expanded in x1 around 0 74.1%
Taylor expanded in x1 around 0 76.5%
if 5.99999999999999978e82 < x1 Initial program 24.5%
Taylor expanded in x1 around 0 5.0%
Taylor expanded in x1 around 0 81.9%
Taylor expanded in x2 around 0 96.2%
Final simplification82.3%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.2e+152)
(+ x1 (- (* x2 -6.0) (* x1 (- 2.0 (* x1 9.0)))))
(if (<= x1 6e+82)
(+
x1
(+
(* x2 -6.0)
(+
(* x1 (- (* x1 9.0) 2.0))
(* x2 (+ (* 8.0 (* x1 x2)) (* x1 (- (* x1 6.0) 12.0)))))))
(+ x1 (+ x1 (* 3.0 (* x1 (+ -1.0 (* x1 (+ x1 3.0))))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.2e+152) {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0))));
} else if (x1 <= 6e+82) {
tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0))))));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * (-1.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 (x1 <= (-2.2d+152)) then
tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 - (x1 * 9.0d0))))
else if (x1 <= 6d+82) then
tmp = x1 + ((x2 * (-6.0d0)) + ((x1 * ((x1 * 9.0d0) - 2.0d0)) + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * ((x1 * 6.0d0) - 12.0d0))))))
else
tmp = x1 + (x1 + (3.0d0 * (x1 * ((-1.0d0) + (x1 * (x1 + 3.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.2e+152) {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0))));
} else if (x1 <= 6e+82) {
tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0))))));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 3.0))))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.2e+152: tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0)))) elif x1 <= 6e+82: tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0)))))) else: tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 3.0)))))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.2e+152) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 - Float64(x1 * 9.0))))); elseif (x1 <= 6e+82) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(x1 * 6.0) - 12.0))))))); else tmp = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(x1 + 3.0))))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.2e+152) tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0)))); elseif (x1 <= 6e+82) tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 6.0) - 12.0)))))); else tmp = x1 + (x1 + (3.0 * (x1 * (-1.0 + (x1 * (x1 + 3.0)))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.2e+152], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 6e+82], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(-1.0 + N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.2 \cdot 10^{+152}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - x1 \cdot 9\right)\right)\\
\mathbf{elif}\;x1 \leq 6 \cdot 10^{+82}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 \cdot \left(x1 \cdot 9 - 2\right) + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(x1 \cdot 6 - 12\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(-1 + x1 \cdot \left(x1 + 3\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.1999999999999998e152Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 69.3%
Taylor expanded in x2 around 0 94.8%
*-commutative94.8%
Simplified94.8%
if -2.1999999999999998e152 < x1 < 5.99999999999999978e82Initial program 96.0%
Taylor expanded in x1 around 0 71.7%
Taylor expanded in x1 around 0 70.1%
Taylor expanded in x1 around 0 71.9%
Taylor expanded in x2 around 0 82.2%
if 5.99999999999999978e82 < x1 Initial program 24.5%
Taylor expanded in x1 around 0 5.0%
Taylor expanded in x1 around 0 81.9%
Taylor expanded in x2 around 0 96.2%
Final simplification86.4%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.16e+83)
(+ 9.0 (+ (* x1 2.0) (* (* x1 x2) -12.0)))
(if (or (<= x1 -5.8e-71) (not (<= x1 1.35e-111)))
(* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))
(+ x1 (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.16e+83) {
tmp = 9.0 + ((x1 * 2.0) + ((x1 * x2) * -12.0));
} else if ((x1 <= -5.8e-71) || !(x1 <= 1.35e-111)) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
} 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 <= (-1.16d+83)) then
tmp = 9.0d0 + ((x1 * 2.0d0) + ((x1 * x2) * (-12.0d0)))
else if ((x1 <= (-5.8d-71)) .or. (.not. (x1 <= 1.35d-111))) then
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
else
tmp = x1 + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.16e+83) {
tmp = 9.0 + ((x1 * 2.0) + ((x1 * x2) * -12.0));
} else if ((x1 <= -5.8e-71) || !(x1 <= 1.35e-111)) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.16e+83: tmp = 9.0 + ((x1 * 2.0) + ((x1 * x2) * -12.0)) elif (x1 <= -5.8e-71) or not (x1 <= 1.35e-111): tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.16e+83) tmp = Float64(9.0 + Float64(Float64(x1 * 2.0) + Float64(Float64(x1 * x2) * -12.0))); elseif ((x1 <= -5.8e-71) || !(x1 <= 1.35e-111)) tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.16e+83) tmp = 9.0 + ((x1 * 2.0) + ((x1 * x2) * -12.0)); elseif ((x1 <= -5.8e-71) || ~((x1 <= 1.35e-111))) tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.16e+83], N[(9.0 + N[(N[(x1 * 2.0), $MachinePrecision] + N[(N[(x1 * x2), $MachinePrecision] * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -5.8e-71], N[Not[LessEqual[x1, 1.35e-111]], $MachinePrecision]], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.16 \cdot 10^{+83}:\\
\;\;\;\;9 + \left(x1 \cdot 2 + \left(x1 \cdot x2\right) \cdot -12\right)\\
\mathbf{elif}\;x1 \leq -5.8 \cdot 10^{-71} \lor \neg \left(x1 \leq 1.35 \cdot 10^{-111}\right):\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -1.1600000000000001e83Initial program 11.6%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around inf 0.1%
Taylor expanded in x2 around 0 12.3%
if -1.1600000000000001e83 < x1 < -5.7999999999999997e-71 or 1.34999999999999994e-111 < x1 Initial program 68.5%
Taylor expanded in x1 around 0 40.9%
Taylor expanded in x1 around inf 43.8%
Taylor expanded in x1 around inf 43.2%
if -5.7999999999999997e-71 < x1 < 1.34999999999999994e-111Initial program 99.4%
Taylor expanded in x1 around 0 84.4%
Taylor expanded in x1 around 0 84.4%
Taylor expanded in x1 around 0 61.2%
*-commutative61.2%
Simplified61.2%
Final simplification44.6%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -2.1e+165) (not (<= x2 2.6e+84))) (+ x1 (+ 9.0 (+ x1 (* x2 (+ (* 8.0 (* x1 x2)) (* x1 -12.0)))))) (+ x1 (- (* x2 -6.0) (* x1 (- 2.0 (* x1 9.0)))))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -2.1e+165) || !(x2 <= 2.6e+84)) {
tmp = x1 + (9.0 + (x1 + (x2 * ((8.0 * (x1 * x2)) + (x1 * -12.0)))));
} else {
tmp = x1 + ((x2 * -6.0) - (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 ((x2 <= (-2.1d+165)) .or. (.not. (x2 <= 2.6d+84))) then
tmp = x1 + (9.0d0 + (x1 + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * (-12.0d0))))))
else
tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 - (x1 * 9.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -2.1e+165) || !(x2 <= 2.6e+84)) {
tmp = x1 + (9.0 + (x1 + (x2 * ((8.0 * (x1 * x2)) + (x1 * -12.0)))));
} else {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -2.1e+165) or not (x2 <= 2.6e+84): tmp = x1 + (9.0 + (x1 + (x2 * ((8.0 * (x1 * x2)) + (x1 * -12.0))))) else: tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0)))) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -2.1e+165) || !(x2 <= 2.6e+84)) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * -12.0)))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 - Float64(x1 * 9.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -2.1e+165) || ~((x2 <= 2.6e+84))) tmp = x1 + (9.0 + (x1 + (x2 * ((8.0 * (x1 * x2)) + (x1 * -12.0))))); else tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -2.1e+165], N[Not[LessEqual[x2, 2.6e+84]], $MachinePrecision]], N[(x1 + N[(9.0 + N[(x1 + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -2.1 \cdot 10^{+165} \lor \neg \left(x2 \leq 2.6 \cdot 10^{+84}\right):\\
\;\;\;\;x1 + \left(9 + \left(x1 + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot -12\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - x1 \cdot 9\right)\right)\\
\end{array}
\end{array}
if x2 < -2.1000000000000001e165 or 2.6000000000000001e84 < x2 Initial program 72.5%
Taylor expanded in x1 around 0 47.1%
Taylor expanded in x1 around inf 65.4%
Taylor expanded in x2 around 0 75.0%
if -2.1000000000000001e165 < x2 < 2.6000000000000001e84Initial program 69.3%
Taylor expanded in x1 around 0 51.3%
Taylor expanded in x1 around 0 67.9%
Taylor expanded in x1 around 0 75.7%
Taylor expanded in x2 around 0 75.5%
*-commutative75.5%
Simplified75.5%
Final simplification75.4%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -5e+167) (not (<= x2 2.6e+84))) (* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))) (+ x1 (- (* x2 -6.0) (* x1 (- 2.0 (* x1 9.0)))))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -5e+167) || !(x2 <= 2.6e+84)) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
} else {
tmp = x1 + ((x2 * -6.0) - (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 ((x2 <= (-5d+167)) .or. (.not. (x2 <= 2.6d+84))) then
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
else
tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 - (x1 * 9.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -5e+167) || !(x2 <= 2.6e+84)) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
} else {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -5e+167) or not (x2 <= 2.6e+84): tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) else: tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0)))) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -5e+167) || !(x2 <= 2.6e+84)) tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 - Float64(x1 * 9.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -5e+167) || ~((x2 <= 2.6e+84))) tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); else tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 - (x1 * 9.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -5e+167], N[Not[LessEqual[x2, 2.6e+84]], $MachinePrecision]], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -5 \cdot 10^{+167} \lor \neg \left(x2 \leq 2.6 \cdot 10^{+84}\right):\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 - x1 \cdot 9\right)\right)\\
\end{array}
\end{array}
if x2 < -4.9999999999999997e167 or 2.6000000000000001e84 < x2 Initial program 72.5%
Taylor expanded in x1 around 0 47.1%
Taylor expanded in x1 around inf 65.4%
Taylor expanded in x1 around inf 65.4%
if -4.9999999999999997e167 < x2 < 2.6000000000000001e84Initial program 69.3%
Taylor expanded in x1 around 0 51.3%
Taylor expanded in x1 around 0 67.9%
Taylor expanded in x1 around 0 75.7%
Taylor expanded in x2 around 0 75.5%
*-commutative75.5%
Simplified75.5%
Final simplification72.5%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -9e-46) (not (<= x1 0.88))) (+ 9.0 (+ (* x1 2.0) (* (* x1 x2) -12.0))) (+ x1 (* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -9e-46) || !(x1 <= 0.88)) {
tmp = 9.0 + ((x1 * 2.0) + ((x1 * x2) * -12.0));
} 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 <= (-9d-46)) .or. (.not. (x1 <= 0.88d0))) then
tmp = 9.0d0 + ((x1 * 2.0d0) + ((x1 * x2) * (-12.0d0)))
else
tmp = x1 + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -9e-46) || !(x1 <= 0.88)) {
tmp = 9.0 + ((x1 * 2.0) + ((x1 * x2) * -12.0));
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -9e-46) or not (x1 <= 0.88): tmp = 9.0 + ((x1 * 2.0) + ((x1 * x2) * -12.0)) else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -9e-46) || !(x1 <= 0.88)) tmp = Float64(9.0 + Float64(Float64(x1 * 2.0) + Float64(Float64(x1 * x2) * -12.0))); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -9e-46) || ~((x1 <= 0.88))) tmp = 9.0 + ((x1 * 2.0) + ((x1 * x2) * -12.0)); else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -9e-46], N[Not[LessEqual[x1, 0.88]], $MachinePrecision]], N[(9.0 + N[(N[(x1 * 2.0), $MachinePrecision] + N[(N[(x1 * x2), $MachinePrecision] * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -9 \cdot 10^{-46} \lor \neg \left(x1 \leq 0.88\right):\\
\;\;\;\;9 + \left(x1 \cdot 2 + \left(x1 \cdot x2\right) \cdot -12\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -9.00000000000000001e-46 or 0.880000000000000004 < x1 Initial program 42.9%
Taylor expanded in x1 around 0 15.8%
Taylor expanded in x1 around inf 25.5%
Taylor expanded in x2 around 0 13.5%
if -9.00000000000000001e-46 < x1 < 0.880000000000000004Initial program 99.5%
Taylor expanded in x1 around 0 86.4%
Taylor expanded in x1 around 0 86.4%
Taylor expanded in x1 around 0 50.1%
*-commutative50.1%
Simplified50.1%
Final simplification31.2%
(FPCore (x1 x2) :precision binary64 (+ (* x1 2.0) 9.0))
double code(double x1, double x2) {
return (x1 * 2.0) + 9.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x1 * 2.0d0) + 9.0d0
end function
public static double code(double x1, double x2) {
return (x1 * 2.0) + 9.0;
}
def code(x1, x2): return (x1 * 2.0) + 9.0
function code(x1, x2) return Float64(Float64(x1 * 2.0) + 9.0) end
function tmp = code(x1, x2) tmp = (x1 * 2.0) + 9.0; end
code[x1_, x2_] := N[(N[(x1 * 2.0), $MachinePrecision] + 9.0), $MachinePrecision]
\begin{array}{l}
\\
x1 \cdot 2 + 9
\end{array}
Initial program 70.3%
Taylor expanded in x1 around 0 50.0%
Taylor expanded in x1 around inf 25.4%
Taylor expanded in x2 around 0 3.6%
*-commutative3.6%
Simplified3.6%
Final simplification3.6%
(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 70.3%
Taylor expanded in x1 around 0 50.0%
Taylor expanded in x1 around 0 63.6%
Taylor expanded in x1 around 0 26.0%
*-commutative26.0%
Simplified26.0%
Final simplification26.0%
(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 70.3%
Taylor expanded in x1 around 0 50.0%
Taylor expanded in x1 around inf 25.4%
Taylor expanded in x1 around 0 3.5%
Final simplification3.5%
herbie shell --seed 2024096
(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))))))