
(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)) x1) (fma x1 x1 1.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* 3.0 (* x1 x1))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_4 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_0 4.0 -6.0)) (* (* x1 (* 2.0 t_0)) (+ t_0 -3.0)))
(fma t_4 t_0 (pow x1 3.0))))))
(*
x1
(+
(+ -1.0 (* -2.0 (+ -1.0 (* 3.0 (- 3.0 (* 2.0 x2))))))
(*
x1
(+ 9.0 (+ (* 4.0 (- (* 2.0 x2) 3.0)) (* x1 (- (* x1 6.0) 3.0))))))))))
double code(double x1, double x2) {
double t_0 = (fma(x1, (x1 * 3.0), (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = 3.0 * (x1 * x1);
double tmp;
if ((x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_0, 4.0, -6.0)), ((x1 * (2.0 * t_0)) * (t_0 + -3.0))), fma(t_4, t_0, pow(x1, 3.0)))));
} else {
tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0))))));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(3.0 * Float64(x1 * x1)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_0, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_0)) * Float64(t_0 + -3.0))), fma(t_4, t_0, (x1 ^ 3.0)))))); else tmp = Float64(x1 * Float64(Float64(-1.0 + Float64(-2.0 * Float64(-1.0 + Float64(3.0 * Float64(3.0 - Float64(2.0 * x2)))))) + Float64(x1 * Float64(9.0 + Float64(Float64(4.0 * Float64(Float64(2.0 * x2) - 3.0)) + Float64(x1 * Float64(Float64(x1 * 6.0) - 3.0))))))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$4 - 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$0 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * t$95$0 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(N[(-1.0 + N[(-2.0 * N[(-1.0 + N[(3.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(9.0 + N[(N[(4.0 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 6.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := 3 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_4 - \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\_0, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_0\right)\right) \cdot \left(t\_0 + -3\right)\right), \mathsf{fma}\left(t\_4, t\_0, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(\left(-1 + -2 \cdot \left(-1 + 3 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(x1 \cdot 6 - 3\right)\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.5%
Simplified99.7%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around -inf 100.0%
Taylor expanded in x1 around 0 100.0%
Final simplification99.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
(if (<= t_3 INFINITY)
t_3
(*
x1
(+
(+ -1.0 (* -2.0 (+ -1.0 (* 3.0 (- 3.0 (* 2.0 x2))))))
(*
x1
(+ 9.0 (+ (* 4.0 (- (* 2.0 x2) 3.0)) (* x1 (- (* x1 6.0) 3.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0))))));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0)))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 * Float64(Float64(-1.0 + Float64(-2.0 * Float64(-1.0 + Float64(3.0 * Float64(3.0 - Float64(2.0 * x2)))))) + Float64(x1 * Float64(9.0 + Float64(Float64(4.0 * Float64(Float64(2.0 * x2) - 3.0)) + Float64(x1 * Float64(Float64(x1 * 6.0) - 3.0))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0)))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 * N[(N[(-1.0 + N[(-2.0 * N[(-1.0 + N[(3.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(9.0 + N[(N[(4.0 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 6.0), $MachinePrecision] - 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 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)\\
\mathbf{if}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(\left(-1 + -2 \cdot \left(-1 + 3 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(x1 \cdot 6 - 3\right)\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.5%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around -inf 100.0%
Taylor expanded in x1 around 0 100.0%
Final simplification99.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (or (<= x1 -5e+102) (not (<= x1 4.2e+56)))
(*
x1
(+
(+ -1.0 (* -2.0 (+ -1.0 (* 3.0 (- 3.0 (* 2.0 x2))))))
(*
x1
(+ 9.0 (+ (* 4.0 (- (* 2.0 x2) 3.0)) (* x1 (- (* x1 6.0) 3.0)))))))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* 3.0 t_0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -5e+102) || !(x1 <= 4.2e+56)) {
tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0))))));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 <= (-5d+102)) .or. (.not. (x1 <= 4.2d+56))) then
tmp = x1 * (((-1.0d0) + ((-2.0d0) * ((-1.0d0) + (3.0d0 * (3.0d0 - (2.0d0 * x2)))))) + (x1 * (9.0d0 + ((4.0d0 * ((2.0d0 * x2) - 3.0d0)) + (x1 * ((x1 * 6.0d0) - 3.0d0))))))
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -5e+102) || !(x1 <= 4.2e+56)) {
tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0))))));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 <= -5e+102) or not (x1 <= 4.2e+56): tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0)))))) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if ((x1 <= -5e+102) || !(x1 <= 4.2e+56)) tmp = Float64(x1 * Float64(Float64(-1.0 + Float64(-2.0 * Float64(-1.0 + Float64(3.0 * Float64(3.0 - Float64(2.0 * x2)))))) + Float64(x1 * Float64(9.0 + Float64(Float64(4.0 * Float64(Float64(2.0 * x2) - 3.0)) + Float64(x1 * Float64(Float64(x1 * 6.0) - 3.0))))))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_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(3.0 * t_0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 <= -5e+102) || ~((x1 <= 4.2e+56))) tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0)))))); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -5e+102], N[Not[LessEqual[x1, 4.2e+56]], $MachinePrecision]], N[(x1 * N[(N[(-1.0 + N[(-2.0 * N[(-1.0 + N[(3.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(9.0 + N[(N[(4.0 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 6.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$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[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102} \lor \neg \left(x1 \leq 4.2 \cdot 10^{+56}\right):\\
\;\;\;\;x1 \cdot \left(\left(-1 + -2 \cdot \left(-1 + 3 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(x1 \cdot 6 - 3\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_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) + 3 \cdot t\_0\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5e102 or 4.20000000000000034e56 < x1 Initial program 20.8%
Simplified20.8%
Taylor expanded in x1 around -inf 100.0%
Taylor expanded in x1 around 0 100.0%
if -5e102 < x1 < 4.20000000000000034e56Initial program 99.5%
Taylor expanded in x1 around inf 99.0%
Final simplification99.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (or (<= x1 -5e+102) (not (<= x1 4.2e+56)))
(*
x1
(+
(+ -1.0 (* -2.0 (+ -1.0 (* 3.0 (- 3.0 (* 2.0 x2))))))
(*
x1
(+ 9.0 (+ (* 4.0 (- (* 2.0 x2) 3.0)) (* x1 (- (* x1 6.0) 3.0)))))))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_2)
(*
t_1
(+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -5e+102) || !(x1 <= 4.2e+56)) {
tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0))))));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 <= (-5d+102)) .or. (.not. (x1 <= 4.2d+56))) then
tmp = x1 * (((-1.0d0) + ((-2.0d0) * ((-1.0d0) + (3.0d0 * (3.0d0 - (2.0d0 * x2)))))) + (x1 * (9.0d0 + ((4.0d0 * ((2.0d0 * x2) - 3.0d0)) + (x1 * ((x1 * 6.0d0) - 3.0d0))))))
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -5e+102) || !(x1 <= 4.2e+56)) {
tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0))))));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 <= -5e+102) or not (x1 <= 4.2e+56): tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0)))))) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if ((x1 <= -5e+102) || !(x1 <= 4.2e+56)) tmp = Float64(x1 * Float64(Float64(-1.0 + Float64(-2.0 * Float64(-1.0 + Float64(3.0 * Float64(3.0 - Float64(2.0 * x2)))))) + Float64(x1 * Float64(9.0 + Float64(Float64(4.0 * Float64(Float64(2.0 * x2) - 3.0)) + Float64(x1 * Float64(Float64(x1 * 6.0) - 3.0))))))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 <= -5e+102) || ~((x1 <= 4.2e+56))) tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0)))))); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -5e+102], N[Not[LessEqual[x1, 4.2e+56]], $MachinePrecision]], N[(x1 * N[(N[(-1.0 + N[(-2.0 * N[(-1.0 + N[(3.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(9.0 + N[(N[(4.0 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 6.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102} \lor \neg \left(x1 \leq 4.2 \cdot 10^{+56}\right):\\
\;\;\;\;x1 \cdot \left(\left(-1 + -2 \cdot \left(-1 + 3 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(x1 \cdot 6 - 3\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot t\_2 + t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5e102 or 4.20000000000000034e56 < x1 Initial program 20.8%
Simplified20.8%
Taylor expanded in x1 around -inf 100.0%
Taylor expanded in x1 around 0 100.0%
if -5e102 < x1 < 4.20000000000000034e56Initial program 99.5%
Taylor expanded in x1 around inf 97.2%
Final simplification98.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (or (<= x1 -1e+102) (not (<= x1 2e+56)))
(*
x1
(+
(+ -1.0 (* -2.0 (+ -1.0 (* 3.0 (- 3.0 (* 2.0 x2))))))
(*
x1
(+ 9.0 (+ (* 4.0 (- (* 2.0 x2) 3.0)) (* x1 (- (* x1 6.0) 3.0)))))))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_0)
(*
t_1
(+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -1e+102) || !(x1 <= 2e+56)) {
tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0))))));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 <= (-1d+102)) .or. (.not. (x1 <= 2d+56))) then
tmp = x1 * (((-1.0d0) + ((-2.0d0) * ((-1.0d0) + (3.0d0 * (3.0d0 - (2.0d0 * x2)))))) + (x1 * (9.0d0 + ((4.0d0 * ((2.0d0 * x2) - 3.0d0)) + (x1 * ((x1 * 6.0d0) - 3.0d0))))))
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -1e+102) || !(x1 <= 2e+56)) {
tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0))))));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 <= -1e+102) or not (x1 <= 2e+56): tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0)))))) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if ((x1 <= -1e+102) || !(x1 <= 2e+56)) tmp = Float64(x1 * Float64(Float64(-1.0 + Float64(-2.0 * Float64(-1.0 + Float64(3.0 * Float64(3.0 - Float64(2.0 * x2)))))) + Float64(x1 * Float64(9.0 + Float64(Float64(4.0 * Float64(Float64(2.0 * x2) - 3.0)) + Float64(x1 * Float64(Float64(x1 * 6.0) - 3.0))))))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_0) + Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 <= -1e+102) || ~((x1 <= 2e+56))) tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0)))))); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -1e+102], N[Not[LessEqual[x1, 2e+56]], $MachinePrecision]], N[(x1 * N[(N[(-1.0 + N[(-2.0 * N[(-1.0 + N[(3.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(9.0 + N[(N[(4.0 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 6.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$0), $MachinePrecision] + 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] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -1 \cdot 10^{+102} \lor \neg \left(x1 \leq 2 \cdot 10^{+56}\right):\\
\;\;\;\;x1 \cdot \left(\left(-1 + -2 \cdot \left(-1 + 3 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(x1 \cdot 6 - 3\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_0 + 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 6\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -9.99999999999999977e101 or 2.00000000000000018e56 < x1 Initial program 20.8%
Simplified20.8%
Taylor expanded in x1 around -inf 100.0%
Taylor expanded in x1 around 0 100.0%
if -9.99999999999999977e101 < x1 < 2.00000000000000018e56Initial program 99.5%
Taylor expanded in x1 around inf 97.2%
Taylor expanded in x1 around inf 97.2%
Final simplification98.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (or (<= x1 -1.45e+57) (not (<= x1 1.1e+49)))
(*
x1
(+
(+ -1.0 (* -2.0 (+ -1.0 (* 3.0 (- 3.0 (* 2.0 x2))))))
(*
x1
(+ 9.0 (+ (* 4.0 (- (* 2.0 x2) 3.0)) (* x1 (- (* x1 6.0) 3.0)))))))
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_0)
(* t_1 (+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0))))))
(* 3.0 (+ (* x2 -2.0) (* x1 (+ -1.0 (* x1 (- 3.0 (* x2 -2.0))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -1.45e+57) || !(x1 <= 1.1e+49)) {
tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0))))));
} else {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))) + (3.0 * ((x2 * -2.0) + (x1 * (-1.0 + (x1 * (3.0 - (x2 * -2.0))))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 <= (-1.45d+57)) .or. (.not. (x1 <= 1.1d+49))) then
tmp = x1 * (((-1.0d0) + ((-2.0d0) * ((-1.0d0) + (3.0d0 * (3.0d0 - (2.0d0 * x2)))))) + (x1 * (9.0d0 + ((4.0d0 * ((2.0d0 * x2) - 3.0d0)) + (x1 * ((x1 * 6.0d0) - 3.0d0))))))
else
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))) + (3.0d0 * ((x2 * (-2.0d0)) + (x1 * ((-1.0d0) + (x1 * (3.0d0 - (x2 * (-2.0d0)))))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -1.45e+57) || !(x1 <= 1.1e+49)) {
tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0))))));
} else {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))) + (3.0 * ((x2 * -2.0) + (x1 * (-1.0 + (x1 * (3.0 - (x2 * -2.0))))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 <= -1.45e+57) or not (x1 <= 1.1e+49): tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0)))))) else: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))) + (3.0 * ((x2 * -2.0) + (x1 * (-1.0 + (x1 * (3.0 - (x2 * -2.0)))))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if ((x1 <= -1.45e+57) || !(x1 <= 1.1e+49)) tmp = Float64(x1 * Float64(Float64(-1.0 + Float64(-2.0 * Float64(-1.0 + Float64(3.0 * Float64(3.0 - Float64(2.0 * x2)))))) + Float64(x1 * Float64(9.0 + Float64(Float64(4.0 * Float64(Float64(2.0 * x2) - 3.0)) + Float64(x1 * Float64(Float64(x1 * 6.0) - 3.0))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_0) + Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))) + Float64(3.0 * Float64(Float64(x2 * -2.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(3.0 - Float64(x2 * -2.0))))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 <= -1.45e+57) || ~((x1 <= 1.1e+49))) tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0)))))); else tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))) + (3.0 * ((x2 * -2.0) + (x1 * (-1.0 + (x1 * (3.0 - (x2 * -2.0)))))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -1.45e+57], N[Not[LessEqual[x1, 1.1e+49]], $MachinePrecision]], N[(x1 * N[(N[(-1.0 + N[(-2.0 * N[(-1.0 + N[(3.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(9.0 + N[(N[(4.0 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 6.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$0), $MachinePrecision] + 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] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -1.45 \cdot 10^{+57} \lor \neg \left(x1 \leq 1.1 \cdot 10^{+49}\right):\\
\;\;\;\;x1 \cdot \left(\left(-1 + -2 \cdot \left(-1 + 3 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(x1 \cdot 6 - 3\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_0 + 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 6\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 + x1 \cdot \left(-1 + x1 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.4500000000000001e57 or 1.1e49 < x1 Initial program 31.4%
Simplified31.4%
Taylor expanded in x1 around -inf 97.2%
Taylor expanded in x1 around 0 97.3%
if -1.4500000000000001e57 < x1 < 1.1e49Initial program 99.5%
Taylor expanded in x1 around inf 97.6%
Taylor expanded in x1 around inf 97.6%
Taylor expanded in x1 around 0 97.0%
Final simplification97.1%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x1 -2.5e+59) (not (<= x1 24.0)))
(*
x1
(+
(+ -1.0 (* -2.0 (+ -1.0 (* 3.0 (- 3.0 (* 2.0 x2))))))
(* x1 (+ 9.0 (+ (* 4.0 (- (* 2.0 x2) 3.0)) (* x1 (- (* x1 6.0) 3.0)))))))
(+
x1
(+
(* x2 -6.0)
(+
(* x1 (- (* x1 9.0) 2.0))
(* x2 (+ (* x1 -12.0) (* 8.0 (* x1 x2)))))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.5e+59) || !(x1 <= 24.0)) {
tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0))))));
} else {
tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-2.5d+59)) .or. (.not. (x1 <= 24.0d0))) then
tmp = x1 * (((-1.0d0) + ((-2.0d0) * ((-1.0d0) + (3.0d0 * (3.0d0 - (2.0d0 * x2)))))) + (x1 * (9.0d0 + ((4.0d0 * ((2.0d0 * x2) - 3.0d0)) + (x1 * ((x1 * 6.0d0) - 3.0d0))))))
else
tmp = x1 + ((x2 * (-6.0d0)) + ((x1 * ((x1 * 9.0d0) - 2.0d0)) + (x2 * ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.5e+59) || !(x1 <= 24.0)) {
tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0))))));
} else {
tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -2.5e+59) or not (x1 <= 24.0): tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0)))))) else: tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -2.5e+59) || !(x1 <= 24.0)) tmp = Float64(x1 * Float64(Float64(-1.0 + Float64(-2.0 * Float64(-1.0 + Float64(3.0 * Float64(3.0 - Float64(2.0 * x2)))))) + Float64(x1 * Float64(9.0 + Float64(Float64(4.0 * Float64(Float64(2.0 * x2) - 3.0)) + Float64(x1 * Float64(Float64(x1 * 6.0) - 3.0))))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) + Float64(x2 * Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -2.5e+59) || ~((x1 <= 24.0))) tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 3.0)))))); else tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -2.5e+59], N[Not[LessEqual[x1, 24.0]], $MachinePrecision]], N[(x1 * N[(N[(-1.0 + N[(-2.0 * N[(-1.0 + N[(3.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(9.0 + N[(N[(4.0 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 6.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.5 \cdot 10^{+59} \lor \neg \left(x1 \leq 24\right):\\
\;\;\;\;x1 \cdot \left(\left(-1 + -2 \cdot \left(-1 + 3 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(x1 \cdot 6 - 3\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 \cdot \left(x1 \cdot 9 - 2\right) + x2 \cdot \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.4999999999999999e59 or 24 < x1 Initial program 37.0%
Simplified37.0%
Taylor expanded in x1 around -inf 95.8%
Taylor expanded in x1 around 0 95.9%
if -2.4999999999999999e59 < x1 < 24Initial program 99.5%
Simplified99.8%
Taylor expanded in x1 around 0 82.1%
Taylor expanded in x2 around 0 82.1%
Taylor expanded in x2 around 0 96.6%
Final simplification96.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (- (* x1 9.0) 2.0))))
(if (<= x1 -4.5e+153)
(+ x1 t_0)
(if (<= x1 -1.65e+96)
(+
x1
(+
(* x2 -6.0)
(*
x1
(-
(+
(* 4.0 (* x2 (- (* 2.0 x2) 3.0)))
(* x2 (+ (* 9.0 (/ x1 x2)) (* x1 12.0))))
2.0))))
(+
x1
(+ (* x2 -6.0) (+ t_0 (* x2 (+ (* x1 -12.0) (* 8.0 (* x1 x2)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 9.0) - 2.0);
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + t_0;
} else if (x1 <= -1.65e+96) {
tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x2 * ((9.0 * (x1 / x2)) + (x1 * 12.0)))) - 2.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (t_0 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 * ((x1 * 9.0d0) - 2.0d0)
if (x1 <= (-4.5d+153)) then
tmp = x1 + t_0
else if (x1 <= (-1.65d+96)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (x2 * ((9.0d0 * (x1 / x2)) + (x1 * 12.0d0)))) - 2.0d0)))
else
tmp = x1 + ((x2 * (-6.0d0)) + (t_0 + (x2 * ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 9.0) - 2.0);
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + t_0;
} else if (x1 <= -1.65e+96) {
tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x2 * ((9.0 * (x1 / x2)) + (x1 * 12.0)))) - 2.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (t_0 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((x1 * 9.0) - 2.0) tmp = 0 if x1 <= -4.5e+153: tmp = x1 + t_0 elif x1 <= -1.65e+96: tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x2 * ((9.0 * (x1 / x2)) + (x1 * 12.0)))) - 2.0))) else: tmp = x1 + ((x2 * -6.0) + (t_0 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) tmp = 0.0 if (x1 <= -4.5e+153) tmp = Float64(x1 + t_0); elseif (x1 <= -1.65e+96) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + Float64(x2 * Float64(Float64(9.0 * Float64(x1 / x2)) + Float64(x1 * 12.0)))) - 2.0)))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(t_0 + Float64(x2 * Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((x1 * 9.0) - 2.0); tmp = 0.0; if (x1 <= -4.5e+153) tmp = x1 + t_0; elseif (x1 <= -1.65e+96) tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x2 * ((9.0 * (x1 / x2)) + (x1 * 12.0)))) - 2.0))); else tmp = x1 + ((x2 * -6.0) + (t_0 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], N[(x1 + t$95$0), $MachinePrecision], If[LessEqual[x1, -1.65e+96], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(9.0 * N[(x1 / x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$0 + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 9 - 2\right)\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + t\_0\\
\mathbf{elif}\;x1 \leq -1.65 \cdot 10^{+96}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x2 \cdot \left(9 \cdot \frac{x1}{x2} + x1 \cdot 12\right)\right) - 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t\_0 + x2 \cdot \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 68.8%
Taylor expanded in x2 around 0 75.0%
Taylor expanded in x2 around 0 100.0%
if -4.5000000000000001e153 < x1 < -1.64999999999999992e96Initial program 25.0%
Simplified25.0%
Taylor expanded in x1 around 0 17.2%
Taylor expanded in x2 around inf 46.1%
if -1.64999999999999992e96 < x1 Initial program 84.2%
Simplified84.4%
Taylor expanded in x1 around 0 68.7%
Taylor expanded in x2 around 0 71.7%
Taylor expanded in x2 around 0 81.1%
Final simplification81.3%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -7e+90)
(*
x1
(+
(+ -1.0 (* -2.0 (+ -1.0 (* 3.0 (- 3.0 (* 2.0 x2))))))
(* x1 (+ 9.0 (+ (* 4.0 (- (* 2.0 x2) 3.0)) (* x1 -3.0))))))
(+
x1
(+
(* x2 -6.0)
(+
(* x1 (- (* x1 9.0) 2.0))
(* x2 (+ (* x1 -12.0) (* 8.0 (* x1 x2)))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -7e+90) {
tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * -3.0)))));
} else {
tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-7d+90)) then
tmp = x1 * (((-1.0d0) + ((-2.0d0) * ((-1.0d0) + (3.0d0 * (3.0d0 - (2.0d0 * x2)))))) + (x1 * (9.0d0 + ((4.0d0 * ((2.0d0 * x2) - 3.0d0)) + (x1 * (-3.0d0))))))
else
tmp = x1 + ((x2 * (-6.0d0)) + ((x1 * ((x1 * 9.0d0) - 2.0d0)) + (x2 * ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -7e+90) {
tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * -3.0)))));
} else {
tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -7e+90: tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * -3.0))))) else: tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -7e+90) tmp = Float64(x1 * Float64(Float64(-1.0 + Float64(-2.0 * Float64(-1.0 + Float64(3.0 * Float64(3.0 - Float64(2.0 * x2)))))) + Float64(x1 * Float64(9.0 + Float64(Float64(4.0 * Float64(Float64(2.0 * x2) - 3.0)) + Float64(x1 * -3.0)))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) + Float64(x2 * Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -7e+90) tmp = x1 * ((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) + (x1 * (9.0 + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * -3.0))))); else tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -7e+90], N[(x1 * N[(N[(-1.0 + N[(-2.0 * N[(-1.0 + N[(3.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(9.0 + N[(N[(4.0 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -7 \cdot 10^{+90}:\\
\;\;\;\;x1 \cdot \left(\left(-1 + -2 \cdot \left(-1 + 3 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + x1 \cdot \left(9 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot -3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 \cdot \left(x1 \cdot 9 - 2\right) + x2 \cdot \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -6.9999999999999997e90Initial program 10.2%
Simplified10.2%
Taylor expanded in x1 around -inf 100.0%
Taylor expanded in x1 around 0 86.7%
if -6.9999999999999997e90 < x1 Initial program 84.1%
Simplified84.3%
Taylor expanded in x1 around 0 69.0%
Taylor expanded in x2 around 0 72.1%
Taylor expanded in x2 around 0 81.5%
Final simplification82.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (- (* x1 9.0) 2.0))))
(if (<= x1 -4.2e+153)
(+ x1 t_0)
(if (<= x1 -5.5e+65)
(* x2 (+ (* x1 12.0) (* (/ x1 x2) -17.0)))
(+
x1
(+ (* x2 -6.0) (+ t_0 (* x2 (+ (* x1 -12.0) (* 8.0 (* x1 x2)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 9.0) - 2.0);
double tmp;
if (x1 <= -4.2e+153) {
tmp = x1 + t_0;
} else if (x1 <= -5.5e+65) {
tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0));
} else {
tmp = x1 + ((x2 * -6.0) + (t_0 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 * ((x1 * 9.0d0) - 2.0d0)
if (x1 <= (-4.2d+153)) then
tmp = x1 + t_0
else if (x1 <= (-5.5d+65)) then
tmp = x2 * ((x1 * 12.0d0) + ((x1 / x2) * (-17.0d0)))
else
tmp = x1 + ((x2 * (-6.0d0)) + (t_0 + (x2 * ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 9.0) - 2.0);
double tmp;
if (x1 <= -4.2e+153) {
tmp = x1 + t_0;
} else if (x1 <= -5.5e+65) {
tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0));
} else {
tmp = x1 + ((x2 * -6.0) + (t_0 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((x1 * 9.0) - 2.0) tmp = 0 if x1 <= -4.2e+153: tmp = x1 + t_0 elif x1 <= -5.5e+65: tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0)) else: tmp = x1 + ((x2 * -6.0) + (t_0 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) tmp = 0.0 if (x1 <= -4.2e+153) tmp = Float64(x1 + t_0); elseif (x1 <= -5.5e+65) tmp = Float64(x2 * Float64(Float64(x1 * 12.0) + Float64(Float64(x1 / x2) * -17.0))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(t_0 + Float64(x2 * Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((x1 * 9.0) - 2.0); tmp = 0.0; if (x1 <= -4.2e+153) tmp = x1 + t_0; elseif (x1 <= -5.5e+65) tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0)); else tmp = x1 + ((x2 * -6.0) + (t_0 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.2e+153], N[(x1 + t$95$0), $MachinePrecision], If[LessEqual[x1, -5.5e+65], N[(x2 * N[(N[(x1 * 12.0), $MachinePrecision] + N[(N[(x1 / x2), $MachinePrecision] * -17.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$0 + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 9 - 2\right)\\
\mathbf{if}\;x1 \leq -4.2 \cdot 10^{+153}:\\
\;\;\;\;x1 + t\_0\\
\mathbf{elif}\;x1 \leq -5.5 \cdot 10^{+65}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot 12 + \frac{x1}{x2} \cdot -17\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t\_0 + x2 \cdot \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -4.20000000000000033e153Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 68.8%
Taylor expanded in x2 around 0 75.0%
Taylor expanded in x2 around 0 100.0%
if -4.20000000000000033e153 < x1 < -5.4999999999999996e65Initial program 47.8%
Simplified47.7%
Taylor expanded in x1 around -inf 95.6%
Taylor expanded in x1 around 0 7.4%
Taylor expanded in x2 around inf 32.8%
if -5.4999999999999996e65 < x1 Initial program 83.7%
Simplified83.8%
Taylor expanded in x1 around 0 71.0%
Taylor expanded in x2 around 0 73.6%
Taylor expanded in x2 around 0 83.3%
Final simplification80.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (- (* x1 9.0) 2.0))))
(if (<= x1 -4.5e+153)
(+ x1 t_0)
(if (<= x1 -5.5e+65)
(* x2 (+ (* x1 12.0) (* (/ x1 x2) -17.0)))
(+ x1 (+ t_0 (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0))))))))
double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 9.0) - 2.0);
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + t_0;
} else if (x1 <= -5.5e+65) {
tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0));
} else {
tmp = x1 + (t_0 + (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 * ((x1 * 9.0d0) - 2.0d0)
if (x1 <= (-4.5d+153)) then
tmp = x1 + t_0
else if (x1 <= (-5.5d+65)) then
tmp = x2 * ((x1 * 12.0d0) + ((x1 / x2) * (-17.0d0)))
else
tmp = x1 + (t_0 + (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 9.0) - 2.0);
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + t_0;
} else if (x1 <= -5.5e+65) {
tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0));
} else {
tmp = x1 + (t_0 + (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((x1 * 9.0) - 2.0) tmp = 0 if x1 <= -4.5e+153: tmp = x1 + t_0 elif x1 <= -5.5e+65: tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0)) else: tmp = x1 + (t_0 + (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) tmp = 0.0 if (x1 <= -4.5e+153) tmp = Float64(x1 + t_0); elseif (x1 <= -5.5e+65) tmp = Float64(x2 * Float64(Float64(x1 * 12.0) + Float64(Float64(x1 / x2) * -17.0))); else tmp = Float64(x1 + Float64(t_0 + Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((x1 * 9.0) - 2.0); tmp = 0.0; if (x1 <= -4.5e+153) tmp = x1 + t_0; elseif (x1 <= -5.5e+65) tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0)); else tmp = x1 + (t_0 + (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], N[(x1 + t$95$0), $MachinePrecision], If[LessEqual[x1, -5.5e+65], N[(x2 * N[(N[(x1 * 12.0), $MachinePrecision] + N[(N[(x1 / x2), $MachinePrecision] * -17.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(t$95$0 + N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 9 - 2\right)\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + t\_0\\
\mathbf{elif}\;x1 \leq -5.5 \cdot 10^{+65}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot 12 + \frac{x1}{x2} \cdot -17\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(t\_0 + x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\right)\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 68.8%
Taylor expanded in x2 around 0 75.0%
Taylor expanded in x2 around 0 100.0%
if -4.5000000000000001e153 < x1 < -5.4999999999999996e65Initial program 47.8%
Simplified47.7%
Taylor expanded in x1 around -inf 95.6%
Taylor expanded in x1 around 0 7.4%
Taylor expanded in x2 around inf 32.8%
if -5.4999999999999996e65 < x1 Initial program 83.7%
Simplified83.8%
Taylor expanded in x1 around 0 71.0%
Taylor expanded in x2 around 0 73.6%
Taylor expanded in x2 around 0 83.3%
Final simplification80.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* x1 (- (* x1 9.0) 2.0)))))
(if (<= x1 -4.5e+153)
t_0
(if (<= x1 -1.76e+62)
(* x2 (+ (* x1 12.0) (* (/ x1 x2) -17.0)))
(if (<= x1 4.4e+125)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))
t_0)))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 * ((x1 * 9.0) - 2.0));
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_0;
} else if (x1 <= -1.76e+62) {
tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0));
} else if (x1 <= 4.4e+125) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + (x1 * ((x1 * 9.0d0) - 2.0d0))
if (x1 <= (-4.5d+153)) then
tmp = t_0
else if (x1 <= (-1.76d+62)) then
tmp = x2 * ((x1 * 12.0d0) + ((x1 / x2) * (-17.0d0)))
else if (x1 <= 4.4d+125) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 * ((x1 * 9.0) - 2.0));
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_0;
} else if (x1 <= -1.76e+62) {
tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0));
} else if (x1 <= 4.4e+125) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 * ((x1 * 9.0) - 2.0)) tmp = 0 if x1 <= -4.5e+153: tmp = t_0 elif x1 <= -1.76e+62: tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0)) elif x1 <= 4.4e+125: tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0))) tmp = 0.0 if (x1 <= -4.5e+153) tmp = t_0; elseif (x1 <= -1.76e+62) tmp = Float64(x2 * Float64(Float64(x1 * 12.0) + Float64(Float64(x1 / x2) * -17.0))); elseif (x1 <= 4.4e+125) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 * ((x1 * 9.0) - 2.0)); tmp = 0.0; if (x1 <= -4.5e+153) tmp = t_0; elseif (x1 <= -1.76e+62) tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0)); elseif (x1 <= 4.4e+125) tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], t$95$0, If[LessEqual[x1, -1.76e+62], N[(x2 * N[(N[(x1 * 12.0), $MachinePrecision] + N[(N[(x1 / x2), $MachinePrecision] * -17.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.4e+125], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x1 \cdot \left(x1 \cdot 9 - 2\right)\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq -1.76 \cdot 10^{+62}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot 12 + \frac{x1}{x2} \cdot -17\right)\\
\mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+125}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153 or 4.39999999999999982e125 < x1 Initial program 8.6%
Simplified8.6%
Taylor expanded in x1 around 0 69.2%
Taylor expanded in x2 around 0 79.3%
Taylor expanded in x2 around 0 90.7%
if -4.5000000000000001e153 < x1 < -1.76e62Initial program 49.8%
Simplified49.8%
Taylor expanded in x1 around -inf 95.8%
Taylor expanded in x1 around 0 7.3%
Taylor expanded in x2 around inf 31.6%
if -1.76e62 < x1 < 4.39999999999999982e125Initial program 99.5%
Simplified99.7%
Taylor expanded in x1 around 0 71.3%
Final simplification72.9%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -4.5e+153)
(+ x1 (* x1 (- (* x1 9.0) 2.0)))
(if (<= x1 -5.5e+65)
(* x2 (+ (* x1 12.0) (* (/ x1 x2) -17.0)))
(+
(* x2 -6.0)
(* x1 (+ -1.0 (+ (* x1 9.0) (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + (x1 * ((x1 * 9.0) - 2.0));
} else if (x1 <= -5.5e+65) {
tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x1 * 9.0) + (4.0 * (x2 * ((2.0 * x2) - 3.0))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-4.5d+153)) then
tmp = x1 + (x1 * ((x1 * 9.0d0) - 2.0d0))
else if (x1 <= (-5.5d+65)) then
tmp = x2 * ((x1 * 12.0d0) + ((x1 / x2) * (-17.0d0)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + ((x1 * 9.0d0) + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + (x1 * ((x1 * 9.0) - 2.0));
} else if (x1 <= -5.5e+65) {
tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x1 * 9.0) + (4.0 * (x2 * ((2.0 * x2) - 3.0))))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -4.5e+153: tmp = x1 + (x1 * ((x1 * 9.0) - 2.0)) elif x1 <= -5.5e+65: tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0)) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x1 * 9.0) + (4.0 * (x2 * ((2.0 * x2) - 3.0)))))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -4.5e+153) tmp = Float64(x1 + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0))); elseif (x1 <= -5.5e+65) tmp = Float64(x2 * Float64(Float64(x1 * 12.0) + Float64(Float64(x1 / x2) * -17.0))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(Float64(x1 * 9.0) + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -4.5e+153) tmp = x1 + (x1 * ((x1 * 9.0) - 2.0)); elseif (x1 <= -5.5e+65) tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0)); else tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x1 * 9.0) + (4.0 * (x2 * ((2.0 * x2) - 3.0)))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -4.5e+153], N[(x1 + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5.5e+65], N[(x2 * N[(N[(x1 * 12.0), $MachinePrecision] + N[(N[(x1 / x2), $MachinePrecision] * -17.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(N[(x1 * 9.0), $MachinePrecision] + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot 9 - 2\right)\\
\mathbf{elif}\;x1 \leq -5.5 \cdot 10^{+65}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot 12 + \frac{x1}{x2} \cdot -17\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + \left(x1 \cdot 9 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 68.8%
Taylor expanded in x2 around 0 75.0%
Taylor expanded in x2 around 0 100.0%
if -4.5000000000000001e153 < x1 < -5.4999999999999996e65Initial program 47.8%
Simplified47.7%
Taylor expanded in x1 around -inf 95.6%
Taylor expanded in x1 around 0 7.4%
Taylor expanded in x2 around inf 32.8%
if -5.4999999999999996e65 < x1 Initial program 83.7%
Simplified83.8%
Taylor expanded in x1 around 0 71.0%
Taylor expanded in x2 around 0 73.6%
Taylor expanded in x1 around 0 73.6%
Final simplification73.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* x1 (- (* x1 9.0) 2.0)))))
(if (<= x1 -4.5e+153)
t_0
(if (<= x1 -1.02e-42)
(* x2 (+ (* x1 12.0) (* (/ x1 x2) -17.0)))
(if (<= x1 9.5e-79) (* x2 -6.0) t_0)))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 * ((x1 * 9.0) - 2.0));
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_0;
} else if (x1 <= -1.02e-42) {
tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0));
} else if (x1 <= 9.5e-79) {
tmp = x2 * -6.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + (x1 * ((x1 * 9.0d0) - 2.0d0))
if (x1 <= (-4.5d+153)) then
tmp = t_0
else if (x1 <= (-1.02d-42)) then
tmp = x2 * ((x1 * 12.0d0) + ((x1 / x2) * (-17.0d0)))
else if (x1 <= 9.5d-79) then
tmp = x2 * (-6.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 * ((x1 * 9.0) - 2.0));
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_0;
} else if (x1 <= -1.02e-42) {
tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0));
} else if (x1 <= 9.5e-79) {
tmp = x2 * -6.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 * ((x1 * 9.0) - 2.0)) tmp = 0 if x1 <= -4.5e+153: tmp = t_0 elif x1 <= -1.02e-42: tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0)) elif x1 <= 9.5e-79: tmp = x2 * -6.0 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0))) tmp = 0.0 if (x1 <= -4.5e+153) tmp = t_0; elseif (x1 <= -1.02e-42) tmp = Float64(x2 * Float64(Float64(x1 * 12.0) + Float64(Float64(x1 / x2) * -17.0))); elseif (x1 <= 9.5e-79) tmp = Float64(x2 * -6.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 * ((x1 * 9.0) - 2.0)); tmp = 0.0; if (x1 <= -4.5e+153) tmp = t_0; elseif (x1 <= -1.02e-42) tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0)); elseif (x1 <= 9.5e-79) tmp = x2 * -6.0; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], t$95$0, If[LessEqual[x1, -1.02e-42], N[(x2 * N[(N[(x1 * 12.0), $MachinePrecision] + N[(N[(x1 / x2), $MachinePrecision] * -17.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9.5e-79], N[(x2 * -6.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x1 \cdot \left(x1 \cdot 9 - 2\right)\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq -1.02 \cdot 10^{-42}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot 12 + \frac{x1}{x2} \cdot -17\right)\\
\mathbf{elif}\;x1 \leq 9.5 \cdot 10^{-79}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153 or 9.4999999999999997e-79 < x1 Initial program 41.0%
Simplified41.1%
Taylor expanded in x1 around 0 59.4%
Taylor expanded in x2 around 0 66.1%
Taylor expanded in x2 around 0 65.3%
if -4.5000000000000001e153 < x1 < -1.0199999999999999e-42Initial program 71.0%
Simplified71.1%
Taylor expanded in x1 around -inf 68.6%
Taylor expanded in x1 around 0 6.6%
Taylor expanded in x2 around inf 20.5%
if -1.0199999999999999e-42 < x1 < 9.4999999999999997e-79Initial program 99.7%
Simplified99.8%
Taylor expanded in x1 around 0 60.1%
*-commutative60.1%
Simplified60.1%
Final simplification55.8%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -2.25e-45) (not (<= x1 1.1e-76))) (+ x1 (* x1 (- (* x1 9.0) 2.0))) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.25e-45) || !(x1 <= 1.1e-76)) {
tmp = x1 + (x1 * ((x1 * 9.0) - 2.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-2.25d-45)) .or. (.not. (x1 <= 1.1d-76))) then
tmp = x1 + (x1 * ((x1 * 9.0d0) - 2.0d0))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.25e-45) || !(x1 <= 1.1e-76)) {
tmp = x1 + (x1 * ((x1 * 9.0) - 2.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -2.25e-45) or not (x1 <= 1.1e-76): tmp = x1 + (x1 * ((x1 * 9.0) - 2.0)) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -2.25e-45) || !(x1 <= 1.1e-76)) tmp = Float64(x1 + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -2.25e-45) || ~((x1 <= 1.1e-76))) tmp = x1 + (x1 * ((x1 * 9.0) - 2.0)); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -2.25e-45], N[Not[LessEqual[x1, 1.1e-76]], $MachinePrecision]], N[(x1 + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.25 \cdot 10^{-45} \lor \neg \left(x1 \leq 1.1 \cdot 10^{-76}\right):\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot 9 - 2\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -2.2499999999999999e-45 or 1.1e-76 < x1 Initial program 49.3%
Simplified49.4%
Taylor expanded in x1 around 0 53.3%
Taylor expanded in x2 around 0 57.5%
Taylor expanded in x2 around 0 49.8%
if -2.2499999999999999e-45 < x1 < 1.1e-76Initial program 99.7%
Simplified99.8%
Taylor expanded in x1 around 0 60.1%
*-commutative60.1%
Simplified60.1%
Final simplification54.0%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -2.6e-70) (not (<= x1 9.6e-77))) (* x1 (- -1.0 (* x2 -12.0))) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.6e-70) || !(x1 <= 9.6e-77)) {
tmp = x1 * (-1.0 - (x2 * -12.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-2.6d-70)) .or. (.not. (x1 <= 9.6d-77))) then
tmp = x1 * ((-1.0d0) - (x2 * (-12.0d0)))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.6e-70) || !(x1 <= 9.6e-77)) {
tmp = x1 * (-1.0 - (x2 * -12.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -2.6e-70) or not (x1 <= 9.6e-77): tmp = x1 * (-1.0 - (x2 * -12.0)) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -2.6e-70) || !(x1 <= 9.6e-77)) tmp = Float64(x1 * Float64(-1.0 - Float64(x2 * -12.0))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -2.6e-70) || ~((x1 <= 9.6e-77))) tmp = x1 * (-1.0 - (x2 * -12.0)); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -2.6e-70], N[Not[LessEqual[x1, 9.6e-77]], $MachinePrecision]], N[(x1 * N[(-1.0 - N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.6 \cdot 10^{-70} \lor \neg \left(x1 \leq 9.6 \cdot 10^{-77}\right):\\
\;\;\;\;x1 \cdot \left(-1 - x2 \cdot -12\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -2.60000000000000002e-70 or 9.59999999999999961e-77 < x1 Initial program 50.6%
Simplified50.7%
Taylor expanded in x1 around -inf 79.5%
Taylor expanded in x1 around 0 14.6%
Taylor expanded in x2 around inf 19.5%
*-commutative19.5%
Simplified19.5%
if -2.60000000000000002e-70 < x1 < 9.59999999999999961e-77Initial program 99.7%
Simplified99.8%
Taylor expanded in x1 around 0 61.4%
*-commutative61.4%
Simplified61.4%
Final simplification36.0%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -2.25e+51) (not (<= x1 1.7e-23))) (* 12.0 (* x1 x2)) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.25e+51) || !(x1 <= 1.7e-23)) {
tmp = 12.0 * (x1 * x2);
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-2.25d+51)) .or. (.not. (x1 <= 1.7d-23))) then
tmp = 12.0d0 * (x1 * x2)
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.25e+51) || !(x1 <= 1.7e-23)) {
tmp = 12.0 * (x1 * x2);
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -2.25e+51) or not (x1 <= 1.7e-23): tmp = 12.0 * (x1 * x2) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -2.25e+51) || !(x1 <= 1.7e-23)) tmp = Float64(12.0 * Float64(x1 * x2)); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -2.25e+51) || ~((x1 <= 1.7e-23))) tmp = 12.0 * (x1 * x2); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -2.25e+51], N[Not[LessEqual[x1, 1.7e-23]], $MachinePrecision]], N[(12.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.25 \cdot 10^{+51} \lor \neg \left(x1 \leq 1.7 \cdot 10^{-23}\right):\\
\;\;\;\;12 \cdot \left(x1 \cdot x2\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -2.25e51 or 1.7e-23 < x1 Initial program 40.9%
Simplified40.9%
Taylor expanded in x1 around -inf 91.0%
Taylor expanded in x1 around 0 16.1%
Taylor expanded in x2 around inf 15.6%
if -2.25e51 < x1 < 1.7e-23Initial program 99.6%
Simplified99.8%
Taylor expanded in x1 around 0 51.1%
*-commutative51.1%
Simplified51.1%
Final simplification33.2%
(FPCore (x1 x2) :precision binary64 (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0)))))
double code(double x1, double x2) {
return x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
end function
public static double code(double x1, double x2) {
return x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
}
def code(x1, x2): return x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)))
function code(x1, x2) return Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))) end
function tmp = code(x1, x2) tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); end
code[x1_, x2_] := N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)
\end{array}
Initial program 70.0%
Simplified70.1%
Taylor expanded in x1 around 0 65.5%
Taylor expanded in x2 around 0 60.5%
*-commutative60.5%
Simplified60.5%
Final simplification60.5%
(FPCore (x1 x2) :precision binary64 (* x2 -6.0))
double code(double x1, double x2) {
return x2 * -6.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * (-6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * -6.0;
}
def code(x1, x2): return x2 * -6.0
function code(x1, x2) return Float64(x2 * -6.0) end
function tmp = code(x1, x2) tmp = x2 * -6.0; end
code[x1_, x2_] := N[(x2 * -6.0), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6
\end{array}
Initial program 70.0%
Simplified70.1%
Taylor expanded in x1 around 0 26.5%
*-commutative26.5%
Simplified26.5%
(FPCore (x1 x2) :precision binary64 (* x1 -17.0))
double code(double x1, double x2) {
return x1 * -17.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 * (-17.0d0)
end function
public static double code(double x1, double x2) {
return x1 * -17.0;
}
def code(x1, x2): return x1 * -17.0
function code(x1, x2) return Float64(x1 * -17.0) end
function tmp = code(x1, x2) tmp = x1 * -17.0; end
code[x1_, x2_] := N[(x1 * -17.0), $MachinePrecision]
\begin{array}{l}
\\
x1 \cdot -17
\end{array}
Initial program 70.0%
Simplified70.1%
Taylor expanded in x1 around -inf 48.7%
Taylor expanded in x1 around 0 10.8%
Taylor expanded in x2 around 0 4.0%
*-commutative4.0%
Simplified4.0%
herbie shell --seed 2024144
(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))))))