
(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 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- 3.0 (* 2.0 x2)))
(t_1 (* 3.0 (* x1 x1)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (fma x1 (* x1 3.0) (* 2.0 x2)))
(t_4 (/ (- t_3 x1) (fma x1 x1 1.0)))
(t_5 (+ (* x1 x1) 1.0))
(t_6 (/ (- (+ t_2 (* 2.0 x2)) x1) t_5))
(t_7 (/ (- x1 t_3) (fma x1 x1 1.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_5
(+
(* (* (* x1 2.0) t_6) (- t_6 3.0))
(* (* x1 x1) (- (* t_6 4.0) 6.0))))
(* t_2 t_6))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_5))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_1 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_4 4.0 -6.0)) (* (* x1 (* 2.0 t_7)) (- t_7 -3.0)))
(fma t_1 t_4 (pow x1 3.0))))))
(*
x1
(-
(- -1.0 (* -2.0 (- 1.0 (* 3.0 t_0))))
(* x1 (- (+ (* 4.0 t_0) (* x1 (- 3.0 (* x1 6.0)))) 9.0)))))))
double code(double x1, double x2) {
double t_0 = 3.0 - (2.0 * x2);
double t_1 = 3.0 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = fma(x1, (x1 * 3.0), (2.0 * x2));
double t_4 = (t_3 - x1) / fma(x1, x1, 1.0);
double t_5 = (x1 * x1) + 1.0;
double t_6 = ((t_2 + (2.0 * x2)) - x1) / t_5;
double t_7 = (x1 - t_3) / fma(x1, x1, 1.0);
double tmp;
if ((x1 + ((x1 + (((t_5 * ((((x1 * 2.0) * t_6) * (t_6 - 3.0)) + ((x1 * x1) * ((t_6 * 4.0) - 6.0)))) + (t_2 * t_6)) + (x1 * (x1 * x1)))) + (3.0 * (((t_2 - (2.0 * x2)) - x1) / t_5)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_4, 4.0, -6.0)), ((x1 * (2.0 * t_7)) * (t_7 - -3.0))), fma(t_1, t_4, pow(x1, 3.0)))));
} else {
tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0)));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(3.0 - Float64(2.0 * x2)) t_1 = Float64(3.0 * Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) t_4 = Float64(Float64(t_3 - x1) / fma(x1, x1, 1.0)) t_5 = Float64(Float64(x1 * x1) + 1.0) t_6 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_5) t_7 = Float64(Float64(x1 - t_3) / fma(x1, x1, 1.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_5 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_6) * Float64(t_6 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_6 * 4.0) - 6.0)))) + Float64(t_2 * t_6)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_5)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_4, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_7)) * Float64(t_7 - -3.0))), fma(t_1, t_4, (x1 ^ 3.0)))))); else tmp = Float64(x1 * Float64(Float64(-1.0 - Float64(-2.0 * Float64(1.0 - Float64(3.0 * t_0)))) - Float64(x1 * Float64(Float64(Float64(4.0 * t_0) + Float64(x1 * Float64(3.0 - Float64(x1 * 6.0)))) - 9.0)))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 - t$95$3), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$5 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$6), $MachinePrecision] * N[(t$95$6 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$6 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * t$95$6), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$1 - 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$4 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$7), $MachinePrecision]), $MachinePrecision] * N[(t$95$7 - -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$4 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(N[(-1.0 - N[(-2.0 * N[(1.0 - N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(N[(N[(4.0 * t$95$0), $MachinePrecision] + N[(x1 * N[(3.0 - N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 - 2 \cdot x2\\
t_1 := 3 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right)\\
t_4 := \frac{t\_3 - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_5 := x1 \cdot x1 + 1\\
t_6 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_5}\\
t_7 := \frac{x1 - t\_3}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_5 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_6\right) \cdot \left(t\_6 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_6 \cdot 4 - 6\right)\right) + t\_2 \cdot t\_6\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_5}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_1 - \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\_4, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_7\right)\right) \cdot \left(t\_7 - -3\right)\right), \mathsf{fma}\left(t\_1, t\_4, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(\left(-1 - -2 \cdot \left(1 - 3 \cdot t\_0\right)\right) - x1 \cdot \left(\left(4 \cdot t\_0 + x1 \cdot \left(3 - x1 \cdot 6\right)\right) - 9\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
Simplified99.6%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around -inf 100.0%
Taylor expanded in x1 around 0 100.0%
Final simplification99.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- 3.0 (* 2.0 x2)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))))
(if (<= t_4 INFINITY)
t_4
(*
x1
(-
(- -1.0 (* -2.0 (- 1.0 (* 3.0 t_0))))
(* x1 (- (+ (* 4.0 t_0) (* x1 (- 3.0 (* x1 6.0)))) 9.0)))))))
double code(double x1, double x2) {
double t_0 = 3.0 - (2.0 * x2);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_4 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0)));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = 3.0 - (2.0 * x2);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = t_4;
} else {
tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 - (2.0 * x2) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2 t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2))) tmp = 0 if t_4 <= math.inf: tmp = t_4 else: tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0))) return tmp
function code(x1, x2) t_0 = Float64(3.0 - Float64(2.0 * x2)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) tmp = 0.0 if (t_4 <= Inf) tmp = t_4; else tmp = Float64(x1 * Float64(Float64(-1.0 - Float64(-2.0 * Float64(1.0 - Float64(3.0 * t_0)))) - Float64(x1 * Float64(Float64(Float64(4.0 * t_0) + Float64(x1 * Float64(3.0 - Float64(x1 * 6.0)))) - 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 - (2.0 * x2); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2; t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2))); tmp = 0.0; if (t_4 <= Inf) tmp = t_4; else tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, Infinity], t$95$4, N[(x1 * N[(N[(-1.0 - N[(-2.0 * N[(1.0 - N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(N[(N[(4.0 * t$95$0), $MachinePrecision] + N[(x1 * N[(3.0 - N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 - 2 \cdot x2\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right)\\
\mathbf{if}\;t\_4 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(\left(-1 - -2 \cdot \left(1 - 3 \cdot t\_0\right)\right) - x1 \cdot \left(\left(4 \cdot t\_0 + x1 \cdot \left(3 - x1 \cdot 6\right)\right) - 9\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around -inf 100.0%
Taylor expanded in x1 around 0 100.0%
Final simplification99.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- 3.0 (* 2.0 x2)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x1 (* x1 x1)))
(t_3 (* x1 (* x1 3.0)))
(t_4 (- (+ t_3 (* 2.0 x2)) x1))
(t_5 (/ t_4 t_1))
(t_6 (* (* x1 x1) (- (* t_5 4.0) 6.0)))
(t_7 (- t_5 3.0)))
(if (<= x1 -9.2e+49)
(*
x1
(-
(- -1.0 (* -2.0 (- 1.0 (* 3.0 t_0))))
(* x1 (- (+ (* 4.0 t_0) (* x1 (- 3.0 (* x1 6.0)))) 9.0))))
(if (<= x1 1.5e-8)
(+
x1
(+
(* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_1))
(+
x1
(-
t_2
(+
(* t_3 (/ t_4 (- -1.0 (* x1 x1))))
(* t_1 (- (* t_7 (* (* x1 2.0) (- x1 (* 2.0 x2)))) t_6)))))))
(if (<= x1 5e+153)
(+
x1
(+
9.0
(+
x1
(+
t_2
(+
(* t_1 (+ (* (* (* x1 2.0) t_5) t_7) t_6))
(* t_3 (- 3.0 (/ (+ 1.0 (/ t_0 x1)) x1))))))))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))))))))
double code(double x1, double x2) {
double t_0 = 3.0 - (2.0 * x2);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = (t_3 + (2.0 * x2)) - x1;
double t_5 = t_4 / t_1;
double t_6 = (x1 * x1) * ((t_5 * 4.0) - 6.0);
double t_7 = t_5 - 3.0;
double tmp;
if (x1 <= -9.2e+49) {
tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0)));
} else if (x1 <= 1.5e-8) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_2 - ((t_3 * (t_4 / (-1.0 - (x1 * x1)))) + (t_1 * ((t_7 * ((x1 * 2.0) * (x1 - (2.0 * x2)))) - t_6))))));
} else if (x1 <= 5e+153) {
tmp = x1 + (9.0 + (x1 + (t_2 + ((t_1 * ((((x1 * 2.0) * t_5) * t_7) + t_6)) + (t_3 * (3.0 - ((1.0 + (t_0 / 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) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_0 = 3.0d0 - (2.0d0 * x2)
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 * (x1 * x1)
t_3 = x1 * (x1 * 3.0d0)
t_4 = (t_3 + (2.0d0 * x2)) - x1
t_5 = t_4 / t_1
t_6 = (x1 * x1) * ((t_5 * 4.0d0) - 6.0d0)
t_7 = t_5 - 3.0d0
if (x1 <= (-9.2d+49)) then
tmp = x1 * (((-1.0d0) - ((-2.0d0) * (1.0d0 - (3.0d0 * t_0)))) - (x1 * (((4.0d0 * t_0) + (x1 * (3.0d0 - (x1 * 6.0d0)))) - 9.0d0)))
else if (x1 <= 1.5d-8) then
tmp = x1 + ((3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + (t_2 - ((t_3 * (t_4 / ((-1.0d0) - (x1 * x1)))) + (t_1 * ((t_7 * ((x1 * 2.0d0) * (x1 - (2.0d0 * x2)))) - t_6))))))
else if (x1 <= 5d+153) then
tmp = x1 + (9.0d0 + (x1 + (t_2 + ((t_1 * ((((x1 * 2.0d0) * t_5) * t_7) + t_6)) + (t_3 * (3.0d0 - ((1.0d0 + (t_0 / 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 = 3.0 - (2.0 * x2);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = (t_3 + (2.0 * x2)) - x1;
double t_5 = t_4 / t_1;
double t_6 = (x1 * x1) * ((t_5 * 4.0) - 6.0);
double t_7 = t_5 - 3.0;
double tmp;
if (x1 <= -9.2e+49) {
tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0)));
} else if (x1 <= 1.5e-8) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_2 - ((t_3 * (t_4 / (-1.0 - (x1 * x1)))) + (t_1 * ((t_7 * ((x1 * 2.0) * (x1 - (2.0 * x2)))) - t_6))))));
} else if (x1 <= 5e+153) {
tmp = x1 + (9.0 + (x1 + (t_2 + ((t_1 * ((((x1 * 2.0) * t_5) * t_7) + t_6)) + (t_3 * (3.0 - ((1.0 + (t_0 / x1)) / x1)))))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 - (2.0 * x2) t_1 = (x1 * x1) + 1.0 t_2 = x1 * (x1 * x1) t_3 = x1 * (x1 * 3.0) t_4 = (t_3 + (2.0 * x2)) - x1 t_5 = t_4 / t_1 t_6 = (x1 * x1) * ((t_5 * 4.0) - 6.0) t_7 = t_5 - 3.0 tmp = 0 if x1 <= -9.2e+49: tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0))) elif x1 <= 1.5e-8: tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_2 - ((t_3 * (t_4 / (-1.0 - (x1 * x1)))) + (t_1 * ((t_7 * ((x1 * 2.0) * (x1 - (2.0 * x2)))) - t_6)))))) elif x1 <= 5e+153: tmp = x1 + (9.0 + (x1 + (t_2 + ((t_1 * ((((x1 * 2.0) * t_5) * t_7) + t_6)) + (t_3 * (3.0 - ((1.0 + (t_0 / x1)) / x1))))))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) t_0 = Float64(3.0 - Float64(2.0 * x2)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) t_5 = Float64(t_4 / t_1) t_6 = Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)) t_7 = Float64(t_5 - 3.0) tmp = 0.0 if (x1 <= -9.2e+49) tmp = Float64(x1 * Float64(Float64(-1.0 - Float64(-2.0 * Float64(1.0 - Float64(3.0 * t_0)))) - Float64(x1 * Float64(Float64(Float64(4.0 * t_0) + Float64(x1 * Float64(3.0 - Float64(x1 * 6.0)))) - 9.0)))); elseif (x1 <= 1.5e-8) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(t_2 - Float64(Float64(t_3 * Float64(t_4 / Float64(-1.0 - Float64(x1 * x1)))) + Float64(t_1 * Float64(Float64(t_7 * Float64(Float64(x1 * 2.0) * Float64(x1 - Float64(2.0 * x2)))) - t_6))))))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_2 + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_5) * t_7) + t_6)) + Float64(t_3 * Float64(3.0 - Float64(Float64(1.0 + Float64(t_0 / 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 = 3.0 - (2.0 * x2); t_1 = (x1 * x1) + 1.0; t_2 = x1 * (x1 * x1); t_3 = x1 * (x1 * 3.0); t_4 = (t_3 + (2.0 * x2)) - x1; t_5 = t_4 / t_1; t_6 = (x1 * x1) * ((t_5 * 4.0) - 6.0); t_7 = t_5 - 3.0; tmp = 0.0; if (x1 <= -9.2e+49) tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0))); elseif (x1 <= 1.5e-8) tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_2 - ((t_3 * (t_4 / (-1.0 - (x1 * x1)))) + (t_1 * ((t_7 * ((x1 * 2.0) * (x1 - (2.0 * x2)))) - t_6)))))); elseif (x1 <= 5e+153) tmp = x1 + (9.0 + (x1 + (t_2 + ((t_1 * ((((x1 * 2.0) * t_5) * t_7) + t_6)) + (t_3 * (3.0 - ((1.0 + (t_0 / 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[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / t$95$1), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$5 - 3.0), $MachinePrecision]}, If[LessEqual[x1, -9.2e+49], N[(x1 * N[(N[(-1.0 - N[(-2.0 * N[(1.0 - N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(N[(N[(4.0 * t$95$0), $MachinePrecision] + N[(x1 * N[(3.0 - N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.5e-8], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$2 - N[(N[(t$95$3 * N[(t$95$4 / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(N[(t$95$7 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(x1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$2 + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision] * t$95$7), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[(3.0 - N[(N[(1.0 + N[(t$95$0 / x1), $MachinePrecision]), $MachinePrecision] / x1), $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}
t_0 := 3 - 2 \cdot x2\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := \left(t\_3 + 2 \cdot x2\right) - x1\\
t_5 := \frac{t\_4}{t\_1}\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(t\_5 \cdot 4 - 6\right)\\
t_7 := t\_5 - 3\\
\mathbf{if}\;x1 \leq -9.2 \cdot 10^{+49}:\\
\;\;\;\;x1 \cdot \left(\left(-1 - -2 \cdot \left(1 - 3 \cdot t\_0\right)\right) - x1 \cdot \left(\left(4 \cdot t\_0 + x1 \cdot \left(3 - x1 \cdot 6\right)\right) - 9\right)\right)\\
\mathbf{elif}\;x1 \leq 1.5 \cdot 10^{-8}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_3 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(t\_2 - \left(t\_3 \cdot \frac{t\_4}{-1 - x1 \cdot x1} + t\_1 \cdot \left(t\_7 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x1 - 2 \cdot x2\right)\right) - t\_6\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_2 + \left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_5\right) \cdot t\_7 + t\_6\right) + t\_3 \cdot \left(3 - \frac{1 + \frac{t\_0}{x1}}{x1}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -9.20000000000000008e49Initial program 28.6%
Simplified28.6%
Taylor expanded in x1 around -inf 99.9%
Taylor expanded in x1 around 0 99.9%
if -9.20000000000000008e49 < x1 < 1.49999999999999987e-8Initial program 99.4%
Taylor expanded in x1 around 0 98.4%
+-commutative98.4%
mul-1-neg98.4%
unsub-neg98.4%
Simplified98.4%
if 1.49999999999999987e-8 < x1 < 5.00000000000000018e153Initial program 99.2%
Taylor expanded in x1 around inf 95.8%
Taylor expanded in x1 around -inf 99.1%
if 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 90.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- 3.0 (* 2.0 x2)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* x1 (+ -1.0 (* x1 9.0))))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_3)))
(if (<= x1 -1150.0)
(*
x1
(-
(- -1.0 (* -2.0 (- 1.0 (* 3.0 t_0))))
(* x1 (- (+ (* 4.0 t_0) (* x1 (- 3.0 (* x1 6.0)))) 9.0))))
(if (<= x1 0.3)
(+ (* x2 -6.0) (+ t_2 (* x2 (+ (* x1 -12.0) (* 8.0 (* x1 x2))))))
(if (<= x1 5e+153)
(+
x1
(+
(+
x1
(+
(+
(*
t_3
(+
(* (* (* x1 2.0) t_4) (- t_4 3.0))
(* (* x1 x1) (- (* t_4 4.0) 6.0))))
(* t_1 t_4))
(* x1 (* x1 x1))))
9.0))
(+ (* x2 -6.0) t_2))))))
double code(double x1, double x2) {
double t_0 = 3.0 - (2.0 * x2);
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 * (-1.0 + (x1 * 9.0));
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double tmp;
if (x1 <= -1150.0) {
tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0)));
} else if (x1 <= 0.3) {
tmp = (x2 * -6.0) + (t_2 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))));
} else if (x1 <= 5e+153) {
tmp = x1 + ((x1 + (((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_1 * t_4)) + (x1 * (x1 * x1)))) + 9.0);
} else {
tmp = (x2 * -6.0) + t_2;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = 3.0d0 - (2.0d0 * x2)
t_1 = x1 * (x1 * 3.0d0)
t_2 = x1 * ((-1.0d0) + (x1 * 9.0d0))
t_3 = (x1 * x1) + 1.0d0
t_4 = ((t_1 + (2.0d0 * x2)) - x1) / t_3
if (x1 <= (-1150.0d0)) then
tmp = x1 * (((-1.0d0) - ((-2.0d0) * (1.0d0 - (3.0d0 * t_0)))) - (x1 * (((4.0d0 * t_0) + (x1 * (3.0d0 - (x1 * 6.0d0)))) - 9.0d0)))
else if (x1 <= 0.3d0) then
tmp = (x2 * (-6.0d0)) + (t_2 + (x2 * ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2)))))
else if (x1 <= 5d+153) then
tmp = x1 + ((x1 + (((t_3 * ((((x1 * 2.0d0) * t_4) * (t_4 - 3.0d0)) + ((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)))) + (t_1 * t_4)) + (x1 * (x1 * x1)))) + 9.0d0)
else
tmp = (x2 * (-6.0d0)) + t_2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 3.0 - (2.0 * x2);
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 * (-1.0 + (x1 * 9.0));
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double tmp;
if (x1 <= -1150.0) {
tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0)));
} else if (x1 <= 0.3) {
tmp = (x2 * -6.0) + (t_2 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))));
} else if (x1 <= 5e+153) {
tmp = x1 + ((x1 + (((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_1 * t_4)) + (x1 * (x1 * x1)))) + 9.0);
} else {
tmp = (x2 * -6.0) + t_2;
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 - (2.0 * x2) t_1 = x1 * (x1 * 3.0) t_2 = x1 * (-1.0 + (x1 * 9.0)) t_3 = (x1 * x1) + 1.0 t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3 tmp = 0 if x1 <= -1150.0: tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0))) elif x1 <= 0.3: tmp = (x2 * -6.0) + (t_2 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))) elif x1 <= 5e+153: tmp = x1 + ((x1 + (((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_1 * t_4)) + (x1 * (x1 * x1)))) + 9.0) else: tmp = (x2 * -6.0) + t_2 return tmp
function code(x1, x2) t_0 = Float64(3.0 - Float64(2.0 * x2)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0))) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_3) tmp = 0.0 if (x1 <= -1150.0) tmp = Float64(x1 * Float64(Float64(-1.0 - Float64(-2.0 * Float64(1.0 - Float64(3.0 * t_0)))) - Float64(x1 * Float64(Float64(Float64(4.0 * t_0) + Float64(x1 * Float64(3.0 - Float64(x1 * 6.0)))) - 9.0)))); elseif (x1 <= 0.3) tmp = Float64(Float64(x2 * -6.0) + Float64(t_2 + Float64(x2 * Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2)))))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_3 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)))) + Float64(t_1 * t_4)) + Float64(x1 * Float64(x1 * x1)))) + 9.0)); else tmp = Float64(Float64(x2 * -6.0) + t_2); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 - (2.0 * x2); t_1 = x1 * (x1 * 3.0); t_2 = x1 * (-1.0 + (x1 * 9.0)); t_3 = (x1 * x1) + 1.0; t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3; tmp = 0.0; if (x1 <= -1150.0) tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0))); elseif (x1 <= 0.3) tmp = (x2 * -6.0) + (t_2 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))); elseif (x1 <= 5e+153) tmp = x1 + ((x1 + (((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_1 * t_4)) + (x1 * (x1 * x1)))) + 9.0); else tmp = (x2 * -6.0) + t_2; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, If[LessEqual[x1, -1150.0], N[(x1 * N[(N[(-1.0 - N[(-2.0 * N[(1.0 - N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(N[(N[(4.0 * t$95$0), $MachinePrecision] + N[(x1 * N[(3.0 - N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.3], N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$2 + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$3 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + t$95$2), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 - 2 \cdot x2\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot \left(-1 + x1 \cdot 9\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_3}\\
\mathbf{if}\;x1 \leq -1150:\\
\;\;\;\;x1 \cdot \left(\left(-1 - -2 \cdot \left(1 - 3 \cdot t\_0\right)\right) - x1 \cdot \left(\left(4 \cdot t\_0 + x1 \cdot \left(3 - x1 \cdot 6\right)\right) - 9\right)\right)\\
\mathbf{elif}\;x1 \leq 0.3:\\
\;\;\;\;x2 \cdot -6 + \left(t\_2 + x2 \cdot \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t\_3 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_4\right) \cdot \left(t\_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_4 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_4\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 9\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + t\_2\\
\end{array}
\end{array}
if x1 < -1150Initial program 37.9%
Simplified37.9%
Taylor expanded in x1 around -inf 95.4%
Taylor expanded in x1 around 0 95.3%
if -1150 < x1 < 0.299999999999999989Initial program 99.4%
Simplified99.7%
Taylor expanded in x1 around 0 85.7%
Taylor expanded in x2 around 0 85.7%
Taylor expanded in x2 around 0 99.1%
if 0.299999999999999989 < x1 < 5.00000000000000018e153Initial program 99.6%
Taylor expanded in x1 around inf 99.2%
metadata-eval99.2%
Applied egg-rr99.2%
if 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 90.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* x1 (* x1 x1)))
(t_2 (- 3.0 (* 2.0 x2)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_0 (* 2.0 x2)) x1) t_3))
(t_5 (* (* x1 x1) (- (* t_4 4.0) 6.0)))
(t_6 (* (* x1 2.0) t_4)))
(if (<= x1 -4e+49)
(*
x1
(-
(- -1.0 (* -2.0 (- 1.0 (* 3.0 t_2))))
(* x1 (- (+ (* 4.0 t_2) (* x1 (- 3.0 (* x1 6.0)))) 9.0))))
(if (<= x1 1.5e-8)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_3))
(+
x1
(+
t_1
(-
(* t_0 t_4)
(* (+ t_5 (* t_6 (- (* 2.0 x2) 3.0))) (- -1.0 (* x1 x1))))))))
(if (<= x1 5e+153)
(+
x1
(+
9.0
(+
x1
(+
t_1
(+
(* t_3 (+ (* t_6 (- t_4 3.0)) t_5))
(* t_0 (- 3.0 (/ (+ 1.0 (/ t_2 x1)) 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 = x1 * (x1 * x1);
double t_2 = 3.0 - (2.0 * x2);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_3;
double t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_6 = (x1 * 2.0) * t_4;
double tmp;
if (x1 <= -4e+49) {
tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_2)))) - (x1 * (((4.0 * t_2) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0)));
} else if (x1 <= 1.5e-8) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_1 + ((t_0 * t_4) - ((t_5 + (t_6 * ((2.0 * x2) - 3.0))) * (-1.0 - (x1 * x1)))))));
} else if (x1 <= 5e+153) {
tmp = x1 + (9.0 + (x1 + (t_1 + ((t_3 * ((t_6 * (t_4 - 3.0)) + t_5)) + (t_0 * (3.0 - ((1.0 + (t_2 / 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) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = x1 * (x1 * x1)
t_2 = 3.0d0 - (2.0d0 * x2)
t_3 = (x1 * x1) + 1.0d0
t_4 = ((t_0 + (2.0d0 * x2)) - x1) / t_3
t_5 = (x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)
t_6 = (x1 * 2.0d0) * t_4
if (x1 <= (-4d+49)) then
tmp = x1 * (((-1.0d0) - ((-2.0d0) * (1.0d0 - (3.0d0 * t_2)))) - (x1 * (((4.0d0 * t_2) + (x1 * (3.0d0 - (x1 * 6.0d0)))) - 9.0d0)))
else if (x1 <= 1.5d-8) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_3)) + (x1 + (t_1 + ((t_0 * t_4) - ((t_5 + (t_6 * ((2.0d0 * x2) - 3.0d0))) * ((-1.0d0) - (x1 * x1)))))))
else if (x1 <= 5d+153) then
tmp = x1 + (9.0d0 + (x1 + (t_1 + ((t_3 * ((t_6 * (t_4 - 3.0d0)) + t_5)) + (t_0 * (3.0d0 - ((1.0d0 + (t_2 / 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 = x1 * (x1 * 3.0);
double t_1 = x1 * (x1 * x1);
double t_2 = 3.0 - (2.0 * x2);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_3;
double t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_6 = (x1 * 2.0) * t_4;
double tmp;
if (x1 <= -4e+49) {
tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_2)))) - (x1 * (((4.0 * t_2) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0)));
} else if (x1 <= 1.5e-8) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_1 + ((t_0 * t_4) - ((t_5 + (t_6 * ((2.0 * x2) - 3.0))) * (-1.0 - (x1 * x1)))))));
} else if (x1 <= 5e+153) {
tmp = x1 + (9.0 + (x1 + (t_1 + ((t_3 * ((t_6 * (t_4 - 3.0)) + t_5)) + (t_0 * (3.0 - ((1.0 + (t_2 / x1)) / 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 = x1 * (x1 * x1) t_2 = 3.0 - (2.0 * x2) t_3 = (x1 * x1) + 1.0 t_4 = ((t_0 + (2.0 * x2)) - x1) / t_3 t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0) t_6 = (x1 * 2.0) * t_4 tmp = 0 if x1 <= -4e+49: tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_2)))) - (x1 * (((4.0 * t_2) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0))) elif x1 <= 1.5e-8: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_1 + ((t_0 * t_4) - ((t_5 + (t_6 * ((2.0 * x2) - 3.0))) * (-1.0 - (x1 * x1))))))) elif x1 <= 5e+153: tmp = x1 + (9.0 + (x1 + (t_1 + ((t_3 * ((t_6 * (t_4 - 3.0)) + t_5)) + (t_0 * (3.0 - ((1.0 + (t_2 / x1)) / 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(x1 * Float64(x1 * x1)) t_2 = Float64(3.0 - Float64(2.0 * x2)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_3) t_5 = Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) t_6 = Float64(Float64(x1 * 2.0) * t_4) tmp = 0.0 if (x1 <= -4e+49) tmp = Float64(x1 * Float64(Float64(-1.0 - Float64(-2.0 * Float64(1.0 - Float64(3.0 * t_2)))) - Float64(x1 * Float64(Float64(Float64(4.0 * t_2) + Float64(x1 * Float64(3.0 - Float64(x1 * 6.0)))) - 9.0)))); elseif (x1 <= 1.5e-8) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_3)) + Float64(x1 + Float64(t_1 + Float64(Float64(t_0 * t_4) - Float64(Float64(t_5 + Float64(t_6 * Float64(Float64(2.0 * x2) - 3.0))) * Float64(-1.0 - Float64(x1 * x1)))))))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_1 + Float64(Float64(t_3 * Float64(Float64(t_6 * Float64(t_4 - 3.0)) + t_5)) + Float64(t_0 * Float64(3.0 - Float64(Float64(1.0 + Float64(t_2 / 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 = x1 * (x1 * 3.0); t_1 = x1 * (x1 * x1); t_2 = 3.0 - (2.0 * x2); t_3 = (x1 * x1) + 1.0; t_4 = ((t_0 + (2.0 * x2)) - x1) / t_3; t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0); t_6 = (x1 * 2.0) * t_4; tmp = 0.0; if (x1 <= -4e+49) tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_2)))) - (x1 * (((4.0 * t_2) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0))); elseif (x1 <= 1.5e-8) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_1 + ((t_0 * t_4) - ((t_5 + (t_6 * ((2.0 * x2) - 3.0))) * (-1.0 - (x1 * x1))))))); elseif (x1 <= 5e+153) tmp = x1 + (9.0 + (x1 + (t_1 + ((t_3 * ((t_6 * (t_4 - 3.0)) + t_5)) + (t_0 * (3.0 - ((1.0 + (t_2 / 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[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision]}, If[LessEqual[x1, -4e+49], N[(x1 * N[(N[(-1.0 - N[(-2.0 * N[(1.0 - N[(3.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(N[(N[(4.0 * t$95$2), $MachinePrecision] + N[(x1 * N[(3.0 - N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.5e-8], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$1 + N[(N[(t$95$0 * t$95$4), $MachinePrecision] - N[(N[(t$95$5 + N[(t$95$6 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$1 + N[(N[(t$95$3 * N[(N[(t$95$6 * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(3.0 - N[(N[(1.0 + N[(t$95$2 / x1), $MachinePrecision]), $MachinePrecision] / x1), $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}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := 3 - 2 \cdot x2\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_3}\\
t_5 := \left(x1 \cdot x1\right) \cdot \left(t\_4 \cdot 4 - 6\right)\\
t_6 := \left(x1 \cdot 2\right) \cdot t\_4\\
\mathbf{if}\;x1 \leq -4 \cdot 10^{+49}:\\
\;\;\;\;x1 \cdot \left(\left(-1 - -2 \cdot \left(1 - 3 \cdot t\_2\right)\right) - x1 \cdot \left(\left(4 \cdot t\_2 + x1 \cdot \left(3 - x1 \cdot 6\right)\right) - 9\right)\right)\\
\mathbf{elif}\;x1 \leq 1.5 \cdot 10^{-8}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_3} + \left(x1 + \left(t\_1 + \left(t\_0 \cdot t\_4 - \left(t\_5 + t\_6 \cdot \left(2 \cdot x2 - 3\right)\right) \cdot \left(-1 - x1 \cdot x1\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_1 + \left(t\_3 \cdot \left(t\_6 \cdot \left(t\_4 - 3\right) + t\_5\right) + t\_0 \cdot \left(3 - \frac{1 + \frac{t\_2}{x1}}{x1}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -3.99999999999999979e49Initial program 28.6%
Simplified28.6%
Taylor expanded in x1 around -inf 99.9%
Taylor expanded in x1 around 0 99.9%
if -3.99999999999999979e49 < x1 < 1.49999999999999987e-8Initial program 99.4%
Taylor expanded in x1 around 0 98.3%
if 1.49999999999999987e-8 < x1 < 5.00000000000000018e153Initial program 99.2%
Taylor expanded in x1 around inf 95.8%
Taylor expanded in x1 around -inf 99.1%
if 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 90.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- 3.0 (* 2.0 x2)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x1 (+ -1.0 (* x1 9.0))))
(t_3 (* x1 (* x1 3.0)))
(t_4 (- (+ t_3 (* 2.0 x2)) x1))
(t_5 (/ t_4 t_1)))
(if (<= x1 -68.0)
(*
x1
(-
(- -1.0 (* -2.0 (- 1.0 (* 3.0 t_0))))
(* x1 (- (+ (* 4.0 t_0) (* x1 (- 3.0 (* x1 6.0)))) 9.0))))
(if (<= x1 1.5e-8)
(+ (* x2 -6.0) (+ t_2 (* x2 (+ (* x1 -12.0) (* 8.0 (* x1 x2))))))
(if (<= x1 5e+153)
(+
x1
(+
9.0
(+
x1
(+
(* x1 (* x1 x1))
(-
(* t_3 (- 3.0 (/ (+ 1.0 (/ t_0 x1)) x1)))
(*
t_1
(-
(* (* (* x1 2.0) t_5) (+ 3.0 (/ t_4 (- -1.0 (* x1 x1)))))
(* (* x1 x1) (- (* t_5 4.0) 6.0)))))))))
(+ (* x2 -6.0) t_2))))))
double code(double x1, double x2) {
double t_0 = 3.0 - (2.0 * x2);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (-1.0 + (x1 * 9.0));
double t_3 = x1 * (x1 * 3.0);
double t_4 = (t_3 + (2.0 * x2)) - x1;
double t_5 = t_4 / t_1;
double tmp;
if (x1 <= -68.0) {
tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0)));
} else if (x1 <= 1.5e-8) {
tmp = (x2 * -6.0) + (t_2 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))));
} else if (x1 <= 5e+153) {
tmp = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_3 * (3.0 - ((1.0 + (t_0 / x1)) / x1))) - (t_1 * ((((x1 * 2.0) * t_5) * (3.0 + (t_4 / (-1.0 - (x1 * x1))))) - ((x1 * x1) * ((t_5 * 4.0) - 6.0))))))));
} else {
tmp = (x2 * -6.0) + t_2;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = 3.0d0 - (2.0d0 * x2)
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 * ((-1.0d0) + (x1 * 9.0d0))
t_3 = x1 * (x1 * 3.0d0)
t_4 = (t_3 + (2.0d0 * x2)) - x1
t_5 = t_4 / t_1
if (x1 <= (-68.0d0)) then
tmp = x1 * (((-1.0d0) - ((-2.0d0) * (1.0d0 - (3.0d0 * t_0)))) - (x1 * (((4.0d0 * t_0) + (x1 * (3.0d0 - (x1 * 6.0d0)))) - 9.0d0)))
else if (x1 <= 1.5d-8) then
tmp = (x2 * (-6.0d0)) + (t_2 + (x2 * ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2)))))
else if (x1 <= 5d+153) then
tmp = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) + ((t_3 * (3.0d0 - ((1.0d0 + (t_0 / x1)) / x1))) - (t_1 * ((((x1 * 2.0d0) * t_5) * (3.0d0 + (t_4 / ((-1.0d0) - (x1 * x1))))) - ((x1 * x1) * ((t_5 * 4.0d0) - 6.0d0))))))))
else
tmp = (x2 * (-6.0d0)) + t_2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 3.0 - (2.0 * x2);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (-1.0 + (x1 * 9.0));
double t_3 = x1 * (x1 * 3.0);
double t_4 = (t_3 + (2.0 * x2)) - x1;
double t_5 = t_4 / t_1;
double tmp;
if (x1 <= -68.0) {
tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0)));
} else if (x1 <= 1.5e-8) {
tmp = (x2 * -6.0) + (t_2 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))));
} else if (x1 <= 5e+153) {
tmp = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_3 * (3.0 - ((1.0 + (t_0 / x1)) / x1))) - (t_1 * ((((x1 * 2.0) * t_5) * (3.0 + (t_4 / (-1.0 - (x1 * x1))))) - ((x1 * x1) * ((t_5 * 4.0) - 6.0))))))));
} else {
tmp = (x2 * -6.0) + t_2;
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 - (2.0 * x2) t_1 = (x1 * x1) + 1.0 t_2 = x1 * (-1.0 + (x1 * 9.0)) t_3 = x1 * (x1 * 3.0) t_4 = (t_3 + (2.0 * x2)) - x1 t_5 = t_4 / t_1 tmp = 0 if x1 <= -68.0: tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0))) elif x1 <= 1.5e-8: tmp = (x2 * -6.0) + (t_2 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))) elif x1 <= 5e+153: tmp = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_3 * (3.0 - ((1.0 + (t_0 / x1)) / x1))) - (t_1 * ((((x1 * 2.0) * t_5) * (3.0 + (t_4 / (-1.0 - (x1 * x1))))) - ((x1 * x1) * ((t_5 * 4.0) - 6.0)))))))) else: tmp = (x2 * -6.0) + t_2 return tmp
function code(x1, x2) t_0 = Float64(3.0 - Float64(2.0 * x2)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0))) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) t_5 = Float64(t_4 / t_1) tmp = 0.0 if (x1 <= -68.0) tmp = Float64(x1 * Float64(Float64(-1.0 - Float64(-2.0 * Float64(1.0 - Float64(3.0 * t_0)))) - Float64(x1 * Float64(Float64(Float64(4.0 * t_0) + Float64(x1 * Float64(3.0 - Float64(x1 * 6.0)))) - 9.0)))); elseif (x1 <= 1.5e-8) tmp = Float64(Float64(x2 * -6.0) + Float64(t_2 + Float64(x2 * Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2)))))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_3 * Float64(3.0 - Float64(Float64(1.0 + Float64(t_0 / x1)) / x1))) - Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_5) * Float64(3.0 + Float64(t_4 / Float64(-1.0 - Float64(x1 * x1))))) - Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0))))))))); else tmp = Float64(Float64(x2 * -6.0) + t_2); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 - (2.0 * x2); t_1 = (x1 * x1) + 1.0; t_2 = x1 * (-1.0 + (x1 * 9.0)); t_3 = x1 * (x1 * 3.0); t_4 = (t_3 + (2.0 * x2)) - x1; t_5 = t_4 / t_1; tmp = 0.0; if (x1 <= -68.0) tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0))); elseif (x1 <= 1.5e-8) tmp = (x2 * -6.0) + (t_2 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))); elseif (x1 <= 5e+153) tmp = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_3 * (3.0 - ((1.0 + (t_0 / x1)) / x1))) - (t_1 * ((((x1 * 2.0) * t_5) * (3.0 + (t_4 / (-1.0 - (x1 * x1))))) - ((x1 * x1) * ((t_5 * 4.0) - 6.0)))))))); else tmp = (x2 * -6.0) + t_2; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -68.0], N[(x1 * N[(N[(-1.0 - N[(-2.0 * N[(1.0 - N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(N[(N[(4.0 * t$95$0), $MachinePrecision] + N[(x1 * N[(3.0 - N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.5e-8], N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$2 + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(9.0 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 * N[(3.0 - N[(N[(1.0 + N[(t$95$0 / x1), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision] * N[(3.0 + N[(t$95$4 / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + t$95$2), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 - 2 \cdot x2\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot \left(-1 + x1 \cdot 9\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := \left(t\_3 + 2 \cdot x2\right) - x1\\
t_5 := \frac{t\_4}{t\_1}\\
\mathbf{if}\;x1 \leq -68:\\
\;\;\;\;x1 \cdot \left(\left(-1 - -2 \cdot \left(1 - 3 \cdot t\_0\right)\right) - x1 \cdot \left(\left(4 \cdot t\_0 + x1 \cdot \left(3 - x1 \cdot 6\right)\right) - 9\right)\right)\\
\mathbf{elif}\;x1 \leq 1.5 \cdot 10^{-8}:\\
\;\;\;\;x2 \cdot -6 + \left(t\_2 + x2 \cdot \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_3 \cdot \left(3 - \frac{1 + \frac{t\_0}{x1}}{x1}\right) - t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_5\right) \cdot \left(3 + \frac{t\_4}{-1 - x1 \cdot x1}\right) - \left(x1 \cdot x1\right) \cdot \left(t\_5 \cdot 4 - 6\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + t\_2\\
\end{array}
\end{array}
if x1 < -68Initial program 37.9%
Simplified37.9%
Taylor expanded in x1 around -inf 95.4%
Taylor expanded in x1 around 0 95.3%
if -68 < x1 < 1.49999999999999987e-8Initial program 99.4%
Simplified99.8%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x2 around 0 86.1%
Taylor expanded in x2 around 0 99.8%
if 1.49999999999999987e-8 < x1 < 5.00000000000000018e153Initial program 99.2%
Taylor expanded in x1 around inf 95.8%
Taylor expanded in x1 around -inf 99.1%
if 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 90.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- 3.0 (* 2.0 x2)))
(t_1 (* x1 (+ -1.0 (* x1 9.0))))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))))
(if (<= x1 -1650.0)
(*
x1
(-
(- -1.0 (* -2.0 (- 1.0 (* 3.0 t_0))))
(* x1 (- (+ (* 4.0 t_0) (* x1 (- 3.0 (* x1 6.0)))) 9.0))))
(if (<= x1 1.95)
(+ (* x2 -6.0) (+ t_1 (* x2 (+ (* x1 -12.0) (* 8.0 (* x1 x2))))))
(if (<= x1 5e+153)
(+
x1
(+
9.0
(+
x1
(+
(* x1 (* x1 x1))
(-
(* t_2 t_3)
(*
(+
(* (* x1 x1) (- (* t_3 4.0) 6.0))
(*
(* (* x1 2.0) t_3)
(/ (+ (* 2.0 (/ x2 x1)) (- -1.0 (/ 3.0 x1))) x1)))
(- -1.0 (* x1 x1))))))))
(+ (* x2 -6.0) t_1))))))
double code(double x1, double x2) {
double t_0 = 3.0 - (2.0 * x2);
double t_1 = x1 * (-1.0 + (x1 * 9.0));
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0);
double tmp;
if (x1 <= -1650.0) {
tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0)));
} else if (x1 <= 1.95) {
tmp = (x2 * -6.0) + (t_1 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))));
} else if (x1 <= 5e+153) {
tmp = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) - ((((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (((x1 * 2.0) * t_3) * (((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1))) * (-1.0 - (x1 * x1)))))));
} else {
tmp = (x2 * -6.0) + t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = 3.0d0 - (2.0d0 * x2)
t_1 = x1 * ((-1.0d0) + (x1 * 9.0d0))
t_2 = x1 * (x1 * 3.0d0)
t_3 = ((t_2 + (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0)
if (x1 <= (-1650.0d0)) then
tmp = x1 * (((-1.0d0) - ((-2.0d0) * (1.0d0 - (3.0d0 * t_0)))) - (x1 * (((4.0d0 * t_0) + (x1 * (3.0d0 - (x1 * 6.0d0)))) - 9.0d0)))
else if (x1 <= 1.95d0) then
tmp = (x2 * (-6.0d0)) + (t_1 + (x2 * ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2)))))
else if (x1 <= 5d+153) then
tmp = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) - ((((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * t_3) * (((2.0d0 * (x2 / x1)) + ((-1.0d0) - (3.0d0 / x1))) / x1))) * ((-1.0d0) - (x1 * x1)))))))
else
tmp = (x2 * (-6.0d0)) + t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 3.0 - (2.0 * x2);
double t_1 = x1 * (-1.0 + (x1 * 9.0));
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0);
double tmp;
if (x1 <= -1650.0) {
tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0)));
} else if (x1 <= 1.95) {
tmp = (x2 * -6.0) + (t_1 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))));
} else if (x1 <= 5e+153) {
tmp = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) - ((((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (((x1 * 2.0) * t_3) * (((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1))) * (-1.0 - (x1 * x1)))))));
} else {
tmp = (x2 * -6.0) + t_1;
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 - (2.0 * x2) t_1 = x1 * (-1.0 + (x1 * 9.0)) t_2 = x1 * (x1 * 3.0) t_3 = ((t_2 + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0) tmp = 0 if x1 <= -1650.0: tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0))) elif x1 <= 1.95: tmp = (x2 * -6.0) + (t_1 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))) elif x1 <= 5e+153: tmp = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) - ((((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (((x1 * 2.0) * t_3) * (((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1))) * (-1.0 - (x1 * x1))))))) else: tmp = (x2 * -6.0) + t_1 return tmp
function code(x1, x2) t_0 = Float64(3.0 - Float64(2.0 * x2)) t_1 = Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0))) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0)) tmp = 0.0 if (x1 <= -1650.0) tmp = Float64(x1 * Float64(Float64(-1.0 - Float64(-2.0 * Float64(1.0 - Float64(3.0 * t_0)))) - Float64(x1 * Float64(Float64(Float64(4.0 * t_0) + Float64(x1 * Float64(3.0 - Float64(x1 * 6.0)))) - 9.0)))); elseif (x1 <= 1.95) tmp = Float64(Float64(x2 * -6.0) + Float64(t_1 + Float64(x2 * Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2)))))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * t_3) - Float64(Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(Float64(Float64(2.0 * Float64(x2 / x1)) + Float64(-1.0 - Float64(3.0 / x1))) / x1))) * Float64(-1.0 - Float64(x1 * x1)))))))); else tmp = Float64(Float64(x2 * -6.0) + t_1); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 - (2.0 * x2); t_1 = x1 * (-1.0 + (x1 * 9.0)); t_2 = x1 * (x1 * 3.0); t_3 = ((t_2 + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0); tmp = 0.0; if (x1 <= -1650.0) tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0))); elseif (x1 <= 1.95) tmp = (x2 * -6.0) + (t_1 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))); elseif (x1 <= 5e+153) tmp = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) - ((((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (((x1 * 2.0) * t_3) * (((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1))) * (-1.0 - (x1 * x1))))))); else tmp = (x2 * -6.0) + t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1650.0], N[(x1 * N[(N[(-1.0 - N[(-2.0 * N[(1.0 - N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(N[(N[(4.0 * t$95$0), $MachinePrecision] + N[(x1 * N[(3.0 - N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.95], N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$1 + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(9.0 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * t$95$3), $MachinePrecision] - N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(N[(N[(2.0 * N[(x2 / x1), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - N[(3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 - 2 \cdot x2\\
t_1 := x1 \cdot \left(-1 + x1 \cdot 9\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\\
\mathbf{if}\;x1 \leq -1650:\\
\;\;\;\;x1 \cdot \left(\left(-1 - -2 \cdot \left(1 - 3 \cdot t\_0\right)\right) - x1 \cdot \left(\left(4 \cdot t\_0 + x1 \cdot \left(3 - x1 \cdot 6\right)\right) - 9\right)\right)\\
\mathbf{elif}\;x1 \leq 1.95:\\
\;\;\;\;x2 \cdot -6 + \left(t\_1 + x2 \cdot \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_2 \cdot t\_3 - \left(\left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \frac{2 \cdot \frac{x2}{x1} + \left(-1 - \frac{3}{x1}\right)}{x1}\right) \cdot \left(-1 - x1 \cdot x1\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + t\_1\\
\end{array}
\end{array}
if x1 < -1650Initial program 37.9%
Simplified37.9%
Taylor expanded in x1 around -inf 95.4%
Taylor expanded in x1 around 0 95.3%
if -1650 < x1 < 1.94999999999999996Initial program 99.4%
Simplified99.7%
Taylor expanded in x1 around 0 85.7%
Taylor expanded in x2 around 0 85.7%
Taylor expanded in x2 around 0 99.1%
if 1.94999999999999996 < x1 < 5.00000000000000018e153Initial program 99.6%
Taylor expanded in x1 around inf 99.2%
Taylor expanded in x1 around inf 98.5%
associate-*r/98.5%
metadata-eval98.5%
Simplified98.5%
if 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 90.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- 3.0 (* 2.0 x2))))
(if (or (<= x1 -185.0) (not (<= x1 0.29)))
(*
x1
(-
(- -1.0 (* -2.0 (- 1.0 (* 3.0 t_0))))
(* x1 (- (+ (* 4.0 t_0) (* x1 (- 3.0 (* x1 6.0)))) 9.0))))
(+
(* x2 -6.0)
(+
(* x1 (+ -1.0 (* x1 9.0)))
(* x2 (+ (* x1 -12.0) (* 8.0 (* x1 x2)))))))))
double code(double x1, double x2) {
double t_0 = 3.0 - (2.0 * x2);
double tmp;
if ((x1 <= -185.0) || !(x1 <= 0.29)) {
tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0)));
} else {
tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = 3.0d0 - (2.0d0 * x2)
if ((x1 <= (-185.0d0)) .or. (.not. (x1 <= 0.29d0))) then
tmp = x1 * (((-1.0d0) - ((-2.0d0) * (1.0d0 - (3.0d0 * t_0)))) - (x1 * (((4.0d0 * t_0) + (x1 * (3.0d0 - (x1 * 6.0d0)))) - 9.0d0)))
else
tmp = (x2 * (-6.0d0)) + ((x1 * ((-1.0d0) + (x1 * 9.0d0))) + (x2 * ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 3.0 - (2.0 * x2);
double tmp;
if ((x1 <= -185.0) || !(x1 <= 0.29)) {
tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0)));
} else {
tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 - (2.0 * x2) tmp = 0 if (x1 <= -185.0) or not (x1 <= 0.29): tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0))) else: tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))) return tmp
function code(x1, x2) t_0 = Float64(3.0 - Float64(2.0 * x2)) tmp = 0.0 if ((x1 <= -185.0) || !(x1 <= 0.29)) tmp = Float64(x1 * Float64(Float64(-1.0 - Float64(-2.0 * Float64(1.0 - Float64(3.0 * t_0)))) - Float64(x1 * Float64(Float64(Float64(4.0 * t_0) + Float64(x1 * Float64(3.0 - Float64(x1 * 6.0)))) - 9.0)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0))) + Float64(x2 * Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 - (2.0 * x2); tmp = 0.0; if ((x1 <= -185.0) || ~((x1 <= 0.29))) tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) + (x1 * (3.0 - (x1 * 6.0)))) - 9.0))); else tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x1, -185.0], N[Not[LessEqual[x1, 0.29]], $MachinePrecision]], N[(x1 * N[(N[(-1.0 - N[(-2.0 * N[(1.0 - N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(N[(N[(4.0 * t$95$0), $MachinePrecision] + N[(x1 * N[(3.0 - N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 - 2 \cdot x2\\
\mathbf{if}\;x1 \leq -185 \lor \neg \left(x1 \leq 0.29\right):\\
\;\;\;\;x1 \cdot \left(\left(-1 - -2 \cdot \left(1 - 3 \cdot t\_0\right)\right) - x1 \cdot \left(\left(4 \cdot t\_0 + x1 \cdot \left(3 - x1 \cdot 6\right)\right) - 9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + \left(x1 \cdot \left(-1 + x1 \cdot 9\right) + x2 \cdot \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -185 or 0.28999999999999998 < x1 Initial program 41.3%
Simplified41.3%
Taylor expanded in x1 around -inf 91.8%
Taylor expanded in x1 around 0 91.7%
if -185 < x1 < 0.28999999999999998Initial program 99.4%
Simplified99.8%
Taylor expanded in x1 around 0 86.3%
Taylor expanded in x2 around 0 86.3%
Taylor expanded in x2 around 0 99.8%
Final simplification95.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ -1.0 (* x1 9.0)))))
(if (<= x1 -7.8e+155)
(+ (* x2 -6.0) t_0)
(if (<= x1 -1.06e+51)
(+
(* x2 -6.0)
(*
x1
(+
-1.0
(+
(* 4.0 (* x2 (- (* 2.0 x2) 3.0)))
(* x2 (+ (* 9.0 (/ x1 x2)) (* x1 12.0)))))))
(+ (* x2 -6.0) (+ t_0 (* x2 (+ (* x1 -12.0) (* 8.0 (* x1 x2))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (-1.0 + (x1 * 9.0));
double tmp;
if (x1 <= -7.8e+155) {
tmp = (x2 * -6.0) + t_0;
} else if (x1 <= -1.06e+51) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x2 * ((9.0 * (x1 / x2)) + (x1 * 12.0))))));
} else {
tmp = (x2 * -6.0) + (t_0 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 * ((-1.0d0) + (x1 * 9.0d0))
if (x1 <= (-7.8d+155)) then
tmp = (x2 * (-6.0d0)) + t_0
else if (x1 <= (-1.06d+51)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (x2 * ((9.0d0 * (x1 / x2)) + (x1 * 12.0d0))))))
else
tmp = (x2 * (-6.0d0)) + (t_0 + (x2 * ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (-1.0 + (x1 * 9.0));
double tmp;
if (x1 <= -7.8e+155) {
tmp = (x2 * -6.0) + t_0;
} else if (x1 <= -1.06e+51) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x2 * ((9.0 * (x1 / x2)) + (x1 * 12.0))))));
} else {
tmp = (x2 * -6.0) + (t_0 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (-1.0 + (x1 * 9.0)) tmp = 0 if x1 <= -7.8e+155: tmp = (x2 * -6.0) + t_0 elif x1 <= -1.06e+51: tmp = (x2 * -6.0) + (x1 * (-1.0 + ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x2 * ((9.0 * (x1 / x2)) + (x1 * 12.0)))))) else: tmp = (x2 * -6.0) + (t_0 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0))) tmp = 0.0 if (x1 <= -7.8e+155) tmp = Float64(Float64(x2 * -6.0) + t_0); elseif (x1 <= -1.06e+51) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + Float64(x2 * Float64(Float64(9.0 * Float64(x1 / x2)) + Float64(x1 * 12.0))))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(t_0 + Float64(x2 * Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (-1.0 + (x1 * 9.0)); tmp = 0.0; if (x1 <= -7.8e+155) tmp = (x2 * -6.0) + t_0; elseif (x1 <= -1.06e+51) tmp = (x2 * -6.0) + (x1 * (-1.0 + ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x2 * ((9.0 * (x1 / x2)) + (x1 * 12.0)))))); else tmp = (x2 * -6.0) + (t_0 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -7.8e+155], N[(N[(x2 * -6.0), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[x1, -1.06e+51], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(9.0 * N[(x1 / x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$0 + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\mathbf{if}\;x1 \leq -7.8 \cdot 10^{+155}:\\
\;\;\;\;x2 \cdot -6 + t\_0\\
\mathbf{elif}\;x1 \leq -1.06 \cdot 10^{+51}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x2 \cdot \left(9 \cdot \frac{x1}{x2} + x1 \cdot 12\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + \left(t\_0 + x2 \cdot \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -7.7999999999999996e155Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 70.0%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -7.7999999999999996e155 < x1 < -1.06000000000000004e51Initial program 58.3%
Simplified58.3%
Taylor expanded in x1 around 0 24.6%
Taylor expanded in x2 around 0 24.6%
*-commutative24.6%
Simplified24.6%
Taylor expanded in x2 around inf 40.9%
if -1.06000000000000004e51 < x1 Initial program 83.7%
Simplified84.0%
Taylor expanded in x1 around 0 75.5%
Taylor expanded in x2 around 0 79.7%
Taylor expanded in x2 around 0 88.7%
Final simplification84.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- 3.0 (* 2.0 x2))))
(if (<= x1 -8.6e+49)
(*
x1
(-
(- -1.0 (* -2.0 (- 1.0 (* 3.0 t_0))))
(* x1 (- (- (* 4.0 t_0) (* x1 -3.0)) 9.0))))
(+
(* x2 -6.0)
(+
(* x1 (+ -1.0 (* x1 9.0)))
(* x2 (+ (* x1 -12.0) (* 8.0 (* x1 x2)))))))))
double code(double x1, double x2) {
double t_0 = 3.0 - (2.0 * x2);
double tmp;
if (x1 <= -8.6e+49) {
tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) - (x1 * -3.0)) - 9.0)));
} else {
tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = 3.0d0 - (2.0d0 * x2)
if (x1 <= (-8.6d+49)) then
tmp = x1 * (((-1.0d0) - ((-2.0d0) * (1.0d0 - (3.0d0 * t_0)))) - (x1 * (((4.0d0 * t_0) - (x1 * (-3.0d0))) - 9.0d0)))
else
tmp = (x2 * (-6.0d0)) + ((x1 * ((-1.0d0) + (x1 * 9.0d0))) + (x2 * ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 3.0 - (2.0 * x2);
double tmp;
if (x1 <= -8.6e+49) {
tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) - (x1 * -3.0)) - 9.0)));
} else {
tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 - (2.0 * x2) tmp = 0 if x1 <= -8.6e+49: tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) - (x1 * -3.0)) - 9.0))) else: tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))) return tmp
function code(x1, x2) t_0 = Float64(3.0 - Float64(2.0 * x2)) tmp = 0.0 if (x1 <= -8.6e+49) tmp = Float64(x1 * Float64(Float64(-1.0 - Float64(-2.0 * Float64(1.0 - Float64(3.0 * t_0)))) - Float64(x1 * Float64(Float64(Float64(4.0 * t_0) - Float64(x1 * -3.0)) - 9.0)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0))) + Float64(x2 * Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 - (2.0 * x2); tmp = 0.0; if (x1 <= -8.6e+49) tmp = x1 * ((-1.0 - (-2.0 * (1.0 - (3.0 * t_0)))) - (x1 * (((4.0 * t_0) - (x1 * -3.0)) - 9.0))); else tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -8.6e+49], N[(x1 * N[(N[(-1.0 - N[(-2.0 * N[(1.0 - N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(N[(N[(4.0 * t$95$0), $MachinePrecision] - N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision] - 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 - 2 \cdot x2\\
\mathbf{if}\;x1 \leq -8.6 \cdot 10^{+49}:\\
\;\;\;\;x1 \cdot \left(\left(-1 - -2 \cdot \left(1 - 3 \cdot t\_0\right)\right) - x1 \cdot \left(\left(4 \cdot t\_0 - x1 \cdot -3\right) - 9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + \left(x1 \cdot \left(-1 + x1 \cdot 9\right) + x2 \cdot \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -8.5999999999999998e49Initial program 28.6%
Simplified28.6%
Taylor expanded in x1 around -inf 99.9%
Taylor expanded in x1 around 0 79.6%
if -8.5999999999999998e49 < x1 Initial program 83.7%
Simplified84.0%
Taylor expanded in x1 around 0 75.5%
Taylor expanded in x2 around 0 79.7%
Taylor expanded in x2 around 0 88.7%
Final simplification86.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ -1.0 (* x1 9.0)))))
(if (<= x1 -9.5e+117)
(+ (* x2 -6.0) t_0)
(+ (* x2 -6.0) (+ t_0 (* x2 (+ (* x1 -12.0) (* 8.0 (* x1 x2)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (-1.0 + (x1 * 9.0));
double tmp;
if (x1 <= -9.5e+117) {
tmp = (x2 * -6.0) + t_0;
} else {
tmp = (x2 * -6.0) + (t_0 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 * ((-1.0d0) + (x1 * 9.0d0))
if (x1 <= (-9.5d+117)) then
tmp = (x2 * (-6.0d0)) + t_0
else
tmp = (x2 * (-6.0d0)) + (t_0 + (x2 * ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (-1.0 + (x1 * 9.0));
double tmp;
if (x1 <= -9.5e+117) {
tmp = (x2 * -6.0) + t_0;
} else {
tmp = (x2 * -6.0) + (t_0 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (-1.0 + (x1 * 9.0)) tmp = 0 if x1 <= -9.5e+117: tmp = (x2 * -6.0) + t_0 else: tmp = (x2 * -6.0) + (t_0 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0))) tmp = 0.0 if (x1 <= -9.5e+117) tmp = Float64(Float64(x2 * -6.0) + t_0); else tmp = Float64(Float64(x2 * -6.0) + Float64(t_0 + Float64(x2 * Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (-1.0 + (x1 * 9.0)); tmp = 0.0; if (x1 <= -9.5e+117) tmp = (x2 * -6.0) + t_0; else tmp = (x2 * -6.0) + (t_0 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -9.5e+117], N[(N[(x2 * -6.0), $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$0 + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{+117}:\\
\;\;\;\;x2 \cdot -6 + t\_0\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + \left(t\_0 + x2 \cdot \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -9.50000000000000041e117Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 65.4%
Taylor expanded in x2 around 0 85.0%
*-commutative85.0%
Simplified85.0%
if -9.50000000000000041e117 < x1 Initial program 83.0%
Simplified83.2%
Taylor expanded in x1 around 0 69.7%
Taylor expanded in x2 around 0 73.4%
Taylor expanded in x2 around 0 81.5%
Final simplification82.1%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -1.95e+116) (not (<= x1 3.5e+152))) (+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))) (+ (* x2 -6.0) (* x1 (+ -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.95e+116) || !(x1 <= 3.5e+152)) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-1.95d+116)) .or. (.not. (x1 <= 3.5d+152))) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.95e+116) || !(x1 <= 3.5e+152)) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -1.95e+116) or not (x1 <= 3.5e+152): tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -1.95e+116) || !(x1 <= 3.5e+152)) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -1.95e+116) || ~((x1 <= 3.5e+152))) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -1.95e+116], N[Not[LessEqual[x1, 3.5e+152]], $MachinePrecision]], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.95 \cdot 10^{+116} \lor \neg \left(x1 \leq 3.5 \cdot 10^{+152}\right):\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.95000000000000016e116 or 3.49999999999999981e152 < x1 Initial program 1.4%
Simplified1.4%
Taylor expanded in x1 around 0 75.9%
Taylor expanded in x2 around 0 90.7%
*-commutative90.7%
Simplified90.7%
if -1.95000000000000016e116 < x1 < 3.49999999999999981e152Initial program 96.7%
Simplified97.0%
Taylor expanded in x1 around 0 68.8%
Final simplification74.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ -1.0 (* x1 9.0)))))
(if (<= x1 -1.85e+121)
(+ (* x2 -6.0) t_0)
(+ t_0 (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0))))))
double code(double x1, double x2) {
double t_0 = x1 * (-1.0 + (x1 * 9.0));
double tmp;
if (x1 <= -1.85e+121) {
tmp = (x2 * -6.0) + t_0;
} else {
tmp = t_0 + (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 * ((-1.0d0) + (x1 * 9.0d0))
if (x1 <= (-1.85d+121)) then
tmp = (x2 * (-6.0d0)) + t_0
else
tmp = t_0 + (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (-1.0 + (x1 * 9.0));
double tmp;
if (x1 <= -1.85e+121) {
tmp = (x2 * -6.0) + t_0;
} else {
tmp = t_0 + (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (-1.0 + (x1 * 9.0)) tmp = 0 if x1 <= -1.85e+121: tmp = (x2 * -6.0) + t_0 else: tmp = t_0 + (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0))) tmp = 0.0 if (x1 <= -1.85e+121) tmp = Float64(Float64(x2 * -6.0) + t_0); else tmp = Float64(t_0 + Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (-1.0 + (x1 * 9.0)); tmp = 0.0; if (x1 <= -1.85e+121) tmp = (x2 * -6.0) + t_0; else tmp = t_0 + (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.85e+121], N[(N[(x2 * -6.0), $MachinePrecision] + t$95$0), $MachinePrecision], N[(t$95$0 + N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\mathbf{if}\;x1 \leq -1.85 \cdot 10^{+121}:\\
\;\;\;\;x2 \cdot -6 + t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 + x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right)\\
\end{array}
\end{array}
if x1 < -1.85000000000000006e121Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 65.4%
Taylor expanded in x2 around 0 85.0%
*-commutative85.0%
Simplified85.0%
if -1.85000000000000006e121 < x1 Initial program 83.0%
Simplified83.2%
Taylor expanded in x1 around 0 69.7%
Taylor expanded in x2 around 0 73.4%
Taylor expanded in x2 around 0 81.5%
Final simplification82.0%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.35e-12)
(* x2 (+ (* x1 12.0) (* (/ x1 x2) -17.0)))
(if (or (<= x1 -1.8e-138) (not (<= x1 6e-127)))
(* x1 (- -1.0 (* -2.0 (* x2 6.0))))
(* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.35e-12) {
tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0));
} else if ((x1 <= -1.8e-138) || !(x1 <= 6e-127)) {
tmp = x1 * (-1.0 - (-2.0 * (x2 * 6.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 <= (-1.35d-12)) then
tmp = x2 * ((x1 * 12.0d0) + ((x1 / x2) * (-17.0d0)))
else if ((x1 <= (-1.8d-138)) .or. (.not. (x1 <= 6d-127))) then
tmp = x1 * ((-1.0d0) - ((-2.0d0) * (x2 * 6.0d0)))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.35e-12) {
tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0));
} else if ((x1 <= -1.8e-138) || !(x1 <= 6e-127)) {
tmp = x1 * (-1.0 - (-2.0 * (x2 * 6.0)));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.35e-12: tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0)) elif (x1 <= -1.8e-138) or not (x1 <= 6e-127): tmp = x1 * (-1.0 - (-2.0 * (x2 * 6.0))) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.35e-12) tmp = Float64(x2 * Float64(Float64(x1 * 12.0) + Float64(Float64(x1 / x2) * -17.0))); elseif ((x1 <= -1.8e-138) || !(x1 <= 6e-127)) tmp = Float64(x1 * Float64(-1.0 - Float64(-2.0 * Float64(x2 * 6.0)))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.35e-12) tmp = x2 * ((x1 * 12.0) + ((x1 / x2) * -17.0)); elseif ((x1 <= -1.8e-138) || ~((x1 <= 6e-127))) tmp = x1 * (-1.0 - (-2.0 * (x2 * 6.0))); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.35e-12], N[(x2 * N[(N[(x1 * 12.0), $MachinePrecision] + N[(N[(x1 / x2), $MachinePrecision] * -17.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -1.8e-138], N[Not[LessEqual[x1, 6e-127]], $MachinePrecision]], N[(x1 * N[(-1.0 - N[(-2.0 * N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.35 \cdot 10^{-12}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot 12 + \frac{x1}{x2} \cdot -17\right)\\
\mathbf{elif}\;x1 \leq -1.8 \cdot 10^{-138} \lor \neg \left(x1 \leq 6 \cdot 10^{-127}\right):\\
\;\;\;\;x1 \cdot \left(-1 - -2 \cdot \left(x2 \cdot 6\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -1.3499999999999999e-12Initial program 39.7%
Simplified39.7%
Taylor expanded in x1 around -inf 92.9%
Taylor expanded in x1 around 0 12.6%
Taylor expanded in x2 around inf 35.5%
if -1.3499999999999999e-12 < x1 < -1.80000000000000009e-138 or 6.00000000000000017e-127 < x1 Initial program 71.7%
Simplified72.0%
Taylor expanded in x1 around -inf 47.6%
Taylor expanded in x1 around 0 15.0%
Taylor expanded in x2 around inf 34.3%
*-commutative34.3%
Simplified34.3%
if -1.80000000000000009e-138 < x1 < 6.00000000000000017e-127Initial program 99.7%
Simplified99.8%
Taylor expanded in x1 around 0 69.9%
*-commutative69.9%
Simplified69.9%
Final simplification44.9%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -8.2e+114) (+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))) (+ (* x2 -6.0) (* x1 (- -1.0 (- (* x2 (- 12.0 (* x2 8.0))) (* x1 9.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -8.2e+114) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 - ((x2 * (12.0 - (x2 * 8.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 <= (-8.2d+114)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) - ((x2 * (12.0d0 - (x2 * 8.0d0))) - (x1 * 9.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -8.2e+114) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 - ((x2 * (12.0 - (x2 * 8.0))) - (x1 * 9.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -8.2e+114: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 - ((x2 * (12.0 - (x2 * 8.0))) - (x1 * 9.0)))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -8.2e+114) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 - Float64(Float64(x2 * Float64(12.0 - Float64(x2 * 8.0))) - Float64(x1 * 9.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -8.2e+114) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); else tmp = (x2 * -6.0) + (x1 * (-1.0 - ((x2 * (12.0 - (x2 * 8.0))) - (x1 * 9.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -8.2e+114], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 - N[(N[(x2 * N[(12.0 - N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -8.2 \cdot 10^{+114}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 - \left(x2 \cdot \left(12 - x2 \cdot 8\right) - x1 \cdot 9\right)\right)\\
\end{array}
\end{array}
if x1 < -8.2000000000000001e114Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 65.4%
Taylor expanded in x2 around 0 85.0%
*-commutative85.0%
Simplified85.0%
if -8.2000000000000001e114 < x1 Initial program 83.0%
Simplified83.2%
Taylor expanded in x1 around 0 69.7%
Taylor expanded in x2 around 0 73.4%
Taylor expanded in x2 around 0 73.4%
Final simplification75.1%
(FPCore (x1 x2) :precision binary64 (if (<= (* 2.0 x2) 5e-82) (+ (* x1 (+ -1.0 (* x1 9.0))) (* x2 (- (* x1 -12.0) 6.0))) (+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x2 12.0))))))))
double code(double x1, double x2) {
double tmp;
if ((2.0 * x2) <= 5e-82) {
tmp = (x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((x1 * -12.0) - 6.0));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x2 * 12.0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((2.0d0 * x2) <= 5d-82) then
tmp = (x1 * ((-1.0d0) + (x1 * 9.0d0))) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x2 * 12.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((2.0 * x2) <= 5e-82) {
tmp = (x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((x1 * -12.0) - 6.0));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x2 * 12.0)))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (2.0 * x2) <= 5e-82: tmp = (x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((x1 * -12.0) - 6.0)) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x2 * 12.0))))) return tmp
function code(x1, x2) tmp = 0.0 if (Float64(2.0 * x2) <= 5e-82) tmp = Float64(Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0))) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x2 * 12.0)))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((2.0 * x2) <= 5e-82) tmp = (x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((x1 * -12.0) - 6.0)); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x2 * 12.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[N[(2.0 * x2), $MachinePrecision], 5e-82], N[(N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x2 * 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot x2 \leq 5 \cdot 10^{-82}:\\
\;\;\;\;x1 \cdot \left(-1 + x1 \cdot 9\right) + x2 \cdot \left(x1 \cdot -12 - 6\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x2 \cdot 12\right)\right)\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) x2) < 4.9999999999999998e-82Initial program 73.3%
Simplified73.6%
Taylor expanded in x1 around 0 68.0%
Taylor expanded in x2 around 0 73.8%
Taylor expanded in x2 around 0 65.8%
if 4.9999999999999998e-82 < (*.f64 #s(literal 2 binary64) x2) Initial program 66.0%
Simplified66.1%
Taylor expanded in x1 around 0 71.6%
Taylor expanded in x2 around 0 71.6%
*-commutative71.6%
Simplified71.6%
Taylor expanded in x1 around inf 65.4%
*-commutative65.4%
Simplified65.4%
Final simplification65.7%
(FPCore (x1 x2) :precision binary64 (if (<= x2 5.2e+34) (+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))) (+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x2 12.0))))))))
double code(double x1, double x2) {
double tmp;
if (x2 <= 5.2e+34) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x2 * 12.0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x2 <= 5.2d+34) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x2 * 12.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= 5.2e+34) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x2 * 12.0)))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= 5.2e+34: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x2 * 12.0))))) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= 5.2e+34) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x2 * 12.0)))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= 5.2e+34) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x2 * 12.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, 5.2e+34], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x2 * 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq 5.2 \cdot 10^{+34}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x2 \cdot 12\right)\right)\\
\end{array}
\end{array}
if x2 < 5.19999999999999995e34Initial program 72.5%
Simplified72.7%
Taylor expanded in x1 around 0 68.6%
Taylor expanded in x2 around 0 64.8%
*-commutative64.8%
Simplified64.8%
if 5.19999999999999995e34 < x2 Initial program 66.0%
Simplified66.0%
Taylor expanded in x1 around 0 71.0%
Taylor expanded in x2 around 0 71.0%
*-commutative71.0%
Simplified71.0%
Taylor expanded in x1 around inf 64.2%
*-commutative64.2%
Simplified64.2%
Final simplification64.6%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -4.8e-138) (not (<= x1 3.9e-127))) (* x1 (- -1.0 (* -2.0 (* x2 6.0)))) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -4.8e-138) || !(x1 <= 3.9e-127)) {
tmp = x1 * (-1.0 - (-2.0 * (x2 * 6.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 <= (-4.8d-138)) .or. (.not. (x1 <= 3.9d-127))) then
tmp = x1 * ((-1.0d0) - ((-2.0d0) * (x2 * 6.0d0)))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -4.8e-138) || !(x1 <= 3.9e-127)) {
tmp = x1 * (-1.0 - (-2.0 * (x2 * 6.0)));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -4.8e-138) or not (x1 <= 3.9e-127): tmp = x1 * (-1.0 - (-2.0 * (x2 * 6.0))) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -4.8e-138) || !(x1 <= 3.9e-127)) tmp = Float64(x1 * Float64(-1.0 - Float64(-2.0 * Float64(x2 * 6.0)))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -4.8e-138) || ~((x1 <= 3.9e-127))) tmp = x1 * (-1.0 - (-2.0 * (x2 * 6.0))); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -4.8e-138], N[Not[LessEqual[x1, 3.9e-127]], $MachinePrecision]], N[(x1 * N[(-1.0 - N[(-2.0 * N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4.8 \cdot 10^{-138} \lor \neg \left(x1 \leq 3.9 \cdot 10^{-127}\right):\\
\;\;\;\;x1 \cdot \left(-1 - -2 \cdot \left(x2 \cdot 6\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -4.7999999999999998e-138 or 3.89999999999999966e-127 < x1 Initial program 59.4%
Simplified59.6%
Taylor expanded in x1 around -inf 65.0%
Taylor expanded in x1 around 0 14.1%
Taylor expanded in x2 around inf 25.5%
*-commutative25.5%
Simplified25.5%
if -4.7999999999999998e-138 < x1 < 3.89999999999999966e-127Initial program 99.7%
Simplified99.8%
Taylor expanded in x1 around 0 69.9%
*-commutative69.9%
Simplified69.9%
Final simplification38.3%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -6000.0) (not (<= x1 8.2e+97))) (* (* x1 x2) 12.0) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -6000.0) || !(x1 <= 8.2e+97)) {
tmp = (x1 * x2) * 12.0;
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-6000.0d0)) .or. (.not. (x1 <= 8.2d+97))) then
tmp = (x1 * x2) * 12.0d0
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -6000.0) || !(x1 <= 8.2e+97)) {
tmp = (x1 * x2) * 12.0;
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -6000.0) or not (x1 <= 8.2e+97): tmp = (x1 * x2) * 12.0 else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -6000.0) || !(x1 <= 8.2e+97)) tmp = Float64(Float64(x1 * x2) * 12.0); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -6000.0) || ~((x1 <= 8.2e+97))) tmp = (x1 * x2) * 12.0; else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -6000.0], N[Not[LessEqual[x1, 8.2e+97]], $MachinePrecision]], N[(N[(x1 * x2), $MachinePrecision] * 12.0), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -6000 \lor \neg \left(x1 \leq 8.2 \cdot 10^{+97}\right):\\
\;\;\;\;\left(x1 \cdot x2\right) \cdot 12\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -6e3 or 8.19999999999999977e97 < x1 Initial program 30.3%
Simplified30.3%
Taylor expanded in x1 around -inf 97.1%
Taylor expanded in x1 around 0 19.0%
Taylor expanded in x2 around inf 17.0%
if -6e3 < x1 < 8.19999999999999977e97Initial program 99.4%
Simplified99.7%
Taylor expanded in x1 around 0 40.9%
*-commutative40.9%
Simplified40.9%
Final simplification31.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* x1 x2) 12.0)))
(if (<= x1 -4.2e-54)
(+ (* x1 -17.0) t_0)
(if (<= x1 8.2e+97) (* x2 -6.0) t_0))))
double code(double x1, double x2) {
double t_0 = (x1 * x2) * 12.0;
double tmp;
if (x1 <= -4.2e-54) {
tmp = (x1 * -17.0) + t_0;
} else if (x1 <= 8.2e+97) {
tmp = x2 * -6.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = (x1 * x2) * 12.0d0
if (x1 <= (-4.2d-54)) then
tmp = (x1 * (-17.0d0)) + t_0
else if (x1 <= 8.2d+97) then
tmp = x2 * (-6.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x2) * 12.0;
double tmp;
if (x1 <= -4.2e-54) {
tmp = (x1 * -17.0) + t_0;
} else if (x1 <= 8.2e+97) {
tmp = x2 * -6.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x2) * 12.0 tmp = 0 if x1 <= -4.2e-54: tmp = (x1 * -17.0) + t_0 elif x1 <= 8.2e+97: tmp = x2 * -6.0 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x2) * 12.0) tmp = 0.0 if (x1 <= -4.2e-54) tmp = Float64(Float64(x1 * -17.0) + t_0); elseif (x1 <= 8.2e+97) tmp = Float64(x2 * -6.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x2) * 12.0; tmp = 0.0; if (x1 <= -4.2e-54) tmp = (x1 * -17.0) + t_0; elseif (x1 <= 8.2e+97) tmp = x2 * -6.0; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x2), $MachinePrecision] * 12.0), $MachinePrecision]}, If[LessEqual[x1, -4.2e-54], N[(N[(x1 * -17.0), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[x1, 8.2e+97], N[(x2 * -6.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x1 \cdot x2\right) \cdot 12\\
\mathbf{if}\;x1 \leq -4.2 \cdot 10^{-54}:\\
\;\;\;\;x1 \cdot -17 + t\_0\\
\mathbf{elif}\;x1 \leq 8.2 \cdot 10^{+97}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -4.2e-54Initial program 47.1%
Simplified47.3%
Taylor expanded in x1 around -inf 82.5%
Taylor expanded in x1 around 0 12.3%
Taylor expanded in x2 around 0 12.3%
if -4.2e-54 < x1 < 8.19999999999999977e97Initial program 99.4%
Simplified99.6%
Taylor expanded in x1 around 0 44.2%
*-commutative44.2%
Simplified44.2%
if 8.19999999999999977e97 < x1 Initial program 18.4%
Simplified18.4%
Taylor expanded in x1 around -inf 100.0%
Taylor expanded in x1 around 0 29.8%
Taylor expanded in x2 around inf 30.9%
Final simplification32.3%
(FPCore (x1 x2) :precision binary64 (+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))))
double code(double x1, double x2) {
return (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end function
public static double code(double x1, double x2) {
return (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
def code(x1, x2): return (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)))
function code(x1, x2) return Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))) end
function tmp = code(x1, x2) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end
code[x1_, x2_] := N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)
\end{array}
Initial program 71.0%
Simplified71.2%
Taylor expanded in x1 around 0 69.1%
Taylor expanded in x2 around 0 62.5%
*-commutative62.5%
Simplified62.5%
Final simplification62.5%
(FPCore (x1 x2) :precision binary64 (* x2 -6.0))
double code(double x1, double x2) {
return x2 * -6.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * (-6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * -6.0;
}
def code(x1, x2): return x2 * -6.0
function code(x1, x2) return Float64(x2 * -6.0) end
function tmp = code(x1, x2) tmp = x2 * -6.0; end
code[x1_, x2_] := N[(x2 * -6.0), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6
\end{array}
Initial program 71.0%
Simplified71.2%
Taylor expanded in x1 around 0 24.9%
*-commutative24.9%
Simplified24.9%
(FPCore (x1 x2) :precision binary64 (* x1 -17.0))
double code(double x1, double x2) {
return x1 * -17.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 * (-17.0d0)
end function
public static double code(double x1, double x2) {
return x1 * -17.0;
}
def code(x1, x2): return x1 * -17.0
function code(x1, x2) return Float64(x1 * -17.0) end
function tmp = code(x1, x2) tmp = x1 * -17.0; end
code[x1_, x2_] := N[(x1 * -17.0), $MachinePrecision]
\begin{array}{l}
\\
x1 \cdot -17
\end{array}
Initial program 71.0%
Simplified71.2%
Taylor expanded in x1 around -inf 46.2%
Taylor expanded in x1 around 0 11.4%
Taylor expanded in x2 around 0 5.1%
*-commutative5.1%
Simplified5.1%
herbie shell --seed 2024116
(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))))))