
(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)))
(t_1 (- -1.0 (* x1 x1)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (+ t_2 (* 2.0 x2)))
(t_4 (/ (- x1 t_3) t_1))
(t_5 (/ (- t_3 x1) t_1))
(t_6 (/ (- t_0 x1) (fma x1 x1 1.0)))
(t_7 (* 3.0 (* x1 x1)))
(t_8 (/ (- x1 t_0) (fma x1 x1 1.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
(* (* (* x1 2.0) t_4) (+ 3.0 t_5))))
(* t_2 t_4))
(* x1 (* x1 x1))))
(* 3.0 (/ (- x1 (- t_2 (* 2.0 x2))) t_1))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_7 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_6 4.0 -6.0)) (* (* x1 (* 2.0 t_8)) (- t_8 -3.0)))
(fma t_7 t_6 (pow x1 3.0))))))
(* 6.0 (pow x1 4.0)))))
double code(double x1, double x2) {
double t_0 = fma(x1, (x1 * 3.0), (2.0 * x2));
double t_1 = -1.0 - (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = t_2 + (2.0 * x2);
double t_4 = (x1 - t_3) / t_1;
double t_5 = (t_3 - x1) / t_1;
double t_6 = (t_0 - x1) / fma(x1, x1, 1.0);
double t_7 = 3.0 * (x1 * x1);
double t_8 = (x1 - t_0) / fma(x1, x1, 1.0);
double tmp;
if ((x1 + ((x1 + (((t_1 * (((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_4) * (3.0 + t_5)))) + (t_2 * t_4)) + (x1 * (x1 * x1)))) + (3.0 * ((x1 - (t_2 - (2.0 * x2))) / t_1)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_7 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_6, 4.0, -6.0)), ((x1 * (2.0 * t_8)) * (t_8 - -3.0))), fma(t_7, t_6, pow(x1, 3.0)))));
} else {
tmp = 6.0 * pow(x1, 4.0);
}
return tmp;
}
function code(x1, x2) t_0 = fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) t_1 = Float64(-1.0 - Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(t_2 + Float64(2.0 * x2)) t_4 = Float64(Float64(x1 - t_3) / t_1) t_5 = Float64(Float64(t_3 - x1) / t_1) t_6 = Float64(Float64(t_0 - x1) / fma(x1, x1, 1.0)) t_7 = Float64(3.0 * Float64(x1 * x1)) t_8 = Float64(Float64(x1 - t_0) / fma(x1, x1, 1.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(3.0 + t_5)))) + Float64(t_2 * t_4)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(x1 - Float64(t_2 - Float64(2.0 * x2))) / t_1)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_7 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_6, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_8)) * Float64(t_8 - -3.0))), fma(t_7, t_6, (x1 ^ 3.0)))))); else tmp = Float64(6.0 * (x1 ^ 4.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 - t$95$3), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$3 - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$6 = N[(N[(t$95$0 - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(N[(x1 - t$95$0), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x1 - N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$7 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$6 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$8), $MachinePrecision]), $MachinePrecision] * N[(t$95$8 - -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$7 * t$95$6 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right)\\
t_1 := -1 - x1 \cdot x1\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := t\_2 + 2 \cdot x2\\
t_4 := \frac{x1 - t\_3}{t\_1}\\
t_5 := \frac{t\_3 - x1}{t\_1}\\
t_6 := \frac{t\_0 - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_7 := 3 \cdot \left(x1 \cdot x1\right)\\
t_8 := \frac{x1 - t\_0}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_4\right) \cdot \left(3 + t\_5\right)\right) + t\_2 \cdot t\_4\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{x1 - \left(t\_2 - 2 \cdot x2\right)}{t\_1}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_7 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_6, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_8\right)\right) \cdot \left(t\_8 - -3\right)\right), \mathsf{fma}\left(t\_7, t\_6, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.5%
Simplified99.7%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around inf 100.0%
Final simplification99.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ t_0 (* 2.0 x2)))
(t_2 (- -1.0 (* x1 x1)))
(t_3 (/ (- x1 t_1) t_2))
(t_4 (/ (- t_1 x1) t_2))
(t_5
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_4)))
(* (* (* x1 2.0) t_3) (+ 3.0 t_4))))
(* t_0 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- x1 (- t_0 (* 2.0 x2))) t_2))))))
(if (<= t_5 INFINITY) t_5 (* 6.0 (pow x1 4.0)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = t_0 + (2.0 * x2);
double t_2 = -1.0 - (x1 * x1);
double t_3 = (x1 - t_1) / t_2;
double t_4 = (t_1 - x1) / t_2;
double t_5 = x1 + ((x1 + (((t_2 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * t_3) * (3.0 + t_4)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * ((x1 - (t_0 - (2.0 * x2))) / t_2)));
double tmp;
if (t_5 <= ((double) INFINITY)) {
tmp = t_5;
} else {
tmp = 6.0 * pow(x1, 4.0);
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = t_0 + (2.0 * x2);
double t_2 = -1.0 - (x1 * x1);
double t_3 = (x1 - t_1) / t_2;
double t_4 = (t_1 - x1) / t_2;
double t_5 = x1 + ((x1 + (((t_2 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * t_3) * (3.0 + t_4)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * ((x1 - (t_0 - (2.0 * x2))) / t_2)));
double tmp;
if (t_5 <= Double.POSITIVE_INFINITY) {
tmp = t_5;
} else {
tmp = 6.0 * Math.pow(x1, 4.0);
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = t_0 + (2.0 * x2) t_2 = -1.0 - (x1 * x1) t_3 = (x1 - t_1) / t_2 t_4 = (t_1 - x1) / t_2 t_5 = x1 + ((x1 + (((t_2 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * t_3) * (3.0 + t_4)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * ((x1 - (t_0 - (2.0 * x2))) / t_2))) tmp = 0 if t_5 <= math.inf: tmp = t_5 else: tmp = 6.0 * math.pow(x1, 4.0) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(t_0 + Float64(2.0 * x2)) t_2 = Float64(-1.0 - Float64(x1 * x1)) t_3 = Float64(Float64(x1 - t_1) / t_2) t_4 = Float64(Float64(t_1 - x1) / t_2) t_5 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_4))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_4)))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(x1 - Float64(t_0 - Float64(2.0 * x2))) / t_2)))) tmp = 0.0 if (t_5 <= Inf) tmp = t_5; else tmp = Float64(6.0 * (x1 ^ 4.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = t_0 + (2.0 * x2); t_2 = -1.0 - (x1 * x1); t_3 = (x1 - t_1) / t_2; t_4 = (t_1 - x1) / t_2; t_5 = x1 + ((x1 + (((t_2 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * t_3) * (3.0 + t_4)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * ((x1 - (t_0 - (2.0 * x2))) / t_2))); tmp = 0.0; if (t_5 <= Inf) tmp = t_5; else tmp = 6.0 * (x1 ^ 4.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 - t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$1 - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x1 - N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, Infinity], t$95$5, N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := t\_0 + 2 \cdot x2\\
t_2 := -1 - x1 \cdot x1\\
t_3 := \frac{x1 - t\_1}{t\_2}\\
t_4 := \frac{t\_1 - x1}{t\_2}\\
t_5 := x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_4\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_4\right)\right) + t\_0 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{x1 - \left(t\_0 - 2 \cdot x2\right)}{t\_2}\right)\\
\mathbf{if}\;t\_5 \leq \infty:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.5%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around inf 100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ t_0 (* 2.0 x2)))
(t_2 (- -1.0 (* x1 x1)))
(t_3 (/ (- t_1 x1) t_2)))
(if (or (<= x1 -9.6e+26) (not (<= x1 2.1e+22)))
(*
(pow x1 4.0)
(- 6.0 (/ (- 3.0 (/ (- 9.0 (* 4.0 (- 3.0 (* 2.0 x2)))) x1)) x1)))
(+
x1
(+
(+
x1
(-
(* x1 (* x1 x1))
(-
(*
(+ (* x1 x1) 1.0)
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_3)))
(* (* (* x1 2.0) (/ (- x1 t_1) t_2)) (+ 3.0 t_3))))
(* 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 = t_0 + (2.0 * x2);
double t_2 = -1.0 - (x1 * x1);
double t_3 = (t_1 - x1) / t_2;
double tmp;
if ((x1 <= -9.6e+26) || !(x1 <= 2.1e+22)) {
tmp = pow(x1, 4.0) * (6.0 - ((3.0 - ((9.0 - (4.0 * (3.0 - (2.0 * x2)))) / x1)) / x1));
} else {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) - ((((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 + (4.0 * t_3))) + (((x1 * 2.0) * ((x1 - t_1) / t_2)) * (3.0 + t_3)))) - (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) :: t_3
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = t_0 + (2.0d0 * x2)
t_2 = (-1.0d0) - (x1 * x1)
t_3 = (t_1 - x1) / t_2
if ((x1 <= (-9.6d+26)) .or. (.not. (x1 <= 2.1d+22))) then
tmp = (x1 ** 4.0d0) * (6.0d0 - ((3.0d0 - ((9.0d0 - (4.0d0 * (3.0d0 - (2.0d0 * x2)))) / x1)) / x1))
else
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) - ((((x1 * x1) + 1.0d0) * (((x1 * x1) * (6.0d0 + (4.0d0 * t_3))) + (((x1 * 2.0d0) * ((x1 - t_1) / t_2)) * (3.0d0 + t_3)))) - (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 = t_0 + (2.0 * x2);
double t_2 = -1.0 - (x1 * x1);
double t_3 = (t_1 - x1) / t_2;
double tmp;
if ((x1 <= -9.6e+26) || !(x1 <= 2.1e+22)) {
tmp = Math.pow(x1, 4.0) * (6.0 - ((3.0 - ((9.0 - (4.0 * (3.0 - (2.0 * x2)))) / x1)) / x1));
} else {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) - ((((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 + (4.0 * t_3))) + (((x1 * 2.0) * ((x1 - t_1) / t_2)) * (3.0 + t_3)))) - (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = t_0 + (2.0 * x2) t_2 = -1.0 - (x1 * x1) t_3 = (t_1 - x1) / t_2 tmp = 0 if (x1 <= -9.6e+26) or not (x1 <= 2.1e+22): tmp = math.pow(x1, 4.0) * (6.0 - ((3.0 - ((9.0 - (4.0 * (3.0 - (2.0 * x2)))) / x1)) / x1)) else: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) - ((((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 + (4.0 * t_3))) + (((x1 * 2.0) * ((x1 - t_1) / t_2)) * (3.0 + t_3)))) - (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(t_0 + Float64(2.0 * x2)) t_2 = Float64(-1.0 - Float64(x1 * x1)) t_3 = Float64(Float64(t_1 - x1) / t_2) tmp = 0.0 if ((x1 <= -9.6e+26) || !(x1 <= 2.1e+22)) tmp = Float64((x1 ^ 4.0) * Float64(6.0 - Float64(Float64(3.0 - Float64(Float64(9.0 - Float64(4.0 * Float64(3.0 - Float64(2.0 * x2)))) / x1)) / x1))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) - Float64(Float64(Float64(Float64(x1 * x1) + 1.0) * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_3))) + Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(x1 - t_1) / t_2)) * Float64(3.0 + t_3)))) - 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 = t_0 + (2.0 * x2); t_2 = -1.0 - (x1 * x1); t_3 = (t_1 - x1) / t_2; tmp = 0.0; if ((x1 <= -9.6e+26) || ~((x1 <= 2.1e+22))) tmp = (x1 ^ 4.0) * (6.0 - ((3.0 - ((9.0 - (4.0 * (3.0 - (2.0 * x2)))) / x1)) / x1)); else tmp = x1 + ((x1 + ((x1 * (x1 * x1)) - ((((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 + (4.0 * t_3))) + (((x1 * 2.0) * ((x1 - t_1) / t_2)) * (3.0 + t_3)))) - (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[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[Or[LessEqual[x1, -9.6e+26], N[Not[LessEqual[x1, 2.1e+22]], $MachinePrecision]], N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 - N[(N[(3.0 - N[(N[(9.0 - N[(4.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(x1 - t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$3), $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 := t\_0 + 2 \cdot x2\\
t_2 := -1 - x1 \cdot x1\\
t_3 := \frac{t\_1 - x1}{t\_2}\\
\mathbf{if}\;x1 \leq -9.6 \cdot 10^{+26} \lor \neg \left(x1 \leq 2.1 \cdot 10^{+22}\right):\\
\;\;\;\;{x1}^{4} \cdot \left(6 - \frac{3 - \frac{9 - 4 \cdot \left(3 - 2 \cdot x2\right)}{x1}}{x1}\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) - \left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_3\right) + \left(\left(x1 \cdot 2\right) \cdot \frac{x1 - t\_1}{t\_2}\right) \cdot \left(3 + t\_3\right)\right) - 3 \cdot t\_0\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\end{array}
\end{array}
if x1 < -9.60000000000000018e26 or 2.0999999999999998e22 < x1 Initial program 38.6%
Simplified38.5%
Taylor expanded in x1 around -inf 99.9%
if -9.60000000000000018e26 < x1 < 2.0999999999999998e22Initial program 99.4%
Taylor expanded in x1 around inf 97.6%
Taylor expanded in x1 around 0 99.4%
mul-1-neg99.4%
unsub-neg99.4%
*-commutative99.4%
Simplified99.4%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- -1.0 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ t_1 (* 2.0 x2)))
(t_3 (/ (- t_2 x1) t_0)))
(if (<= x1 -4.3e+64)
(* 6.0 (pow x1 4.0))
(if (<= x1 2e+153)
(+
x1
(+
(+
x1
(-
(* x1 (* x1 x1))
(-
(*
(+ (* x1 x1) 1.0)
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_3)))
(* (* (* x1 2.0) (/ (- x1 t_2) t_0)) (+ 3.0 t_3))))
(* 3.0 t_1))))
(* 3.0 (- (* x2 -2.0) x1))))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0))))))))
double code(double x1, double x2) {
double t_0 = -1.0 - (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = t_1 + (2.0 * x2);
double t_3 = (t_2 - x1) / t_0;
double tmp;
if (x1 <= -4.3e+64) {
tmp = 6.0 * pow(x1, 4.0);
} else if (x1 <= 2e+153) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) - ((((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 + (4.0 * t_3))) + (((x1 * 2.0) * ((x1 - t_2) / t_0)) * (3.0 + t_3)))) - (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.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 = (-1.0d0) - (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = t_1 + (2.0d0 * x2)
t_3 = (t_2 - x1) / t_0
if (x1 <= (-4.3d+64)) then
tmp = 6.0d0 * (x1 ** 4.0d0)
else if (x1 <= 2d+153) then
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) - ((((x1 * x1) + 1.0d0) * (((x1 * x1) * (6.0d0 + (4.0d0 * t_3))) + (((x1 * 2.0d0) * ((x1 - t_2) / t_0)) * (3.0d0 + t_3)))) - (3.0d0 * t_1)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = -1.0 - (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = t_1 + (2.0 * x2);
double t_3 = (t_2 - x1) / t_0;
double tmp;
if (x1 <= -4.3e+64) {
tmp = 6.0 * Math.pow(x1, 4.0);
} else if (x1 <= 2e+153) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) - ((((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 + (4.0 * t_3))) + (((x1 * 2.0) * ((x1 - t_2) / t_0)) * (3.0 + t_3)))) - (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = -1.0 - (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = t_1 + (2.0 * x2) t_3 = (t_2 - x1) / t_0 tmp = 0 if x1 <= -4.3e+64: tmp = 6.0 * math.pow(x1, 4.0) elif x1 <= 2e+153: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) - ((((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 + (4.0 * t_3))) + (((x1 * 2.0) * ((x1 - t_2) / t_0)) * (3.0 + t_3)))) - (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) t_0 = Float64(-1.0 - Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(t_1 + Float64(2.0 * x2)) t_3 = Float64(Float64(t_2 - x1) / t_0) tmp = 0.0 if (x1 <= -4.3e+64) tmp = Float64(6.0 * (x1 ^ 4.0)); elseif (x1 <= 2e+153) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) - Float64(Float64(Float64(Float64(x1 * x1) + 1.0) * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_3))) + Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(x1 - t_2) / t_0)) * Float64(3.0 + t_3)))) - Float64(3.0 * t_1)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = -1.0 - (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = t_1 + (2.0 * x2); t_3 = (t_2 - x1) / t_0; tmp = 0.0; if (x1 <= -4.3e+64) tmp = 6.0 * (x1 ^ 4.0); elseif (x1 <= 2e+153) tmp = x1 + ((x1 + ((x1 * (x1 * x1)) - ((((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 + (4.0 * t_3))) + (((x1 * 2.0) * ((x1 - t_2) / t_0)) * (3.0 + t_3)))) - (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(-1.0 - 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[(t$95$2 - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x1, -4.3e+64], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+153], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(x1 - t$95$2), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 - x1 \cdot x1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := t\_1 + 2 \cdot x2\\
t_3 := \frac{t\_2 - x1}{t\_0}\\
\mathbf{if}\;x1 \leq -4.3 \cdot 10^{+64}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) - \left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_3\right) + \left(\left(x1 \cdot 2\right) \cdot \frac{x1 - t\_2}{t\_0}\right) \cdot \left(3 + t\_3\right)\right) - 3 \cdot t\_1\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -4.2999999999999998e64Initial program 15.3%
Simplified15.3%
Taylor expanded in x1 around inf 98.0%
if -4.2999999999999998e64 < x1 < 2e153Initial program 99.5%
Taylor expanded in x1 around inf 98.1%
Taylor expanded in x1 around 0 99.4%
mul-1-neg99.4%
unsub-neg99.4%
*-commutative99.4%
Simplified99.4%
if 2e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 80.0%
Taylor expanded in x2 around 0 100.0%
Final simplification99.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ t_0 (* 2.0 x2)))
(t_2 (- -1.0 (* x1 x1)))
(t_3 (/ (- t_1 x1) t_2)))
(if (<= x1 -5.6e+102)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))))
(if (<= x1 2e+153)
(+
x1
(+
(+
x1
(-
(* x1 (* x1 x1))
(-
(*
(+ (* x1 x1) 1.0)
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_3)))
(* (* (* x1 2.0) (/ (- x1 t_1) t_2)) (+ 3.0 t_3))))
(* 3.0 t_0))))
(* 3.0 (- (* x2 -2.0) x1))))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = t_0 + (2.0 * x2);
double t_2 = -1.0 - (x1 * x1);
double t_3 = (t_1 - x1) / t_2;
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 2e+153) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) - ((((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 + (4.0 * t_3))) + (((x1 * 2.0) * ((x1 - t_1) / t_2)) * (3.0 + t_3)))) - (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = t_0 + (2.0d0 * x2)
t_2 = (-1.0d0) - (x1 * x1)
t_3 = (t_1 - x1) / t_2
if (x1 <= (-5.6d+102)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0))))))
else if (x1 <= 2d+153) then
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) - ((((x1 * x1) + 1.0d0) * (((x1 * x1) * (6.0d0 + (4.0d0 * t_3))) + (((x1 * 2.0d0) * ((x1 - t_1) / t_2)) * (3.0d0 + t_3)))) - (3.0d0 * t_0)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = t_0 + (2.0 * x2);
double t_2 = -1.0 - (x1 * x1);
double t_3 = (t_1 - x1) / t_2;
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 2e+153) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) - ((((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 + (4.0 * t_3))) + (((x1 * 2.0) * ((x1 - t_1) / t_2)) * (3.0 + t_3)))) - (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = t_0 + (2.0 * x2) t_2 = -1.0 - (x1 * x1) t_3 = (t_1 - x1) / t_2 tmp = 0 if x1 <= -5.6e+102: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) elif x1 <= 2e+153: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) - ((((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 + (4.0 * t_3))) + (((x1 * 2.0) * ((x1 - t_1) / t_2)) * (3.0 + t_3)))) - (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(t_0 + Float64(2.0 * x2)) t_2 = Float64(-1.0 - Float64(x1 * x1)) t_3 = Float64(Float64(t_1 - x1) / t_2) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))))); elseif (x1 <= 2e+153) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) - Float64(Float64(Float64(Float64(x1 * x1) + 1.0) * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_3))) + Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(x1 - t_1) / t_2)) * Float64(3.0 + t_3)))) - Float64(3.0 * t_0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = t_0 + (2.0 * x2); t_2 = -1.0 - (x1 * x1); t_3 = (t_1 - x1) / t_2; tmp = 0.0; if (x1 <= -5.6e+102) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))); elseif (x1 <= 2e+153) tmp = x1 + ((x1 + ((x1 * (x1 * x1)) - ((((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 + (4.0 * t_3))) + (((x1 * 2.0) * ((x1 - t_1) / t_2)) * (3.0 + t_3)))) - (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 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[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+153], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(x1 - t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$3), $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[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := t\_0 + 2 \cdot x2\\
t_2 := -1 - x1 \cdot x1\\
t_3 := \frac{t\_1 - x1}{t\_2}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) - \left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_3\right) + \left(\left(x1 \cdot 2\right) \cdot \frac{x1 - t\_1}{t\_2}\right) \cdot \left(3 + t\_3\right)\right) - 3 \cdot t\_0\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 2.2%
Simplified26.7%
Taylor expanded in x1 around 0 73.3%
Taylor expanded in x2 around 0 97.8%
*-commutative97.8%
Simplified97.8%
if -5.60000000000000037e102 < x1 < 2e153Initial program 99.5%
Taylor expanded in x1 around inf 98.2%
Taylor expanded in x1 around 0 99.4%
mul-1-neg99.4%
unsub-neg99.4%
*-commutative99.4%
Simplified99.4%
if 2e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 80.0%
Taylor expanded in x2 around 0 100.0%
Final simplification99.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- -1.0 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ t_1 (* 2.0 x2))))
(if (<= x1 -1e+104)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))))
(if (<= x1 2e+153)
(-
x1
(-
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))
(-
x1
(-
(-
(*
(+ (* x1 x1) 1.0)
(-
(* (* (* x1 2.0) (/ (- x1 t_2) t_0)) (+ 3.0 (/ (- t_2 x1) t_0)))
(* (* x1 x1) 6.0)))
(* 3.0 t_1))
(* x1 (* x1 x1))))))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0))))))))
double code(double x1, double x2) {
double t_0 = -1.0 - (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = t_1 + (2.0 * x2);
double tmp;
if (x1 <= -1e+104) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 2e+153) {
tmp = x1 - ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) - (x1 - (((((x1 * x1) + 1.0) * ((((x1 * 2.0) * ((x1 - t_2) / t_0)) * (3.0 + ((t_2 - x1) / t_0))) - ((x1 * x1) * 6.0))) - (3.0 * t_1)) - (x1 * (x1 * x1)))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.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 = (-1.0d0) - (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = t_1 + (2.0d0 * x2)
if (x1 <= (-1d+104)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0))))))
else if (x1 <= 2d+153) then
tmp = x1 - ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)) - (x1 - (((((x1 * x1) + 1.0d0) * ((((x1 * 2.0d0) * ((x1 - t_2) / t_0)) * (3.0d0 + ((t_2 - x1) / t_0))) - ((x1 * x1) * 6.0d0))) - (3.0d0 * t_1)) - (x1 * (x1 * x1)))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = -1.0 - (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = t_1 + (2.0 * x2);
double tmp;
if (x1 <= -1e+104) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 2e+153) {
tmp = x1 - ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) - (x1 - (((((x1 * x1) + 1.0) * ((((x1 * 2.0) * ((x1 - t_2) / t_0)) * (3.0 + ((t_2 - x1) / t_0))) - ((x1 * x1) * 6.0))) - (3.0 * t_1)) - (x1 * (x1 * x1)))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = -1.0 - (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = t_1 + (2.0 * x2) tmp = 0 if x1 <= -1e+104: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) elif x1 <= 2e+153: tmp = x1 - ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) - (x1 - (((((x1 * x1) + 1.0) * ((((x1 * 2.0) * ((x1 - t_2) / t_0)) * (3.0 + ((t_2 - x1) / t_0))) - ((x1 * x1) * 6.0))) - (3.0 * t_1)) - (x1 * (x1 * x1))))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) t_0 = Float64(-1.0 - Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(t_1 + Float64(2.0 * x2)) tmp = 0.0 if (x1 <= -1e+104) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))))); elseif (x1 <= 2e+153) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)) - Float64(x1 - Float64(Float64(Float64(Float64(Float64(x1 * x1) + 1.0) * Float64(Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(x1 - t_2) / t_0)) * Float64(3.0 + Float64(Float64(t_2 - x1) / t_0))) - Float64(Float64(x1 * x1) * 6.0))) - Float64(3.0 * t_1)) - Float64(x1 * Float64(x1 * x1)))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = -1.0 - (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = t_1 + (2.0 * x2); tmp = 0.0; if (x1 <= -1e+104) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))); elseif (x1 <= 2e+153) tmp = x1 - ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) - (x1 - (((((x1 * x1) + 1.0) * ((((x1 * 2.0) * ((x1 - t_2) / t_0)) * (3.0 + ((t_2 - x1) / t_0))) - ((x1 * x1) * 6.0))) - (3.0 * t_1)) - (x1 * (x1 * x1))))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(-1.0 - 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]}, If[LessEqual[x1, -1e+104], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+153], N[(x1 - N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] - N[(x1 - N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(x1 - t$95$2), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] * N[(3.0 + N[(N[(t$95$2 - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 - x1 \cdot x1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := t\_1 + 2 \cdot x2\\
\mathbf{if}\;x1 \leq -1 \cdot 10^{+104}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+153}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0} - \left(x1 - \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{x1 - t\_2}{t\_0}\right) \cdot \left(3 + \frac{t\_2 - x1}{t\_0}\right) - \left(x1 \cdot x1\right) \cdot 6\right) - 3 \cdot t\_1\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -1e104Initial program 2.2%
Simplified26.7%
Taylor expanded in x1 around 0 73.3%
Taylor expanded in x2 around 0 97.8%
*-commutative97.8%
Simplified97.8%
if -1e104 < x1 < 2e153Initial program 99.5%
Taylor expanded in x1 around inf 98.2%
Taylor expanded in x1 around inf 96.6%
if 2e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 80.0%
Taylor expanded in x2 around 0 100.0%
Final simplification97.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- -1.0 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ t_1 (* 2.0 x2))))
(if (<= x1 -1e+104)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))))
(if (<= x1 4.5e+153)
(-
x1
(-
(* 3.0 (- x1 (* x2 -2.0)))
(-
x1
(-
(-
(*
(+ (* x1 x1) 1.0)
(+
(* (* x1 x1) (+ 6.0 (* 4.0 (/ (- t_2 x1) t_0))))
(* (- (/ (- x1 t_2) t_0) 3.0) (* (* x1 2.0) (- x1 (* 2.0 x2))))))
(* 3.0 t_1))
(* x1 (* x1 x1))))))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0))))))))
double code(double x1, double x2) {
double t_0 = -1.0 - (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = t_1 + (2.0 * x2);
double tmp;
if (x1 <= -1e+104) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 4.5e+153) {
tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 - (((((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 + (4.0 * ((t_2 - x1) / t_0)))) + ((((x1 - t_2) / t_0) - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2)))))) - (3.0 * t_1)) - (x1 * (x1 * x1)))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.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 = (-1.0d0) - (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = t_1 + (2.0d0 * x2)
if (x1 <= (-1d+104)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0))))))
else if (x1 <= 4.5d+153) then
tmp = x1 - ((3.0d0 * (x1 - (x2 * (-2.0d0)))) - (x1 - (((((x1 * x1) + 1.0d0) * (((x1 * x1) * (6.0d0 + (4.0d0 * ((t_2 - x1) / t_0)))) + ((((x1 - t_2) / t_0) - 3.0d0) * ((x1 * 2.0d0) * (x1 - (2.0d0 * x2)))))) - (3.0d0 * t_1)) - (x1 * (x1 * x1)))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = -1.0 - (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = t_1 + (2.0 * x2);
double tmp;
if (x1 <= -1e+104) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 4.5e+153) {
tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 - (((((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 + (4.0 * ((t_2 - x1) / t_0)))) + ((((x1 - t_2) / t_0) - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2)))))) - (3.0 * t_1)) - (x1 * (x1 * x1)))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = -1.0 - (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = t_1 + (2.0 * x2) tmp = 0 if x1 <= -1e+104: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) elif x1 <= 4.5e+153: tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 - (((((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 + (4.0 * ((t_2 - x1) / t_0)))) + ((((x1 - t_2) / t_0) - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2)))))) - (3.0 * t_1)) - (x1 * (x1 * x1))))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) t_0 = Float64(-1.0 - Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(t_1 + Float64(2.0 * x2)) tmp = 0.0 if (x1 <= -1e+104) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))))); elseif (x1 <= 4.5e+153) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(x1 - Float64(x2 * -2.0))) - Float64(x1 - Float64(Float64(Float64(Float64(Float64(x1 * x1) + 1.0) * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(Float64(t_2 - x1) / t_0)))) + Float64(Float64(Float64(Float64(x1 - t_2) / t_0) - 3.0) * Float64(Float64(x1 * 2.0) * Float64(x1 - Float64(2.0 * x2)))))) - Float64(3.0 * t_1)) - Float64(x1 * Float64(x1 * x1)))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = -1.0 - (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = t_1 + (2.0 * x2); tmp = 0.0; if (x1 <= -1e+104) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))); elseif (x1 <= 4.5e+153) tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 - (((((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 + (4.0 * ((t_2 - x1) / t_0)))) + ((((x1 - t_2) / t_0) - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2)))))) - (3.0 * t_1)) - (x1 * (x1 * x1))))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(-1.0 - 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]}, If[LessEqual[x1, -1e+104], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], N[(x1 - N[(N[(3.0 * N[(x1 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 - N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(N[(t$95$2 - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(x1 - t$95$2), $MachinePrecision] / t$95$0), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(x1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 - x1 \cdot x1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := t\_1 + 2 \cdot x2\\
\mathbf{if}\;x1 \leq -1 \cdot 10^{+104}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 - \left(3 \cdot \left(x1 - x2 \cdot -2\right) - \left(x1 - \left(\left(\left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{t\_2 - x1}{t\_0}\right) + \left(\frac{x1 - t\_2}{t\_0} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x1 - 2 \cdot x2\right)\right)\right) - 3 \cdot t\_1\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -1e104Initial program 2.2%
Simplified26.7%
Taylor expanded in x1 around 0 73.3%
Taylor expanded in x2 around 0 97.8%
*-commutative97.8%
Simplified97.8%
if -1e104 < x1 < 4.5000000000000001e153Initial program 99.5%
Taylor expanded in x1 around inf 98.2%
Taylor expanded in x1 around 0 99.4%
mul-1-neg99.4%
unsub-neg99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in x1 around 0 95.1%
if 4.5000000000000001e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 80.0%
Taylor expanded in x2 around 0 100.0%
Final simplification96.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(-
x1
(-
(*
3.0
(/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (- -1.0 (* x1 x1))))
(-
x1
(*
x1
(+
(* x1 (- 3.0 (- (* x2 8.0) (* x1 (- 3.0 (* x1 6.0))))))
(* 6.0 (- 3.0 (* 2.0 x2)))))))))
(t_1 (+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0))))))
(if (<= x1 -5e+154)
t_1
(if (<= x1 -15500000000.0)
t_0
(if (<= x1 43000000000.0)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(if (<= x1 2e+153) t_0 t_1))))))
double code(double x1, double x2) {
double t_0 = x1 - ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / (-1.0 - (x1 * x1)))) - (x1 - (x1 * ((x1 * (3.0 - ((x2 * 8.0) - (x1 * (3.0 - (x1 * 6.0)))))) + (6.0 * (3.0 - (2.0 * x2)))))));
double t_1 = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
double tmp;
if (x1 <= -5e+154) {
tmp = t_1;
} else if (x1 <= -15500000000.0) {
tmp = t_0;
} else if (x1 <= 43000000000.0) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 2e+153) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 - ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((-1.0d0) - (x1 * x1)))) - (x1 - (x1 * ((x1 * (3.0d0 - ((x2 * 8.0d0) - (x1 * (3.0d0 - (x1 * 6.0d0)))))) + (6.0d0 * (3.0d0 - (2.0d0 * x2)))))))
t_1 = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
if (x1 <= (-5d+154)) then
tmp = t_1
else if (x1 <= (-15500000000.0d0)) then
tmp = t_0
else if (x1 <= 43000000000.0d0) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else if (x1 <= 2d+153) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 - ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / (-1.0 - (x1 * x1)))) - (x1 - (x1 * ((x1 * (3.0 - ((x2 * 8.0) - (x1 * (3.0 - (x1 * 6.0)))))) + (6.0 * (3.0 - (2.0 * x2)))))));
double t_1 = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
double tmp;
if (x1 <= -5e+154) {
tmp = t_1;
} else if (x1 <= -15500000000.0) {
tmp = t_0;
} else if (x1 <= 43000000000.0) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 2e+153) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 - ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / (-1.0 - (x1 * x1)))) - (x1 - (x1 * ((x1 * (3.0 - ((x2 * 8.0) - (x1 * (3.0 - (x1 * 6.0)))))) + (6.0 * (3.0 - (2.0 * x2))))))) t_1 = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) tmp = 0 if x1 <= -5e+154: tmp = t_1 elif x1 <= -15500000000.0: tmp = t_0 elif x1 <= 43000000000.0: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 elif x1 <= 2e+153: tmp = t_0 else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(-1.0 - Float64(x1 * x1)))) - Float64(x1 - Float64(x1 * Float64(Float64(x1 * Float64(3.0 - Float64(Float64(x2 * 8.0) - Float64(x1 * Float64(3.0 - Float64(x1 * 6.0)))))) + Float64(6.0 * Float64(3.0 - Float64(2.0 * x2)))))))) t_1 = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))) tmp = 0.0 if (x1 <= -5e+154) tmp = t_1; elseif (x1 <= -15500000000.0) tmp = t_0; elseif (x1 <= 43000000000.0) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); elseif (x1 <= 2e+153) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 - ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / (-1.0 - (x1 * x1)))) - (x1 - (x1 * ((x1 * (3.0 - ((x2 * 8.0) - (x1 * (3.0 - (x1 * 6.0)))))) + (6.0 * (3.0 - (2.0 * x2))))))); t_1 = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); tmp = 0.0; if (x1 <= -5e+154) tmp = t_1; elseif (x1 <= -15500000000.0) tmp = t_0; elseif (x1 <= 43000000000.0) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; elseif (x1 <= 2e+153) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 - N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 - N[(x1 * N[(N[(x1 * N[(3.0 - N[(N[(x2 * 8.0), $MachinePrecision] - N[(x1 * N[(3.0 - N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(6.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+154], t$95$1, If[LessEqual[x1, -15500000000.0], t$95$0, If[LessEqual[x1, 43000000000.0], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 2e+153], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 - \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1} - \left(x1 - x1 \cdot \left(x1 \cdot \left(3 - \left(x2 \cdot 8 - x1 \cdot \left(3 - x1 \cdot 6\right)\right)\right) + 6 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right)\\
t_1 := x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -15500000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 43000000000:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+153}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -5.00000000000000004e154 or 2e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 73.5%
Taylor expanded in x2 around 0 100.0%
if -5.00000000000000004e154 < x1 < -1.55e10 or 4.3e10 < x1 < 2e153Initial program 83.0%
Taylor expanded in x1 around inf 83.0%
Taylor expanded in x1 around inf 81.4%
Taylor expanded in x1 around 0 72.5%
Taylor expanded in x2 around 0 98.3%
if -1.55e10 < x1 < 4.3e10Initial program 99.4%
Simplified88.1%
Taylor expanded in x1 around 0 85.5%
fma-define85.6%
*-commutative85.6%
fmm-def85.6%
metadata-eval85.6%
cancel-sign-sub-inv85.6%
cancel-sign-sub-inv85.6%
metadata-eval85.6%
*-commutative85.6%
metadata-eval85.6%
Simplified85.6%
Taylor expanded in x2 around 0 97.1%
Final simplification98.2%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -4e+17)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))))
(if (<= x1 2.9e-55)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(if (<= x1 1.56e+150)
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(+
x1
(+
(* x1 (* x1 x1))
(-
(* 3.0 (* x1 (* x1 3.0)))
(* (+ (* x1 x1) 1.0) (* 4.0 (* x1 (* x2 (- 3.0 (* 2.0 x2)))))))))))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -4e+17) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 2.9e-55) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 1.56e+150) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * (x1 * (x1 * 3.0))) - (((x1 * x1) + 1.0) * (4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))))))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-4d+17)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0))))))
else if (x1 <= 2.9d-55) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else if (x1 <= 1.56d+150) then
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * (x1 * (x1 * 3.0d0))) - (((x1 * x1) + 1.0d0) * (4.0d0 * (x1 * (x2 * (3.0d0 - (2.0d0 * x2))))))))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -4e+17) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 2.9e-55) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 1.56e+150) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * (x1 * (x1 * 3.0))) - (((x1 * x1) + 1.0) * (4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))))))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -4e+17: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) elif x1 <= 2.9e-55: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 elif x1 <= 1.56e+150: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * (x1 * (x1 * 3.0))) - (((x1 * x1) + 1.0) * (4.0 * (x1 * (x2 * (3.0 - (2.0 * x2)))))))))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -4e+17) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))))); elseif (x1 <= 2.9e-55) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); elseif (x1 <= 1.56e+150) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * Float64(x1 * Float64(x1 * 3.0))) - Float64(Float64(Float64(x1 * x1) + 1.0) * Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))))))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -4e+17) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))); elseif (x1 <= 2.9e-55) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; elseif (x1 <= 1.56e+150) tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * (x1 * (x1 * 3.0))) - (((x1 * x1) + 1.0) * (4.0 * (x1 * (x2 * (3.0 - (2.0 * x2)))))))))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -4e+17], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.9e-55], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 1.56e+150], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision] * N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4 \cdot 10^{+17}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq 2.9 \cdot 10^{-55}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{elif}\;x1 \leq 1.56 \cdot 10^{+150}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right) - \left(x1 \cdot x1 + 1\right) \cdot \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -4e17Initial program 29.9%
Simplified47.4%
Taylor expanded in x1 around 0 56.1%
Taylor expanded in x2 around 0 71.9%
*-commutative71.9%
Simplified71.9%
if -4e17 < x1 < 2.9e-55Initial program 99.4%
Simplified87.4%
Taylor expanded in x1 around 0 85.1%
fma-define85.3%
*-commutative85.3%
fmm-def85.3%
metadata-eval85.3%
cancel-sign-sub-inv85.3%
cancel-sign-sub-inv85.3%
metadata-eval85.3%
*-commutative85.3%
metadata-eval85.3%
Simplified85.3%
Taylor expanded in x2 around 0 97.5%
if 2.9e-55 < x1 < 1.56e150Initial program 99.7%
Taylor expanded in x1 around inf 95.5%
Taylor expanded in x1 around 0 99.5%
mul-1-neg99.5%
unsub-neg99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in x1 around 0 64.4%
if 1.56e150 < x1 Initial program 2.8%
Simplified2.8%
Taylor expanded in x1 around 0 78.1%
Taylor expanded in x2 around 0 97.5%
Final simplification85.8%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -4e+17)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))))
(if (<= x1 1e-85)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(-
(* x2 -6.0)
(* x1 (- (- (* x2 (- 12.0 (* x2 8.0))) (* x1 9.0)) -1.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -4e+17) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 1e-85) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x2 * 8.0))) - (x1 * 9.0)) - -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-4d+17)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0))))))
else if (x1 <= 1d-85) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else
tmp = (x2 * (-6.0d0)) - (x1 * (((x2 * (12.0d0 - (x2 * 8.0d0))) - (x1 * 9.0d0)) - (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -4e+17) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 1e-85) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x2 * 8.0))) - (x1 * 9.0)) - -1.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -4e+17: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) elif x1 <= 1e-85: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 else: tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x2 * 8.0))) - (x1 * 9.0)) - -1.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -4e+17) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))))); elseif (x1 <= 1e-85) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); else tmp = Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(Float64(Float64(x2 * Float64(12.0 - Float64(x2 * 8.0))) - Float64(x1 * 9.0)) - -1.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -4e+17) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))); elseif (x1 <= 1e-85) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; else tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x2 * 8.0))) - (x1 * 9.0)) - -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -4e+17], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e-85], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(N[(N[(x2 * N[(12.0 - N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4 \cdot 10^{+17}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{-85}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x2 \cdot \left(12 - x2 \cdot 8\right) - x1 \cdot 9\right) - -1\right)\\
\end{array}
\end{array}
if x1 < -4e17Initial program 29.9%
Simplified47.4%
Taylor expanded in x1 around 0 56.1%
Taylor expanded in x2 around 0 71.9%
*-commutative71.9%
Simplified71.9%
if -4e17 < x1 < 9.9999999999999998e-86Initial program 99.4%
Simplified86.9%
Taylor expanded in x1 around 0 84.6%
fma-define84.8%
*-commutative84.8%
fmm-def84.8%
metadata-eval84.8%
cancel-sign-sub-inv84.8%
cancel-sign-sub-inv84.8%
metadata-eval84.8%
*-commutative84.8%
metadata-eval84.8%
Simplified84.8%
Taylor expanded in x2 around 0 97.4%
if 9.9999999999999998e-86 < x1 Initial program 57.1%
Simplified57.2%
Taylor expanded in x1 around 0 56.6%
Taylor expanded in x2 around 0 61.5%
Taylor expanded in x2 around inf 66.8%
*-commutative66.8%
Simplified66.8%
Final simplification81.3%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -3.5e+17)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))))
(if (<= x1 1.15e+144)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.5e+17) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 1.15e+144) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-3.5d+17)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0))))))
else if (x1 <= 1.15d+144) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -3.5e+17) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 1.15e+144) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3.5e+17: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) elif x1 <= 1.15e+144: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3.5e+17) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))))); elseif (x1 <= 1.15e+144) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -3.5e+17) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))); elseif (x1 <= 1.15e+144) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3.5e+17], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.15e+144], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.5 \cdot 10^{+17}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq 1.15 \cdot 10^{+144}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -3.5e17Initial program 29.9%
Simplified47.4%
Taylor expanded in x1 around 0 56.1%
Taylor expanded in x2 around 0 71.9%
*-commutative71.9%
Simplified71.9%
if -3.5e17 < x1 < 1.1500000000000001e144Initial program 99.5%
Simplified90.5%
Taylor expanded in x1 around 0 72.8%
fma-define72.9%
*-commutative72.9%
fmm-def72.9%
metadata-eval72.9%
cancel-sign-sub-inv72.9%
cancel-sign-sub-inv72.9%
metadata-eval72.9%
*-commutative72.9%
metadata-eval72.9%
Simplified72.9%
Taylor expanded in x2 around 0 82.0%
if 1.1500000000000001e144 < x1 Initial program 10.3%
Simplified10.3%
Taylor expanded in x1 around 0 72.1%
Taylor expanded in x2 around 0 90.8%
Final simplification80.9%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -4e+17)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))))
(if (<= x1 1.15e+144)
(- (* x2 -6.0) (* x1 (- (* x2 (- 12.0 (* x2 8.0))) -1.0)))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -4e+17) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 1.15e+144) {
tmp = (x2 * -6.0) - (x1 * ((x2 * (12.0 - (x2 * 8.0))) - -1.0));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-4d+17)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0))))))
else if (x1 <= 1.15d+144) then
tmp = (x2 * (-6.0d0)) - (x1 * ((x2 * (12.0d0 - (x2 * 8.0d0))) - (-1.0d0)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -4e+17) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 1.15e+144) {
tmp = (x2 * -6.0) - (x1 * ((x2 * (12.0 - (x2 * 8.0))) - -1.0));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -4e+17: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) elif x1 <= 1.15e+144: tmp = (x2 * -6.0) - (x1 * ((x2 * (12.0 - (x2 * 8.0))) - -1.0)) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -4e+17) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))))); elseif (x1 <= 1.15e+144) tmp = Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(Float64(x2 * Float64(12.0 - Float64(x2 * 8.0))) - -1.0))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -4e+17) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))); elseif (x1 <= 1.15e+144) tmp = (x2 * -6.0) - (x1 * ((x2 * (12.0 - (x2 * 8.0))) - -1.0)); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -4e+17], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.15e+144], N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(N[(x2 * N[(12.0 - N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4 \cdot 10^{+17}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq 1.15 \cdot 10^{+144}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(x2 \cdot \left(12 - x2 \cdot 8\right) - -1\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -4e17Initial program 29.9%
Simplified47.4%
Taylor expanded in x1 around 0 56.1%
Taylor expanded in x2 around 0 71.9%
*-commutative71.9%
Simplified71.9%
if -4e17 < x1 < 1.1500000000000001e144Initial program 99.5%
Simplified90.5%
Taylor expanded in x1 around 0 72.8%
fma-define72.9%
*-commutative72.9%
fmm-def72.9%
metadata-eval72.9%
cancel-sign-sub-inv72.9%
cancel-sign-sub-inv72.9%
metadata-eval72.9%
*-commutative72.9%
metadata-eval72.9%
Simplified72.9%
Taylor expanded in x2 around 0 72.9%
Taylor expanded in x1 around 0 72.8%
if 1.1500000000000001e144 < x1 Initial program 10.3%
Simplified10.3%
Taylor expanded in x1 around 0 72.1%
Taylor expanded in x2 around 0 90.8%
Final simplification75.3%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -1.7e+254) (not (<= x2 1e+171))) (* x1 (+ -1.0 (* x2 (- (* x2 8.0) 12.0)))) (+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0))))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.7e+254) || !(x2 <= 1e+171)) {
tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-1.7d+254)) .or. (.not. (x2 <= 1d+171))) then
tmp = x1 * ((-1.0d0) + (x2 * ((x2 * 8.0d0) - 12.0d0)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.7e+254) || !(x2 <= 1e+171)) {
tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -1.7e+254) or not (x2 <= 1e+171): tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -1.7e+254) || !(x2 <= 1e+171)) tmp = Float64(x1 * Float64(-1.0 + Float64(x2 * Float64(Float64(x2 * 8.0) - 12.0)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -1.7e+254) || ~((x2 <= 1e+171))) tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -1.7e+254], N[Not[LessEqual[x2, 1e+171]], $MachinePrecision]], N[(x1 * N[(-1.0 + N[(x2 * N[(N[(x2 * 8.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.7 \cdot 10^{+254} \lor \neg \left(x2 \leq 10^{+171}\right):\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x2 < -1.7e254 or 9.99999999999999954e170 < x2 Initial program 70.0%
Simplified60.7%
Taylor expanded in x1 around 0 68.2%
fma-define68.2%
*-commutative68.2%
fmm-def68.2%
metadata-eval68.2%
cancel-sign-sub-inv68.2%
cancel-sign-sub-inv68.2%
metadata-eval68.2%
*-commutative68.2%
metadata-eval68.2%
Simplified68.2%
Taylor expanded in x2 around 0 68.2%
Taylor expanded in x1 around inf 68.2%
if -1.7e254 < x2 < 9.99999999999999954e170Initial program 68.5%
Simplified69.0%
Taylor expanded in x1 around 0 64.2%
Taylor expanded in x2 around 0 67.6%
Final simplification67.7%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -1e-98) (not (<= x1 3.7e-115))) (* x1 (+ -1.0 (* x2 (- (* x2 8.0) 12.0)))) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -1e-98) || !(x1 <= 3.7e-115)) {
tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 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 <= (-1d-98)) .or. (.not. (x1 <= 3.7d-115))) then
tmp = x1 * ((-1.0d0) + (x2 * ((x2 * 8.0d0) - 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 <= -1e-98) || !(x1 <= 3.7e-115)) {
tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -1e-98) or not (x1 <= 3.7e-115): tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -1e-98) || !(x1 <= 3.7e-115)) tmp = Float64(x1 * Float64(-1.0 + Float64(x2 * Float64(Float64(x2 * 8.0) - 12.0)))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -1e-98) || ~((x1 <= 3.7e-115))) tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -1e-98], N[Not[LessEqual[x1, 3.7e-115]], $MachinePrecision]], N[(x1 * N[(-1.0 + N[(x2 * N[(N[(x2 * 8.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1 \cdot 10^{-98} \lor \neg \left(x1 \leq 3.7 \cdot 10^{-115}\right):\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -9.99999999999999939e-99 or 3.7e-115 < x1 Initial program 56.7%
Simplified61.8%
Taylor expanded in x1 around 0 38.7%
fma-define38.7%
*-commutative38.7%
fmm-def38.7%
metadata-eval38.7%
cancel-sign-sub-inv38.7%
cancel-sign-sub-inv38.7%
metadata-eval38.7%
*-commutative38.7%
metadata-eval38.7%
Simplified38.7%
Taylor expanded in x2 around 0 38.7%
Taylor expanded in x1 around inf 34.5%
if -9.99999999999999939e-99 < x1 < 3.7e-115Initial program 99.5%
Simplified99.8%
Taylor expanded in x1 around 0 78.5%
Final simplification46.8%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 2.4e-76)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))))
(if (<= x1 1.15e+144)
(* x1 (+ -1.0 (* x2 (- (* x2 8.0) 12.0))))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= 2.4e-76) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 1.15e+144) {
tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= 2.4d-76) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0))))))
else if (x1 <= 1.15d+144) then
tmp = x1 * ((-1.0d0) + (x2 * ((x2 * 8.0d0) - 12.0d0)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 2.4e-76) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 1.15e+144) {
tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 2.4e-76: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) elif x1 <= 1.15e+144: tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 2.4e-76) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))))); elseif (x1 <= 1.15e+144) tmp = Float64(x1 * Float64(-1.0 + Float64(x2 * Float64(Float64(x2 * 8.0) - 12.0)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 2.4e-76) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))); elseif (x1 <= 1.15e+144) tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 2.4e-76], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.15e+144], N[(x1 * N[(-1.0 + N[(x2 * N[(N[(x2 * 8.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 2.4 \cdot 10^{-76}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq 1.15 \cdot 10^{+144}:\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < 2.40000000000000013e-76Initial program 74.4%
Simplified72.8%
Taylor expanded in x1 around 0 67.0%
Taylor expanded in x2 around 0 74.5%
*-commutative74.5%
Simplified74.5%
if 2.40000000000000013e-76 < x1 < 1.1500000000000001e144Initial program 99.6%
Simplified99.7%
Taylor expanded in x1 around 0 40.9%
fma-define40.9%
*-commutative40.9%
fmm-def40.9%
metadata-eval40.9%
cancel-sign-sub-inv40.9%
cancel-sign-sub-inv40.9%
metadata-eval40.9%
*-commutative40.9%
metadata-eval40.9%
Simplified40.9%
Taylor expanded in x2 around 0 40.9%
Taylor expanded in x1 around inf 40.9%
if 1.1500000000000001e144 < x1 Initial program 10.3%
Simplified10.3%
Taylor expanded in x1 around 0 72.1%
Taylor expanded in x2 around 0 90.8%
Final simplification71.5%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -2.7e-234) (not (<= x2 1.1e-70))) (* x2 -6.0) (- x1)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -2.7e-234) || !(x2 <= 1.1e-70)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-2.7d-234)) .or. (.not. (x2 <= 1.1d-70))) then
tmp = x2 * (-6.0d0)
else
tmp = -x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -2.7e-234) || !(x2 <= 1.1e-70)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -2.7e-234) or not (x2 <= 1.1e-70): tmp = x2 * -6.0 else: tmp = -x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -2.7e-234) || !(x2 <= 1.1e-70)) tmp = Float64(x2 * -6.0); else tmp = Float64(-x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -2.7e-234) || ~((x2 <= 1.1e-70))) tmp = x2 * -6.0; else tmp = -x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -2.7e-234], N[Not[LessEqual[x2, 1.1e-70]], $MachinePrecision]], N[(x2 * -6.0), $MachinePrecision], (-x1)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -2.7 \cdot 10^{-234} \lor \neg \left(x2 \leq 1.1 \cdot 10^{-70}\right):\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;-x1\\
\end{array}
\end{array}
if x2 < -2.7000000000000002e-234 or 1.0999999999999999e-70 < x2 Initial program 68.7%
Simplified68.8%
Taylor expanded in x1 around 0 31.3%
if -2.7000000000000002e-234 < x2 < 1.0999999999999999e-70Initial program 68.8%
Simplified73.6%
Taylor expanded in x1 around 0 45.2%
fma-define45.2%
*-commutative45.2%
fmm-def45.2%
metadata-eval45.2%
cancel-sign-sub-inv45.2%
cancel-sign-sub-inv45.2%
metadata-eval45.2%
*-commutative45.2%
metadata-eval45.2%
Simplified45.2%
Taylor expanded in x2 around 0 32.6%
mul-1-neg32.6%
Simplified32.6%
Final simplification31.7%
(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 Float64(-x1) end
function tmp = code(x1, x2) tmp = -x1; end
code[x1_, x2_] := (-x1)
\begin{array}{l}
\\
-x1
\end{array}
Initial program 68.8%
Simplified67.7%
Taylor expanded in x1 around 0 51.0%
fma-define51.1%
*-commutative51.1%
fmm-def51.1%
metadata-eval51.1%
cancel-sign-sub-inv51.1%
cancel-sign-sub-inv51.1%
metadata-eval51.1%
*-commutative51.1%
metadata-eval51.1%
Simplified51.1%
Taylor expanded in x2 around 0 11.9%
mul-1-neg11.9%
Simplified11.9%
herbie shell --seed 2024163
(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))))))