
(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 15 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 (* (* 3.0 x1) x1))
(t_1 (/ (- (fma x1 (* x1 3.0) (* 2.0 x2)) x1) (fma x1 x1 1.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_4 (* 3.0 (* x1 x1))))
(if (<=
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* 4.0 t_3) 6.0)))
t_2)
(* t_0 t_3))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 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_1 4.0 -6.0)) (* (* x1 (* 2.0 t_1)) (+ t_1 -3.0)))
(fma t_4 t_1 (pow x1 3.0))))))
(+ x1 (* x1 (- (* x1 (- (* x1 (- (* 6.0 x1) 3.0)) 3.0)) 18.0))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (fma(x1, (x1 * 3.0), (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = 3.0 * (x1 * x1);
double tmp;
if ((x1 + (((((((((2.0 * x1) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0))) * t_2) + (t_0 * t_3)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (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_1, 4.0, -6.0)), ((x1 * (2.0 * t_1)) * (t_1 + -3.0))), fma(t_4, t_1, pow(x1, 3.0)))));
} else {
tmp = x1 + (x1 * ((x1 * ((x1 * ((6.0 * x1) - 3.0)) - 3.0)) - 18.0));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(3.0 * Float64(x1 * x1)) tmp = 0.0 if (Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_3) - 6.0))) * t_2) + Float64(t_0 * t_3)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - 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_1, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_1)) * Float64(t_1 + -3.0))), fma(t_4, t_1, (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * Float64(Float64(6.0 * x1) - 3.0)) - 3.0)) - 18.0))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = 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$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$3), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] + N[(t$95$0 * t$95$3), $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$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$1 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * t$95$1 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(N[(x1 * N[(N[(x1 * N[(N[(6.0 * x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] - 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := 3 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_3 - 6\right)\right) \cdot t\_2 + t\_0 \cdot t\_3\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 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\_1, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_1\right)\right) \cdot \left(t\_1 + -3\right)\right), \mathsf{fma}\left(t\_4, t\_1, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot \left(6 \cdot x1 - 3\right) - 3\right) - 18\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.4%
Simplified99.6%
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%
Taylor expanded in x2 around 0 100.0%
(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))
(t_3
(+
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))))))
(if (<= t_3 INFINITY)
t_3
(+ x1 (* x1 (- (* x1 (- (* x1 (- (* 6.0 x1) 3.0)) 3.0)) 18.0))))))
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;
double t_3 = 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 tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + (x1 * ((x1 * ((x1 * ((6.0 * x1) - 3.0)) - 3.0)) - 18.0));
}
return tmp;
}
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;
double t_3 = 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 tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + (x1 * ((x1 * ((x1 * ((6.0 * x1) - 3.0)) - 3.0)) - 18.0));
}
return tmp;
}
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 t_3 = 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))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + (x1 * ((x1 * ((x1 * ((6.0 * x1) - 3.0)) - 3.0)) - 18.0)) return tmp
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) t_3 = 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)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * Float64(Float64(6.0 * x1) - 3.0)) - 3.0)) - 18.0))); end return tmp end
function tmp_2 = 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; t_3 = 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))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + (x1 * ((x1 * ((x1 * ((6.0 * x1) - 3.0)) - 3.0)) - 18.0)); end tmp_2 = tmp; 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]}, Block[{t$95$3 = 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]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(x1 * N[(N[(x1 * N[(N[(x1 * N[(N[(6.0 * x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] - 18.0), $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}\\
t_3 := 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)\\
\mathbf{if}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot \left(6 \cdot x1 - 3\right) - 3\right) - 18\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.4%
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%
Taylor expanded in x2 around 0 100.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (- (* 2.0 x2) 3.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -1.06e+51)
(+
x1
(*
x1
(+
(* -1.0 (+ 2.0 (* -2.0 (+ 1.0 (* 3.0 t_2)))))
(* x1 (+ 9.0 (+ (* 4.0 t_2) (* x1 (- (* 6.0 x1) 3.0))))))))
(if (<= x1 5e+153)
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* 4.0 t_3) 6.0)))
t_1)
(* t_0 3.0))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))
(+ (* -6.0 x2) (* x1 (- (* 9.0 x1) 1.0)))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = (2.0 * x2) - 3.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -1.06e+51) {
tmp = x1 + (x1 * ((-1.0 * (2.0 + (-2.0 * (1.0 + (3.0 * t_2))))) + (x1 * (9.0 + ((4.0 * t_2) + (x1 * ((6.0 * x1) - 3.0)))))));
} else if (x1 <= 5e+153) {
tmp = x1 + (((((((((2.0 * x1) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0))) * t_1) + (t_0 * 3.0)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
} else {
tmp = (-6.0 * x2) + (x1 * ((9.0 * x1) - 1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = (2.0d0 * x2) - 3.0d0
t_3 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-1.06d+51)) then
tmp = x1 + (x1 * (((-1.0d0) * (2.0d0 + ((-2.0d0) * (1.0d0 + (3.0d0 * t_2))))) + (x1 * (9.0d0 + ((4.0d0 * t_2) + (x1 * ((6.0d0 * x1) - 3.0d0)))))))
else if (x1 <= 5d+153) then
tmp = x1 + (((((((((2.0d0 * x1) * t_3) * (t_3 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_3) - 6.0d0))) * t_1) + (t_0 * 3.0d0)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
else
tmp = ((-6.0d0) * x2) + (x1 * ((9.0d0 * x1) - 1.0d0))
end if
code = tmp
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 = (2.0 * x2) - 3.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -1.06e+51) {
tmp = x1 + (x1 * ((-1.0 * (2.0 + (-2.0 * (1.0 + (3.0 * t_2))))) + (x1 * (9.0 + ((4.0 * t_2) + (x1 * ((6.0 * x1) - 3.0)))))));
} else if (x1 <= 5e+153) {
tmp = x1 + (((((((((2.0 * x1) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0))) * t_1) + (t_0 * 3.0)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
} else {
tmp = (-6.0 * x2) + (x1 * ((9.0 * x1) - 1.0));
}
return tmp;
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = (2.0 * x2) - 3.0 t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -1.06e+51: tmp = x1 + (x1 * ((-1.0 * (2.0 + (-2.0 * (1.0 + (3.0 * t_2))))) + (x1 * (9.0 + ((4.0 * t_2) + (x1 * ((6.0 * x1) - 3.0))))))) elif x1 <= 5e+153: tmp = x1 + (((((((((2.0 * x1) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0))) * t_1) + (t_0 * 3.0)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) else: tmp = (-6.0 * x2) + (x1 * ((9.0 * x1) - 1.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(2.0 * x2) - 3.0) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -1.06e+51) tmp = Float64(x1 + Float64(x1 * Float64(Float64(-1.0 * Float64(2.0 + Float64(-2.0 * Float64(1.0 + Float64(3.0 * t_2))))) + Float64(x1 * Float64(9.0 + Float64(Float64(4.0 * t_2) + Float64(x1 * Float64(Float64(6.0 * x1) - 3.0)))))))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_3) - 6.0))) * t_1) + Float64(t_0 * 3.0)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))); else tmp = Float64(Float64(-6.0 * x2) + Float64(x1 * Float64(Float64(9.0 * x1) - 1.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = (2.0 * x2) - 3.0; t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -1.06e+51) tmp = x1 + (x1 * ((-1.0 * (2.0 + (-2.0 * (1.0 + (3.0 * t_2))))) + (x1 * (9.0 + ((4.0 * t_2) + (x1 * ((6.0 * x1) - 3.0))))))); elseif (x1 <= 5e+153) tmp = x1 + (((((((((2.0 * x1) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0))) * t_1) + (t_0 * 3.0)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); else tmp = (-6.0 * x2) + (x1 * ((9.0 * x1) - 1.0)); end tmp_2 = tmp; 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[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -1.06e+51], N[(x1 + N[(x1 * N[(N[(-1.0 * N[(2.0 + N[(-2.0 * N[(1.0 + N[(3.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(9.0 + N[(N[(4.0 * t$95$2), $MachinePrecision] + N[(x1 * N[(N[(6.0 * x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$3), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * 3.0), $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], N[(N[(-6.0 * x2), $MachinePrecision] + N[(x1 * N[(N[(9.0 * x1), $MachinePrecision] - 1.0), $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 := 2 \cdot x2 - 3\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -1.06 \cdot 10^{+51}:\\
\;\;\;\;x1 + x1 \cdot \left(-1 \cdot \left(2 + -2 \cdot \left(1 + 3 \cdot t\_2\right)\right) + x1 \cdot \left(9 + \left(4 \cdot t\_2 + x1 \cdot \left(6 \cdot x1 - 3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_3 - 6\right)\right) \cdot t\_1 + t\_0 \cdot 3\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)\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot x2 + x1 \cdot \left(9 \cdot x1 - 1\right)\\
\end{array}
\end{array}
if x1 < -1.06000000000000004e51Initial program 28.6%
Simplified28.6%
Taylor expanded in x1 around -inf 99.9%
Taylor expanded in x1 around 0 99.9%
if -1.06000000000000004e51 < x1 < 5.00000000000000018e153Initial program 99.4%
Taylor expanded in x1 around inf 98.3%
if 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 90.3%
Taylor expanded in x2 around 0 100.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (- (* 2.0 x2) 3.0))
(t_3 (* x1 (- (* 6.0 x1) 3.0)))
(t_4 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -4.7e+49)
(+
x1
(*
x1
(+
(* -1.0 (+ 2.0 (* -2.0 (+ 1.0 (* 3.0 t_2)))))
(* x1 (+ 9.0 (+ (* 4.0 t_2) t_3))))))
(if (<= x1 5e+76)
(+
x1
(+
(+
(+
(+
(*
(+ (* (* (* 2.0 x1) t_4) t_2) (* (* x1 x1) (- (* 4.0 3.0) 6.0)))
t_1)
(* t_0 t_4))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))
(+ x1 (* x1 (- (* x1 (- t_3 3.0)) 18.0)))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = (2.0 * x2) - 3.0;
double t_3 = x1 * ((6.0 * x1) - 3.0);
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -4.7e+49) {
tmp = x1 + (x1 * ((-1.0 * (2.0 + (-2.0 * (1.0 + (3.0 * t_2))))) + (x1 * (9.0 + ((4.0 * t_2) + t_3)))));
} else if (x1 <= 5e+76) {
tmp = x1 + (((((((((2.0 * x1) * t_4) * t_2) + ((x1 * x1) * ((4.0 * 3.0) - 6.0))) * t_1) + (t_0 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
} else {
tmp = x1 + (x1 * ((x1 * (t_3 - 3.0)) - 18.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 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = (2.0d0 * x2) - 3.0d0
t_3 = x1 * ((6.0d0 * x1) - 3.0d0)
t_4 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-4.7d+49)) then
tmp = x1 + (x1 * (((-1.0d0) * (2.0d0 + ((-2.0d0) * (1.0d0 + (3.0d0 * t_2))))) + (x1 * (9.0d0 + ((4.0d0 * t_2) + t_3)))))
else if (x1 <= 5d+76) then
tmp = x1 + (((((((((2.0d0 * x1) * t_4) * t_2) + ((x1 * x1) * ((4.0d0 * 3.0d0) - 6.0d0))) * t_1) + (t_0 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
else
tmp = x1 + (x1 * ((x1 * (t_3 - 3.0d0)) - 18.0d0))
end if
code = tmp
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 = (2.0 * x2) - 3.0;
double t_3 = x1 * ((6.0 * x1) - 3.0);
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -4.7e+49) {
tmp = x1 + (x1 * ((-1.0 * (2.0 + (-2.0 * (1.0 + (3.0 * t_2))))) + (x1 * (9.0 + ((4.0 * t_2) + t_3)))));
} else if (x1 <= 5e+76) {
tmp = x1 + (((((((((2.0 * x1) * t_4) * t_2) + ((x1 * x1) * ((4.0 * 3.0) - 6.0))) * t_1) + (t_0 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
} else {
tmp = x1 + (x1 * ((x1 * (t_3 - 3.0)) - 18.0));
}
return tmp;
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = (2.0 * x2) - 3.0 t_3 = x1 * ((6.0 * x1) - 3.0) t_4 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -4.7e+49: tmp = x1 + (x1 * ((-1.0 * (2.0 + (-2.0 * (1.0 + (3.0 * t_2))))) + (x1 * (9.0 + ((4.0 * t_2) + t_3))))) elif x1 <= 5e+76: tmp = x1 + (((((((((2.0 * x1) * t_4) * t_2) + ((x1 * x1) * ((4.0 * 3.0) - 6.0))) * t_1) + (t_0 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) else: tmp = x1 + (x1 * ((x1 * (t_3 - 3.0)) - 18.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(2.0 * x2) - 3.0) t_3 = Float64(x1 * Float64(Float64(6.0 * x1) - 3.0)) t_4 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -4.7e+49) tmp = Float64(x1 + Float64(x1 * Float64(Float64(-1.0 * Float64(2.0 + Float64(-2.0 * Float64(1.0 + Float64(3.0 * t_2))))) + Float64(x1 * Float64(9.0 + Float64(Float64(4.0 * t_2) + t_3)))))); elseif (x1 <= 5e+76) tmp = Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_4) * t_2) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * 3.0) - 6.0))) * t_1) + Float64(t_0 * t_4)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))); else tmp = Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(t_3 - 3.0)) - 18.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = (2.0 * x2) - 3.0; t_3 = x1 * ((6.0 * x1) - 3.0); t_4 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -4.7e+49) tmp = x1 + (x1 * ((-1.0 * (2.0 + (-2.0 * (1.0 + (3.0 * t_2))))) + (x1 * (9.0 + ((4.0 * t_2) + t_3))))); elseif (x1 <= 5e+76) tmp = x1 + (((((((((2.0 * x1) * t_4) * t_2) + ((x1 * x1) * ((4.0 * 3.0) - 6.0))) * t_1) + (t_0 * t_4)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); else tmp = x1 + (x1 * ((x1 * (t_3 - 3.0)) - 18.0)); end tmp_2 = tmp; 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[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(N[(6.0 * x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -4.7e+49], N[(x1 + N[(x1 * N[(N[(-1.0 * N[(2.0 + N[(-2.0 * N[(1.0 + N[(3.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(9.0 + N[(N[(4.0 * t$95$2), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+76], N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$4), $MachinePrecision] * t$95$2), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * 3.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$4), $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], N[(x1 + N[(x1 * N[(N[(x1 * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] - 18.0), $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 := 2 \cdot x2 - 3\\
t_3 := x1 \cdot \left(6 \cdot x1 - 3\right)\\
t_4 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -4.7 \cdot 10^{+49}:\\
\;\;\;\;x1 + x1 \cdot \left(-1 \cdot \left(2 + -2 \cdot \left(1 + 3 \cdot t\_2\right)\right) + x1 \cdot \left(9 + \left(4 \cdot t\_2 + t\_3\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+76}:\\
\;\;\;\;x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_4\right) \cdot t\_2 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot 3 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_4\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)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(t\_3 - 3\right) - 18\right)\\
\end{array}
\end{array}
if x1 < -4.6999999999999997e49Initial program 28.6%
Simplified28.6%
Taylor expanded in x1 around -inf 99.9%
Taylor expanded in x1 around 0 99.9%
if -4.6999999999999997e49 < x1 < 4.99999999999999991e76Initial program 99.3%
Taylor expanded in x1 around 0 95.1%
Taylor expanded in x1 around inf 94.9%
if 4.99999999999999991e76 < x1 Initial program 24.4%
Simplified24.4%
Taylor expanded in x1 around -inf 100.0%
Taylor expanded in x1 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* 2.0 x2) 3.0)) (t_1 (* x1 (- (* 6.0 x1) 3.0))))
(if (<= x1 -220.0)
(+
x1
(*
x1
(+
(* -1.0 (+ 2.0 (* -2.0 (+ 1.0 (* 3.0 t_0)))))
(* x1 (+ 9.0 (+ (* 4.0 t_0) t_1))))))
(if (<= x1 0.29)
(+
(* -6.0 x2)
(+
(* x1 (- (* 9.0 x1) 1.0))
(* x2 (+ (* 8.0 (* x1 x2)) (* x1 (- (* 12.0 x1) 12.0))))))
(+ x1 (* x1 (- (* x1 (- t_1 3.0)) 18.0)))))))
double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = x1 * ((6.0 * x1) - 3.0);
double tmp;
if (x1 <= -220.0) {
tmp = x1 + (x1 * ((-1.0 * (2.0 + (-2.0 * (1.0 + (3.0 * t_0))))) + (x1 * (9.0 + ((4.0 * t_0) + t_1)))));
} else if (x1 <= 0.29) {
tmp = (-6.0 * x2) + ((x1 * ((9.0 * x1) - 1.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((12.0 * x1) - 12.0)))));
} else {
tmp = x1 + (x1 * ((x1 * (t_1 - 3.0)) - 18.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 = (2.0d0 * x2) - 3.0d0
t_1 = x1 * ((6.0d0 * x1) - 3.0d0)
if (x1 <= (-220.0d0)) then
tmp = x1 + (x1 * (((-1.0d0) * (2.0d0 + ((-2.0d0) * (1.0d0 + (3.0d0 * t_0))))) + (x1 * (9.0d0 + ((4.0d0 * t_0) + t_1)))))
else if (x1 <= 0.29d0) then
tmp = ((-6.0d0) * x2) + ((x1 * ((9.0d0 * x1) - 1.0d0)) + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * ((12.0d0 * x1) - 12.0d0)))))
else
tmp = x1 + (x1 * ((x1 * (t_1 - 3.0d0)) - 18.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = x1 * ((6.0 * x1) - 3.0);
double tmp;
if (x1 <= -220.0) {
tmp = x1 + (x1 * ((-1.0 * (2.0 + (-2.0 * (1.0 + (3.0 * t_0))))) + (x1 * (9.0 + ((4.0 * t_0) + t_1)))));
} else if (x1 <= 0.29) {
tmp = (-6.0 * x2) + ((x1 * ((9.0 * x1) - 1.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((12.0 * x1) - 12.0)))));
} else {
tmp = x1 + (x1 * ((x1 * (t_1 - 3.0)) - 18.0));
}
return tmp;
}
def code(x1, x2): t_0 = (2.0 * x2) - 3.0 t_1 = x1 * ((6.0 * x1) - 3.0) tmp = 0 if x1 <= -220.0: tmp = x1 + (x1 * ((-1.0 * (2.0 + (-2.0 * (1.0 + (3.0 * t_0))))) + (x1 * (9.0 + ((4.0 * t_0) + t_1))))) elif x1 <= 0.29: tmp = (-6.0 * x2) + ((x1 * ((9.0 * x1) - 1.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((12.0 * x1) - 12.0))))) else: tmp = x1 + (x1 * ((x1 * (t_1 - 3.0)) - 18.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(2.0 * x2) - 3.0) t_1 = Float64(x1 * Float64(Float64(6.0 * x1) - 3.0)) tmp = 0.0 if (x1 <= -220.0) tmp = Float64(x1 + Float64(x1 * Float64(Float64(-1.0 * Float64(2.0 + Float64(-2.0 * Float64(1.0 + Float64(3.0 * t_0))))) + Float64(x1 * Float64(9.0 + Float64(Float64(4.0 * t_0) + t_1)))))); elseif (x1 <= 0.29) tmp = Float64(Float64(-6.0 * x2) + Float64(Float64(x1 * Float64(Float64(9.0 * x1) - 1.0)) + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(12.0 * x1) - 12.0)))))); else tmp = Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(t_1 - 3.0)) - 18.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (2.0 * x2) - 3.0; t_1 = x1 * ((6.0 * x1) - 3.0); tmp = 0.0; if (x1 <= -220.0) tmp = x1 + (x1 * ((-1.0 * (2.0 + (-2.0 * (1.0 + (3.0 * t_0))))) + (x1 * (9.0 + ((4.0 * t_0) + t_1))))); elseif (x1 <= 0.29) tmp = (-6.0 * x2) + ((x1 * ((9.0 * x1) - 1.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((12.0 * x1) - 12.0))))); else tmp = x1 + (x1 * ((x1 * (t_1 - 3.0)) - 18.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(N[(6.0 * x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -220.0], N[(x1 + N[(x1 * N[(N[(-1.0 * N[(2.0 + N[(-2.0 * N[(1.0 + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(9.0 + N[(N[(4.0 * t$95$0), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.29], N[(N[(-6.0 * x2), $MachinePrecision] + N[(N[(x1 * N[(N[(9.0 * x1), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(12.0 * x1), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(N[(x1 * N[(t$95$1 - 3.0), $MachinePrecision]), $MachinePrecision] - 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot x2 - 3\\
t_1 := x1 \cdot \left(6 \cdot x1 - 3\right)\\
\mathbf{if}\;x1 \leq -220:\\
\;\;\;\;x1 + x1 \cdot \left(-1 \cdot \left(2 + -2 \cdot \left(1 + 3 \cdot t\_0\right)\right) + x1 \cdot \left(9 + \left(4 \cdot t\_0 + t\_1\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 0.29:\\
\;\;\;\;-6 \cdot x2 + \left(x1 \cdot \left(9 \cdot x1 - 1\right) + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(12 \cdot x1 - 12\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(t\_1 - 3\right) - 18\right)\\
\end{array}
\end{array}
if x1 < -220Initial program 37.9%
Simplified37.9%
Taylor expanded in x1 around -inf 95.4%
Taylor expanded in x1 around 0 95.3%
if -220 < x1 < 0.28999999999999998Initial program 99.4%
Simplified99.8%
Taylor expanded in x1 around 0 86.3%
Taylor expanded in x2 around 0 99.8%
if 0.28999999999999998 < x1 Initial program 45.2%
Simplified45.2%
Taylor expanded in x1 around -inf 87.5%
Taylor expanded in x1 around 0 87.5%
Taylor expanded in x2 around 0 88.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* x1 (- (* x1 (- (* x1 (- (* 6.0 x1) 3.0)) 3.0)) 18.0)))))
(if (<= x1 -68.0)
t_0
(if (<= x1 0.29)
(+
(* -6.0 x2)
(+
(* x1 (- (* 9.0 x1) 1.0))
(* x2 (+ (* 8.0 (* x1 x2)) (* x1 (- (* 12.0 x1) 12.0))))))
t_0))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 * ((x1 * ((x1 * ((6.0 * x1) - 3.0)) - 3.0)) - 18.0));
double tmp;
if (x1 <= -68.0) {
tmp = t_0;
} else if (x1 <= 0.29) {
tmp = (-6.0 * x2) + ((x1 * ((9.0 * x1) - 1.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((12.0 * x1) - 12.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 * ((x1 * ((6.0d0 * x1) - 3.0d0)) - 3.0d0)) - 18.0d0))
if (x1 <= (-68.0d0)) then
tmp = t_0
else if (x1 <= 0.29d0) then
tmp = ((-6.0d0) * x2) + ((x1 * ((9.0d0 * x1) - 1.0d0)) + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * ((12.0d0 * x1) - 12.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 * ((x1 * ((6.0 * x1) - 3.0)) - 3.0)) - 18.0));
double tmp;
if (x1 <= -68.0) {
tmp = t_0;
} else if (x1 <= 0.29) {
tmp = (-6.0 * x2) + ((x1 * ((9.0 * x1) - 1.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((12.0 * x1) - 12.0)))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 * ((x1 * ((x1 * ((6.0 * x1) - 3.0)) - 3.0)) - 18.0)) tmp = 0 if x1 <= -68.0: tmp = t_0 elif x1 <= 0.29: tmp = (-6.0 * x2) + ((x1 * ((9.0 * x1) - 1.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((12.0 * x1) - 12.0))))) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * Float64(Float64(6.0 * x1) - 3.0)) - 3.0)) - 18.0))) tmp = 0.0 if (x1 <= -68.0) tmp = t_0; elseif (x1 <= 0.29) tmp = Float64(Float64(-6.0 * x2) + Float64(Float64(x1 * Float64(Float64(9.0 * x1) - 1.0)) + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(12.0 * x1) - 12.0)))))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 * ((x1 * ((x1 * ((6.0 * x1) - 3.0)) - 3.0)) - 18.0)); tmp = 0.0; if (x1 <= -68.0) tmp = t_0; elseif (x1 <= 0.29) tmp = (-6.0 * x2) + ((x1 * ((9.0 * x1) - 1.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((12.0 * x1) - 12.0))))); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 * N[(N[(x1 * N[(N[(x1 * N[(N[(6.0 * x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] - 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -68.0], t$95$0, If[LessEqual[x1, 0.29], N[(N[(-6.0 * x2), $MachinePrecision] + N[(N[(x1 * N[(N[(9.0 * x1), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(12.0 * x1), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot \left(6 \cdot x1 - 3\right) - 3\right) - 18\right)\\
\mathbf{if}\;x1 \leq -68:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 0.29:\\
\;\;\;\;-6 \cdot x2 + \left(x1 \cdot \left(9 \cdot x1 - 1\right) + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(12 \cdot x1 - 12\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -68 or 0.28999999999999998 < x1 Initial program 41.3%
Simplified41.3%
Taylor expanded in x1 around -inf 91.8%
Taylor expanded in x1 around 0 91.7%
Taylor expanded in x2 around 0 88.8%
if -68 < x1 < 0.28999999999999998Initial program 99.4%
Simplified99.8%
Taylor expanded in x1 around 0 86.3%
Taylor expanded in x2 around 0 99.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* x1 (- (* x1 (- (* x1 (- (* 6.0 x1) 3.0)) 3.0)) 18.0)))))
(if (<= x1 -42.0)
t_0
(if (<= x1 23.0)
(+ (* -6.0 x2) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 1.0)))
t_0))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 * ((x1 * ((x1 * ((6.0 * x1) - 3.0)) - 3.0)) - 18.0));
double tmp;
if (x1 <= -42.0) {
tmp = t_0;
} else if (x1 <= 23.0) {
tmp = (-6.0 * x2) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 1.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 * ((x1 * ((6.0d0 * x1) - 3.0d0)) - 3.0d0)) - 18.0d0))
if (x1 <= (-42.0d0)) then
tmp = t_0
else if (x1 <= 23.0d0) then
tmp = ((-6.0d0) * x2) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 1.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 * ((x1 * ((6.0 * x1) - 3.0)) - 3.0)) - 18.0));
double tmp;
if (x1 <= -42.0) {
tmp = t_0;
} else if (x1 <= 23.0) {
tmp = (-6.0 * x2) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 1.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 * ((x1 * ((x1 * ((6.0 * x1) - 3.0)) - 3.0)) - 18.0)) tmp = 0 if x1 <= -42.0: tmp = t_0 elif x1 <= 23.0: tmp = (-6.0 * x2) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 1.0)) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * Float64(Float64(6.0 * x1) - 3.0)) - 3.0)) - 18.0))) tmp = 0.0 if (x1 <= -42.0) tmp = t_0; elseif (x1 <= 23.0) tmp = Float64(Float64(-6.0 * x2) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 1.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 * ((x1 * ((x1 * ((6.0 * x1) - 3.0)) - 3.0)) - 18.0)); tmp = 0.0; if (x1 <= -42.0) tmp = t_0; elseif (x1 <= 23.0) tmp = (-6.0 * x2) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 1.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 * N[(N[(x1 * N[(N[(x1 * N[(N[(6.0 * x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] - 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -42.0], t$95$0, If[LessEqual[x1, 23.0], N[(N[(-6.0 * x2), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot \left(6 \cdot x1 - 3\right) - 3\right) - 18\right)\\
\mathbf{if}\;x1 \leq -42:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 23:\\
\;\;\;\;-6 \cdot x2 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -42 or 23 < x1 Initial program 40.9%
Simplified40.9%
Taylor expanded in x1 around -inf 92.4%
Taylor expanded in x1 around 0 92.4%
Taylor expanded in x2 around 0 89.4%
if -42 < x1 < 23Initial program 99.4%
Simplified99.7%
Taylor expanded in x1 around 0 85.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* x1 (- (* x1 (- (* x1 (- (* 6.0 x1) 3.0)) 3.0)) 18.0)))))
(if (<= x1 -0.7)
t_0
(if (<= x1 1.5e-8) (+ (* -6.0 x2) (* x1 (- (* 9.0 x1) 1.0))) t_0))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 * ((x1 * ((x1 * ((6.0 * x1) - 3.0)) - 3.0)) - 18.0));
double tmp;
if (x1 <= -0.7) {
tmp = t_0;
} else if (x1 <= 1.5e-8) {
tmp = (-6.0 * x2) + (x1 * ((9.0 * x1) - 1.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 * ((x1 * ((6.0d0 * x1) - 3.0d0)) - 3.0d0)) - 18.0d0))
if (x1 <= (-0.7d0)) then
tmp = t_0
else if (x1 <= 1.5d-8) then
tmp = ((-6.0d0) * x2) + (x1 * ((9.0d0 * x1) - 1.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 * ((x1 * ((6.0 * x1) - 3.0)) - 3.0)) - 18.0));
double tmp;
if (x1 <= -0.7) {
tmp = t_0;
} else if (x1 <= 1.5e-8) {
tmp = (-6.0 * x2) + (x1 * ((9.0 * x1) - 1.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 * ((x1 * ((x1 * ((6.0 * x1) - 3.0)) - 3.0)) - 18.0)) tmp = 0 if x1 <= -0.7: tmp = t_0 elif x1 <= 1.5e-8: tmp = (-6.0 * x2) + (x1 * ((9.0 * x1) - 1.0)) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * Float64(Float64(6.0 * x1) - 3.0)) - 3.0)) - 18.0))) tmp = 0.0 if (x1 <= -0.7) tmp = t_0; elseif (x1 <= 1.5e-8) tmp = Float64(Float64(-6.0 * x2) + Float64(x1 * Float64(Float64(9.0 * x1) - 1.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 * ((x1 * ((x1 * ((6.0 * x1) - 3.0)) - 3.0)) - 18.0)); tmp = 0.0; if (x1 <= -0.7) tmp = t_0; elseif (x1 <= 1.5e-8) tmp = (-6.0 * x2) + (x1 * ((9.0 * x1) - 1.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 * N[(N[(x1 * N[(N[(x1 * N[(N[(6.0 * x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] - 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -0.7], t$95$0, If[LessEqual[x1, 1.5e-8], N[(N[(-6.0 * x2), $MachinePrecision] + N[(x1 * N[(N[(9.0 * x1), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot \left(6 \cdot x1 - 3\right) - 3\right) - 18\right)\\
\mathbf{if}\;x1 \leq -0.7:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 1.5 \cdot 10^{-8}:\\
\;\;\;\;-6 \cdot x2 + x1 \cdot \left(9 \cdot x1 - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -0.69999999999999996 or 1.49999999999999987e-8 < x1 Initial program 42.2%
Simplified42.2%
Taylor expanded in x1 around -inf 90.4%
Taylor expanded in x1 around 0 90.4%
Taylor expanded in x2 around 0 87.4%
if -0.69999999999999996 < x1 < 1.49999999999999987e-8Initial program 99.4%
Simplified99.8%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x2 around 0 72.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))))
(if (<= x2 -6.5e+135)
t_0
(if (<= x2 3.8e+189) (+ (* -6.0 x2) (* x1 (- (* 9.0 x1) 1.0))) t_0))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
double tmp;
if (x2 <= -6.5e+135) {
tmp = t_0;
} else if (x2 <= 3.8e+189) {
tmp = (-6.0 * x2) + (x1 * ((9.0 * x1) - 1.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 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
if (x2 <= (-6.5d+135)) then
tmp = t_0
else if (x2 <= 3.8d+189) then
tmp = ((-6.0d0) * x2) + (x1 * ((9.0d0 * x1) - 1.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
double tmp;
if (x2 <= -6.5e+135) {
tmp = t_0;
} else if (x2 <= 3.8e+189) {
tmp = (-6.0 * x2) + (x1 * ((9.0 * x1) - 1.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) tmp = 0 if x2 <= -6.5e+135: tmp = t_0 elif x2 <= 3.8e+189: tmp = (-6.0 * x2) + (x1 * ((9.0 * x1) - 1.0)) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))) tmp = 0.0 if (x2 <= -6.5e+135) tmp = t_0; elseif (x2 <= 3.8e+189) tmp = Float64(Float64(-6.0 * x2) + Float64(x1 * Float64(Float64(9.0 * x1) - 1.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); tmp = 0.0; if (x2 <= -6.5e+135) tmp = t_0; elseif (x2 <= 3.8e+189) tmp = (-6.0 * x2) + (x1 * ((9.0 * x1) - 1.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -6.5e+135], t$95$0, If[LessEqual[x2, 3.8e+189], N[(N[(-6.0 * x2), $MachinePrecision] + N[(x1 * N[(N[(9.0 * x1), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{if}\;x2 \leq -6.5 \cdot 10^{+135}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x2 \leq 3.8 \cdot 10^{+189}:\\
\;\;\;\;-6 \cdot x2 + x1 \cdot \left(9 \cdot x1 - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x2 < -6.5000000000000003e135 or 3.7999999999999998e189 < x2 Initial program 83.5%
Taylor expanded in x1 around 0 3.3%
Taylor expanded in x1 around 0 54.4%
Taylor expanded in x1 around inf 61.0%
if -6.5000000000000003e135 < x2 < 3.7999999999999998e189Initial program 67.1%
Simplified67.4%
Taylor expanded in x1 around 0 74.7%
Taylor expanded in x2 around 0 73.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x2 (+ 12.0 (* 8.0 x1))))))
(if (<= x1 -1.32e+48)
t_0
(if (<= x1 1.65e+216) (* x2 (- (/ x1 x2) 6.0)) t_0))))
double code(double x1, double x2) {
double t_0 = x1 * (x2 * (12.0 + (8.0 * x1)));
double tmp;
if (x1 <= -1.32e+48) {
tmp = t_0;
} else if (x1 <= 1.65e+216) {
tmp = x2 * ((x1 / 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 * (x2 * (12.0d0 + (8.0d0 * x1)))
if (x1 <= (-1.32d+48)) then
tmp = t_0
else if (x1 <= 1.65d+216) then
tmp = x2 * ((x1 / 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 * (x2 * (12.0 + (8.0 * x1)));
double tmp;
if (x1 <= -1.32e+48) {
tmp = t_0;
} else if (x1 <= 1.65e+216) {
tmp = x2 * ((x1 / x2) - 6.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x2 * (12.0 + (8.0 * x1))) tmp = 0 if x1 <= -1.32e+48: tmp = t_0 elif x1 <= 1.65e+216: tmp = x2 * ((x1 / x2) - 6.0) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x2 * Float64(12.0 + Float64(8.0 * x1)))) tmp = 0.0 if (x1 <= -1.32e+48) tmp = t_0; elseif (x1 <= 1.65e+216) tmp = Float64(x2 * Float64(Float64(x1 / x2) - 6.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x2 * (12.0 + (8.0 * x1))); tmp = 0.0; if (x1 <= -1.32e+48) tmp = t_0; elseif (x1 <= 1.65e+216) tmp = x2 * ((x1 / x2) - 6.0); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x2 * N[(12.0 + N[(8.0 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.32e+48], t$95$0, If[LessEqual[x1, 1.65e+216], N[(x2 * N[(N[(x1 / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x2 \cdot \left(12 + 8 \cdot x1\right)\right)\\
\mathbf{if}\;x1 \leq -1.32 \cdot 10^{+48}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 1.65 \cdot 10^{+216}:\\
\;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -1.32e48 or 1.65e216 < x1 Initial program 23.2%
Simplified23.2%
Taylor expanded in x1 around -inf 99.9%
Taylor expanded in x1 around 0 99.9%
Taylor expanded in x2 around inf 44.0%
if -1.32e48 < x1 < 1.65e216Initial program 91.6%
Simplified91.8%
Taylor expanded in x1 around 0 34.9%
Taylor expanded in x2 around inf 39.6%
(FPCore (x1 x2) :precision binary64 (+ (* -6.0 x2) (* x1 (- (* 9.0 x1) 1.0))))
double code(double x1, double x2) {
return (-6.0 * x2) + (x1 * ((9.0 * x1) - 1.0));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = ((-6.0d0) * x2) + (x1 * ((9.0d0 * x1) - 1.0d0))
end function
public static double code(double x1, double x2) {
return (-6.0 * x2) + (x1 * ((9.0 * x1) - 1.0));
}
def code(x1, x2): return (-6.0 * x2) + (x1 * ((9.0 * x1) - 1.0))
function code(x1, x2) return Float64(Float64(-6.0 * x2) + Float64(x1 * Float64(Float64(9.0 * x1) - 1.0))) end
function tmp = code(x1, x2) tmp = (-6.0 * x2) + (x1 * ((9.0 * x1) - 1.0)); end
code[x1_, x2_] := N[(N[(-6.0 * x2), $MachinePrecision] + N[(x1 * N[(N[(9.0 * x1), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-6 \cdot x2 + x1 \cdot \left(9 \cdot x1 - 1\right)
\end{array}
Initial program 71.0%
Simplified71.2%
Taylor expanded in x1 around 0 69.1%
Taylor expanded in x2 around 0 62.5%
(FPCore (x1 x2) :precision binary64 (* x2 (- (/ x1 x2) 6.0)))
double code(double x1, double x2) {
return x2 * ((x1 / x2) - 6.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * ((x1 / x2) - 6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * ((x1 / x2) - 6.0);
}
def code(x1, x2): return x2 * ((x1 / x2) - 6.0)
function code(x1, x2) return Float64(x2 * Float64(Float64(x1 / x2) - 6.0)) end
function tmp = code(x1, x2) tmp = x2 * ((x1 / x2) - 6.0); end
code[x1_, x2_] := N[(x2 * N[(N[(x1 / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot \left(\frac{x1}{x2} - 6\right)
\end{array}
Initial program 71.0%
Simplified71.2%
Taylor expanded in x1 around 0 25.0%
Taylor expanded in x2 around inf 30.1%
(FPCore (x1 x2) :precision binary64 (+ x1 (* -6.0 x2)))
double code(double x1, double x2) {
return x1 + (-6.0 * x2);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + ((-6.0d0) * x2)
end function
public static double code(double x1, double x2) {
return x1 + (-6.0 * x2);
}
def code(x1, x2): return x1 + (-6.0 * x2)
function code(x1, x2) return Float64(x1 + Float64(-6.0 * x2)) end
function tmp = code(x1, x2) tmp = x1 + (-6.0 * x2); end
code[x1_, x2_] := N[(x1 + N[(-6.0 * x2), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + -6 \cdot x2
\end{array}
Initial program 71.0%
Simplified71.2%
Taylor expanded in x1 around 0 25.0%
(FPCore (x1 x2) :precision binary64 (* -6.0 x2))
double code(double x1, double x2) {
return -6.0 * x2;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (-6.0d0) * x2
end function
public static double code(double x1, double x2) {
return -6.0 * x2;
}
def code(x1, x2): return -6.0 * x2
function code(x1, x2) return Float64(-6.0 * x2) end
function tmp = code(x1, x2) tmp = -6.0 * x2; end
code[x1_, x2_] := N[(-6.0 * x2), $MachinePrecision]
\begin{array}{l}
\\
-6 \cdot x2
\end{array}
Initial program 71.0%
Simplified71.2%
Taylor expanded in x1 around 0 24.9%
(FPCore (x1 x2) :precision binary64 x1)
double code(double x1, double x2) {
return x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1
end function
public static double code(double x1, double x2) {
return x1;
}
def code(x1, x2): return x1
function code(x1, x2) return x1 end
function tmp = code(x1, x2) tmp = x1; end
code[x1_, x2_] := x1
\begin{array}{l}
\\
x1
\end{array}
Initial program 71.0%
Simplified71.2%
Taylor expanded in x1 around 0 25.0%
Taylor expanded in x1 around inf 3.2%
herbie shell --seed 2024116 -o generate:simplify
(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))))))