
(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 17 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 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = (fma(x1, (x1 * 3.0), (2.0 * x2)) - 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 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.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(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.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[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $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 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
Simplified99.6%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 18.5%
*-commutative18.5%
Simplified18.5%
Taylor expanded in x1 around inf 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 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(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(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(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[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)\\
\mathbf{if}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 18.5%
*-commutative18.5%
Simplified18.5%
Taylor expanded in x1 around inf 100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (or (<= x1 -5.9e+66) (not (<= x1 1.5e+78)))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0))
(+
x1
(+
(+
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))))
(* 3.0 (- (* x2 -2.0) x1)))))))
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 <= -5.9e+66) || !(x1 <= 1.5e+78)) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
} else {
tmp = x1 + ((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)))) + (3.0 * ((x2 * -2.0) - x1)));
}
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 <= (-5.9d+66)) .or. (.not. (x1 <= 1.5d+78))) then
tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
else
tmp = x1 + ((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)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
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 <= -5.9e+66) || !(x1 <= 1.5e+78)) {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
} else {
tmp = x1 + ((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)))) + (3.0 * ((x2 * -2.0) - x1)));
}
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 <= -5.9e+66) or not (x1 <= 1.5e+78): tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) else: tmp = x1 + ((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)))) + (3.0 * ((x2 * -2.0) - x1))) 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 <= -5.9e+66) || !(x1 <= 1.5e+78)) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); else tmp = Float64(x1 + Float64(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)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); 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 <= -5.9e+66) || ~((x1 <= 1.5e+78))) tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); else tmp = x1 + ((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)))) + (3.0 * ((x2 * -2.0) - x1))); 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, -5.9e+66], N[Not[LessEqual[x1, 1.5e+78]], $MachinePrecision]], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(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] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $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.9 \cdot 10^{+66} \lor \neg \left(x1 \leq 1.5 \cdot 10^{+78}\right):\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\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) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\end{array}
\end{array}
if x1 < -5.89999999999999988e66 or 1.49999999999999991e78 < x1 Initial program 22.6%
Taylor expanded in x1 around inf 36.9%
*-commutative36.9%
Simplified36.9%
Taylor expanded in x1 around inf 100.0%
if -5.89999999999999988e66 < x1 < 1.49999999999999991e78Initial program 99.3%
Taylor expanded in x1 around inf 97.5%
Taylor expanded in x1 around 0 99.1%
neg-mul-199.1%
unsub-neg99.1%
*-commutative99.1%
Simplified99.1%
Final simplification99.5%
(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 (<= x1 -5.6e+102)
(+ (* x1 (+ (* x2 -12.0) -1.0)) (* x2 -6.0))
(if (<= x1 1.35e+154)
(+
x1
(+
(+
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))))
(* 3.0 (- (* x2 -2.0) x1))))
(* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0);
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((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)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: 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 <= (-5.6d+102)) then
tmp = (x1 * ((x2 * (-12.0d0)) + (-1.0d0))) + (x2 * (-6.0d0))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((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)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double 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 <= -5.6e+102) {
tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0);
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((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)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -5.6e+102: tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0) elif x1 <= 1.35e+154: tmp = x1 + ((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)))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0)) + Float64(x2 * -6.0)); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(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)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); end return tmp end
function tmp_2 = code(x1, x2) 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 <= -5.6e+102) tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0); elseif (x1 <= 1.35e+154) tmp = x1 + ((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)))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(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] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
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.6 \cdot 10^{+102}:\\
\;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right) + x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\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) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 4.5%
*-commutative4.5%
*-commutative4.5%
associate-*l*4.5%
Simplified4.5%
Taylor expanded in x1 around 0 21.9%
if -5.60000000000000037e102 < x1 < 1.35000000000000003e154Initial program 99.4%
Taylor expanded in x1 around inf 97.9%
Taylor expanded in x1 around 0 99.2%
neg-mul-199.2%
unsub-neg99.2%
*-commutative99.2%
Simplified99.2%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 52.5%
Taylor expanded in x1 around inf 52.5%
Final simplification75.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)))
(if (<= x1 -5.6e+102)
(+ (* x1 (+ (* x2 -12.0) -1.0)) (* x2 -6.0))
(if (<= x1 1.35e+154)
(+
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))))))))
(* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0);
} else if (x1 <= 1.35e+154) {
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)))))));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: 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 <= (-5.6d+102)) then
tmp = (x1 * ((x2 * (-12.0d0)) + (-1.0d0))) + (x2 * (-6.0d0))
else if (x1 <= 1.35d+154) then
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)))))))
else
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double 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 <= -5.6e+102) {
tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0);
} else if (x1 <= 1.35e+154) {
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)))))));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -5.6e+102: tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0) elif x1 <= 1.35e+154: 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))))))) else: tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0)) + Float64(x2 * -6.0)); elseif (x1 <= 1.35e+154) 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)))))))); else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); end return tmp end
function tmp_2 = code(x1, x2) 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 <= -5.6e+102) tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0); elseif (x1 <= 1.35e+154) 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))))))); else tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], 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], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
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.6 \cdot 10^{+102}:\\
\;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right) + x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;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)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 4.5%
*-commutative4.5%
*-commutative4.5%
associate-*l*4.5%
Simplified4.5%
Taylor expanded in x1 around 0 21.9%
if -5.60000000000000037e102 < x1 < 1.35000000000000003e154Initial program 99.4%
Taylor expanded in x1 around inf 97.9%
Taylor expanded in x1 around inf 96.6%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 52.5%
Taylor expanded in x1 around inf 52.5%
Final simplification74.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- (* 2.0 x2) 3.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2)))
(t_4
(+
x1
(+
t_3
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_1 (* 2.0 x2))
(*
t_2
(+
(* x1 2.0)
(*
(* x1 x1)
(- (* (/ (- (+ t_1 (* 2.0 x2)) x1) t_2) 4.0) 6.0)))))))))))
(if (<= x1 -5.6e+102)
(+ (* x1 (+ (* x2 -12.0) -1.0)) (* x2 -6.0))
(if (<= x1 -170.0)
t_4
(if (<= x1 6e+15)
(+ x1 (+ t_3 (+ x1 (* 4.0 (* x1 t_0)))))
(if (<= x1 9.5e+95) t_4 (* x1 (+ 2.0 (* 4.0 t_0)))))))))
double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (2.0 * x2)) + (t_2 * ((x1 * 2.0) + ((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_2) * 4.0) - 6.0))))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0);
} else if (x1 <= -170.0) {
tmp = t_4;
} else if (x1 <= 6e+15) {
tmp = x1 + (t_3 + (x1 + (4.0 * (x1 * t_0))));
} else if (x1 <= 9.5e+95) {
tmp = t_4;
} else {
tmp = x1 * (2.0 + (4.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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x2 * ((2.0d0 * x2) - 3.0d0)
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)
t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (2.0d0 * x2)) + (t_2 * ((x1 * 2.0d0) + ((x1 * x1) * (((((t_1 + (2.0d0 * x2)) - x1) / t_2) * 4.0d0) - 6.0d0))))))))
if (x1 <= (-5.6d+102)) then
tmp = (x1 * ((x2 * (-12.0d0)) + (-1.0d0))) + (x2 * (-6.0d0))
else if (x1 <= (-170.0d0)) then
tmp = t_4
else if (x1 <= 6d+15) then
tmp = x1 + (t_3 + (x1 + (4.0d0 * (x1 * t_0))))
else if (x1 <= 9.5d+95) then
tmp = t_4
else
tmp = x1 * (2.0d0 + (4.0d0 * t_0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (2.0 * x2)) + (t_2 * ((x1 * 2.0) + ((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_2) * 4.0) - 6.0))))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0);
} else if (x1 <= -170.0) {
tmp = t_4;
} else if (x1 <= 6e+15) {
tmp = x1 + (t_3 + (x1 + (4.0 * (x1 * t_0))));
} else if (x1 <= 9.5e+95) {
tmp = t_4;
} else {
tmp = x1 * (2.0 + (4.0 * t_0));
}
return tmp;
}
def code(x1, x2): t_0 = x2 * ((2.0 * x2) - 3.0) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2) t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (2.0 * x2)) + (t_2 * ((x1 * 2.0) + ((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)))))))) tmp = 0 if x1 <= -5.6e+102: tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0) elif x1 <= -170.0: tmp = t_4 elif x1 <= 6e+15: tmp = x1 + (t_3 + (x1 + (4.0 * (x1 * t_0)))) elif x1 <= 9.5e+95: tmp = t_4 else: tmp = x1 * (2.0 + (4.0 * t_0)) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) t_4 = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(2.0 * x2)) + Float64(t_2 * Float64(Float64(x1 * 2.0) + Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) * 4.0) - 6.0))))))))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0)) + Float64(x2 * -6.0)); elseif (x1 <= -170.0) tmp = t_4; elseif (x1 <= 6e+15) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(4.0 * Float64(x1 * t_0))))); elseif (x1 <= 9.5e+95) tmp = t_4; else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * t_0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * ((2.0 * x2) - 3.0); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2); t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (2.0 * x2)) + (t_2 * ((x1 * 2.0) + ((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)))))))); tmp = 0.0; if (x1 <= -5.6e+102) tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0); elseif (x1 <= -170.0) tmp = t_4; elseif (x1 <= 6e+15) tmp = x1 + (t_3 + (x1 + (4.0 * (x1 * t_0)))); elseif (x1 <= 9.5e+95) tmp = t_4; else tmp = x1 * (2.0 + (4.0 * t_0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.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[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(N[(x1 * 2.0), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -170.0], t$95$4, If[LessEqual[x1, 6e+15], N[(x1 + N[(t$95$3 + N[(x1 + N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9.5e+95], t$95$4, N[(x1 * N[(2.0 + N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 + \left(t\_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot \left(2 \cdot x2\right) + t\_2 \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(\frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2} \cdot 4 - 6\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right) + x2 \cdot -6\\
\mathbf{elif}\;x1 \leq -170:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 6 \cdot 10^{+15}:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + 4 \cdot \left(x1 \cdot t\_0\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 9.5 \cdot 10^{+95}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot t\_0\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 4.5%
*-commutative4.5%
*-commutative4.5%
associate-*l*4.5%
Simplified4.5%
Taylor expanded in x1 around 0 21.9%
if -5.60000000000000037e102 < x1 < -170 or 6e15 < x1 < 9.5000000000000004e95Initial program 99.2%
Taylor expanded in x1 around 0 87.0%
Taylor expanded in x1 around 0 80.2%
+-commutative80.2%
neg-mul-180.2%
unsub-neg80.2%
Simplified80.2%
Taylor expanded in x1 around inf 78.4%
*-commutative78.4%
Simplified78.4%
if -170 < x1 < 6e15Initial program 99.4%
Taylor expanded in x1 around 0 88.7%
if 9.5000000000000004e95 < x1 Initial program 24.5%
Taylor expanded in x1 around 0 18.7%
Taylor expanded in x1 around inf 58.3%
Taylor expanded in x1 around inf 58.3%
Final simplification66.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* t_1 (* 2.0 x2)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (* (* x1 x1) (- (* (/ (- (+ t_1 (* 2.0 x2)) x1) t_3) 4.0) 6.0)))
(t_5 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_3)))
(t_6 (* x2 (- (* 2.0 x2) 3.0))))
(if (<= x1 -5.6e+102)
(+ (* x1 (+ (* x2 -12.0) -1.0)) (* x2 -6.0))
(if (<= x1 -62.0)
(+
x1
(+
t_5
(+
x1
(+
t_0
(+
t_2
(* t_3 (+ t_4 (+ (* x1 2.0) (* -2.0 (- (* x2 4.0) 3.0))))))))))
(if (<= x1 6e+15)
(+ x1 (+ t_5 (+ x1 (* 4.0 (* x1 t_6)))))
(if (<= x1 9.5e+95)
(+ x1 (+ t_5 (+ x1 (+ t_0 (+ t_2 (* t_3 (+ (* x1 2.0) t_4)))))))
(* x1 (+ 2.0 (* 4.0 t_6)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = t_1 * (2.0 * x2);
double t_3 = (x1 * x1) + 1.0;
double t_4 = (x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_3) * 4.0) - 6.0);
double t_5 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3);
double t_6 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0);
} else if (x1 <= -62.0) {
tmp = x1 + (t_5 + (x1 + (t_0 + (t_2 + (t_3 * (t_4 + ((x1 * 2.0) + (-2.0 * ((x2 * 4.0) - 3.0)))))))));
} else if (x1 <= 6e+15) {
tmp = x1 + (t_5 + (x1 + (4.0 * (x1 * t_6))));
} else if (x1 <= 9.5e+95) {
tmp = x1 + (t_5 + (x1 + (t_0 + (t_2 + (t_3 * ((x1 * 2.0) + t_4))))));
} else {
tmp = x1 * (2.0 + (4.0 * t_6));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = t_1 * (2.0d0 * x2)
t_3 = (x1 * x1) + 1.0d0
t_4 = (x1 * x1) * (((((t_1 + (2.0d0 * x2)) - x1) / t_3) * 4.0d0) - 6.0d0)
t_5 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_3)
t_6 = x2 * ((2.0d0 * x2) - 3.0d0)
if (x1 <= (-5.6d+102)) then
tmp = (x1 * ((x2 * (-12.0d0)) + (-1.0d0))) + (x2 * (-6.0d0))
else if (x1 <= (-62.0d0)) then
tmp = x1 + (t_5 + (x1 + (t_0 + (t_2 + (t_3 * (t_4 + ((x1 * 2.0d0) + ((-2.0d0) * ((x2 * 4.0d0) - 3.0d0)))))))))
else if (x1 <= 6d+15) then
tmp = x1 + (t_5 + (x1 + (4.0d0 * (x1 * t_6))))
else if (x1 <= 9.5d+95) then
tmp = x1 + (t_5 + (x1 + (t_0 + (t_2 + (t_3 * ((x1 * 2.0d0) + t_4))))))
else
tmp = x1 * (2.0d0 + (4.0d0 * t_6))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = t_1 * (2.0 * x2);
double t_3 = (x1 * x1) + 1.0;
double t_4 = (x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_3) * 4.0) - 6.0);
double t_5 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3);
double t_6 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0);
} else if (x1 <= -62.0) {
tmp = x1 + (t_5 + (x1 + (t_0 + (t_2 + (t_3 * (t_4 + ((x1 * 2.0) + (-2.0 * ((x2 * 4.0) - 3.0)))))))));
} else if (x1 <= 6e+15) {
tmp = x1 + (t_5 + (x1 + (4.0 * (x1 * t_6))));
} else if (x1 <= 9.5e+95) {
tmp = x1 + (t_5 + (x1 + (t_0 + (t_2 + (t_3 * ((x1 * 2.0) + t_4))))));
} else {
tmp = x1 * (2.0 + (4.0 * t_6));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = t_1 * (2.0 * x2) t_3 = (x1 * x1) + 1.0 t_4 = (x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_3) * 4.0) - 6.0) t_5 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3) t_6 = x2 * ((2.0 * x2) - 3.0) tmp = 0 if x1 <= -5.6e+102: tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0) elif x1 <= -62.0: tmp = x1 + (t_5 + (x1 + (t_0 + (t_2 + (t_3 * (t_4 + ((x1 * 2.0) + (-2.0 * ((x2 * 4.0) - 3.0))))))))) elif x1 <= 6e+15: tmp = x1 + (t_5 + (x1 + (4.0 * (x1 * t_6)))) elif x1 <= 9.5e+95: tmp = x1 + (t_5 + (x1 + (t_0 + (t_2 + (t_3 * ((x1 * 2.0) + t_4)))))) else: tmp = x1 * (2.0 + (4.0 * t_6)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(t_1 * Float64(2.0 * x2)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_3) * 4.0) - 6.0)) t_5 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_3)) t_6 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0)) + Float64(x2 * -6.0)); elseif (x1 <= -62.0) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_0 + Float64(t_2 + Float64(t_3 * Float64(t_4 + Float64(Float64(x1 * 2.0) + Float64(-2.0 * Float64(Float64(x2 * 4.0) - 3.0)))))))))); elseif (x1 <= 6e+15) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(4.0 * Float64(x1 * t_6))))); elseif (x1 <= 9.5e+95) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_0 + Float64(t_2 + Float64(t_3 * Float64(Float64(x1 * 2.0) + t_4))))))); else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * t_6))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = t_1 * (2.0 * x2); t_3 = (x1 * x1) + 1.0; t_4 = (x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_3) * 4.0) - 6.0); t_5 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3); t_6 = x2 * ((2.0 * x2) - 3.0); tmp = 0.0; if (x1 <= -5.6e+102) tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0); elseif (x1 <= -62.0) tmp = x1 + (t_5 + (x1 + (t_0 + (t_2 + (t_3 * (t_4 + ((x1 * 2.0) + (-2.0 * ((x2 * 4.0) - 3.0))))))))); elseif (x1 <= 6e+15) tmp = x1 + (t_5 + (x1 + (4.0 * (x1 * t_6)))); elseif (x1 <= 9.5e+95) tmp = x1 + (t_5 + (x1 + (t_0 + (t_2 + (t_3 * ((x1 * 2.0) + t_4)))))); else tmp = x1 * (2.0 + (4.0 * t_6)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -62.0], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$0 + N[(t$95$2 + N[(t$95$3 * N[(t$95$4 + N[(N[(x1 * 2.0), $MachinePrecision] + N[(-2.0 * N[(N[(x2 * 4.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 6e+15], N[(x1 + N[(t$95$5 + N[(x1 + N[(4.0 * N[(x1 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9.5e+95], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$0 + N[(t$95$2 + N[(t$95$3 * N[(N[(x1 * 2.0), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := t\_1 \cdot \left(2 \cdot x2\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \left(x1 \cdot x1\right) \cdot \left(\frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_3} \cdot 4 - 6\right)\\
t_5 := 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_3}\\
t_6 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right) + x2 \cdot -6\\
\mathbf{elif}\;x1 \leq -62:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + \left(t\_0 + \left(t\_2 + t\_3 \cdot \left(t\_4 + \left(x1 \cdot 2 + -2 \cdot \left(x2 \cdot 4 - 3\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 6 \cdot 10^{+15}:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + 4 \cdot \left(x1 \cdot t\_6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 9.5 \cdot 10^{+95}:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + \left(t\_0 + \left(t\_2 + t\_3 \cdot \left(x1 \cdot 2 + t\_4\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot t\_6\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 4.5%
*-commutative4.5%
*-commutative4.5%
associate-*l*4.5%
Simplified4.5%
Taylor expanded in x1 around 0 21.9%
if -5.60000000000000037e102 < x1 < -62Initial program 99.1%
Taylor expanded in x1 around 0 87.7%
Taylor expanded in x1 around 0 73.4%
+-commutative73.4%
neg-mul-173.4%
unsub-neg73.4%
Simplified73.4%
Taylor expanded in x1 around -inf 74.1%
if -62 < x1 < 6e15Initial program 99.4%
Taylor expanded in x1 around 0 88.7%
if 6e15 < x1 < 9.5000000000000004e95Initial program 99.4%
Taylor expanded in x1 around 0 86.3%
Taylor expanded in x1 around 0 86.4%
+-commutative86.4%
neg-mul-186.4%
unsub-neg86.4%
Simplified86.4%
Taylor expanded in x1 around inf 82.3%
*-commutative82.3%
Simplified82.3%
if 9.5000000000000004e95 < x1 Initial program 24.5%
Taylor expanded in x1 around 0 18.7%
Taylor expanded in x1 around inf 58.3%
Taylor expanded in x1 around inf 58.3%
Final simplification66.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* x2 (- (* 2.0 x2) 3.0)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (* (* x1 x1) (- (* (/ (- (+ t_1 (* 2.0 x2)) x1) t_3) 4.0) 6.0)))
(t_5 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_3)))
(t_6 (* t_1 (* 2.0 x2))))
(if (<= x1 -5.6e+102)
(+ (* x1 (+ (* x2 -12.0) -1.0)) (* x2 -6.0))
(if (<= x1 -340.0)
(+
x1
(+
t_5
(+
x1
(+
t_0
(+ t_6 (* t_3 (+ t_4 (* (* (* x1 2.0) (- (* 2.0 x2) x1)) 0.0))))))))
(if (<= x1 1.12e+17)
(+ x1 (+ t_5 (+ x1 (* 4.0 (* x1 t_2)))))
(if (<= x1 9.5e+95)
(+ x1 (+ t_5 (+ x1 (+ t_0 (+ t_6 (* t_3 (+ (* x1 2.0) t_4)))))))
(* x1 (+ 2.0 (* 4.0 t_2)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = x2 * ((2.0 * x2) - 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = (x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_3) * 4.0) - 6.0);
double t_5 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3);
double t_6 = t_1 * (2.0 * x2);
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0);
} else if (x1 <= -340.0) {
tmp = x1 + (t_5 + (x1 + (t_0 + (t_6 + (t_3 * (t_4 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * 0.0)))))));
} else if (x1 <= 1.12e+17) {
tmp = x1 + (t_5 + (x1 + (4.0 * (x1 * t_2))));
} else if (x1 <= 9.5e+95) {
tmp = x1 + (t_5 + (x1 + (t_0 + (t_6 + (t_3 * ((x1 * 2.0) + t_4))))));
} else {
tmp = x1 * (2.0 + (4.0 * t_2));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = x2 * ((2.0d0 * x2) - 3.0d0)
t_3 = (x1 * x1) + 1.0d0
t_4 = (x1 * x1) * (((((t_1 + (2.0d0 * x2)) - x1) / t_3) * 4.0d0) - 6.0d0)
t_5 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_3)
t_6 = t_1 * (2.0d0 * x2)
if (x1 <= (-5.6d+102)) then
tmp = (x1 * ((x2 * (-12.0d0)) + (-1.0d0))) + (x2 * (-6.0d0))
else if (x1 <= (-340.0d0)) then
tmp = x1 + (t_5 + (x1 + (t_0 + (t_6 + (t_3 * (t_4 + (((x1 * 2.0d0) * ((2.0d0 * x2) - x1)) * 0.0d0)))))))
else if (x1 <= 1.12d+17) then
tmp = x1 + (t_5 + (x1 + (4.0d0 * (x1 * t_2))))
else if (x1 <= 9.5d+95) then
tmp = x1 + (t_5 + (x1 + (t_0 + (t_6 + (t_3 * ((x1 * 2.0d0) + t_4))))))
else
tmp = x1 * (2.0d0 + (4.0d0 * t_2))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = x2 * ((2.0 * x2) - 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = (x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_3) * 4.0) - 6.0);
double t_5 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3);
double t_6 = t_1 * (2.0 * x2);
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0);
} else if (x1 <= -340.0) {
tmp = x1 + (t_5 + (x1 + (t_0 + (t_6 + (t_3 * (t_4 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * 0.0)))))));
} else if (x1 <= 1.12e+17) {
tmp = x1 + (t_5 + (x1 + (4.0 * (x1 * t_2))));
} else if (x1 <= 9.5e+95) {
tmp = x1 + (t_5 + (x1 + (t_0 + (t_6 + (t_3 * ((x1 * 2.0) + t_4))))));
} else {
tmp = x1 * (2.0 + (4.0 * t_2));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = x2 * ((2.0 * x2) - 3.0) t_3 = (x1 * x1) + 1.0 t_4 = (x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_3) * 4.0) - 6.0) t_5 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3) t_6 = t_1 * (2.0 * x2) tmp = 0 if x1 <= -5.6e+102: tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0) elif x1 <= -340.0: tmp = x1 + (t_5 + (x1 + (t_0 + (t_6 + (t_3 * (t_4 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * 0.0))))))) elif x1 <= 1.12e+17: tmp = x1 + (t_5 + (x1 + (4.0 * (x1 * t_2)))) elif x1 <= 9.5e+95: tmp = x1 + (t_5 + (x1 + (t_0 + (t_6 + (t_3 * ((x1 * 2.0) + t_4)))))) else: tmp = x1 * (2.0 + (4.0 * t_2)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_3) * 4.0) - 6.0)) t_5 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_3)) t_6 = Float64(t_1 * Float64(2.0 * x2)) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0)) + Float64(x2 * -6.0)); elseif (x1 <= -340.0) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_0 + Float64(t_6 + Float64(t_3 * Float64(t_4 + Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)) * 0.0)))))))); elseif (x1 <= 1.12e+17) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(4.0 * Float64(x1 * t_2))))); elseif (x1 <= 9.5e+95) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_0 + Float64(t_6 + Float64(t_3 * Float64(Float64(x1 * 2.0) + t_4))))))); else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * t_2))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = x2 * ((2.0 * x2) - 3.0); t_3 = (x1 * x1) + 1.0; t_4 = (x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_3) * 4.0) - 6.0); t_5 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3); t_6 = t_1 * (2.0 * x2); tmp = 0.0; if (x1 <= -5.6e+102) tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0); elseif (x1 <= -340.0) tmp = x1 + (t_5 + (x1 + (t_0 + (t_6 + (t_3 * (t_4 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * 0.0))))))); elseif (x1 <= 1.12e+17) tmp = x1 + (t_5 + (x1 + (4.0 * (x1 * t_2)))); elseif (x1 <= 9.5e+95) tmp = x1 + (t_5 + (x1 + (t_0 + (t_6 + (t_3 * ((x1 * 2.0) + t_4)))))); else tmp = x1 * (2.0 + (4.0 * t_2)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -340.0], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$0 + N[(t$95$6 + N[(t$95$3 * N[(t$95$4 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] * 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.12e+17], N[(x1 + N[(t$95$5 + N[(x1 + N[(4.0 * N[(x1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9.5e+95], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$0 + N[(t$95$6 + N[(t$95$3 * N[(N[(x1 * 2.0), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \left(x1 \cdot x1\right) \cdot \left(\frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_3} \cdot 4 - 6\right)\\
t_5 := 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_3}\\
t_6 := t\_1 \cdot \left(2 \cdot x2\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right) + x2 \cdot -6\\
\mathbf{elif}\;x1 \leq -340:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + \left(t\_0 + \left(t\_6 + t\_3 \cdot \left(t\_4 + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right) \cdot 0\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.12 \cdot 10^{+17}:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + 4 \cdot \left(x1 \cdot t\_2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 9.5 \cdot 10^{+95}:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + \left(t\_0 + \left(t\_6 + t\_3 \cdot \left(x1 \cdot 2 + t\_4\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot t\_2\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 4.5%
*-commutative4.5%
*-commutative4.5%
associate-*l*4.5%
Simplified4.5%
Taylor expanded in x1 around 0 21.9%
if -5.60000000000000037e102 < x1 < -340Initial program 99.1%
Taylor expanded in x1 around 0 87.7%
Taylor expanded in x1 around 0 73.4%
+-commutative73.4%
neg-mul-173.4%
unsub-neg73.4%
Simplified73.4%
Taylor expanded in x1 around inf 77.7%
if -340 < x1 < 1.12e17Initial program 99.4%
Taylor expanded in x1 around 0 88.7%
if 1.12e17 < x1 < 9.5000000000000004e95Initial program 99.4%
Taylor expanded in x1 around 0 86.3%
Taylor expanded in x1 around 0 86.4%
+-commutative86.4%
neg-mul-186.4%
unsub-neg86.4%
Simplified86.4%
Taylor expanded in x1 around inf 82.3%
*-commutative82.3%
Simplified82.3%
if 9.5000000000000004e95 < x1 Initial program 24.5%
Taylor expanded in x1 around 0 18.7%
Taylor expanded in x1 around inf 58.3%
Taylor expanded in x1 around inf 58.3%
Final simplification67.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0))) (t_1 (+ (* x1 x1) 1.0)))
(if (<= x1 -5.6e+102)
(+ (* x1 (+ (* x2 -12.0) -1.0)) (* x2 -6.0))
(if (<= x1 9.5e+95)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* x1 x1) 6.0)
(*
(- (/ (- (+ t_0 (* 2.0 x2)) x1) t_1) 3.0)
(* (* x1 2.0) (- (* 2.0 x2) x1)))))
(* t_0 (* 2.0 x2)))))))
(* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0);
} else if (x1 <= 9.5e+95) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((x1 * x1) * 6.0) + (((((t_0 + (2.0 * x2)) - x1) / t_1) - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))) + (t_0 * (2.0 * x2))))));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
if (x1 <= (-5.6d+102)) then
tmp = (x1 * ((x2 * (-12.0d0)) + (-1.0d0))) + (x2 * (-6.0d0))
else if (x1 <= 9.5d+95) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((x1 * x1) * 6.0d0) + (((((t_0 + (2.0d0 * x2)) - x1) / t_1) - 3.0d0) * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1))))) + (t_0 * (2.0d0 * x2))))))
else
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0);
} else if (x1 <= 9.5e+95) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((x1 * x1) * 6.0) + (((((t_0 + (2.0 * x2)) - x1) / t_1) - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))) + (t_0 * (2.0 * x2))))));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 tmp = 0 if x1 <= -5.6e+102: tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0) elif x1 <= 9.5e+95: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((x1 * x1) * 6.0) + (((((t_0 + (2.0 * x2)) - x1) / t_1) - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))) + (t_0 * (2.0 * x2)))))) else: tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0)) + Float64(x2 * -6.0)); elseif (x1 <= 9.5e+95) 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(x1 * x1) * 6.0) + Float64(Float64(Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1))))) + Float64(t_0 * Float64(2.0 * x2))))))); else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; tmp = 0.0; if (x1 <= -5.6e+102) tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0); elseif (x1 <= 9.5e+95) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((x1 * x1) * 6.0) + (((((t_0 + (2.0 * x2)) - x1) / t_1) - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))) + (t_0 * (2.0 * x2)))))); else tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9.5e+95], 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[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + N[(N[(N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right) + x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 9.5 \cdot 10^{+95}:\\
\;\;\;\;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(x1 \cdot x1\right) \cdot 6 + \left(\frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right) + t\_0 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 4.5%
*-commutative4.5%
*-commutative4.5%
associate-*l*4.5%
Simplified4.5%
Taylor expanded in x1 around 0 21.9%
if -5.60000000000000037e102 < x1 < 9.5000000000000004e95Initial program 99.3%
Taylor expanded in x1 around 0 95.5%
Taylor expanded in x1 around 0 92.9%
+-commutative92.9%
neg-mul-192.9%
unsub-neg92.9%
Simplified92.9%
Taylor expanded in x1 around inf 91.7%
if 9.5000000000000004e95 < x1 Initial program 24.5%
Taylor expanded in x1 around 0 18.7%
Taylor expanded in x1 around inf 58.3%
Taylor expanded in x1 around inf 58.3%
Final simplification70.3%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -4.5e+67) (+ (* x1 (+ (* x2 -12.0) -1.0)) (* x2 -6.0)) (+ x1 (+ (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)) (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -4.5e+67) {
tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0);
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-4.5d+67)) then
tmp = (x1 * ((x2 * (-12.0d0)) + (-1.0d0))) + (x2 * (-6.0d0))
else
tmp = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -4.5e+67) {
tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0);
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -4.5e+67: tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0) else: tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -4.5e+67) tmp = Float64(Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0)) + Float64(x2 * -6.0)); else tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -4.5e+67) tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0); else tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -4.5e+67], N[(N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+67}:\\
\;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right) + x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\
\end{array}
\end{array}
if x1 < -4.4999999999999998e67Initial program 11.2%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 4.2%
*-commutative4.2%
*-commutative4.2%
associate-*l*4.2%
Simplified4.2%
Taylor expanded in x1 around 0 19.9%
if -4.4999999999999998e67 < x1 Initial program 80.4%
Taylor expanded in x1 around 0 74.1%
*-commutative74.1%
fma-def74.1%
+-commutative74.1%
neg-mul-174.1%
unsub-neg74.1%
+-commutative74.1%
unpow374.1%
unpow274.1%
distribute-lft-out74.7%
cancel-sign-sub-inv74.7%
metadata-eval74.7%
+-commutative74.7%
Simplified74.7%
Taylor expanded in x1 around 0 66.4%
Final simplification55.2%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -6.8e+112) (not (<= x2 1.5e+217))) (* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))) (+ (* x1 (+ (* x2 -12.0) -1.0)) (* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -6.8e+112) || !(x2 <= 1.5e+217)) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
} else {
tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-6.8d+112)) .or. (.not. (x2 <= 1.5d+217))) then
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
else
tmp = (x1 * ((x2 * (-12.0d0)) + (-1.0d0))) + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -6.8e+112) || !(x2 <= 1.5e+217)) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
} else {
tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -6.8e+112) or not (x2 <= 1.5e+217): tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) else: tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -6.8e+112) || !(x2 <= 1.5e+217)) tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); else tmp = Float64(Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0)) + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -6.8e+112) || ~((x2 <= 1.5e+217))) tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); else tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -6.8e+112], N[Not[LessEqual[x2, 1.5e+217]], $MachinePrecision]], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -6.8 \cdot 10^{+112} \lor \neg \left(x2 \leq 1.5 \cdot 10^{+217}\right):\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right) + x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -6.79999999999999987e112 or 1.49999999999999988e217 < x2 Initial program 62.6%
Taylor expanded in x1 around 0 54.4%
Taylor expanded in x1 around inf 69.3%
Taylor expanded in x1 around inf 69.3%
if -6.79999999999999987e112 < x2 < 1.49999999999999988e217Initial program 64.0%
Taylor expanded in x1 around 0 40.2%
Taylor expanded in x2 around 0 37.1%
*-commutative37.1%
*-commutative37.1%
associate-*l*37.1%
Simplified37.1%
Taylor expanded in x1 around 0 40.5%
Final simplification48.0%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -6.6e+86) (not (<= x1 0.186))) (* x1 (+ 2.0 (* x2 -12.0))) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -6.6e+86) || !(x1 <= 0.186)) {
tmp = x1 * (2.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 <= (-6.6d+86)) .or. (.not. (x1 <= 0.186d0))) then
tmp = x1 * (2.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 <= -6.6e+86) || !(x1 <= 0.186)) {
tmp = x1 * (2.0 + (x2 * -12.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -6.6e+86) or not (x1 <= 0.186): tmp = x1 * (2.0 + (x2 * -12.0)) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -6.6e+86) || !(x1 <= 0.186)) tmp = Float64(x1 * Float64(2.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 <= -6.6e+86) || ~((x1 <= 0.186))) tmp = x1 * (2.0 + (x2 * -12.0)); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -6.6e+86], N[Not[LessEqual[x1, 0.186]], $MachinePrecision]], N[(x1 * N[(2.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -6.6 \cdot 10^{+86} \lor \neg \left(x1 \leq 0.186\right):\\
\;\;\;\;x1 \cdot \left(2 + x2 \cdot -12\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -6.5999999999999998e86 or 0.186 < x1 Initial program 29.6%
Taylor expanded in x1 around 0 11.6%
Taylor expanded in x2 around 0 5.4%
*-commutative5.4%
*-commutative5.4%
associate-*l*5.4%
Simplified5.4%
Taylor expanded in x1 around inf 18.1%
*-commutative18.1%
Simplified18.1%
if -6.5999999999999998e86 < x1 < 0.186Initial program 99.3%
Taylor expanded in x1 around 0 77.7%
Taylor expanded in x2 around 0 56.4%
*-commutative56.4%
*-commutative56.4%
associate-*l*56.4%
Simplified56.4%
Taylor expanded in x1 around 0 37.6%
*-commutative37.6%
Simplified37.6%
Final simplification27.6%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -2.05e-28) (+ 9.0 (+ (* x1 2.0) (* -12.0 (* x1 x2)))) (if (<= x1 0.186) (* x2 -6.0) (* x1 (+ 2.0 (* x2 -12.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.05e-28) {
tmp = 9.0 + ((x1 * 2.0) + (-12.0 * (x1 * x2)));
} else if (x1 <= 0.186) {
tmp = x2 * -6.0;
} else {
tmp = x1 * (2.0 + (x2 * -12.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.05d-28)) then
tmp = 9.0d0 + ((x1 * 2.0d0) + ((-12.0d0) * (x1 * x2)))
else if (x1 <= 0.186d0) then
tmp = x2 * (-6.0d0)
else
tmp = x1 * (2.0d0 + (x2 * (-12.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.05e-28) {
tmp = 9.0 + ((x1 * 2.0) + (-12.0 * (x1 * x2)));
} else if (x1 <= 0.186) {
tmp = x2 * -6.0;
} else {
tmp = x1 * (2.0 + (x2 * -12.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.05e-28: tmp = 9.0 + ((x1 * 2.0) + (-12.0 * (x1 * x2))) elif x1 <= 0.186: tmp = x2 * -6.0 else: tmp = x1 * (2.0 + (x2 * -12.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.05e-28) tmp = Float64(9.0 + Float64(Float64(x1 * 2.0) + Float64(-12.0 * Float64(x1 * x2)))); elseif (x1 <= 0.186) tmp = Float64(x2 * -6.0); else tmp = Float64(x1 * Float64(2.0 + Float64(x2 * -12.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.05e-28) tmp = 9.0 + ((x1 * 2.0) + (-12.0 * (x1 * x2))); elseif (x1 <= 0.186) tmp = x2 * -6.0; else tmp = x1 * (2.0 + (x2 * -12.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.05e-28], N[(9.0 + N[(N[(x1 * 2.0), $MachinePrecision] + N[(-12.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.186], N[(x2 * -6.0), $MachinePrecision], N[(x1 * N[(2.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.05 \cdot 10^{-28}:\\
\;\;\;\;9 + \left(x1 \cdot 2 + -12 \cdot \left(x1 \cdot x2\right)\right)\\
\mathbf{elif}\;x1 \leq 0.186:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + x2 \cdot -12\right)\\
\end{array}
\end{array}
if x1 < -2.0500000000000001e-28Initial program 32.6%
Taylor expanded in x1 around 0 8.6%
Taylor expanded in x1 around inf 7.1%
Taylor expanded in x2 around 0 14.0%
if -2.0500000000000001e-28 < x1 < 0.186Initial program 99.5%
Taylor expanded in x1 around 0 90.1%
Taylor expanded in x2 around 0 68.6%
*-commutative68.6%
*-commutative68.6%
associate-*l*68.6%
Simplified68.6%
Taylor expanded in x1 around 0 46.3%
*-commutative46.3%
Simplified46.3%
if 0.186 < x1 Initial program 49.8%
Taylor expanded in x1 around 0 20.6%
Taylor expanded in x2 around 0 6.0%
*-commutative6.0%
*-commutative6.0%
associate-*l*6.0%
Simplified6.0%
Taylor expanded in x1 around inf 17.6%
*-commutative17.6%
Simplified17.6%
Final simplification27.7%
(FPCore (x1 x2) :precision binary64 (+ (* x1 (+ (* x2 -12.0) -1.0)) (* x2 -6.0)))
double code(double x1, double x2) {
return (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x1 * ((x2 * (-12.0d0)) + (-1.0d0))) + (x2 * (-6.0d0))
end function
public static double code(double x1, double x2) {
return (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0);
}
def code(x1, x2): return (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0)
function code(x1, x2) return Float64(Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0)) + Float64(x2 * -6.0)) end
function tmp = code(x1, x2) tmp = (x1 * ((x2 * -12.0) + -1.0)) + (x2 * -6.0); end
code[x1_, x2_] := N[(N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 \cdot \left(x2 \cdot -12 + -1\right) + x2 \cdot -6
\end{array}
Initial program 63.7%
Taylor expanded in x1 around 0 43.9%
Taylor expanded in x2 around 0 30.3%
*-commutative30.3%
*-commutative30.3%
associate-*l*30.3%
Simplified30.3%
Taylor expanded in x1 around 0 36.3%
Final simplification36.3%
(FPCore (x1 x2) :precision binary64 (+ x1 (* x2 -6.0)))
double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + (x2 * (-6.0d0))
end function
public static double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
def code(x1, x2): return x1 + (x2 * -6.0)
function code(x1, x2) return Float64(x1 + Float64(x2 * -6.0)) end
function tmp = code(x1, x2) tmp = x1 + (x2 * -6.0); end
code[x1_, x2_] := N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + x2 \cdot -6
\end{array}
Initial program 63.7%
Taylor expanded in x1 around 0 58.9%
*-commutative58.9%
fma-def58.9%
+-commutative58.9%
neg-mul-158.9%
unsub-neg58.9%
+-commutative58.9%
unpow358.9%
unpow258.9%
distribute-lft-out59.3%
cancel-sign-sub-inv59.3%
metadata-eval59.3%
+-commutative59.3%
Simplified59.3%
Taylor expanded in x1 around 0 19.8%
*-commutative19.8%
Simplified19.8%
Final simplification19.8%
(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 63.7%
Taylor expanded in x1 around 0 43.9%
Taylor expanded in x2 around 0 30.3%
*-commutative30.3%
*-commutative30.3%
associate-*l*30.3%
Simplified30.3%
Taylor expanded in x1 around 0 19.7%
*-commutative19.7%
Simplified19.7%
Final simplification19.7%
(FPCore (x1 x2) :precision binary64 9.0)
double code(double x1, double x2) {
return 9.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = 9.0d0
end function
public static double code(double x1, double x2) {
return 9.0;
}
def code(x1, x2): return 9.0
function code(x1, x2) return 9.0 end
function tmp = code(x1, x2) tmp = 9.0; end
code[x1_, x2_] := 9.0
\begin{array}{l}
\\
9
\end{array}
Initial program 63.7%
Taylor expanded in x1 around 0 43.9%
Taylor expanded in x1 around inf 26.2%
Taylor expanded in x1 around 0 3.4%
Final simplification3.4%
herbie shell --seed 2024031
(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))))))