
(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 25 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 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- (+ t_1 (* 2.0 x2)) x1))
(t_3 (/ t_2 t_0))
(t_4 (fma x1 (* x1 3.0) (* 2.0 x2)))
(t_5 (/ (- t_4 x1) (fma x1 x1 1.0)))
(t_6 (- -1.0 (* x1 x1)))
(t_7 (/ t_2 t_6))
(t_8 (/ (- x1 t_4) (fma x1 x1 1.0)))
(t_9 (* 3.0 (* x1 x1))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_7)))
(* (* (* x1 2.0) t_3) (+ 3.0 t_7)))
t_6)
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_9 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_5 4.0 -6.0)) (* (* x1 (* 2.0 t_8)) (- t_8 -3.0)))
(fma t_9 t_5 (pow x1 3.0))))))
(+
x1
(+
(+
x1
(*
(pow x1 4.0)
(+ 6.0 (/ (- (/ (- 9.0 (* 4.0 (- 3.0 (* 2.0 x2)))) x1) 3.0) x1))))
(* 3.0 (* x2 -2.0)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = t_2 / t_0;
double t_4 = fma(x1, (x1 * 3.0), (2.0 * x2));
double t_5 = (t_4 - x1) / fma(x1, x1, 1.0);
double t_6 = -1.0 - (x1 * x1);
double t_7 = t_2 / t_6;
double t_8 = (x1 - t_4) / fma(x1, x1, 1.0);
double t_9 = 3.0 * (x1 * x1);
double tmp;
if ((x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_7))) + (((x1 * 2.0) * t_3) * (3.0 + t_7))) * t_6) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_9 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_5, 4.0, -6.0)), ((x1 * (2.0 * t_8)) * (t_8 - -3.0))), fma(t_9, t_5, pow(x1, 3.0)))));
} else {
tmp = x1 + ((x1 + (pow(x1, 4.0) * (6.0 + ((((9.0 - (4.0 * (3.0 - (2.0 * x2)))) / x1) - 3.0) / x1)))) + (3.0 * (x2 * -2.0)));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) t_3 = Float64(t_2 / t_0) t_4 = fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) t_5 = Float64(Float64(t_4 - x1) / fma(x1, x1, 1.0)) t_6 = Float64(-1.0 - Float64(x1 * x1)) t_7 = Float64(t_2 / t_6) t_8 = Float64(Float64(x1 - t_4) / fma(x1, x1, 1.0)) t_9 = Float64(3.0 * Float64(x1 * x1)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_7))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_7))) * t_6) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_9 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_5, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_8)) * Float64(t_8 - -3.0))), fma(t_9, t_5, (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64((x1 ^ 4.0) * Float64(6.0 + Float64(Float64(Float64(Float64(9.0 - Float64(4.0 * Float64(3.0 - Float64(2.0 * x2)))) / x1) - 3.0) / x1)))) + Float64(3.0 * Float64(x2 * -2.0)))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$4 - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$2 / t$95$6), $MachinePrecision]}, Block[{t$95$8 = N[(N[(x1 - t$95$4), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$9 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$6), $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$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$9 - 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$5 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$8), $MachinePrecision]), $MachinePrecision] * N[(t$95$8 - -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$9 * t$95$5 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(N[(N[(N[(9.0 - N[(4.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := \frac{t\_2}{t\_0}\\
t_4 := \mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right)\\
t_5 := \frac{t\_4 - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_6 := -1 - x1 \cdot x1\\
t_7 := \frac{t\_2}{t\_6}\\
t_8 := \frac{x1 - t\_4}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_9 := 3 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_7\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_7\right)\right) \cdot t\_6 + 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\_0}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_9 - \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\_5, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_8\right)\right) \cdot \left(t\_8 - -3\right)\right), \mathsf{fma}\left(t\_9, t\_5, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + {x1}^{4} \cdot \left(6 + \frac{\frac{9 - 4 \cdot \left(3 - 2 \cdot x2\right)}{x1} - 3}{x1}\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.5%
Simplified99.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%
Taylor expanded in x1 around -inf 15.1%
Taylor expanded in x1 around 0 98.6%
*-commutative98.6%
Simplified98.6%
Final simplification99.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- (+ t_1 (* 2.0 x2)) x1))
(t_3 (/ t_2 t_0))
(t_4 (- -1.0 (* x1 x1)))
(t_5 (/ t_2 t_4))
(t_6
(+
x1
(+
(+
(*
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
(* (* (* x1 2.0) t_3) (+ 3.0 t_5)))
t_4)
(* t_1 t_3))
(* x1 (* x1 x1))))))
(if (<= (+ x1 (+ t_6 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0)))) INFINITY)
(+
x1
(+
t_6
(*
3.0
(*
x2
(-
(/ (fma 3.0 (pow x1 2.0) (- x1)) (* x2 (fma x1 x1 1.0)))
(/ 2.0 (fma x1 x1 1.0)))))))
(+
x1
(+
(+
x1
(*
(pow x1 4.0)
(+ 6.0 (/ (- (/ (- 9.0 (* 4.0 (- 3.0 (* 2.0 x2)))) x1) 3.0) x1))))
(* 3.0 (* x2 -2.0)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = t_2 / t_0;
double t_4 = -1.0 - (x1 * x1);
double t_5 = t_2 / t_4;
double t_6 = x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)));
double tmp;
if ((x1 + (t_6 + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)))) <= ((double) INFINITY)) {
tmp = x1 + (t_6 + (3.0 * (x2 * ((fma(3.0, pow(x1, 2.0), -x1) / (x2 * fma(x1, x1, 1.0))) - (2.0 / fma(x1, x1, 1.0))))));
} else {
tmp = x1 + ((x1 + (pow(x1, 4.0) * (6.0 + ((((9.0 - (4.0 * (3.0 - (2.0 * x2)))) / x1) - 3.0) / x1)))) + (3.0 * (x2 * -2.0)));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) t_3 = Float64(t_2 / t_0) t_4 = Float64(-1.0 - Float64(x1 * x1)) t_5 = Float64(t_2 / t_4) t_6 = Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_5))) * t_4) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) tmp = 0.0 if (Float64(x1 + Float64(t_6 + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))) <= Inf) tmp = Float64(x1 + Float64(t_6 + Float64(3.0 * Float64(x2 * Float64(Float64(fma(3.0, (x1 ^ 2.0), Float64(-x1)) / Float64(x2 * fma(x1, x1, 1.0))) - Float64(2.0 / fma(x1, x1, 1.0))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64((x1 ^ 4.0) * Float64(6.0 + Float64(Float64(Float64(Float64(9.0 - Float64(4.0 * Float64(3.0 - Float64(2.0 * x2)))) / x1) - 3.0) / x1)))) + Float64(3.0 * Float64(x2 * -2.0)))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(t$95$6 + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$6 + N[(3.0 * N[(x2 * N[(N[(N[(3.0 * N[Power[x1, 2.0], $MachinePrecision] + (-x1)), $MachinePrecision] / N[(x2 * N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(N[(N[(N[(9.0 - N[(4.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := \frac{t\_2}{t\_0}\\
t_4 := -1 - x1 \cdot x1\\
t_5 := \frac{t\_2}{t\_4}\\
t_6 := x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\\
\mathbf{if}\;x1 + \left(t\_6 + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0}\right) \leq \infty:\\
\;\;\;\;x1 + \left(t\_6 + 3 \cdot \left(x2 \cdot \left(\frac{\mathsf{fma}\left(3, {x1}^{2}, -x1\right)}{x2 \cdot \mathsf{fma}\left(x1, x1, 1\right)} - \frac{2}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + {x1}^{4} \cdot \left(6 + \frac{\frac{9 - 4 \cdot \left(3 - 2 \cdot x2\right)}{x1} - 3}{x1}\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.5%
Taylor expanded in x2 around inf 99.5%
+-commutative99.5%
associate--r+99.5%
associate-*r/99.5%
div-sub99.5%
fma-neg99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
associate-*r/99.5%
metadata-eval99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around -inf 15.1%
Taylor expanded in x1 around 0 98.6%
*-commutative98.6%
Simplified98.6%
Final simplification99.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- (+ t_1 (* 2.0 x2)) x1))
(t_3 (/ t_2 t_0))
(t_4 (- -1.0 (* x1 x1)))
(t_5 (/ t_2 t_4))
(t_6
(+
x1
(+
(+
x1
(+
(+
(*
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
(* (* (* x1 2.0) t_3) (+ 3.0 t_5)))
t_4)
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))))
(if (<= t_6 INFINITY)
t_6
(+
x1
(+
(+
x1
(*
(pow x1 4.0)
(+ 6.0 (/ (- (/ (- 9.0 (* 4.0 (- 3.0 (* 2.0 x2)))) x1) 3.0) x1))))
(* 3.0 (* x2 -2.0)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = t_2 / t_0;
double t_4 = -1.0 - (x1 * x1);
double t_5 = t_2 / t_4;
double t_6 = x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
double tmp;
if (t_6 <= ((double) INFINITY)) {
tmp = t_6;
} else {
tmp = x1 + ((x1 + (pow(x1, 4.0) * (6.0 + ((((9.0 - (4.0 * (3.0 - (2.0 * x2)))) / x1) - 3.0) / x1)))) + (3.0 * (x2 * -2.0)));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = t_2 / t_0;
double t_4 = -1.0 - (x1 * x1);
double t_5 = t_2 / t_4;
double t_6 = x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
double tmp;
if (t_6 <= Double.POSITIVE_INFINITY) {
tmp = t_6;
} else {
tmp = x1 + ((x1 + (Math.pow(x1, 4.0) * (6.0 + ((((9.0 - (4.0 * (3.0 - (2.0 * x2)))) / x1) - 3.0) / x1)))) + (3.0 * (x2 * -2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = (t_1 + (2.0 * x2)) - x1 t_3 = t_2 / t_0 t_4 = -1.0 - (x1 * x1) t_5 = t_2 / t_4 t_6 = x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0))) tmp = 0 if t_6 <= math.inf: tmp = t_6 else: tmp = x1 + ((x1 + (math.pow(x1, 4.0) * (6.0 + ((((9.0 - (4.0 * (3.0 - (2.0 * x2)))) / x1) - 3.0) / x1)))) + (3.0 * (x2 * -2.0))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) t_3 = Float64(t_2 / t_0) t_4 = Float64(-1.0 - Float64(x1 * x1)) t_5 = Float64(t_2 / t_4) t_6 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_5))) * t_4) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))) tmp = 0.0 if (t_6 <= Inf) tmp = t_6; else tmp = Float64(x1 + Float64(Float64(x1 + Float64((x1 ^ 4.0) * Float64(6.0 + Float64(Float64(Float64(Float64(9.0 - Float64(4.0 * Float64(3.0 - Float64(2.0 * x2)))) / x1) - 3.0) / x1)))) + Float64(3.0 * Float64(x2 * -2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = (t_1 + (2.0 * x2)) - x1; t_3 = t_2 / t_0; t_4 = -1.0 - (x1 * x1); t_5 = t_2 / t_4; t_6 = x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0))); tmp = 0.0; if (t_6 <= Inf) tmp = t_6; else tmp = x1 + ((x1 + ((x1 ^ 4.0) * (6.0 + ((((9.0 - (4.0 * (3.0 - (2.0 * x2)))) / x1) - 3.0) / x1)))) + (3.0 * (x2 * -2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $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$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, Infinity], t$95$6, N[(x1 + N[(N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(N[(N[(N[(9.0 - N[(4.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := \frac{t\_2}{t\_0}\\
t_4 := -1 - x1 \cdot x1\\
t_5 := \frac{t\_2}{t\_4}\\
t_6 := x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + 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\_0}\right)\\
\mathbf{if}\;t\_6 \leq \infty:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + {x1}^{4} \cdot \left(6 + \frac{\frac{9 - 4 \cdot \left(3 - 2 \cdot x2\right)}{x1} - 3}{x1}\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.5%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around -inf 15.1%
Taylor expanded in x1 around 0 98.6%
*-commutative98.6%
Simplified98.6%
Final simplification99.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- (+ t_1 (* 2.0 x2)) x1))
(t_3 (- 3.0 (* 2.0 x2)))
(t_4 (- -1.0 (* x1 x1)))
(t_5 (/ t_2 t_4))
(t_6 (/ t_2 t_0)))
(if (<= x1 -1e+103)
(+ x1 (+ 6.0 (+ x1 (* x1 (- (* x1 (- (* x1 -6.0) 12.0)) 16.0)))))
(if (<= x1 1.9e+122)
(+
x1
(+
(+
x1
(+
(+
(*
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
(* (* (* x1 2.0) t_6) (+ 3.0 t_5)))
t_4)
(* t_1 t_6))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))
(-
(* x2 -6.0)
(+
(*
x1
(-
(+
(* x1 (- (* 3.0 (- (* x2 -2.0) 3.0)) (* x1 3.0)))
(* 2.0 (+ -1.0 (* 3.0 t_3))))
-1.0))
(* -2.0 t_3)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = 3.0 - (2.0 * x2);
double t_4 = -1.0 - (x1 * x1);
double t_5 = t_2 / t_4;
double t_6 = t_2 / t_0;
double tmp;
if (x1 <= -1e+103) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if (x1 <= 1.9e+122) {
tmp = x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_6) * (3.0 + t_5))) * t_4) + (t_1 * t_6)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
} else {
tmp = (x2 * -6.0) - ((x1 * (((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (2.0 * (-1.0 + (3.0 * t_3)))) - -1.0)) + (-2.0 * t_3));
}
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) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = (t_1 + (2.0d0 * x2)) - x1
t_3 = 3.0d0 - (2.0d0 * x2)
t_4 = (-1.0d0) - (x1 * x1)
t_5 = t_2 / t_4
t_6 = t_2 / t_0
if (x1 <= (-1d+103)) then
tmp = x1 + (6.0d0 + (x1 + (x1 * ((x1 * ((x1 * (-6.0d0)) - 12.0d0)) - 16.0d0))))
else if (x1 <= 1.9d+122) then
tmp = x1 + ((x1 + ((((((x1 * x1) * (6.0d0 + (4.0d0 * t_5))) + (((x1 * 2.0d0) * t_6) * (3.0d0 + t_5))) * t_4) + (t_1 * t_6)) + (x1 * (x1 * x1)))) + (3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)))
else
tmp = (x2 * (-6.0d0)) - ((x1 * (((x1 * ((3.0d0 * ((x2 * (-2.0d0)) - 3.0d0)) - (x1 * 3.0d0))) + (2.0d0 * ((-1.0d0) + (3.0d0 * t_3)))) - (-1.0d0))) + ((-2.0d0) * t_3))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = 3.0 - (2.0 * x2);
double t_4 = -1.0 - (x1 * x1);
double t_5 = t_2 / t_4;
double t_6 = t_2 / t_0;
double tmp;
if (x1 <= -1e+103) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if (x1 <= 1.9e+122) {
tmp = x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_6) * (3.0 + t_5))) * t_4) + (t_1 * t_6)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
} else {
tmp = (x2 * -6.0) - ((x1 * (((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (2.0 * (-1.0 + (3.0 * t_3)))) - -1.0)) + (-2.0 * t_3));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = (t_1 + (2.0 * x2)) - x1 t_3 = 3.0 - (2.0 * x2) t_4 = -1.0 - (x1 * x1) t_5 = t_2 / t_4 t_6 = t_2 / t_0 tmp = 0 if x1 <= -1e+103: tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))) elif x1 <= 1.9e+122: tmp = x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_6) * (3.0 + t_5))) * t_4) + (t_1 * t_6)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0))) else: tmp = (x2 * -6.0) - ((x1 * (((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (2.0 * (-1.0 + (3.0 * t_3)))) - -1.0)) + (-2.0 * t_3)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) t_3 = Float64(3.0 - Float64(2.0 * x2)) t_4 = Float64(-1.0 - Float64(x1 * x1)) t_5 = Float64(t_2 / t_4) t_6 = Float64(t_2 / t_0) tmp = 0.0 if (x1 <= -1e+103) tmp = Float64(x1 + Float64(6.0 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * -6.0) - 12.0)) - 16.0))))); elseif (x1 <= 1.9e+122) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(Float64(x1 * 2.0) * t_6) * Float64(3.0 + t_5))) * t_4) + Float64(t_1 * t_6)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))); else tmp = Float64(Float64(x2 * -6.0) - Float64(Float64(x1 * Float64(Float64(Float64(x1 * Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - 3.0)) - Float64(x1 * 3.0))) + Float64(2.0 * Float64(-1.0 + Float64(3.0 * t_3)))) - -1.0)) + Float64(-2.0 * t_3))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = (t_1 + (2.0 * x2)) - x1; t_3 = 3.0 - (2.0 * x2); t_4 = -1.0 - (x1 * x1); t_5 = t_2 / t_4; t_6 = t_2 / t_0; tmp = 0.0; if (x1 <= -1e+103) tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))); elseif (x1 <= 1.9e+122) tmp = x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_6) * (3.0 + t_5))) * t_4) + (t_1 * t_6)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0))); else tmp = (x2 * -6.0) - ((x1 * (((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (2.0 * (-1.0 + (3.0 * t_3)))) - -1.0)) + (-2.0 * t_3)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$2 / t$95$0), $MachinePrecision]}, If[LessEqual[x1, -1e+103], N[(x1 + N[(6.0 + N[(x1 + N[(x1 * N[(N[(x1 * N[(N[(x1 * -6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision] - 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.9e+122], N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$6), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision] + N[(t$95$1 * t$95$6), $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$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - N[(N[(x1 * N[(N[(N[(x1 * N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] - N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(-1.0 + N[(3.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := 3 - 2 \cdot x2\\
t_4 := -1 - x1 \cdot x1\\
t_5 := \frac{t\_2}{t\_4}\\
t_6 := \frac{t\_2}{t\_0}\\
\mathbf{if}\;x1 \leq -1 \cdot 10^{+103}:\\
\;\;\;\;x1 + \left(6 + \left(x1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot -6 - 12\right) - 16\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.9 \cdot 10^{+122}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_6\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + t\_1 \cdot t\_6\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0}\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - \left(x1 \cdot \left(\left(x1 \cdot \left(3 \cdot \left(x2 \cdot -2 - 3\right) - x1 \cdot 3\right) + 2 \cdot \left(-1 + 3 \cdot t\_3\right)\right) - -1\right) + -2 \cdot t\_3\right)\\
\end{array}
\end{array}
if x1 < -1e103Initial program 2.3%
Taylor expanded in x1 around inf 2.3%
Taylor expanded in x1 around 0 20.9%
Taylor expanded in x1 around 0 88.4%
*-commutative97.7%
Simplified88.4%
Taylor expanded in x2 around 0 97.7%
if -1e103 < x1 < 1.8999999999999999e122Initial program 99.4%
if 1.8999999999999999e122 < x1 Initial program 18.4%
Taylor expanded in x1 around inf 18.4%
Taylor expanded in x1 around 0 8.1%
Taylor expanded in x1 around 0 97.4%
Final simplification98.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (- 3.0 (* 2.0 x2)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (- (+ t_2 (* 2.0 x2)) x1))
(t_4 (/ t_3 t_0)))
(if (<= x1 -5e+102)
(+ x1 (+ 6.0 (+ x1 (* x1 (- (* x1 (- (* x1 -6.0) 12.0)) 16.0)))))
(if (<= x1 2e+122)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
(+
x1
(+
(* x1 (* x1 x1))
(-
(* t_2 t_4)
(*
t_0
(-
(* (* (* x1 2.0) t_4) (+ 3.0 (/ t_3 (- -1.0 (* x1 x1)))))
(* (* x1 x1) 6.0))))))))
(-
(* x2 -6.0)
(+
(*
x1
(-
(+
(* x1 (- (* 3.0 (- (* x2 -2.0) 3.0)) (* x1 3.0)))
(* 2.0 (+ -1.0 (* 3.0 t_1))))
-1.0))
(* -2.0 t_1)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = 3.0 - (2.0 * x2);
double t_2 = x1 * (x1 * 3.0);
double t_3 = (t_2 + (2.0 * x2)) - x1;
double t_4 = t_3 / t_0;
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if (x1 <= 2e+122) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_4) - (t_0 * ((((x1 * 2.0) * t_4) * (3.0 + (t_3 / (-1.0 - (x1 * x1))))) - ((x1 * x1) * 6.0)))))));
} else {
tmp = (x2 * -6.0) - ((x1 * (((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (2.0 * (-1.0 + (3.0 * t_1)))) - -1.0)) + (-2.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) :: t_4
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = 3.0d0 - (2.0d0 * x2)
t_2 = x1 * (x1 * 3.0d0)
t_3 = (t_2 + (2.0d0 * x2)) - x1
t_4 = t_3 / t_0
if (x1 <= (-5d+102)) then
tmp = x1 + (6.0d0 + (x1 + (x1 * ((x1 * ((x1 * (-6.0d0)) - 12.0d0)) - 16.0d0))))
else if (x1 <= 2d+122) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_4) - (t_0 * ((((x1 * 2.0d0) * t_4) * (3.0d0 + (t_3 / ((-1.0d0) - (x1 * x1))))) - ((x1 * x1) * 6.0d0)))))))
else
tmp = (x2 * (-6.0d0)) - ((x1 * (((x1 * ((3.0d0 * ((x2 * (-2.0d0)) - 3.0d0)) - (x1 * 3.0d0))) + (2.0d0 * ((-1.0d0) + (3.0d0 * t_1)))) - (-1.0d0))) + ((-2.0d0) * t_1))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = 3.0 - (2.0 * x2);
double t_2 = x1 * (x1 * 3.0);
double t_3 = (t_2 + (2.0 * x2)) - x1;
double t_4 = t_3 / t_0;
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if (x1 <= 2e+122) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_4) - (t_0 * ((((x1 * 2.0) * t_4) * (3.0 + (t_3 / (-1.0 - (x1 * x1))))) - ((x1 * x1) * 6.0)))))));
} else {
tmp = (x2 * -6.0) - ((x1 * (((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (2.0 * (-1.0 + (3.0 * t_1)))) - -1.0)) + (-2.0 * t_1));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = 3.0 - (2.0 * x2) t_2 = x1 * (x1 * 3.0) t_3 = (t_2 + (2.0 * x2)) - x1 t_4 = t_3 / t_0 tmp = 0 if x1 <= -5e+102: tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))) elif x1 <= 2e+122: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_4) - (t_0 * ((((x1 * 2.0) * t_4) * (3.0 + (t_3 / (-1.0 - (x1 * x1))))) - ((x1 * x1) * 6.0))))))) else: tmp = (x2 * -6.0) - ((x1 * (((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (2.0 * (-1.0 + (3.0 * t_1)))) - -1.0)) + (-2.0 * t_1)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(3.0 - Float64(2.0 * x2)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) t_4 = Float64(t_3 / t_0) tmp = 0.0 if (x1 <= -5e+102) tmp = Float64(x1 + Float64(6.0 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * -6.0) - 12.0)) - 16.0))))); elseif (x1 <= 2e+122) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * t_4) - Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(3.0 + Float64(t_3 / Float64(-1.0 - Float64(x1 * x1))))) - Float64(Float64(x1 * x1) * 6.0)))))))); else tmp = Float64(Float64(x2 * -6.0) - Float64(Float64(x1 * Float64(Float64(Float64(x1 * Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - 3.0)) - Float64(x1 * 3.0))) + Float64(2.0 * Float64(-1.0 + Float64(3.0 * t_1)))) - -1.0)) + Float64(-2.0 * t_1))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = 3.0 - (2.0 * x2); t_2 = x1 * (x1 * 3.0); t_3 = (t_2 + (2.0 * x2)) - x1; t_4 = t_3 / t_0; tmp = 0.0; if (x1 <= -5e+102) tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))); elseif (x1 <= 2e+122) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_4) - (t_0 * ((((x1 * 2.0) * t_4) * (3.0 + (t_3 / (-1.0 - (x1 * x1))))) - ((x1 * x1) * 6.0))))))); else tmp = (x2 * -6.0) - ((x1 * (((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (2.0 * (-1.0 + (3.0 * t_1)))) - -1.0)) + (-2.0 * t_1)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 / t$95$0), $MachinePrecision]}, If[LessEqual[x1, -5e+102], N[(x1 + N[(6.0 + N[(x1 + N[(x1 * N[(N[(x1 * N[(N[(x1 * -6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision] - 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+122], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * t$95$4), $MachinePrecision] - N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(3.0 + N[(t$95$3 / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - N[(N[(x1 * N[(N[(N[(x1 * N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] - N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(-1.0 + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := 3 - 2 \cdot x2\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \left(t\_2 + 2 \cdot x2\right) - x1\\
t_4 := \frac{t\_3}{t\_0}\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(6 + \left(x1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot -6 - 12\right) - 16\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+122}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_0} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_2 \cdot t\_4 - t\_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_4\right) \cdot \left(3 + \frac{t\_3}{-1 - x1 \cdot x1}\right) - \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - \left(x1 \cdot \left(\left(x1 \cdot \left(3 \cdot \left(x2 \cdot -2 - 3\right) - x1 \cdot 3\right) + 2 \cdot \left(-1 + 3 \cdot t\_1\right)\right) - -1\right) + -2 \cdot t\_1\right)\\
\end{array}
\end{array}
if x1 < -5e102Initial program 2.3%
Taylor expanded in x1 around inf 2.3%
Taylor expanded in x1 around 0 20.9%
Taylor expanded in x1 around 0 88.4%
*-commutative97.7%
Simplified88.4%
Taylor expanded in x2 around 0 97.7%
if -5e102 < x1 < 2.00000000000000003e122Initial program 99.4%
Taylor expanded in x1 around inf 98.3%
if 2.00000000000000003e122 < x1 Initial program 18.4%
Taylor expanded in x1 around inf 18.4%
Taylor expanded in x1 around 0 8.1%
Taylor expanded in x1 around 0 97.4%
Final simplification98.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (- 3.0 (* 2.0 x2)))
(t_2 (- -1.0 (* x1 x1)))
(t_3 (* x1 (* x1 3.0)))
(t_4 (* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_0)))
(t_5 (- (+ t_3 (* 2.0 x2)) x1))
(t_6
(+
x1
(-
t_4
(-
(-
(+
(* t_3 (/ t_5 t_2))
(*
(+ (* (* x1 x1) 6.0) (* (- (/ t_5 t_0) 3.0) (* (* x1 2.0) 3.0)))
t_2))
(* x1 (* x1 x1)))
x1)))))
(if (<= x1 -1e+103)
(+ x1 (+ 6.0 (+ x1 (* x1 (- (* x1 (- (* x1 -6.0) 12.0)) 16.0)))))
(if (<= x1 -31000000000000.0)
t_6
(if (<= x1 1.28e+35)
(+ x1 (+ t_4 (+ x1 (* 4.0 (* x2 (+ (* x1 -3.0) (* 2.0 (* x1 x2))))))))
(if (<= x1 4.5e+123)
t_6
(-
(* x2 -6.0)
(+
(*
x1
(-
(+
(* x1 (- (* 3.0 (- (* x2 -2.0) 3.0)) (* x1 3.0)))
(* 2.0 (+ -1.0 (* 3.0 t_1))))
-1.0))
(* -2.0 t_1)))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = 3.0 - (2.0 * x2);
double t_2 = -1.0 - (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = 3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0);
double t_5 = (t_3 + (2.0 * x2)) - x1;
double t_6 = x1 + (t_4 - ((((t_3 * (t_5 / t_2)) + ((((x1 * x1) * 6.0) + (((t_5 / t_0) - 3.0) * ((x1 * 2.0) * 3.0))) * t_2)) - (x1 * (x1 * x1))) - x1));
double tmp;
if (x1 <= -1e+103) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if (x1 <= -31000000000000.0) {
tmp = t_6;
} else if (x1 <= 1.28e+35) {
tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else if (x1 <= 4.5e+123) {
tmp = t_6;
} else {
tmp = (x2 * -6.0) - ((x1 * (((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (2.0 * (-1.0 + (3.0 * t_1)))) - -1.0)) + (-2.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) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = 3.0d0 - (2.0d0 * x2)
t_2 = (-1.0d0) - (x1 * x1)
t_3 = x1 * (x1 * 3.0d0)
t_4 = 3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_0)
t_5 = (t_3 + (2.0d0 * x2)) - x1
t_6 = x1 + (t_4 - ((((t_3 * (t_5 / t_2)) + ((((x1 * x1) * 6.0d0) + (((t_5 / t_0) - 3.0d0) * ((x1 * 2.0d0) * 3.0d0))) * t_2)) - (x1 * (x1 * x1))) - x1))
if (x1 <= (-1d+103)) then
tmp = x1 + (6.0d0 + (x1 + (x1 * ((x1 * ((x1 * (-6.0d0)) - 12.0d0)) - 16.0d0))))
else if (x1 <= (-31000000000000.0d0)) then
tmp = t_6
else if (x1 <= 1.28d+35) then
tmp = x1 + (t_4 + (x1 + (4.0d0 * (x2 * ((x1 * (-3.0d0)) + (2.0d0 * (x1 * x2)))))))
else if (x1 <= 4.5d+123) then
tmp = t_6
else
tmp = (x2 * (-6.0d0)) - ((x1 * (((x1 * ((3.0d0 * ((x2 * (-2.0d0)) - 3.0d0)) - (x1 * 3.0d0))) + (2.0d0 * ((-1.0d0) + (3.0d0 * t_1)))) - (-1.0d0))) + ((-2.0d0) * t_1))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = 3.0 - (2.0 * x2);
double t_2 = -1.0 - (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = 3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0);
double t_5 = (t_3 + (2.0 * x2)) - x1;
double t_6 = x1 + (t_4 - ((((t_3 * (t_5 / t_2)) + ((((x1 * x1) * 6.0) + (((t_5 / t_0) - 3.0) * ((x1 * 2.0) * 3.0))) * t_2)) - (x1 * (x1 * x1))) - x1));
double tmp;
if (x1 <= -1e+103) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if (x1 <= -31000000000000.0) {
tmp = t_6;
} else if (x1 <= 1.28e+35) {
tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else if (x1 <= 4.5e+123) {
tmp = t_6;
} else {
tmp = (x2 * -6.0) - ((x1 * (((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (2.0 * (-1.0 + (3.0 * t_1)))) - -1.0)) + (-2.0 * t_1));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = 3.0 - (2.0 * x2) t_2 = -1.0 - (x1 * x1) t_3 = x1 * (x1 * 3.0) t_4 = 3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0) t_5 = (t_3 + (2.0 * x2)) - x1 t_6 = x1 + (t_4 - ((((t_3 * (t_5 / t_2)) + ((((x1 * x1) * 6.0) + (((t_5 / t_0) - 3.0) * ((x1 * 2.0) * 3.0))) * t_2)) - (x1 * (x1 * x1))) - x1)) tmp = 0 if x1 <= -1e+103: tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))) elif x1 <= -31000000000000.0: tmp = t_6 elif x1 <= 1.28e+35: tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))) elif x1 <= 4.5e+123: tmp = t_6 else: tmp = (x2 * -6.0) - ((x1 * (((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (2.0 * (-1.0 + (3.0 * t_1)))) - -1.0)) + (-2.0 * t_1)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(3.0 - Float64(2.0 * x2)) t_2 = Float64(-1.0 - Float64(x1 * x1)) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_0)) t_5 = Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) t_6 = Float64(x1 + Float64(t_4 - Float64(Float64(Float64(Float64(t_3 * Float64(t_5 / t_2)) + Float64(Float64(Float64(Float64(x1 * x1) * 6.0) + Float64(Float64(Float64(t_5 / t_0) - 3.0) * Float64(Float64(x1 * 2.0) * 3.0))) * t_2)) - Float64(x1 * Float64(x1 * x1))) - x1))) tmp = 0.0 if (x1 <= -1e+103) tmp = Float64(x1 + Float64(6.0 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * -6.0) - 12.0)) - 16.0))))); elseif (x1 <= -31000000000000.0) tmp = t_6; elseif (x1 <= 1.28e+35) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(Float64(x1 * -3.0) + Float64(2.0 * Float64(x1 * x2)))))))); elseif (x1 <= 4.5e+123) tmp = t_6; else tmp = Float64(Float64(x2 * -6.0) - Float64(Float64(x1 * Float64(Float64(Float64(x1 * Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - 3.0)) - Float64(x1 * 3.0))) + Float64(2.0 * Float64(-1.0 + Float64(3.0 * t_1)))) - -1.0)) + Float64(-2.0 * t_1))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = 3.0 - (2.0 * x2); t_2 = -1.0 - (x1 * x1); t_3 = x1 * (x1 * 3.0); t_4 = 3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0); t_5 = (t_3 + (2.0 * x2)) - x1; t_6 = x1 + (t_4 - ((((t_3 * (t_5 / t_2)) + ((((x1 * x1) * 6.0) + (((t_5 / t_0) - 3.0) * ((x1 * 2.0) * 3.0))) * t_2)) - (x1 * (x1 * x1))) - x1)); tmp = 0.0; if (x1 <= -1e+103) tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))); elseif (x1 <= -31000000000000.0) tmp = t_6; elseif (x1 <= 1.28e+35) tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))); elseif (x1 <= 4.5e+123) tmp = t_6; else tmp = (x2 * -6.0) - ((x1 * (((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (2.0 * (-1.0 + (3.0 * t_1)))) - -1.0)) + (-2.0 * t_1)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(t$95$4 - N[(N[(N[(N[(t$95$3 * N[(t$95$5 / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + N[(N[(N[(t$95$5 / t$95$0), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1e+103], N[(x1 + N[(6.0 + N[(x1 + N[(x1 * N[(N[(x1 * N[(N[(x1 * -6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision] - 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -31000000000000.0], t$95$6, If[LessEqual[x1, 1.28e+35], N[(x1 + N[(t$95$4 + N[(x1 + N[(4.0 * N[(x2 * N[(N[(x1 * -3.0), $MachinePrecision] + N[(2.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+123], t$95$6, N[(N[(x2 * -6.0), $MachinePrecision] - N[(N[(x1 * N[(N[(N[(x1 * N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] - N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(-1.0 + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := 3 - 2 \cdot x2\\
t_2 := -1 - x1 \cdot x1\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := 3 \cdot \frac{\left(t\_3 - 2 \cdot x2\right) - x1}{t\_0}\\
t_5 := \left(t\_3 + 2 \cdot x2\right) - x1\\
t_6 := x1 + \left(t\_4 - \left(\left(\left(t\_3 \cdot \frac{t\_5}{t\_2} + \left(\left(x1 \cdot x1\right) \cdot 6 + \left(\frac{t\_5}{t\_0} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot 3\right)\right) \cdot t\_2\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\
\mathbf{if}\;x1 \leq -1 \cdot 10^{+103}:\\
\;\;\;\;x1 + \left(6 + \left(x1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot -6 - 12\right) - 16\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -31000000000000:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;x1 \leq 1.28 \cdot 10^{+35}:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3 + 2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+123}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - \left(x1 \cdot \left(\left(x1 \cdot \left(3 \cdot \left(x2 \cdot -2 - 3\right) - x1 \cdot 3\right) + 2 \cdot \left(-1 + 3 \cdot t\_1\right)\right) - -1\right) + -2 \cdot t\_1\right)\\
\end{array}
\end{array}
if x1 < -1e103Initial program 2.3%
Taylor expanded in x1 around inf 2.3%
Taylor expanded in x1 around 0 20.9%
Taylor expanded in x1 around 0 88.4%
*-commutative97.7%
Simplified88.4%
Taylor expanded in x2 around 0 97.7%
if -1e103 < x1 < -3.1e13 or 1.2799999999999999e35 < x1 < 4.49999999999999983e123Initial program 99.3%
Taylor expanded in x1 around inf 96.5%
Taylor expanded in x1 around inf 87.4%
if -3.1e13 < x1 < 1.2799999999999999e35Initial program 99.5%
Taylor expanded in x1 around 0 83.7%
Taylor expanded in x2 around 0 95.7%
if 4.49999999999999983e123 < x1 Initial program 18.4%
Taylor expanded in x1 around inf 18.4%
Taylor expanded in x1 around 0 8.1%
Taylor expanded in x1 around 0 97.4%
Final simplification95.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (- 3.0 (* 2.0 x2)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (- (+ t_2 (* 2.0 x2)) x1)))
(if (<= x1 -5e+102)
(+ x1 (+ 6.0 (+ x1 (* x1 (- (* x1 (- (* x1 -6.0) 12.0)) 16.0)))))
(if (<= x1 2e+122)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
(-
x1
(-
(-
(*
t_0
(-
(* (* (* x1 2.0) (/ t_3 t_0)) (+ 3.0 (/ t_3 (- -1.0 (* x1 x1)))))
(* (* x1 x1) 6.0)))
(* 3.0 t_2))
(* x1 (* x1 x1))))))
(-
(* x2 -6.0)
(+
(*
x1
(-
(+
(* x1 (- (* 3.0 (- (* x2 -2.0) 3.0)) (* x1 3.0)))
(* 2.0 (+ -1.0 (* 3.0 t_1))))
-1.0))
(* -2.0 t_1)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = 3.0 - (2.0 * x2);
double t_2 = x1 * (x1 * 3.0);
double t_3 = (t_2 + (2.0 * x2)) - x1;
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if (x1 <= 2e+122) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 - (((t_0 * ((((x1 * 2.0) * (t_3 / t_0)) * (3.0 + (t_3 / (-1.0 - (x1 * x1))))) - ((x1 * x1) * 6.0))) - (3.0 * t_2)) - (x1 * (x1 * x1)))));
} else {
tmp = (x2 * -6.0) - ((x1 * (((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (2.0 * (-1.0 + (3.0 * t_1)))) - -1.0)) + (-2.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 = (x1 * x1) + 1.0d0
t_1 = 3.0d0 - (2.0d0 * x2)
t_2 = x1 * (x1 * 3.0d0)
t_3 = (t_2 + (2.0d0 * x2)) - x1
if (x1 <= (-5d+102)) then
tmp = x1 + (6.0d0 + (x1 + (x1 * ((x1 * ((x1 * (-6.0d0)) - 12.0d0)) - 16.0d0))))
else if (x1 <= 2d+122) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 - (((t_0 * ((((x1 * 2.0d0) * (t_3 / t_0)) * (3.0d0 + (t_3 / ((-1.0d0) - (x1 * x1))))) - ((x1 * x1) * 6.0d0))) - (3.0d0 * t_2)) - (x1 * (x1 * x1)))))
else
tmp = (x2 * (-6.0d0)) - ((x1 * (((x1 * ((3.0d0 * ((x2 * (-2.0d0)) - 3.0d0)) - (x1 * 3.0d0))) + (2.0d0 * ((-1.0d0) + (3.0d0 * t_1)))) - (-1.0d0))) + ((-2.0d0) * t_1))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = 3.0 - (2.0 * x2);
double t_2 = x1 * (x1 * 3.0);
double t_3 = (t_2 + (2.0 * x2)) - x1;
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if (x1 <= 2e+122) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 - (((t_0 * ((((x1 * 2.0) * (t_3 / t_0)) * (3.0 + (t_3 / (-1.0 - (x1 * x1))))) - ((x1 * x1) * 6.0))) - (3.0 * t_2)) - (x1 * (x1 * x1)))));
} else {
tmp = (x2 * -6.0) - ((x1 * (((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (2.0 * (-1.0 + (3.0 * t_1)))) - -1.0)) + (-2.0 * t_1));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = 3.0 - (2.0 * x2) t_2 = x1 * (x1 * 3.0) t_3 = (t_2 + (2.0 * x2)) - x1 tmp = 0 if x1 <= -5e+102: tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))) elif x1 <= 2e+122: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 - (((t_0 * ((((x1 * 2.0) * (t_3 / t_0)) * (3.0 + (t_3 / (-1.0 - (x1 * x1))))) - ((x1 * x1) * 6.0))) - (3.0 * t_2)) - (x1 * (x1 * x1))))) else: tmp = (x2 * -6.0) - ((x1 * (((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (2.0 * (-1.0 + (3.0 * t_1)))) - -1.0)) + (-2.0 * t_1)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(3.0 - Float64(2.0 * x2)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) tmp = 0.0 if (x1 <= -5e+102) tmp = Float64(x1 + Float64(6.0 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * -6.0) - 12.0)) - 16.0))))); elseif (x1 <= 2e+122) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 - Float64(Float64(Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * Float64(t_3 / t_0)) * Float64(3.0 + Float64(t_3 / Float64(-1.0 - Float64(x1 * x1))))) - Float64(Float64(x1 * x1) * 6.0))) - Float64(3.0 * t_2)) - Float64(x1 * Float64(x1 * x1)))))); else tmp = Float64(Float64(x2 * -6.0) - Float64(Float64(x1 * Float64(Float64(Float64(x1 * Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - 3.0)) - Float64(x1 * 3.0))) + Float64(2.0 * Float64(-1.0 + Float64(3.0 * t_1)))) - -1.0)) + Float64(-2.0 * t_1))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = 3.0 - (2.0 * x2); t_2 = x1 * (x1 * 3.0); t_3 = (t_2 + (2.0 * x2)) - x1; tmp = 0.0; if (x1 <= -5e+102) tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))); elseif (x1 <= 2e+122) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 - (((t_0 * ((((x1 * 2.0) * (t_3 / t_0)) * (3.0 + (t_3 / (-1.0 - (x1 * x1))))) - ((x1 * x1) * 6.0))) - (3.0 * t_2)) - (x1 * (x1 * x1))))); else tmp = (x2 * -6.0) - ((x1 * (((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (2.0 * (-1.0 + (3.0 * t_1)))) - -1.0)) + (-2.0 * t_1)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, If[LessEqual[x1, -5e+102], N[(x1 + N[(6.0 + N[(x1 + N[(x1 * N[(N[(x1 * N[(N[(x1 * -6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision] - 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+122], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 - N[(N[(N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(t$95$3 / t$95$0), $MachinePrecision]), $MachinePrecision] * N[(3.0 + N[(t$95$3 / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * t$95$2), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - N[(N[(x1 * N[(N[(N[(x1 * N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] - N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(-1.0 + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := 3 - 2 \cdot x2\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \left(t\_2 + 2 \cdot x2\right) - x1\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(6 + \left(x1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot -6 - 12\right) - 16\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+122}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_0} + \left(x1 - \left(\left(t\_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{t\_3}{t\_0}\right) \cdot \left(3 + \frac{t\_3}{-1 - x1 \cdot x1}\right) - \left(x1 \cdot x1\right) \cdot 6\right) - 3 \cdot t\_2\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - \left(x1 \cdot \left(\left(x1 \cdot \left(3 \cdot \left(x2 \cdot -2 - 3\right) - x1 \cdot 3\right) + 2 \cdot \left(-1 + 3 \cdot t\_1\right)\right) - -1\right) + -2 \cdot t\_1\right)\\
\end{array}
\end{array}
if x1 < -5e102Initial program 2.3%
Taylor expanded in x1 around inf 2.3%
Taylor expanded in x1 around 0 20.9%
Taylor expanded in x1 around 0 88.4%
*-commutative97.7%
Simplified88.4%
Taylor expanded in x2 around 0 97.7%
if -5e102 < x1 < 2.00000000000000003e122Initial program 99.4%
Taylor expanded in x1 around inf 98.3%
Taylor expanded in x1 around inf 98.3%
if 2.00000000000000003e122 < x1 Initial program 18.4%
Taylor expanded in x1 around inf 18.4%
Taylor expanded in x1 around 0 8.1%
Taylor expanded in x1 around 0 97.4%
Final simplification98.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- 3.0 (* 2.0 x2))))
(if (<= x1 -1.85e+94)
(+ x1 (+ 6.0 (+ x1 (* x1 (- (* x1 (- (* x1 -6.0) 12.0)) 16.0)))))
(if (<= x1 1.1e+122)
(-
x1
(-
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (- -1.0 (* x1 x1))))
(+ x1 (* 4.0 (* x2 (+ (* x1 -3.0) (* 2.0 (* x1 x2))))))))
(-
(* x2 -6.0)
(+
(*
x1
(-
(+
(* x1 (- (* 3.0 (- (* x2 -2.0) 3.0)) (* x1 3.0)))
(* 2.0 (+ -1.0 (* 3.0 t_0))))
-1.0))
(* -2.0 t_0)))))))
double code(double x1, double x2) {
double t_0 = 3.0 - (2.0 * x2);
double tmp;
if (x1 <= -1.85e+94) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if (x1 <= 1.1e+122) {
tmp = x1 - ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / (-1.0 - (x1 * x1)))) - (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else {
tmp = (x2 * -6.0) - ((x1 * (((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (2.0 * (-1.0 + (3.0 * t_0)))) - -1.0)) + (-2.0 * t_0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = 3.0d0 - (2.0d0 * x2)
if (x1 <= (-1.85d+94)) then
tmp = x1 + (6.0d0 + (x1 + (x1 * ((x1 * ((x1 * (-6.0d0)) - 12.0d0)) - 16.0d0))))
else if (x1 <= 1.1d+122) then
tmp = x1 - ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((-1.0d0) - (x1 * x1)))) - (x1 + (4.0d0 * (x2 * ((x1 * (-3.0d0)) + (2.0d0 * (x1 * x2)))))))
else
tmp = (x2 * (-6.0d0)) - ((x1 * (((x1 * ((3.0d0 * ((x2 * (-2.0d0)) - 3.0d0)) - (x1 * 3.0d0))) + (2.0d0 * ((-1.0d0) + (3.0d0 * t_0)))) - (-1.0d0))) + ((-2.0d0) * t_0))
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 <= -1.85e+94) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if (x1 <= 1.1e+122) {
tmp = x1 - ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / (-1.0 - (x1 * x1)))) - (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else {
tmp = (x2 * -6.0) - ((x1 * (((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (2.0 * (-1.0 + (3.0 * t_0)))) - -1.0)) + (-2.0 * t_0));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 - (2.0 * x2) tmp = 0 if x1 <= -1.85e+94: tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))) elif x1 <= 1.1e+122: tmp = x1 - ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / (-1.0 - (x1 * x1)))) - (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))) else: tmp = (x2 * -6.0) - ((x1 * (((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (2.0 * (-1.0 + (3.0 * t_0)))) - -1.0)) + (-2.0 * t_0)) return tmp
function code(x1, x2) t_0 = Float64(3.0 - Float64(2.0 * x2)) tmp = 0.0 if (x1 <= -1.85e+94) tmp = Float64(x1 + Float64(6.0 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * -6.0) - 12.0)) - 16.0))))); elseif (x1 <= 1.1e+122) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(-1.0 - Float64(x1 * x1)))) - Float64(x1 + Float64(4.0 * Float64(x2 * Float64(Float64(x1 * -3.0) + Float64(2.0 * Float64(x1 * x2)))))))); else tmp = Float64(Float64(x2 * -6.0) - Float64(Float64(x1 * Float64(Float64(Float64(x1 * Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - 3.0)) - Float64(x1 * 3.0))) + Float64(2.0 * Float64(-1.0 + Float64(3.0 * t_0)))) - -1.0)) + Float64(-2.0 * t_0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 - (2.0 * x2); tmp = 0.0; if (x1 <= -1.85e+94) tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))); elseif (x1 <= 1.1e+122) tmp = x1 - ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / (-1.0 - (x1 * x1)))) - (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))); else tmp = (x2 * -6.0) - ((x1 * (((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (2.0 * (-1.0 + (3.0 * t_0)))) - -1.0)) + (-2.0 * t_0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.85e+94], N[(x1 + N[(6.0 + N[(x1 + N[(x1 * N[(N[(x1 * N[(N[(x1 * -6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision] - 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.1e+122], N[(x1 - N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 + N[(4.0 * N[(x2 * N[(N[(x1 * -3.0), $MachinePrecision] + N[(2.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - N[(N[(x1 * N[(N[(N[(x1 * N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] - N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(-1.0 + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 - 2 \cdot x2\\
\mathbf{if}\;x1 \leq -1.85 \cdot 10^{+94}:\\
\;\;\;\;x1 + \left(6 + \left(x1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot -6 - 12\right) - 16\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.1 \cdot 10^{+122}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1} - \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3 + 2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - \left(x1 \cdot \left(\left(x1 \cdot \left(3 \cdot \left(x2 \cdot -2 - 3\right) - x1 \cdot 3\right) + 2 \cdot \left(-1 + 3 \cdot t\_0\right)\right) - -1\right) + -2 \cdot t\_0\right)\\
\end{array}
\end{array}
if x1 < -1.8500000000000001e94Initial program 8.7%
Taylor expanded in x1 around inf 8.7%
Taylor expanded in x1 around 0 20.2%
Taylor expanded in x1 around 0 83.2%
*-commutative97.8%
Simplified83.2%
Taylor expanded in x2 around 0 91.9%
if -1.8500000000000001e94 < x1 < 1.1e122Initial program 99.4%
Taylor expanded in x1 around 0 73.4%
Taylor expanded in x2 around 0 83.3%
if 1.1e122 < x1 Initial program 18.4%
Taylor expanded in x1 around inf 18.4%
Taylor expanded in x1 around 0 8.1%
Taylor expanded in x1 around 0 97.4%
Final simplification86.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 4.0 (* x1 (* x2 (- 3.0 (* 2.0 x2)))))))
(if (<= x1 -1.46e+96)
(+ x1 (+ 6.0 (+ x1 (* x1 (- (* x1 (- (* x1 -6.0) 12.0)) 16.0)))))
(if (<= x1 -2.05e-196)
(-
x1
(+
(- t_0 x1)
(* 3.0 (- (* x1 (- (* x1 (- (* x2 -2.0) 3.0)) -1.0)) (* x2 -2.0)))))
(if (<= x1 5e-265)
(+
x1
(+
(*
3.0
(/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (* x1 (* x2 -3.0))))))
(+
x1
(-
(- x1 t_0)
(*
3.0
(-
(* x1 (- (* x1 (- (* x2 -2.0) (+ x1 3.0))) -1.0))
(* x2 -2.0))))))))))
double code(double x1, double x2) {
double t_0 = 4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))));
double tmp;
if (x1 <= -1.46e+96) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if (x1 <= -2.05e-196) {
tmp = x1 - ((t_0 - x1) + (3.0 * ((x1 * ((x1 * ((x2 * -2.0) - 3.0)) - -1.0)) - (x2 * -2.0))));
} else if (x1 <= 5e-265) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (x2 * -3.0)))));
} else {
tmp = x1 + ((x1 - t_0) - (3.0 * ((x1 * ((x1 * ((x2 * -2.0) - (x1 + 3.0))) - -1.0)) - (x2 * -2.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = 4.0d0 * (x1 * (x2 * (3.0d0 - (2.0d0 * x2))))
if (x1 <= (-1.46d+96)) then
tmp = x1 + (6.0d0 + (x1 + (x1 * ((x1 * ((x1 * (-6.0d0)) - 12.0d0)) - 16.0d0))))
else if (x1 <= (-2.05d-196)) then
tmp = x1 - ((t_0 - x1) + (3.0d0 * ((x1 * ((x1 * ((x2 * (-2.0d0)) - 3.0d0)) - (-1.0d0))) - (x2 * (-2.0d0)))))
else if (x1 <= 5d-265) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))))
else
tmp = x1 + ((x1 - t_0) - (3.0d0 * ((x1 * ((x1 * ((x2 * (-2.0d0)) - (x1 + 3.0d0))) - (-1.0d0))) - (x2 * (-2.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))));
double tmp;
if (x1 <= -1.46e+96) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if (x1 <= -2.05e-196) {
tmp = x1 - ((t_0 - x1) + (3.0 * ((x1 * ((x1 * ((x2 * -2.0) - 3.0)) - -1.0)) - (x2 * -2.0))));
} else if (x1 <= 5e-265) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (x2 * -3.0)))));
} else {
tmp = x1 + ((x1 - t_0) - (3.0 * ((x1 * ((x1 * ((x2 * -2.0) - (x1 + 3.0))) - -1.0)) - (x2 * -2.0))));
}
return tmp;
}
def code(x1, x2): t_0 = 4.0 * (x1 * (x2 * (3.0 - (2.0 * x2)))) tmp = 0 if x1 <= -1.46e+96: tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))) elif x1 <= -2.05e-196: tmp = x1 - ((t_0 - x1) + (3.0 * ((x1 * ((x1 * ((x2 * -2.0) - 3.0)) - -1.0)) - (x2 * -2.0)))) elif x1 <= 5e-265: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (x2 * -3.0))))) else: tmp = x1 + ((x1 - t_0) - (3.0 * ((x1 * ((x1 * ((x2 * -2.0) - (x1 + 3.0))) - -1.0)) - (x2 * -2.0)))) return tmp
function code(x1, x2) t_0 = Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))) tmp = 0.0 if (x1 <= -1.46e+96) tmp = Float64(x1 + Float64(6.0 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * -6.0) - 12.0)) - 16.0))))); elseif (x1 <= -2.05e-196) tmp = Float64(x1 - Float64(Float64(t_0 - x1) + Float64(3.0 * Float64(Float64(x1 * Float64(Float64(x1 * Float64(Float64(x2 * -2.0) - 3.0)) - -1.0)) - Float64(x2 * -2.0))))); elseif (x1 <= 5e-265) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))))); else tmp = Float64(x1 + Float64(Float64(x1 - t_0) - Float64(3.0 * Float64(Float64(x1 * Float64(Float64(x1 * Float64(Float64(x2 * -2.0) - Float64(x1 + 3.0))) - -1.0)) - Float64(x2 * -2.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 4.0 * (x1 * (x2 * (3.0 - (2.0 * x2)))); tmp = 0.0; if (x1 <= -1.46e+96) tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))); elseif (x1 <= -2.05e-196) tmp = x1 - ((t_0 - x1) + (3.0 * ((x1 * ((x1 * ((x2 * -2.0) - 3.0)) - -1.0)) - (x2 * -2.0)))); elseif (x1 <= 5e-265) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (x2 * -3.0))))); else tmp = x1 + ((x1 - t_0) - (3.0 * ((x1 * ((x1 * ((x2 * -2.0) - (x1 + 3.0))) - -1.0)) - (x2 * -2.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.46e+96], N[(x1 + N[(6.0 + N[(x1 + N[(x1 * N[(N[(x1 * N[(N[(x1 * -6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision] - 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2.05e-196], N[(x1 - N[(N[(t$95$0 - x1), $MachinePrecision] + N[(3.0 * N[(N[(x1 * N[(N[(x1 * N[(N[(x2 * -2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e-265], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 - t$95$0), $MachinePrecision] - N[(3.0 * N[(N[(x1 * N[(N[(x1 * N[(N[(x2 * -2.0), $MachinePrecision] - N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\
\mathbf{if}\;x1 \leq -1.46 \cdot 10^{+96}:\\
\;\;\;\;x1 + \left(6 + \left(x1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot -6 - 12\right) - 16\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -2.05 \cdot 10^{-196}:\\
\;\;\;\;x1 - \left(\left(t\_0 - x1\right) + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x2 \cdot -2 - 3\right) - -1\right) - x2 \cdot -2\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{-265}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - t\_0\right) - 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x2 \cdot -2 - \left(x1 + 3\right)\right) - -1\right) - x2 \cdot -2\right)\right)\\
\end{array}
\end{array}
if x1 < -1.4600000000000001e96Initial program 8.7%
Taylor expanded in x1 around inf 8.7%
Taylor expanded in x1 around 0 20.2%
Taylor expanded in x1 around 0 83.2%
*-commutative97.8%
Simplified83.2%
Taylor expanded in x2 around 0 91.9%
if -1.4600000000000001e96 < x1 < -2.05000000000000011e-196Initial program 99.4%
Taylor expanded in x1 around 0 67.0%
Taylor expanded in x1 around 0 68.1%
if -2.05000000000000011e-196 < x1 < 5.0000000000000001e-265Initial program 99.7%
Taylor expanded in x1 around 0 76.1%
Taylor expanded in x2 around 0 96.9%
*-commutative96.9%
Simplified96.9%
if 5.0000000000000001e-265 < x1 Initial program 71.7%
Taylor expanded in x1 around 0 53.3%
Taylor expanded in x1 around 0 82.1%
Final simplification82.2%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.7e+95)
(+ x1 (+ 6.0 (+ x1 (* x1 (- (* x1 (- (* x1 -6.0) 12.0)) 16.0)))))
(if (or (<= x1 -3.2e-198) (not (<= x1 5.6e-264)))
(-
x1
(+
(- (* 4.0 (* x1 (* x2 (- 3.0 (* 2.0 x2))))) x1)
(* 3.0 (- (* x1 (- (* x1 (- (* x2 -2.0) 3.0)) -1.0)) (* x2 -2.0)))))
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (* x1 (* x2 -3.0)))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.7e+95) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if ((x1 <= -3.2e-198) || !(x1 <= 5.6e-264)) {
tmp = x1 - (((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 * ((x1 * ((x2 * -2.0) - 3.0)) - -1.0)) - (x2 * -2.0))));
} else {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (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 <= (-2.7d+95)) then
tmp = x1 + (6.0d0 + (x1 + (x1 * ((x1 * ((x1 * (-6.0d0)) - 12.0d0)) - 16.0d0))))
else if ((x1 <= (-3.2d-198)) .or. (.not. (x1 <= 5.6d-264))) then
tmp = x1 - (((4.0d0 * (x1 * (x2 * (3.0d0 - (2.0d0 * x2))))) - x1) + (3.0d0 * ((x1 * ((x1 * ((x2 * (-2.0d0)) - 3.0d0)) - (-1.0d0))) - (x2 * (-2.0d0)))))
else
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.7e+95) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if ((x1 <= -3.2e-198) || !(x1 <= 5.6e-264)) {
tmp = x1 - (((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 * ((x1 * ((x2 * -2.0) - 3.0)) - -1.0)) - (x2 * -2.0))));
} else {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (x2 * -3.0)))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.7e+95: tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))) elif (x1 <= -3.2e-198) or not (x1 <= 5.6e-264): tmp = x1 - (((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 * ((x1 * ((x2 * -2.0) - 3.0)) - -1.0)) - (x2 * -2.0)))) else: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (x2 * -3.0))))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.7e+95) tmp = Float64(x1 + Float64(6.0 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * -6.0) - 12.0)) - 16.0))))); elseif ((x1 <= -3.2e-198) || !(x1 <= 5.6e-264)) tmp = Float64(x1 - Float64(Float64(Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))) - x1) + Float64(3.0 * Float64(Float64(x1 * Float64(Float64(x1 * Float64(Float64(x2 * -2.0) - 3.0)) - -1.0)) - Float64(x2 * -2.0))))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.7e+95) tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))); elseif ((x1 <= -3.2e-198) || ~((x1 <= 5.6e-264))) tmp = x1 - (((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 * ((x1 * ((x2 * -2.0) - 3.0)) - -1.0)) - (x2 * -2.0)))); else tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (x2 * -3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.7e+95], N[(x1 + N[(6.0 + N[(x1 + N[(x1 * N[(N[(x1 * N[(N[(x1 * -6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision] - 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -3.2e-198], N[Not[LessEqual[x1, 5.6e-264]], $MachinePrecision]], N[(x1 - N[(N[(N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] + N[(3.0 * N[(N[(x1 * N[(N[(x1 * N[(N[(x2 * -2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.7 \cdot 10^{+95}:\\
\;\;\;\;x1 + \left(6 + \left(x1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot -6 - 12\right) - 16\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -3.2 \cdot 10^{-198} \lor \neg \left(x1 \leq 5.6 \cdot 10^{-264}\right):\\
\;\;\;\;x1 - \left(\left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right) + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x2 \cdot -2 - 3\right) - -1\right) - x2 \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.7e95Initial program 8.7%
Taylor expanded in x1 around inf 8.7%
Taylor expanded in x1 around 0 20.2%
Taylor expanded in x1 around 0 83.2%
*-commutative97.8%
Simplified83.2%
Taylor expanded in x2 around 0 91.9%
if -2.7e95 < x1 < -3.19999999999999994e-198 or 5.60000000000000024e-264 < x1 Initial program 82.0%
Taylor expanded in x1 around 0 58.4%
Taylor expanded in x1 around 0 74.1%
if -3.19999999999999994e-198 < x1 < 5.60000000000000024e-264Initial program 99.7%
Taylor expanded in x1 around 0 76.1%
Taylor expanded in x2 around 0 96.9%
*-commutative96.9%
Simplified96.9%
Final simplification80.2%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -3e+94)
(+ x1 (+ 6.0 (+ x1 (* x1 (- (* x1 (- (* x1 -6.0) 12.0)) 16.0)))))
(if (<= x1 1.1e+122)
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (* x2 (+ (* x1 -3.0) (* 2.0 (* x1 x2))))))))
(+
x1
(-
(- x1 (* 4.0 (* x1 (* x2 (- 3.0 (* 2.0 x2))))))
(*
3.0
(- (* x1 (- (* x1 (- (* x2 -2.0) (+ x1 3.0))) -1.0)) (* x2 -2.0))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3e+94) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if (x1 <= 1.1e+122) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else {
tmp = x1 + ((x1 - (4.0 * (x1 * (x2 * (3.0 - (2.0 * x2)))))) - (3.0 * ((x1 * ((x1 * ((x2 * -2.0) - (x1 + 3.0))) - -1.0)) - (x2 * -2.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-3d+94)) then
tmp = x1 + (6.0d0 + (x1 + (x1 * ((x1 * ((x1 * (-6.0d0)) - 12.0d0)) - 16.0d0))))
else if (x1 <= 1.1d+122) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (x2 * ((x1 * (-3.0d0)) + (2.0d0 * (x1 * x2)))))))
else
tmp = x1 + ((x1 - (4.0d0 * (x1 * (x2 * (3.0d0 - (2.0d0 * x2)))))) - (3.0d0 * ((x1 * ((x1 * ((x2 * (-2.0d0)) - (x1 + 3.0d0))) - (-1.0d0))) - (x2 * (-2.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -3e+94) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if (x1 <= 1.1e+122) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else {
tmp = x1 + ((x1 - (4.0 * (x1 * (x2 * (3.0 - (2.0 * x2)))))) - (3.0 * ((x1 * ((x1 * ((x2 * -2.0) - (x1 + 3.0))) - -1.0)) - (x2 * -2.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3e+94: tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))) elif x1 <= 1.1e+122: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))) else: tmp = x1 + ((x1 - (4.0 * (x1 * (x2 * (3.0 - (2.0 * x2)))))) - (3.0 * ((x1 * ((x1 * ((x2 * -2.0) - (x1 + 3.0))) - -1.0)) - (x2 * -2.0)))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3e+94) tmp = Float64(x1 + Float64(6.0 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * -6.0) - 12.0)) - 16.0))))); elseif (x1 <= 1.1e+122) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(Float64(x1 * -3.0) + Float64(2.0 * Float64(x1 * x2)))))))); else tmp = Float64(x1 + Float64(Float64(x1 - Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))))) - Float64(3.0 * Float64(Float64(x1 * Float64(Float64(x1 * Float64(Float64(x2 * -2.0) - Float64(x1 + 3.0))) - -1.0)) - Float64(x2 * -2.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -3e+94) tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))); elseif (x1 <= 1.1e+122) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))); else tmp = x1 + ((x1 - (4.0 * (x1 * (x2 * (3.0 - (2.0 * x2)))))) - (3.0 * ((x1 * ((x1 * ((x2 * -2.0) - (x1 + 3.0))) - -1.0)) - (x2 * -2.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3e+94], N[(x1 + N[(6.0 + N[(x1 + N[(x1 * N[(N[(x1 * N[(N[(x1 * -6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision] - 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.1e+122], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(N[(x1 * -3.0), $MachinePrecision] + N[(2.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 - N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * N[(N[(x1 * N[(N[(x1 * N[(N[(x2 * -2.0), $MachinePrecision] - N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3 \cdot 10^{+94}:\\
\;\;\;\;x1 + \left(6 + \left(x1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot -6 - 12\right) - 16\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.1 \cdot 10^{+122}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3 + 2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right) - 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x2 \cdot -2 - \left(x1 + 3\right)\right) - -1\right) - x2 \cdot -2\right)\right)\\
\end{array}
\end{array}
if x1 < -3.0000000000000001e94Initial program 8.7%
Taylor expanded in x1 around inf 8.7%
Taylor expanded in x1 around 0 20.2%
Taylor expanded in x1 around 0 83.2%
*-commutative97.8%
Simplified83.2%
Taylor expanded in x2 around 0 91.9%
if -3.0000000000000001e94 < x1 < 1.1e122Initial program 99.4%
Taylor expanded in x1 around 0 73.4%
Taylor expanded in x2 around 0 83.3%
if 1.1e122 < x1 Initial program 18.4%
Taylor expanded in x1 around 0 6.0%
Taylor expanded in x1 around 0 94.7%
Final simplification86.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- 3.0 (* 2.0 x2)))))
(if (<= x1 -1.46e+96)
(+ x1 (+ 6.0 (+ x1 (* x1 (- (* x1 (- (* x1 -6.0) 12.0)) 16.0)))))
(if (<= x1 -1e-192)
(+ x1 (- (- x1 (* 4.0 (* x1 t_0))) (* 3.0 (* x2 (+ 2.0 (/ x1 x2))))))
(if (<= x1 2.35e-262)
(+
x1
(+
(*
3.0
(/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (* x1 (* x2 -3.0))))))
(+ x1 (- (* x2 -6.0) (* x1 (+ 2.0 (* 4.0 t_0))))))))))
double code(double x1, double x2) {
double t_0 = x2 * (3.0 - (2.0 * x2));
double tmp;
if (x1 <= -1.46e+96) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if (x1 <= -1e-192) {
tmp = x1 + ((x1 - (4.0 * (x1 * t_0))) - (3.0 * (x2 * (2.0 + (x1 / x2)))));
} else if (x1 <= 2.35e-262) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (x2 * -3.0)))));
} else {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * t_0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x2 * (3.0d0 - (2.0d0 * x2))
if (x1 <= (-1.46d+96)) then
tmp = x1 + (6.0d0 + (x1 + (x1 * ((x1 * ((x1 * (-6.0d0)) - 12.0d0)) - 16.0d0))))
else if (x1 <= (-1d-192)) then
tmp = x1 + ((x1 - (4.0d0 * (x1 * t_0))) - (3.0d0 * (x2 * (2.0d0 + (x1 / x2)))))
else if (x1 <= 2.35d-262) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))))
else
tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 + (4.0d0 * t_0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 * (3.0 - (2.0 * x2));
double tmp;
if (x1 <= -1.46e+96) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if (x1 <= -1e-192) {
tmp = x1 + ((x1 - (4.0 * (x1 * t_0))) - (3.0 * (x2 * (2.0 + (x1 / x2)))));
} else if (x1 <= 2.35e-262) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (x2 * -3.0)))));
} else {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * t_0))));
}
return tmp;
}
def code(x1, x2): t_0 = x2 * (3.0 - (2.0 * x2)) tmp = 0 if x1 <= -1.46e+96: tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))) elif x1 <= -1e-192: tmp = x1 + ((x1 - (4.0 * (x1 * t_0))) - (3.0 * (x2 * (2.0 + (x1 / x2))))) elif x1 <= 2.35e-262: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (x2 * -3.0))))) else: tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * t_0)))) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2))) tmp = 0.0 if (x1 <= -1.46e+96) tmp = Float64(x1 + Float64(6.0 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * -6.0) - 12.0)) - 16.0))))); elseif (x1 <= -1e-192) tmp = Float64(x1 + Float64(Float64(x1 - Float64(4.0 * Float64(x1 * t_0))) - Float64(3.0 * Float64(x2 * Float64(2.0 + Float64(x1 / x2)))))); elseif (x1 <= 2.35e-262) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 + Float64(4.0 * t_0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * (3.0 - (2.0 * x2)); tmp = 0.0; if (x1 <= -1.46e+96) tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))); elseif (x1 <= -1e-192) tmp = x1 + ((x1 - (4.0 * (x1 * t_0))) - (3.0 * (x2 * (2.0 + (x1 / x2))))); elseif (x1 <= 2.35e-262) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (x2 * -3.0))))); else tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * t_0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.46e+96], N[(x1 + N[(6.0 + N[(x1 + N[(x1 * N[(N[(x1 * N[(N[(x1 * -6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision] - 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1e-192], N[(x1 + N[(N[(x1 - N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * N[(x2 * N[(2.0 + N[(x1 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.35e-262], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 + N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
\mathbf{if}\;x1 \leq -1.46 \cdot 10^{+96}:\\
\;\;\;\;x1 + \left(6 + \left(x1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot -6 - 12\right) - 16\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -1 \cdot 10^{-192}:\\
\;\;\;\;x1 + \left(\left(x1 - 4 \cdot \left(x1 \cdot t\_0\right)\right) - 3 \cdot \left(x2 \cdot \left(2 + \frac{x1}{x2}\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2.35 \cdot 10^{-262}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + 4 \cdot t\_0\right)\right)\\
\end{array}
\end{array}
if x1 < -1.4600000000000001e96Initial program 8.7%
Taylor expanded in x1 around inf 8.7%
Taylor expanded in x1 around 0 20.2%
Taylor expanded in x1 around 0 83.2%
*-commutative97.8%
Simplified83.2%
Taylor expanded in x2 around 0 91.9%
if -1.4600000000000001e96 < x1 < -1.0000000000000001e-192Initial program 99.4%
Taylor expanded in x2 around inf 99.4%
+-commutative99.4%
associate--r+99.4%
associate-*r/99.4%
div-sub99.4%
fma-neg99.4%
+-commutative99.4%
unpow299.4%
fma-undefine99.4%
associate-*r/99.4%
metadata-eval99.4%
+-commutative99.4%
unpow299.4%
fma-undefine99.4%
Simplified99.4%
Taylor expanded in x1 around 0 98.0%
associate-*r/98.0%
neg-mul-198.0%
Simplified98.0%
Taylor expanded in x1 around 0 66.9%
Taylor expanded in x1 around 0 66.9%
if -1.0000000000000001e-192 < x1 < 2.3499999999999999e-262Initial program 99.6%
Taylor expanded in x1 around 0 77.4%
Taylor expanded in x2 around 0 97.0%
*-commutative97.0%
Simplified97.0%
if 2.3499999999999999e-262 < x1 Initial program 71.7%
Taylor expanded in x2 around inf 71.6%
+-commutative71.6%
associate--r+71.6%
associate-*r/71.6%
div-sub71.6%
fma-neg71.6%
+-commutative71.6%
unpow271.6%
fma-undefine71.6%
associate-*r/71.6%
metadata-eval71.6%
+-commutative71.6%
unpow271.6%
fma-undefine71.6%
Simplified71.6%
Taylor expanded in x1 around 0 71.1%
associate-*r/71.1%
neg-mul-171.1%
Simplified71.1%
Taylor expanded in x1 around 0 59.2%
Taylor expanded in x1 around 0 59.4%
Final simplification72.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- 3.0 (* 2.0 x2)))))
(if (<= x1 -5.1e+95)
(+ x1 (+ 6.0 (+ x1 (* x1 (- (* x1 (- (* x1 -6.0) 12.0)) 16.0)))))
(if (<= x1 -5.1e-200)
(+ x1 (- (- x1 (* 4.0 (* x1 t_0))) (* 3.0 (* x2 (+ 2.0 (/ x1 x2))))))
(if (<= x1 -3.6e-291)
(+ x1 (+ x1 (* x2 (- (+ (* x1 -12.0) (* (* x1 x2) 8.0)) 6.0))))
(+ x1 (- (* x2 -6.0) (* x1 (+ 2.0 (* 4.0 t_0))))))))))
double code(double x1, double x2) {
double t_0 = x2 * (3.0 - (2.0 * x2));
double tmp;
if (x1 <= -5.1e+95) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if (x1 <= -5.1e-200) {
tmp = x1 + ((x1 - (4.0 * (x1 * t_0))) - (3.0 * (x2 * (2.0 + (x1 / x2)))));
} else if (x1 <= -3.6e-291) {
tmp = x1 + (x1 + (x2 * (((x1 * -12.0) + ((x1 * x2) * 8.0)) - 6.0)));
} else {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * t_0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x2 * (3.0d0 - (2.0d0 * x2))
if (x1 <= (-5.1d+95)) then
tmp = x1 + (6.0d0 + (x1 + (x1 * ((x1 * ((x1 * (-6.0d0)) - 12.0d0)) - 16.0d0))))
else if (x1 <= (-5.1d-200)) then
tmp = x1 + ((x1 - (4.0d0 * (x1 * t_0))) - (3.0d0 * (x2 * (2.0d0 + (x1 / x2)))))
else if (x1 <= (-3.6d-291)) then
tmp = x1 + (x1 + (x2 * (((x1 * (-12.0d0)) + ((x1 * x2) * 8.0d0)) - 6.0d0)))
else
tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 + (4.0d0 * t_0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 * (3.0 - (2.0 * x2));
double tmp;
if (x1 <= -5.1e+95) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if (x1 <= -5.1e-200) {
tmp = x1 + ((x1 - (4.0 * (x1 * t_0))) - (3.0 * (x2 * (2.0 + (x1 / x2)))));
} else if (x1 <= -3.6e-291) {
tmp = x1 + (x1 + (x2 * (((x1 * -12.0) + ((x1 * x2) * 8.0)) - 6.0)));
} else {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * t_0))));
}
return tmp;
}
def code(x1, x2): t_0 = x2 * (3.0 - (2.0 * x2)) tmp = 0 if x1 <= -5.1e+95: tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))) elif x1 <= -5.1e-200: tmp = x1 + ((x1 - (4.0 * (x1 * t_0))) - (3.0 * (x2 * (2.0 + (x1 / x2))))) elif x1 <= -3.6e-291: tmp = x1 + (x1 + (x2 * (((x1 * -12.0) + ((x1 * x2) * 8.0)) - 6.0))) else: tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * t_0)))) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2))) tmp = 0.0 if (x1 <= -5.1e+95) tmp = Float64(x1 + Float64(6.0 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * -6.0) - 12.0)) - 16.0))))); elseif (x1 <= -5.1e-200) tmp = Float64(x1 + Float64(Float64(x1 - Float64(4.0 * Float64(x1 * t_0))) - Float64(3.0 * Float64(x2 * Float64(2.0 + Float64(x1 / x2)))))); elseif (x1 <= -3.6e-291) tmp = Float64(x1 + Float64(x1 + Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(Float64(x1 * x2) * 8.0)) - 6.0)))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 + Float64(4.0 * t_0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * (3.0 - (2.0 * x2)); tmp = 0.0; if (x1 <= -5.1e+95) tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))); elseif (x1 <= -5.1e-200) tmp = x1 + ((x1 - (4.0 * (x1 * t_0))) - (3.0 * (x2 * (2.0 + (x1 / x2))))); elseif (x1 <= -3.6e-291) tmp = x1 + (x1 + (x2 * (((x1 * -12.0) + ((x1 * x2) * 8.0)) - 6.0))); else tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * t_0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.1e+95], N[(x1 + N[(6.0 + N[(x1 + N[(x1 * N[(N[(x1 * N[(N[(x1 * -6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision] - 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5.1e-200], N[(x1 + N[(N[(x1 - N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * N[(x2 * N[(2.0 + N[(x1 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3.6e-291], N[(x1 + N[(x1 + N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(N[(x1 * x2), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 + N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
\mathbf{if}\;x1 \leq -5.1 \cdot 10^{+95}:\\
\;\;\;\;x1 + \left(6 + \left(x1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot -6 - 12\right) - 16\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -5.1 \cdot 10^{-200}:\\
\;\;\;\;x1 + \left(\left(x1 - 4 \cdot \left(x1 \cdot t\_0\right)\right) - 3 \cdot \left(x2 \cdot \left(2 + \frac{x1}{x2}\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -3.6 \cdot 10^{-291}:\\
\;\;\;\;x1 + \left(x1 + x2 \cdot \left(\left(x1 \cdot -12 + \left(x1 \cdot x2\right) \cdot 8\right) - 6\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + 4 \cdot t\_0\right)\right)\\
\end{array}
\end{array}
if x1 < -5.10000000000000003e95Initial program 8.7%
Taylor expanded in x1 around inf 8.7%
Taylor expanded in x1 around 0 20.2%
Taylor expanded in x1 around 0 83.2%
*-commutative97.8%
Simplified83.2%
Taylor expanded in x2 around 0 91.9%
if -5.10000000000000003e95 < x1 < -5.0999999999999999e-200Initial program 99.4%
Taylor expanded in x2 around inf 99.4%
+-commutative99.4%
associate--r+99.4%
associate-*r/99.4%
div-sub99.4%
fma-neg99.4%
+-commutative99.4%
unpow299.4%
fma-undefine99.4%
associate-*r/99.4%
metadata-eval99.4%
+-commutative99.4%
unpow299.4%
fma-undefine99.4%
Simplified99.4%
Taylor expanded in x1 around 0 98.1%
associate-*r/98.1%
neg-mul-198.1%
Simplified98.1%
Taylor expanded in x1 around 0 68.4%
Taylor expanded in x1 around 0 68.4%
if -5.0999999999999999e-200 < x1 < -3.59999999999999965e-291Initial program 99.9%
Taylor expanded in x1 around 0 67.2%
Taylor expanded in x1 around 0 64.2%
*-commutative0.0%
Simplified64.2%
Taylor expanded in x2 around 0 96.8%
if -3.59999999999999965e-291 < x1 Initial program 74.1%
Taylor expanded in x2 around inf 74.1%
+-commutative74.1%
associate--r+74.1%
associate-*r/74.1%
div-sub74.1%
fma-neg74.1%
+-commutative74.1%
unpow274.1%
fma-undefine74.1%
associate-*r/74.1%
metadata-eval74.1%
+-commutative74.1%
unpow274.1%
fma-undefine74.1%
Simplified74.1%
Taylor expanded in x1 around 0 73.6%
associate-*r/73.6%
neg-mul-173.6%
Simplified73.6%
Taylor expanded in x1 around 0 62.1%
Taylor expanded in x1 around 0 62.2%
Final simplification72.0%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -9.5e+95)
(+ x1 (+ 6.0 (+ x1 (* x1 (- (* x1 (- (* x1 -6.0) 12.0)) 16.0)))))
(if (or (<= x1 -5.9e-200) (not (<= x1 -3.6e-291)))
(+ x1 (- (* x2 -6.0) (* x1 (+ 2.0 (* 4.0 (* x2 (- 3.0 (* 2.0 x2))))))))
(+ x1 (+ x1 (* x2 (- (+ (* x1 -12.0) (* (* x1 x2) 8.0)) 6.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -9.5e+95) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if ((x1 <= -5.9e-200) || !(x1 <= -3.6e-291)) {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))));
} else {
tmp = x1 + (x1 + (x2 * (((x1 * -12.0) + ((x1 * x2) * 8.0)) - 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 <= (-9.5d+95)) then
tmp = x1 + (6.0d0 + (x1 + (x1 * ((x1 * ((x1 * (-6.0d0)) - 12.0d0)) - 16.0d0))))
else if ((x1 <= (-5.9d-200)) .or. (.not. (x1 <= (-3.6d-291)))) then
tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 + (4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2)))))))
else
tmp = x1 + (x1 + (x2 * (((x1 * (-12.0d0)) + ((x1 * x2) * 8.0d0)) - 6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -9.5e+95) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if ((x1 <= -5.9e-200) || !(x1 <= -3.6e-291)) {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))));
} else {
tmp = x1 + (x1 + (x2 * (((x1 * -12.0) + ((x1 * x2) * 8.0)) - 6.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -9.5e+95: tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))) elif (x1 <= -5.9e-200) or not (x1 <= -3.6e-291): tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2))))))) else: tmp = x1 + (x1 + (x2 * (((x1 * -12.0) + ((x1 * x2) * 8.0)) - 6.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -9.5e+95) tmp = Float64(x1 + Float64(6.0 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * -6.0) - 12.0)) - 16.0))))); elseif ((x1 <= -5.9e-200) || !(x1 <= -3.6e-291)) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))))))); else tmp = Float64(x1 + Float64(x1 + Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(Float64(x1 * x2) * 8.0)) - 6.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -9.5e+95) tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))); elseif ((x1 <= -5.9e-200) || ~((x1 <= -3.6e-291))) tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2))))))); else tmp = x1 + (x1 + (x2 * (((x1 * -12.0) + ((x1 * x2) * 8.0)) - 6.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -9.5e+95], N[(x1 + N[(6.0 + N[(x1 + N[(x1 * N[(N[(x1 * N[(N[(x1 * -6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision] - 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -5.9e-200], N[Not[LessEqual[x1, -3.6e-291]], $MachinePrecision]], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(N[(x1 * x2), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{+95}:\\
\;\;\;\;x1 + \left(6 + \left(x1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot -6 - 12\right) - 16\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -5.9 \cdot 10^{-200} \lor \neg \left(x1 \leq -3.6 \cdot 10^{-291}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + x2 \cdot \left(\left(x1 \cdot -12 + \left(x1 \cdot x2\right) \cdot 8\right) - 6\right)\right)\\
\end{array}
\end{array}
if x1 < -9.5000000000000004e95Initial program 8.7%
Taylor expanded in x1 around inf 8.7%
Taylor expanded in x1 around 0 20.2%
Taylor expanded in x1 around 0 83.2%
*-commutative97.8%
Simplified83.2%
Taylor expanded in x2 around 0 91.9%
if -9.5000000000000004e95 < x1 < -5.90000000000000053e-200 or -3.59999999999999965e-291 < x1 Initial program 83.1%
Taylor expanded in x2 around inf 83.1%
+-commutative83.1%
associate--r+83.1%
associate-*r/83.1%
div-sub83.1%
fma-neg83.1%
+-commutative83.1%
unpow283.1%
fma-undefine83.1%
associate-*r/83.1%
metadata-eval83.1%
+-commutative83.1%
unpow283.1%
fma-undefine83.1%
Simplified83.1%
Taylor expanded in x1 around 0 82.3%
associate-*r/82.3%
neg-mul-182.3%
Simplified82.3%
Taylor expanded in x1 around 0 64.3%
Taylor expanded in x1 around 0 64.0%
if -5.90000000000000053e-200 < x1 < -3.59999999999999965e-291Initial program 99.9%
Taylor expanded in x1 around 0 67.2%
Taylor expanded in x1 around 0 64.2%
*-commutative0.0%
Simplified64.2%
Taylor expanded in x2 around 0 96.8%
Final simplification71.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- 3.0 (* 2.0 x2)))))
(if (<= x1 -2.25e+95)
(+ x1 (+ 6.0 (+ x1 (* x1 (- (* x1 (- (* x1 -6.0) 12.0)) 16.0)))))
(if (<= x1 -1.52e-200)
(+ x1 (- (* 3.0 (- (* x2 -2.0) x1)) (- (* 4.0 (* x1 t_0)) x1)))
(if (<= x1 -5.8e-291)
(+ x1 (+ x1 (* x2 (- (+ (* x1 -12.0) (* (* x1 x2) 8.0)) 6.0))))
(+ x1 (- (* x2 -6.0) (* x1 (+ 2.0 (* 4.0 t_0))))))))))
double code(double x1, double x2) {
double t_0 = x2 * (3.0 - (2.0 * x2));
double tmp;
if (x1 <= -2.25e+95) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if (x1 <= -1.52e-200) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) - ((4.0 * (x1 * t_0)) - x1));
} else if (x1 <= -5.8e-291) {
tmp = x1 + (x1 + (x2 * (((x1 * -12.0) + ((x1 * x2) * 8.0)) - 6.0)));
} else {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * t_0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x2 * (3.0d0 - (2.0d0 * x2))
if (x1 <= (-2.25d+95)) then
tmp = x1 + (6.0d0 + (x1 + (x1 * ((x1 * ((x1 * (-6.0d0)) - 12.0d0)) - 16.0d0))))
else if (x1 <= (-1.52d-200)) then
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) - ((4.0d0 * (x1 * t_0)) - x1))
else if (x1 <= (-5.8d-291)) then
tmp = x1 + (x1 + (x2 * (((x1 * (-12.0d0)) + ((x1 * x2) * 8.0d0)) - 6.0d0)))
else
tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 + (4.0d0 * t_0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 * (3.0 - (2.0 * x2));
double tmp;
if (x1 <= -2.25e+95) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if (x1 <= -1.52e-200) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) - ((4.0 * (x1 * t_0)) - x1));
} else if (x1 <= -5.8e-291) {
tmp = x1 + (x1 + (x2 * (((x1 * -12.0) + ((x1 * x2) * 8.0)) - 6.0)));
} else {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * t_0))));
}
return tmp;
}
def code(x1, x2): t_0 = x2 * (3.0 - (2.0 * x2)) tmp = 0 if x1 <= -2.25e+95: tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))) elif x1 <= -1.52e-200: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) - ((4.0 * (x1 * t_0)) - x1)) elif x1 <= -5.8e-291: tmp = x1 + (x1 + (x2 * (((x1 * -12.0) + ((x1 * x2) * 8.0)) - 6.0))) else: tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * t_0)))) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2))) tmp = 0.0 if (x1 <= -2.25e+95) tmp = Float64(x1 + Float64(6.0 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * -6.0) - 12.0)) - 16.0))))); elseif (x1 <= -1.52e-200) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) - Float64(Float64(4.0 * Float64(x1 * t_0)) - x1))); elseif (x1 <= -5.8e-291) tmp = Float64(x1 + Float64(x1 + Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(Float64(x1 * x2) * 8.0)) - 6.0)))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 + Float64(4.0 * t_0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * (3.0 - (2.0 * x2)); tmp = 0.0; if (x1 <= -2.25e+95) tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))); elseif (x1 <= -1.52e-200) tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) - ((4.0 * (x1 * t_0)) - x1)); elseif (x1 <= -5.8e-291) tmp = x1 + (x1 + (x2 * (((x1 * -12.0) + ((x1 * x2) * 8.0)) - 6.0))); else tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * t_0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.25e+95], N[(x1 + N[(6.0 + N[(x1 + N[(x1 * N[(N[(x1 * N[(N[(x1 * -6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision] - 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.52e-200], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] - N[(N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5.8e-291], N[(x1 + N[(x1 + N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(N[(x1 * x2), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 + N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
\mathbf{if}\;x1 \leq -2.25 \cdot 10^{+95}:\\
\;\;\;\;x1 + \left(6 + \left(x1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot -6 - 12\right) - 16\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -1.52 \cdot 10^{-200}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) - \left(4 \cdot \left(x1 \cdot t\_0\right) - x1\right)\right)\\
\mathbf{elif}\;x1 \leq -5.8 \cdot 10^{-291}:\\
\;\;\;\;x1 + \left(x1 + x2 \cdot \left(\left(x1 \cdot -12 + \left(x1 \cdot x2\right) \cdot 8\right) - 6\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + 4 \cdot t\_0\right)\right)\\
\end{array}
\end{array}
if x1 < -2.25000000000000008e95Initial program 8.7%
Taylor expanded in x1 around inf 8.7%
Taylor expanded in x1 around 0 20.2%
Taylor expanded in x1 around 0 83.2%
*-commutative97.8%
Simplified83.2%
Taylor expanded in x2 around 0 91.9%
if -2.25000000000000008e95 < x1 < -1.52e-200Initial program 99.4%
Taylor expanded in x1 around 0 67.5%
Taylor expanded in x1 around 0 68.3%
neg-mul-168.3%
unsub-neg68.3%
*-commutative68.3%
Simplified68.3%
if -1.52e-200 < x1 < -5.80000000000000003e-291Initial program 99.9%
Taylor expanded in x1 around 0 67.2%
Taylor expanded in x1 around 0 64.2%
*-commutative0.0%
Simplified64.2%
Taylor expanded in x2 around 0 96.8%
if -5.80000000000000003e-291 < x1 Initial program 74.1%
Taylor expanded in x2 around inf 74.1%
+-commutative74.1%
associate--r+74.1%
associate-*r/74.1%
div-sub74.1%
fma-neg74.1%
+-commutative74.1%
unpow274.1%
fma-undefine74.1%
associate-*r/74.1%
metadata-eval74.1%
+-commutative74.1%
unpow274.1%
fma-undefine74.1%
Simplified74.1%
Taylor expanded in x1 around 0 73.6%
associate-*r/73.6%
neg-mul-173.6%
Simplified73.6%
Taylor expanded in x1 around 0 62.1%
Taylor expanded in x1 around 0 62.2%
Final simplification72.0%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -7.8e+95)
(+ x1 (+ 6.0 (+ x1 (* x1 (- (* x1 (- (* x1 -6.0) 12.0)) 16.0)))))
(if (or (<= x1 -1.6e-69) (not (<= x1 3e-93)))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))
(+ x1 (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -7.8e+95) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if ((x1 <= -1.6e-69) || !(x1 <= 3e-93)) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = x1 + (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 <= (-7.8d+95)) then
tmp = x1 + (6.0d0 + (x1 + (x1 * ((x1 * ((x1 * (-6.0d0)) - 12.0d0)) - 16.0d0))))
else if ((x1 <= (-1.6d-69)) .or. (.not. (x1 <= 3d-93))) then
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
else
tmp = x1 + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -7.8e+95) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else if ((x1 <= -1.6e-69) || !(x1 <= 3e-93)) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -7.8e+95: tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))) elif (x1 <= -1.6e-69) or not (x1 <= 3e-93): tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -7.8e+95) tmp = Float64(x1 + Float64(6.0 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * -6.0) - 12.0)) - 16.0))))); elseif ((x1 <= -1.6e-69) || !(x1 <= 3e-93)) tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -7.8e+95) tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))); elseif ((x1 <= -1.6e-69) || ~((x1 <= 3e-93))) tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -7.8e+95], N[(x1 + N[(6.0 + N[(x1 + N[(x1 * N[(N[(x1 * N[(N[(x1 * -6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision] - 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -1.6e-69], N[Not[LessEqual[x1, 3e-93]], $MachinePrecision]], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -7.8 \cdot 10^{+95}:\\
\;\;\;\;x1 + \left(6 + \left(x1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot -6 - 12\right) - 16\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -1.6 \cdot 10^{-69} \lor \neg \left(x1 \leq 3 \cdot 10^{-93}\right):\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -7.7999999999999994e95Initial program 8.7%
Taylor expanded in x1 around inf 8.7%
Taylor expanded in x1 around 0 20.2%
Taylor expanded in x1 around 0 83.2%
*-commutative97.8%
Simplified83.2%
Taylor expanded in x2 around 0 91.9%
if -7.7999999999999994e95 < x1 < -1.59999999999999999e-69 or 3.0000000000000001e-93 < x1 Initial program 69.7%
Taylor expanded in x1 around 0 35.9%
Taylor expanded in x1 around 0 39.0%
*-commutative74.6%
Simplified39.0%
Taylor expanded in x1 around inf 34.6%
if -1.59999999999999999e-69 < x1 < 3.0000000000000001e-93Initial program 99.6%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 68.9%
*-commutative12.5%
Simplified68.9%
Taylor expanded in x1 around 0 69.1%
*-commutative69.1%
Simplified69.1%
Final simplification59.2%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.45e+65)
(+ x1 (* x2 (- (* x1 (+ 12.0 (* x1 14.0))) 10.0)))
(if (or (<= x1 -1.75e-68) (not (<= x1 9.5e-93)))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))
(+ x1 (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.45e+65) {
tmp = x1 + (x2 * ((x1 * (12.0 + (x1 * 14.0))) - 10.0));
} else if ((x1 <= -1.75e-68) || !(x1 <= 9.5e-93)) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-2.45d+65)) then
tmp = x1 + (x2 * ((x1 * (12.0d0 + (x1 * 14.0d0))) - 10.0d0))
else if ((x1 <= (-1.75d-68)) .or. (.not. (x1 <= 9.5d-93))) then
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
else
tmp = x1 + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.45e+65) {
tmp = x1 + (x2 * ((x1 * (12.0 + (x1 * 14.0))) - 10.0));
} else if ((x1 <= -1.75e-68) || !(x1 <= 9.5e-93)) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.45e+65: tmp = x1 + (x2 * ((x1 * (12.0 + (x1 * 14.0))) - 10.0)) elif (x1 <= -1.75e-68) or not (x1 <= 9.5e-93): tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.45e+65) tmp = Float64(x1 + Float64(x2 * Float64(Float64(x1 * Float64(12.0 + Float64(x1 * 14.0))) - 10.0))); elseif ((x1 <= -1.75e-68) || !(x1 <= 9.5e-93)) tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.45e+65) tmp = x1 + (x2 * ((x1 * (12.0 + (x1 * 14.0))) - 10.0)); elseif ((x1 <= -1.75e-68) || ~((x1 <= 9.5e-93))) tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.45e+65], N[(x1 + N[(x2 * N[(N[(x1 * N[(12.0 + N[(x1 * 14.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -1.75e-68], N[Not[LessEqual[x1, 9.5e-93]], $MachinePrecision]], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.45 \cdot 10^{+65}:\\
\;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(12 + x1 \cdot 14\right) - 10\right)\\
\mathbf{elif}\;x1 \leq -1.75 \cdot 10^{-68} \lor \neg \left(x1 \leq 9.5 \cdot 10^{-93}\right):\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -2.44999999999999978e65Initial program 20.7%
Taylor expanded in x1 around inf 20.7%
Taylor expanded in x1 around 0 22.0%
Taylor expanded in x1 around 0 76.7%
*-commutative98.1%
Simplified76.7%
Taylor expanded in x2 around inf 42.2%
if -2.44999999999999978e65 < x1 < -1.75000000000000006e-68 or 9.5000000000000001e-93 < x1 Initial program 67.6%
Taylor expanded in x1 around 0 37.4%
Taylor expanded in x1 around 0 40.8%
*-commutative72.8%
Simplified40.8%
Taylor expanded in x1 around inf 36.0%
if -1.75000000000000006e-68 < x1 < 9.5000000000000001e-93Initial program 99.6%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 68.9%
*-commutative12.5%
Simplified68.9%
Taylor expanded in x1 around 0 69.1%
*-commutative69.1%
Simplified69.1%
Final simplification51.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* x2 (- (* x1 (+ 12.0 (* x1 14.0))) 10.0)))))
(if (<= x1 -3.8e-42)
t_0
(if (<= x1 6.2e-94)
(+ x1 (* x2 -6.0))
(if (<= x1 1e-29) (+ x1 (* x1 -2.0)) t_0)))))
double code(double x1, double x2) {
double t_0 = x1 + (x2 * ((x1 * (12.0 + (x1 * 14.0))) - 10.0));
double tmp;
if (x1 <= -3.8e-42) {
tmp = t_0;
} else if (x1 <= 6.2e-94) {
tmp = x1 + (x2 * -6.0);
} else if (x1 <= 1e-29) {
tmp = x1 + (x1 * -2.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 * ((x1 * (12.0d0 + (x1 * 14.0d0))) - 10.0d0))
if (x1 <= (-3.8d-42)) then
tmp = t_0
else if (x1 <= 6.2d-94) then
tmp = x1 + (x2 * (-6.0d0))
else if (x1 <= 1d-29) then
tmp = x1 + (x1 * (-2.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x2 * ((x1 * (12.0 + (x1 * 14.0))) - 10.0));
double tmp;
if (x1 <= -3.8e-42) {
tmp = t_0;
} else if (x1 <= 6.2e-94) {
tmp = x1 + (x2 * -6.0);
} else if (x1 <= 1e-29) {
tmp = x1 + (x1 * -2.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x2 * ((x1 * (12.0 + (x1 * 14.0))) - 10.0)) tmp = 0 if x1 <= -3.8e-42: tmp = t_0 elif x1 <= 6.2e-94: tmp = x1 + (x2 * -6.0) elif x1 <= 1e-29: tmp = x1 + (x1 * -2.0) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x2 * Float64(Float64(x1 * Float64(12.0 + Float64(x1 * 14.0))) - 10.0))) tmp = 0.0 if (x1 <= -3.8e-42) tmp = t_0; elseif (x1 <= 6.2e-94) tmp = Float64(x1 + Float64(x2 * -6.0)); elseif (x1 <= 1e-29) tmp = Float64(x1 + Float64(x1 * -2.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x2 * ((x1 * (12.0 + (x1 * 14.0))) - 10.0)); tmp = 0.0; if (x1 <= -3.8e-42) tmp = t_0; elseif (x1 <= 6.2e-94) tmp = x1 + (x2 * -6.0); elseif (x1 <= 1e-29) tmp = x1 + (x1 * -2.0); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x2 * N[(N[(x1 * N[(12.0 + N[(x1 * 14.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.8e-42], t$95$0, If[LessEqual[x1, 6.2e-94], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e-29], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x2 \cdot \left(x1 \cdot \left(12 + x1 \cdot 14\right) - 10\right)\\
\mathbf{if}\;x1 \leq -3.8 \cdot 10^{-42}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 6.2 \cdot 10^{-94}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 10^{-29}:\\
\;\;\;\;x1 + x1 \cdot -2\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -3.80000000000000017e-42 or 9.99999999999999943e-30 < x1 Initial program 43.1%
Taylor expanded in x1 around inf 34.5%
Taylor expanded in x1 around 0 15.0%
Taylor expanded in x1 around 0 39.8%
*-commutative91.2%
Simplified39.8%
Taylor expanded in x2 around inf 30.8%
if -3.80000000000000017e-42 < x1 < 6.1999999999999996e-94Initial program 99.6%
Taylor expanded in x1 around 0 86.9%
Taylor expanded in x1 around 0 70.8%
*-commutative15.3%
Simplified70.8%
Taylor expanded in x1 around 0 66.8%
*-commutative66.8%
Simplified66.8%
if 6.1999999999999996e-94 < x1 < 9.99999999999999943e-30Initial program 98.9%
Taylor expanded in x2 around inf 98.7%
+-commutative98.7%
associate--r+98.7%
associate-*r/98.7%
div-sub98.7%
fma-neg98.7%
+-commutative98.7%
unpow298.7%
fma-undefine98.7%
associate-*r/98.7%
metadata-eval98.7%
+-commutative98.7%
unpow298.7%
fma-undefine98.7%
Simplified98.7%
Taylor expanded in x1 around 0 98.7%
associate-*r/98.7%
neg-mul-198.7%
Simplified98.7%
Taylor expanded in x1 around 0 79.5%
Taylor expanded in x2 around 0 36.7%
distribute-rgt1-in37.1%
metadata-eval37.1%
Simplified37.1%
Final simplification47.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- (* x1 12.0) 10.0))))
(if (<= x1 -1.15e-42)
t_0
(if (<= x1 5e-94)
(+ x1 (* x2 -6.0))
(if (<= x1 1e-29)
(+ x1 (* x1 -2.0))
(if (<= x1 8.6e+53) (+ x1 x1) t_0))))))
double code(double x1, double x2) {
double t_0 = x2 * ((x1 * 12.0) - 10.0);
double tmp;
if (x1 <= -1.15e-42) {
tmp = t_0;
} else if (x1 <= 5e-94) {
tmp = x1 + (x2 * -6.0);
} else if (x1 <= 1e-29) {
tmp = x1 + (x1 * -2.0);
} else if (x1 <= 8.6e+53) {
tmp = x1 + x1;
} 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 = x2 * ((x1 * 12.0d0) - 10.0d0)
if (x1 <= (-1.15d-42)) then
tmp = t_0
else if (x1 <= 5d-94) then
tmp = x1 + (x2 * (-6.0d0))
else if (x1 <= 1d-29) then
tmp = x1 + (x1 * (-2.0d0))
else if (x1 <= 8.6d+53) then
tmp = x1 + x1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 * ((x1 * 12.0) - 10.0);
double tmp;
if (x1 <= -1.15e-42) {
tmp = t_0;
} else if (x1 <= 5e-94) {
tmp = x1 + (x2 * -6.0);
} else if (x1 <= 1e-29) {
tmp = x1 + (x1 * -2.0);
} else if (x1 <= 8.6e+53) {
tmp = x1 + x1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x2 * ((x1 * 12.0) - 10.0) tmp = 0 if x1 <= -1.15e-42: tmp = t_0 elif x1 <= 5e-94: tmp = x1 + (x2 * -6.0) elif x1 <= 1e-29: tmp = x1 + (x1 * -2.0) elif x1 <= 8.6e+53: tmp = x1 + x1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(Float64(x1 * 12.0) - 10.0)) tmp = 0.0 if (x1 <= -1.15e-42) tmp = t_0; elseif (x1 <= 5e-94) tmp = Float64(x1 + Float64(x2 * -6.0)); elseif (x1 <= 1e-29) tmp = Float64(x1 + Float64(x1 * -2.0)); elseif (x1 <= 8.6e+53) tmp = Float64(x1 + x1); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * ((x1 * 12.0) - 10.0); tmp = 0.0; if (x1 <= -1.15e-42) tmp = t_0; elseif (x1 <= 5e-94) tmp = x1 + (x2 * -6.0); elseif (x1 <= 1e-29) tmp = x1 + (x1 * -2.0); elseif (x1 <= 8.6e+53) tmp = x1 + x1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 * N[(N[(x1 * 12.0), $MachinePrecision] - 10.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.15e-42], t$95$0, If[LessEqual[x1, 5e-94], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e-29], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8.6e+53], N[(x1 + x1), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(x1 \cdot 12 - 10\right)\\
\mathbf{if}\;x1 \leq -1.15 \cdot 10^{-42}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{-94}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 10^{-29}:\\
\;\;\;\;x1 + x1 \cdot -2\\
\mathbf{elif}\;x1 \leq 8.6 \cdot 10^{+53}:\\
\;\;\;\;x1 + x1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -1.15000000000000002e-42 or 8.5999999999999995e53 < x1 Initial program 36.9%
Taylor expanded in x1 around inf 32.8%
Taylor expanded in x1 around 0 6.5%
Taylor expanded in x1 around 0 17.3%
Taylor expanded in x2 around inf 16.4%
if -1.15000000000000002e-42 < x1 < 4.9999999999999995e-94Initial program 99.6%
Taylor expanded in x1 around 0 86.8%
Taylor expanded in x1 around 0 71.4%
*-commutative15.4%
Simplified71.4%
Taylor expanded in x1 around 0 67.3%
*-commutative67.3%
Simplified67.3%
if 4.9999999999999995e-94 < x1 < 9.99999999999999943e-30Initial program 98.9%
Taylor expanded in x2 around inf 98.7%
+-commutative98.7%
associate--r+98.7%
associate-*r/98.7%
div-sub98.7%
fma-neg98.7%
+-commutative98.7%
unpow298.7%
fma-undefine98.7%
associate-*r/98.7%
metadata-eval98.7%
+-commutative98.7%
unpow298.7%
fma-undefine98.7%
Simplified98.7%
Taylor expanded in x1 around 0 98.7%
associate-*r/98.7%
neg-mul-198.7%
Simplified98.7%
Taylor expanded in x1 around 0 79.5%
Taylor expanded in x2 around 0 36.7%
distribute-rgt1-in37.1%
metadata-eval37.1%
Simplified37.1%
if 9.99999999999999943e-30 < x1 < 8.5999999999999995e53Initial program 99.4%
Taylor expanded in x1 around 0 40.4%
Taylor expanded in x1 around 0 40.4%
*-commutative54.0%
Simplified40.4%
Taylor expanded in x2 around 0 5.0%
Final simplification39.2%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -1.22e+95) (+ x1 (+ 6.0 (+ x1 (* x1 (- (* x1 (- (* x1 -6.0) 12.0)) 16.0))))) (+ x1 (+ x1 (* x2 (- (+ (* x1 -12.0) (* (* x1 x2) 8.0)) 6.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.22e+95) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else {
tmp = x1 + (x1 + (x2 * (((x1 * -12.0) + ((x1 * x2) * 8.0)) - 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.22d+95)) then
tmp = x1 + (6.0d0 + (x1 + (x1 * ((x1 * ((x1 * (-6.0d0)) - 12.0d0)) - 16.0d0))))
else
tmp = x1 + (x1 + (x2 * (((x1 * (-12.0d0)) + ((x1 * x2) * 8.0d0)) - 6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.22e+95) {
tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0))));
} else {
tmp = x1 + (x1 + (x2 * (((x1 * -12.0) + ((x1 * x2) * 8.0)) - 6.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.22e+95: tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))) else: tmp = x1 + (x1 + (x2 * (((x1 * -12.0) + ((x1 * x2) * 8.0)) - 6.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.22e+95) tmp = Float64(x1 + Float64(6.0 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * -6.0) - 12.0)) - 16.0))))); else tmp = Float64(x1 + Float64(x1 + Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(Float64(x1 * x2) * 8.0)) - 6.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.22e+95) tmp = x1 + (6.0 + (x1 + (x1 * ((x1 * ((x1 * -6.0) - 12.0)) - 16.0)))); else tmp = x1 + (x1 + (x2 * (((x1 * -12.0) + ((x1 * x2) * 8.0)) - 6.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.22e+95], N[(x1 + N[(6.0 + N[(x1 + N[(x1 * N[(N[(x1 * N[(N[(x1 * -6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision] - 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(N[(x1 * x2), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.22 \cdot 10^{+95}:\\
\;\;\;\;x1 + \left(6 + \left(x1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot -6 - 12\right) - 16\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + x2 \cdot \left(\left(x1 \cdot -12 + \left(x1 \cdot x2\right) \cdot 8\right) - 6\right)\right)\\
\end{array}
\end{array}
if x1 < -1.22000000000000007e95Initial program 8.7%
Taylor expanded in x1 around inf 8.7%
Taylor expanded in x1 around 0 20.2%
Taylor expanded in x1 around 0 83.2%
*-commutative97.8%
Simplified83.2%
Taylor expanded in x2 around 0 91.9%
if -1.22000000000000007e95 < x1 Initial program 84.8%
Taylor expanded in x1 around 0 61.2%
Taylor expanded in x1 around 0 54.1%
*-commutative43.3%
Simplified54.1%
Taylor expanded in x2 around 0 62.2%
Final simplification67.5%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -3.4e-266) (not (<= x2 2.95e-120))) (- x1 (- (* x2 (- 6.0 (* x1 -12.0))) x1)) (+ x1 (* x1 -2.0))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -3.4e-266) || !(x2 <= 2.95e-120)) {
tmp = x1 - ((x2 * (6.0 - (x1 * -12.0))) - x1);
} else {
tmp = x1 + (x1 * -2.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-3.4d-266)) .or. (.not. (x2 <= 2.95d-120))) then
tmp = x1 - ((x2 * (6.0d0 - (x1 * (-12.0d0)))) - x1)
else
tmp = x1 + (x1 * (-2.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -3.4e-266) || !(x2 <= 2.95e-120)) {
tmp = x1 - ((x2 * (6.0 - (x1 * -12.0))) - x1);
} else {
tmp = x1 + (x1 * -2.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -3.4e-266) or not (x2 <= 2.95e-120): tmp = x1 - ((x2 * (6.0 - (x1 * -12.0))) - x1) else: tmp = x1 + (x1 * -2.0) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -3.4e-266) || !(x2 <= 2.95e-120)) tmp = Float64(x1 - Float64(Float64(x2 * Float64(6.0 - Float64(x1 * -12.0))) - x1)); else tmp = Float64(x1 + Float64(x1 * -2.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -3.4e-266) || ~((x2 <= 2.95e-120))) tmp = x1 - ((x2 * (6.0 - (x1 * -12.0))) - x1); else tmp = x1 + (x1 * -2.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -3.4e-266], N[Not[LessEqual[x2, 2.95e-120]], $MachinePrecision]], N[(x1 - N[(N[(x2 * N[(6.0 - N[(x1 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -3.4 \cdot 10^{-266} \lor \neg \left(x2 \leq 2.95 \cdot 10^{-120}\right):\\
\;\;\;\;x1 - \left(x2 \cdot \left(6 - x1 \cdot -12\right) - x1\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot -2\\
\end{array}
\end{array}
if x2 < -3.39999999999999995e-266 or 2.94999999999999989e-120 < x2 Initial program 69.7%
Taylor expanded in x1 around 0 48.5%
Taylor expanded in x1 around 0 49.1%
*-commutative55.8%
Simplified49.1%
Taylor expanded in x2 around 0 38.7%
if -3.39999999999999995e-266 < x2 < 2.94999999999999989e-120Initial program 79.6%
Taylor expanded in x2 around inf 79.6%
+-commutative79.6%
associate--r+79.6%
associate-*r/79.6%
div-sub79.6%
fma-neg79.6%
+-commutative79.6%
unpow279.6%
fma-undefine79.6%
associate-*r/79.6%
metadata-eval79.6%
+-commutative79.6%
unpow279.6%
fma-undefine79.6%
Simplified79.6%
Taylor expanded in x1 around 0 77.0%
associate-*r/77.0%
neg-mul-177.0%
Simplified77.0%
Taylor expanded in x1 around 0 77.7%
Taylor expanded in x2 around 0 38.4%
distribute-rgt1-in38.7%
metadata-eval38.7%
Simplified38.7%
Final simplification38.7%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -3.4e-266) (not (<= x2 6.5e-121))) (+ x1 (* x2 -6.0)) (+ x1 (* x1 -2.0))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -3.4e-266) || !(x2 <= 6.5e-121)) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = x1 + (x1 * -2.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-3.4d-266)) .or. (.not. (x2 <= 6.5d-121))) then
tmp = x1 + (x2 * (-6.0d0))
else
tmp = x1 + (x1 * (-2.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -3.4e-266) || !(x2 <= 6.5e-121)) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = x1 + (x1 * -2.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -3.4e-266) or not (x2 <= 6.5e-121): tmp = x1 + (x2 * -6.0) else: tmp = x1 + (x1 * -2.0) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -3.4e-266) || !(x2 <= 6.5e-121)) tmp = Float64(x1 + Float64(x2 * -6.0)); else tmp = Float64(x1 + Float64(x1 * -2.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -3.4e-266) || ~((x2 <= 6.5e-121))) tmp = x1 + (x2 * -6.0); else tmp = x1 + (x1 * -2.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -3.4e-266], N[Not[LessEqual[x2, 6.5e-121]], $MachinePrecision]], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -3.4 \cdot 10^{-266} \lor \neg \left(x2 \leq 6.5 \cdot 10^{-121}\right):\\
\;\;\;\;x1 + x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot -2\\
\end{array}
\end{array}
if x2 < -3.39999999999999995e-266 or 6.5000000000000003e-121 < x2 Initial program 69.7%
Taylor expanded in x1 around 0 48.5%
Taylor expanded in x1 around 0 49.1%
*-commutative55.8%
Simplified49.1%
Taylor expanded in x1 around 0 33.8%
*-commutative33.8%
Simplified33.8%
if -3.39999999999999995e-266 < x2 < 6.5000000000000003e-121Initial program 79.6%
Taylor expanded in x2 around inf 79.6%
+-commutative79.6%
associate--r+79.6%
associate-*r/79.6%
div-sub79.6%
fma-neg79.6%
+-commutative79.6%
unpow279.6%
fma-undefine79.6%
associate-*r/79.6%
metadata-eval79.6%
+-commutative79.6%
unpow279.6%
fma-undefine79.6%
Simplified79.6%
Taylor expanded in x1 around 0 77.0%
associate-*r/77.0%
neg-mul-177.0%
Simplified77.0%
Taylor expanded in x1 around 0 77.7%
Taylor expanded in x2 around 0 38.4%
distribute-rgt1-in38.7%
metadata-eval38.7%
Simplified38.7%
Final simplification34.4%
(FPCore (x1 x2) :precision binary64 (+ x1 (* x1 -2.0)))
double code(double x1, double x2) {
return x1 + (x1 * -2.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + (x1 * (-2.0d0))
end function
public static double code(double x1, double x2) {
return x1 + (x1 * -2.0);
}
def code(x1, x2): return x1 + (x1 * -2.0)
function code(x1, x2) return Float64(x1 + Float64(x1 * -2.0)) end
function tmp = code(x1, x2) tmp = x1 + (x1 * -2.0); end
code[x1_, x2_] := N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + x1 \cdot -2
\end{array}
Initial program 71.1%
Taylor expanded in x2 around inf 71.1%
+-commutative71.1%
associate--r+71.1%
associate-*r/71.1%
div-sub71.1%
fma-neg71.1%
+-commutative71.1%
unpow271.1%
fma-undefine71.1%
associate-*r/71.1%
metadata-eval71.1%
+-commutative71.1%
unpow271.1%
fma-undefine71.1%
Simplified71.1%
Taylor expanded in x1 around 0 70.5%
associate-*r/70.5%
neg-mul-170.5%
Simplified70.5%
Taylor expanded in x1 around 0 59.0%
Taylor expanded in x2 around 0 10.3%
distribute-rgt1-in10.3%
metadata-eval10.3%
Simplified10.3%
Final simplification10.3%
(FPCore (x1 x2) :precision binary64 (+ 6.0 (* x1 -17.0)))
double code(double x1, double x2) {
return 6.0 + (x1 * -17.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = 6.0d0 + (x1 * (-17.0d0))
end function
public static double code(double x1, double x2) {
return 6.0 + (x1 * -17.0);
}
def code(x1, x2): return 6.0 + (x1 * -17.0)
function code(x1, x2) return Float64(6.0 + Float64(x1 * -17.0)) end
function tmp = code(x1, x2) tmp = 6.0 + (x1 * -17.0); end
code[x1_, x2_] := N[(6.0 + N[(x1 * -17.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
6 + x1 \cdot -17
\end{array}
Initial program 71.1%
Taylor expanded in x1 around inf 21.6%
Taylor expanded in x1 around 0 7.2%
Taylor expanded in x1 around 0 12.2%
Taylor expanded in x2 around 0 3.5%
*-commutative3.5%
Simplified3.5%
(FPCore (x1 x2) :precision binary64 (+ x1 x1))
double code(double x1, double x2) {
return x1 + x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + x1
end function
public static double code(double x1, double x2) {
return x1 + x1;
}
def code(x1, x2): return x1 + x1
function code(x1, x2) return Float64(x1 + x1) end
function tmp = code(x1, x2) tmp = x1 + x1; end
code[x1_, x2_] := N[(x1 + x1), $MachinePrecision]
\begin{array}{l}
\\
x1 + x1
\end{array}
Initial program 71.1%
Taylor expanded in x1 around 0 50.6%
Taylor expanded in x1 around 0 44.8%
*-commutative53.1%
Simplified44.8%
Taylor expanded in x2 around 0 3.3%
herbie shell --seed 2024100
(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))))))