
(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 27 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 (fma x1 (* x1 3.0) (* 2.0 x2)))
(t_2 (- -1.0 (* x1 x1)))
(t_3 (/ (- x1 t_1) (fma x1 x1 1.0)))
(t_4 (* 3.0 (* x1 x1)))
(t_5 (* x1 (* x1 3.0)))
(t_6 (- (+ t_5 (* 2.0 x2)) x1))
(t_7 (/ t_6 t_0))
(t_8 (/ t_6 t_2))
(t_9 (/ (- t_1 x1) (fma x1 x1 1.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_8)))
(* (* (* x1 2.0) t_7) (+ 3.0 t_8))))
(* t_5 t_7))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_5 (* 2.0 x2)) x1) t_0))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_4 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_9 4.0 -6.0)) (* (* x1 (* 2.0 t_3)) (- t_3 -3.0)))
(fma t_4 t_9 (pow x1 3.0))))))
(*
(pow x1 4.0)
(+
6.0
(/
(-
(/
(+
9.0
(+
(/ (+ -1.0 (* -2.0 (+ -1.0 (* 3.0 (- 3.0 (* 2.0 x2)))))) x1)
(* 4.0 (- (* 2.0 x2) 3.0))))
x1)
3.0)
x1))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = fma(x1, (x1 * 3.0), (2.0 * x2));
double t_2 = -1.0 - (x1 * x1);
double t_3 = (x1 - t_1) / fma(x1, x1, 1.0);
double t_4 = 3.0 * (x1 * x1);
double t_5 = x1 * (x1 * 3.0);
double t_6 = (t_5 + (2.0 * x2)) - x1;
double t_7 = t_6 / t_0;
double t_8 = t_6 / t_2;
double t_9 = (t_1 - x1) / fma(x1, x1, 1.0);
double tmp;
if ((x1 + ((x1 + (((t_2 * (((x1 * x1) * (6.0 + (4.0 * t_8))) + (((x1 * 2.0) * t_7) * (3.0 + t_8)))) + (t_5 * t_7)) + (x1 * (x1 * x1)))) + (3.0 * (((t_5 - (2.0 * x2)) - x1) / t_0)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_9, 4.0, -6.0)), ((x1 * (2.0 * t_3)) * (t_3 - -3.0))), fma(t_4, t_9, pow(x1, 3.0)))));
} else {
tmp = pow(x1, 4.0) * (6.0 + ((((9.0 + (((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) / x1) + (4.0 * ((2.0 * x2) - 3.0)))) / x1) - 3.0) / x1));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) t_2 = Float64(-1.0 - Float64(x1 * x1)) t_3 = Float64(Float64(x1 - t_1) / fma(x1, x1, 1.0)) t_4 = Float64(3.0 * Float64(x1 * x1)) t_5 = Float64(x1 * Float64(x1 * 3.0)) t_6 = Float64(Float64(t_5 + Float64(2.0 * x2)) - x1) t_7 = Float64(t_6 / t_0) t_8 = Float64(t_6 / t_2) t_9 = Float64(Float64(t_1 - x1) / fma(x1, x1, 1.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_8))) + Float64(Float64(Float64(x1 * 2.0) * t_7) * Float64(3.0 + t_8)))) + Float64(t_5 * t_7)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_5 - Float64(2.0 * x2)) - x1) / t_0)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_9, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_3)) * Float64(t_3 - -3.0))), fma(t_4, t_9, (x1 ^ 3.0)))))); else tmp = Float64((x1 ^ 4.0) * Float64(6.0 + Float64(Float64(Float64(Float64(9.0 + Float64(Float64(Float64(-1.0 + Float64(-2.0 * Float64(-1.0 + Float64(3.0 * Float64(3.0 - Float64(2.0 * x2)))))) / x1) + Float64(4.0 * Float64(Float64(2.0 * x2) - 3.0)))) / x1) - 3.0) / x1))); 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] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 - t$95$1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(t$95$5 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$6 / t$95$0), $MachinePrecision]}, Block[{t$95$8 = N[(t$95$6 / t$95$2), $MachinePrecision]}, Block[{t$95$9 = N[(N[(t$95$1 - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$7), $MachinePrecision] * N[(3.0 + t$95$8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$5 * t$95$7), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$5 - 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$4 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$9 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$3), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 - -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * t$95$9 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(N[(N[(N[(9.0 + N[(N[(N[(-1.0 + N[(-2.0 * N[(-1.0 + N[(3.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision] + N[(4.0 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := \mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right)\\
t_2 := -1 - x1 \cdot x1\\
t_3 := \frac{x1 - t\_1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_4 := 3 \cdot \left(x1 \cdot x1\right)\\
t_5 := x1 \cdot \left(x1 \cdot 3\right)\\
t_6 := \left(t\_5 + 2 \cdot x2\right) - x1\\
t_7 := \frac{t\_6}{t\_0}\\
t_8 := \frac{t\_6}{t\_2}\\
t_9 := \frac{t\_1 - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_8\right) + \left(\left(x1 \cdot 2\right) \cdot t\_7\right) \cdot \left(3 + t\_8\right)\right) + t\_5 \cdot t\_7\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_5 - 2 \cdot x2\right) - x1}{t\_0}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_4 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_9, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_3\right)\right) \cdot \left(t\_3 - -3\right)\right), \mathsf{fma}\left(t\_4, t\_9, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{x1}^{4} \cdot \left(6 + \frac{\frac{9 + \left(\frac{-1 + -2 \cdot \left(-1 + 3 \cdot \left(3 - 2 \cdot x2\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} - 3}{x1}\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
Simplified99.6%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around -inf 100.0%
Final simplification99.7%
(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
(+
(+
(*
t_4
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
(* (* (* x1 2.0) t_3) (+ 3.0 t_5))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))))
(if (<= t_6 INFINITY)
t_6
(*
(pow x1 4.0)
(+
6.0
(/
(-
(/
(+
9.0
(+
(/ (+ -1.0 (* -2.0 (+ -1.0 (* 3.0 (- 3.0 (* 2.0 x2)))))) x1)
(* 4.0 (- (* 2.0 x2) 3.0))))
x1)
3.0)
x1))))))
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 + (((t_4 * (((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5)))) + (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 = pow(x1, 4.0) * (6.0 + ((((9.0 + (((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) / x1) + (4.0 * ((2.0 * x2) - 3.0)))) / x1) - 3.0) / x1));
}
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 + (((t_4 * (((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5)))) + (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 = Math.pow(x1, 4.0) * (6.0 + ((((9.0 + (((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) / x1) + (4.0 * ((2.0 * x2) - 3.0)))) / x1) - 3.0) / x1));
}
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 + (((t_4 * (((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5)))) + (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 = math.pow(x1, 4.0) * (6.0 + ((((9.0 + (((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) / x1) + (4.0 * ((2.0 * x2) - 3.0)))) / x1) - 3.0) / x1)) 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(t_4 * 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)))) + 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 ^ 4.0) * Float64(6.0 + Float64(Float64(Float64(Float64(9.0 + Float64(Float64(Float64(-1.0 + Float64(-2.0 * Float64(-1.0 + Float64(3.0 * Float64(3.0 - Float64(2.0 * x2)))))) / x1) + Float64(4.0 * Float64(Float64(2.0 * x2) - 3.0)))) / x1) - 3.0) / x1))); 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 + (((t_4 * (((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5)))) + (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 ^ 4.0) * (6.0 + ((((9.0 + (((-1.0 + (-2.0 * (-1.0 + (3.0 * (3.0 - (2.0 * x2)))))) / x1) + (4.0 * ((2.0 * x2) - 3.0)))) / x1) - 3.0) / x1)); 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[(t$95$4 * 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]), $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[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(N[(N[(N[(9.0 + N[(N[(N[(-1.0 + N[(-2.0 * N[(-1.0 + N[(3.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision] + N[(4.0 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $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(t\_4 \cdot \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) + 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}^{4} \cdot \left(6 + \frac{\frac{9 + \left(\frac{-1 + -2 \cdot \left(-1 + 3 \cdot \left(3 - 2 \cdot x2\right)\right)}{x1} + 4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1} - 3}{x1}\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around -inf 100.0%
Final simplification99.6%
(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
(+
(+
(*
t_4
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
(* (* (* x1 2.0) t_3) (+ 3.0 t_5))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))))
(if (<= t_6 INFINITY)
t_6
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 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 + (((t_4 * (((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5)))) + (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 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 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 + (((t_4 * (((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5)))) + (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 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 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 + (((t_4 * (((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5)))) + (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 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 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(t_4 * 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)))) + 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(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 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 + (((t_4 * (((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5)))) + (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 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 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[(t$95$4 * 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]), $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[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 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(t\_4 \cdot \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) + 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(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 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.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 64.2%
Taylor expanded in x2 around 0 94.0%
*-commutative94.0%
Simplified94.0%
Final simplification98.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (/ (- (* 2.0 x2) 3.0) x1))
(t_1 (* x1 (* x1 x1)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* x1 (* x1 3.0)))
(t_4 (- (+ t_3 (* 2.0 x2)) x1))
(t_5 (/ t_4 t_2))
(t_6 (* x1 (- (* x1 9.0) 2.0)))
(t_7 (+ x1 (+ (* x2 -6.0) t_6)))
(t_8 (- -1.0 (* x1 x1)))
(t_9 (/ t_4 t_8))
(t_10 (* (* x1 2.0) t_5)))
(if (<= x1 -4.6e+113)
t_7
(if (<= x1 -1.15e-5)
(+
x1
(+
9.0
(+
x1
(+
t_1
(+
(* t_8 (+ (* (* x1 x1) (+ 6.0 (* 4.0 t_9))) (* t_10 (+ 3.0 t_9))))
(* t_3 (+ 3.0 (/ (+ -1.0 t_0) x1))))))))
(if (<= x1 1.9e-22)
(+ x1 (+ (* x2 -6.0) (+ t_6 (* x2 (* x2 (* x1 8.0))))))
(if (<= x1 5e+153)
(+
x1
(+
9.0
(+
x1
(+
t_1
(-
(* t_3 t_5)
(*
t_2
(-
(* (* x1 x1) (+ 6.0 (* 4.0 (- (/ (- 1.0 t_0) x1) 3.0))))
(* t_10 (- t_5 3.0)))))))))
t_7))))))
double code(double x1, double x2) {
double t_0 = ((2.0 * x2) - 3.0) / x1;
double t_1 = x1 * (x1 * x1);
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 * (x1 * 3.0);
double t_4 = (t_3 + (2.0 * x2)) - x1;
double t_5 = t_4 / t_2;
double t_6 = x1 * ((x1 * 9.0) - 2.0);
double t_7 = x1 + ((x2 * -6.0) + t_6);
double t_8 = -1.0 - (x1 * x1);
double t_9 = t_4 / t_8;
double t_10 = (x1 * 2.0) * t_5;
double tmp;
if (x1 <= -4.6e+113) {
tmp = t_7;
} else if (x1 <= -1.15e-5) {
tmp = x1 + (9.0 + (x1 + (t_1 + ((t_8 * (((x1 * x1) * (6.0 + (4.0 * t_9))) + (t_10 * (3.0 + t_9)))) + (t_3 * (3.0 + ((-1.0 + t_0) / x1)))))));
} else if (x1 <= 1.9e-22) {
tmp = x1 + ((x2 * -6.0) + (t_6 + (x2 * (x2 * (x1 * 8.0)))));
} else if (x1 <= 5e+153) {
tmp = x1 + (9.0 + (x1 + (t_1 + ((t_3 * t_5) - (t_2 * (((x1 * x1) * (6.0 + (4.0 * (((1.0 - t_0) / x1) - 3.0)))) - (t_10 * (t_5 - 3.0))))))));
} else {
tmp = t_7;
}
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_10
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: t_9
real(8) :: tmp
t_0 = ((2.0d0 * x2) - 3.0d0) / x1
t_1 = x1 * (x1 * x1)
t_2 = (x1 * x1) + 1.0d0
t_3 = x1 * (x1 * 3.0d0)
t_4 = (t_3 + (2.0d0 * x2)) - x1
t_5 = t_4 / t_2
t_6 = x1 * ((x1 * 9.0d0) - 2.0d0)
t_7 = x1 + ((x2 * (-6.0d0)) + t_6)
t_8 = (-1.0d0) - (x1 * x1)
t_9 = t_4 / t_8
t_10 = (x1 * 2.0d0) * t_5
if (x1 <= (-4.6d+113)) then
tmp = t_7
else if (x1 <= (-1.15d-5)) then
tmp = x1 + (9.0d0 + (x1 + (t_1 + ((t_8 * (((x1 * x1) * (6.0d0 + (4.0d0 * t_9))) + (t_10 * (3.0d0 + t_9)))) + (t_3 * (3.0d0 + (((-1.0d0) + t_0) / x1)))))))
else if (x1 <= 1.9d-22) then
tmp = x1 + ((x2 * (-6.0d0)) + (t_6 + (x2 * (x2 * (x1 * 8.0d0)))))
else if (x1 <= 5d+153) then
tmp = x1 + (9.0d0 + (x1 + (t_1 + ((t_3 * t_5) - (t_2 * (((x1 * x1) * (6.0d0 + (4.0d0 * (((1.0d0 - t_0) / x1) - 3.0d0)))) - (t_10 * (t_5 - 3.0d0))))))))
else
tmp = t_7
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = ((2.0 * x2) - 3.0) / x1;
double t_1 = x1 * (x1 * x1);
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 * (x1 * 3.0);
double t_4 = (t_3 + (2.0 * x2)) - x1;
double t_5 = t_4 / t_2;
double t_6 = x1 * ((x1 * 9.0) - 2.0);
double t_7 = x1 + ((x2 * -6.0) + t_6);
double t_8 = -1.0 - (x1 * x1);
double t_9 = t_4 / t_8;
double t_10 = (x1 * 2.0) * t_5;
double tmp;
if (x1 <= -4.6e+113) {
tmp = t_7;
} else if (x1 <= -1.15e-5) {
tmp = x1 + (9.0 + (x1 + (t_1 + ((t_8 * (((x1 * x1) * (6.0 + (4.0 * t_9))) + (t_10 * (3.0 + t_9)))) + (t_3 * (3.0 + ((-1.0 + t_0) / x1)))))));
} else if (x1 <= 1.9e-22) {
tmp = x1 + ((x2 * -6.0) + (t_6 + (x2 * (x2 * (x1 * 8.0)))));
} else if (x1 <= 5e+153) {
tmp = x1 + (9.0 + (x1 + (t_1 + ((t_3 * t_5) - (t_2 * (((x1 * x1) * (6.0 + (4.0 * (((1.0 - t_0) / x1) - 3.0)))) - (t_10 * (t_5 - 3.0))))))));
} else {
tmp = t_7;
}
return tmp;
}
def code(x1, x2): t_0 = ((2.0 * x2) - 3.0) / x1 t_1 = x1 * (x1 * x1) t_2 = (x1 * x1) + 1.0 t_3 = x1 * (x1 * 3.0) t_4 = (t_3 + (2.0 * x2)) - x1 t_5 = t_4 / t_2 t_6 = x1 * ((x1 * 9.0) - 2.0) t_7 = x1 + ((x2 * -6.0) + t_6) t_8 = -1.0 - (x1 * x1) t_9 = t_4 / t_8 t_10 = (x1 * 2.0) * t_5 tmp = 0 if x1 <= -4.6e+113: tmp = t_7 elif x1 <= -1.15e-5: tmp = x1 + (9.0 + (x1 + (t_1 + ((t_8 * (((x1 * x1) * (6.0 + (4.0 * t_9))) + (t_10 * (3.0 + t_9)))) + (t_3 * (3.0 + ((-1.0 + t_0) / x1))))))) elif x1 <= 1.9e-22: tmp = x1 + ((x2 * -6.0) + (t_6 + (x2 * (x2 * (x1 * 8.0))))) elif x1 <= 5e+153: tmp = x1 + (9.0 + (x1 + (t_1 + ((t_3 * t_5) - (t_2 * (((x1 * x1) * (6.0 + (4.0 * (((1.0 - t_0) / x1) - 3.0)))) - (t_10 * (t_5 - 3.0)))))))) else: tmp = t_7 return tmp
function code(x1, x2) t_0 = Float64(Float64(Float64(2.0 * x2) - 3.0) / x1) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) t_5 = Float64(t_4 / t_2) t_6 = Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) t_7 = Float64(x1 + Float64(Float64(x2 * -6.0) + t_6)) t_8 = Float64(-1.0 - Float64(x1 * x1)) t_9 = Float64(t_4 / t_8) t_10 = Float64(Float64(x1 * 2.0) * t_5) tmp = 0.0 if (x1 <= -4.6e+113) tmp = t_7; elseif (x1 <= -1.15e-5) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_1 + Float64(Float64(t_8 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_9))) + Float64(t_10 * Float64(3.0 + t_9)))) + Float64(t_3 * Float64(3.0 + Float64(Float64(-1.0 + t_0) / x1)))))))); elseif (x1 <= 1.9e-22) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(t_6 + Float64(x2 * Float64(x2 * Float64(x1 * 8.0)))))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_1 + Float64(Float64(t_3 * t_5) - Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(Float64(Float64(1.0 - t_0) / x1) - 3.0)))) - Float64(t_10 * Float64(t_5 - 3.0))))))))); else tmp = t_7; end return tmp end
function tmp_2 = code(x1, x2) t_0 = ((2.0 * x2) - 3.0) / x1; t_1 = x1 * (x1 * x1); t_2 = (x1 * x1) + 1.0; t_3 = x1 * (x1 * 3.0); t_4 = (t_3 + (2.0 * x2)) - x1; t_5 = t_4 / t_2; t_6 = x1 * ((x1 * 9.0) - 2.0); t_7 = x1 + ((x2 * -6.0) + t_6); t_8 = -1.0 - (x1 * x1); t_9 = t_4 / t_8; t_10 = (x1 * 2.0) * t_5; tmp = 0.0; if (x1 <= -4.6e+113) tmp = t_7; elseif (x1 <= -1.15e-5) tmp = x1 + (9.0 + (x1 + (t_1 + ((t_8 * (((x1 * x1) * (6.0 + (4.0 * t_9))) + (t_10 * (3.0 + t_9)))) + (t_3 * (3.0 + ((-1.0 + t_0) / x1))))))); elseif (x1 <= 1.9e-22) tmp = x1 + ((x2 * -6.0) + (t_6 + (x2 * (x2 * (x1 * 8.0))))); elseif (x1 <= 5e+153) tmp = x1 + (9.0 + (x1 + (t_1 + ((t_3 * t_5) - (t_2 * (((x1 * x1) * (6.0 + (4.0 * (((1.0 - t_0) / x1) - 3.0)))) - (t_10 * (t_5 - 3.0)))))))); else tmp = t_7; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / t$95$2), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$9 = N[(t$95$4 / t$95$8), $MachinePrecision]}, Block[{t$95$10 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision]}, If[LessEqual[x1, -4.6e+113], t$95$7, If[LessEqual[x1, -1.15e-5], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$1 + N[(N[(t$95$8 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$9), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$10 * N[(3.0 + t$95$9), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[(3.0 + N[(N[(-1.0 + t$95$0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.9e-22], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$6 + N[(x2 * N[(x2 * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$1 + N[(N[(t$95$3 * t$95$5), $MachinePrecision] - N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(N[(N[(1.0 - t$95$0), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$10 * N[(t$95$5 - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$7]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2 \cdot x2 - 3}{x1}\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := \left(t\_3 + 2 \cdot x2\right) - x1\\
t_5 := \frac{t\_4}{t\_2}\\
t_6 := x1 \cdot \left(x1 \cdot 9 - 2\right)\\
t_7 := x1 + \left(x2 \cdot -6 + t\_6\right)\\
t_8 := -1 - x1 \cdot x1\\
t_9 := \frac{t\_4}{t\_8}\\
t_10 := \left(x1 \cdot 2\right) \cdot t\_5\\
\mathbf{if}\;x1 \leq -4.6 \cdot 10^{+113}:\\
\;\;\;\;t\_7\\
\mathbf{elif}\;x1 \leq -1.15 \cdot 10^{-5}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_1 + \left(t\_8 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_9\right) + t\_10 \cdot \left(3 + t\_9\right)\right) + t\_3 \cdot \left(3 + \frac{-1 + t\_0}{x1}\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.9 \cdot 10^{-22}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t\_6 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_1 + \left(t\_3 \cdot t\_5 - t\_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \left(\frac{1 - t\_0}{x1} - 3\right)\right) - t\_10 \cdot \left(t\_5 - 3\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_7\\
\end{array}
\end{array}
if x1 < -4.59999999999999993e113 or 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 64.2%
Taylor expanded in x2 around 0 94.0%
*-commutative94.0%
Simplified94.0%
if -4.59999999999999993e113 < x1 < -1.15e-5Initial program 99.5%
Taylor expanded in x1 around inf 98.2%
Taylor expanded in x1 around -inf 99.4%
if -1.15e-5 < x1 < 1.90000000000000012e-22Initial program 99.4%
Simplified99.7%
Taylor expanded in x1 around 0 87.3%
Taylor expanded in x2 around 0 87.3%
Taylor expanded in x2 around 0 99.6%
Taylor expanded in x2 around inf 99.6%
associate-*r*99.6%
*-commutative99.6%
*-commutative99.6%
Simplified99.6%
if 1.90000000000000012e-22 < x1 < 5.00000000000000018e153Initial program 99.5%
Taylor expanded in x1 around inf 99.5%
Taylor expanded in x1 around -inf 99.7%
Final simplification98.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (- (* x1 9.0) 2.0)))
(t_2 (+ x1 (+ (* x2 -6.0) t_1)))
(t_3 (* x1 (* x1 3.0)))
(t_4 (/ (- (+ t_3 (* 2.0 x2)) x1) t_0))
(t_5
(+
x1
(+
9.0
(+
x1
(+
(* x1 (* x1 x1))
(-
(* t_3 t_4)
(*
t_0
(-
(*
(* x1 x1)
(+
6.0
(* 4.0 (- (/ (- 1.0 (/ (- (* 2.0 x2) 3.0) x1)) x1) 3.0))))
(* (* (* x1 2.0) t_4) (- t_4 3.0)))))))))))
(if (<= x1 -3.6e+113)
t_2
(if (<= x1 -0.029)
t_5
(if (<= x1 1.9e-22)
(+ x1 (+ (* x2 -6.0) (+ t_1 (* x2 (* x2 (* x1 8.0))))))
(if (<= x1 5e+153) t_5 t_2))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * ((x1 * 9.0) - 2.0);
double t_2 = x1 + ((x2 * -6.0) + t_1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
double t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_3 * t_4) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * (((1.0 - (((2.0 * x2) - 3.0) / x1)) / x1) - 3.0)))) - (((x1 * 2.0) * t_4) * (t_4 - 3.0))))))));
double tmp;
if (x1 <= -3.6e+113) {
tmp = t_2;
} else if (x1 <= -0.029) {
tmp = t_5;
} else if (x1 <= 1.9e-22) {
tmp = x1 + ((x2 * -6.0) + (t_1 + (x2 * (x2 * (x1 * 8.0)))));
} else if (x1 <= 5e+153) {
tmp = t_5;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * ((x1 * 9.0d0) - 2.0d0)
t_2 = x1 + ((x2 * (-6.0d0)) + t_1)
t_3 = x1 * (x1 * 3.0d0)
t_4 = ((t_3 + (2.0d0 * x2)) - x1) / t_0
t_5 = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) + ((t_3 * t_4) - (t_0 * (((x1 * x1) * (6.0d0 + (4.0d0 * (((1.0d0 - (((2.0d0 * x2) - 3.0d0) / x1)) / x1) - 3.0d0)))) - (((x1 * 2.0d0) * t_4) * (t_4 - 3.0d0))))))))
if (x1 <= (-3.6d+113)) then
tmp = t_2
else if (x1 <= (-0.029d0)) then
tmp = t_5
else if (x1 <= 1.9d-22) then
tmp = x1 + ((x2 * (-6.0d0)) + (t_1 + (x2 * (x2 * (x1 * 8.0d0)))))
else if (x1 <= 5d+153) then
tmp = t_5
else
tmp = t_2
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 * 9.0) - 2.0);
double t_2 = x1 + ((x2 * -6.0) + t_1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
double t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_3 * t_4) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * (((1.0 - (((2.0 * x2) - 3.0) / x1)) / x1) - 3.0)))) - (((x1 * 2.0) * t_4) * (t_4 - 3.0))))))));
double tmp;
if (x1 <= -3.6e+113) {
tmp = t_2;
} else if (x1 <= -0.029) {
tmp = t_5;
} else if (x1 <= 1.9e-22) {
tmp = x1 + ((x2 * -6.0) + (t_1 + (x2 * (x2 * (x1 * 8.0)))));
} else if (x1 <= 5e+153) {
tmp = t_5;
} else {
tmp = t_2;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * ((x1 * 9.0) - 2.0) t_2 = x1 + ((x2 * -6.0) + t_1) t_3 = x1 * (x1 * 3.0) t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0 t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_3 * t_4) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * (((1.0 - (((2.0 * x2) - 3.0) / x1)) / x1) - 3.0)))) - (((x1 * 2.0) * t_4) * (t_4 - 3.0)))))))) tmp = 0 if x1 <= -3.6e+113: tmp = t_2 elif x1 <= -0.029: tmp = t_5 elif x1 <= 1.9e-22: tmp = x1 + ((x2 * -6.0) + (t_1 + (x2 * (x2 * (x1 * 8.0))))) elif x1 <= 5e+153: tmp = t_5 else: tmp = t_2 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) t_2 = Float64(x1 + Float64(Float64(x2 * -6.0) + t_1)) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_0) t_5 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_3 * t_4) - Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(Float64(Float64(1.0 - Float64(Float64(Float64(2.0 * x2) - 3.0) / x1)) / x1) - 3.0)))) - Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0))))))))) tmp = 0.0 if (x1 <= -3.6e+113) tmp = t_2; elseif (x1 <= -0.029) tmp = t_5; elseif (x1 <= 1.9e-22) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(t_1 + Float64(x2 * Float64(x2 * Float64(x1 * 8.0)))))); elseif (x1 <= 5e+153) tmp = t_5; else tmp = t_2; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * ((x1 * 9.0) - 2.0); t_2 = x1 + ((x2 * -6.0) + t_1); t_3 = x1 * (x1 * 3.0); t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0; t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_3 * t_4) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * (((1.0 - (((2.0 * x2) - 3.0) / x1)) / x1) - 3.0)))) - (((x1 * 2.0) * t_4) * (t_4 - 3.0)))))))); tmp = 0.0; if (x1 <= -3.6e+113) tmp = t_2; elseif (x1 <= -0.029) tmp = t_5; elseif (x1 <= 1.9e-22) tmp = x1 + ((x2 * -6.0) + (t_1 + (x2 * (x2 * (x1 * 8.0))))); elseif (x1 <= 5e+153) tmp = t_5; else tmp = t_2; 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[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(9.0 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 * t$95$4), $MachinePrecision] - N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(N[(N[(1.0 - N[(N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.6e+113], t$95$2, If[LessEqual[x1, -0.029], t$95$5, If[LessEqual[x1, 1.9e-22], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$1 + N[(x2 * N[(x2 * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], t$95$5, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 9 - 2\right)\\
t_2 := x1 + \left(x2 \cdot -6 + t\_1\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := \frac{\left(t\_3 + 2 \cdot x2\right) - x1}{t\_0}\\
t_5 := x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_3 \cdot t\_4 - t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \left(\frac{1 - \frac{2 \cdot x2 - 3}{x1}}{x1} - 3\right)\right) - \left(\left(x1 \cdot 2\right) \cdot t\_4\right) \cdot \left(t\_4 - 3\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -3.6 \cdot 10^{+113}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x1 \leq -0.029:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;x1 \leq 1.9 \cdot 10^{-22}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t\_1 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x1 < -3.59999999999999992e113 or 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 64.2%
Taylor expanded in x2 around 0 94.0%
*-commutative94.0%
Simplified94.0%
if -3.59999999999999992e113 < x1 < -0.0290000000000000015 or 1.90000000000000012e-22 < x1 < 5.00000000000000018e153Initial program 99.5%
Taylor expanded in x1 around inf 99.0%
Taylor expanded in x1 around -inf 98.8%
if -0.0290000000000000015 < x1 < 1.90000000000000012e-22Initial program 99.4%
Simplified99.7%
Taylor expanded in x1 around 0 87.3%
Taylor expanded in x2 around 0 87.3%
Taylor expanded in x2 around 0 99.6%
Taylor expanded in x2 around inf 99.6%
associate-*r*99.6%
*-commutative99.6%
*-commutative99.6%
Simplified99.6%
Final simplification98.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- -1.0 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* x1 (* x1 x1)))
(t_4 (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0)))))
(t_5 (- (+ t_1 (* 2.0 x2)) x1))
(t_6 (/ t_5 t_2))
(t_7 (/ t_5 t_0))
(t_8 (- t_6 3.0)))
(if (<= x1 -3e+113)
t_4
(if (<= x1 1.9e-22)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))
(+
x1
(-
t_3
(-
(* t_1 t_7)
(*
t_0
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_7)))
(* t_8 (* (* x1 2.0) (- x1 (* 2.0 x2)))))))))))
(if (<= x1 5e+153)
(+
x1
(+
9.0
(+
x1
(+
t_3
(-
(* t_1 t_6)
(*
t_2
(-
(*
(* x1 x1)
(+
6.0
(* 4.0 (- (/ (- 1.0 (/ (- (* 2.0 x2) 3.0) x1)) x1) 3.0))))
(* (* (* x1 2.0) t_6) t_8))))))))
t_4)))))
double code(double x1, double x2) {
double t_0 = -1.0 - (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 * (x1 * x1);
double t_4 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_5 = (t_1 + (2.0 * x2)) - x1;
double t_6 = t_5 / t_2;
double t_7 = t_5 / t_0;
double t_8 = t_6 - 3.0;
double tmp;
if (x1 <= -3e+113) {
tmp = t_4;
} else if (x1 <= 1.9e-22) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_3 - ((t_1 * t_7) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * t_7))) + (t_8 * ((x1 * 2.0) * (x1 - (2.0 * x2))))))))));
} else if (x1 <= 5e+153) {
tmp = x1 + (9.0 + (x1 + (t_3 + ((t_1 * t_6) - (t_2 * (((x1 * x1) * (6.0 + (4.0 * (((1.0 - (((2.0 * x2) - 3.0) / x1)) / x1) - 3.0)))) - (((x1 * 2.0) * t_6) * t_8)))))));
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_0 = (-1.0d0) - (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = x1 * (x1 * x1)
t_4 = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
t_5 = (t_1 + (2.0d0 * x2)) - x1
t_6 = t_5 / t_2
t_7 = t_5 / t_0
t_8 = t_6 - 3.0d0
if (x1 <= (-3d+113)) then
tmp = t_4
else if (x1 <= 1.9d-22) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + (t_3 - ((t_1 * t_7) - (t_0 * (((x1 * x1) * (6.0d0 + (4.0d0 * t_7))) + (t_8 * ((x1 * 2.0d0) * (x1 - (2.0d0 * x2))))))))))
else if (x1 <= 5d+153) then
tmp = x1 + (9.0d0 + (x1 + (t_3 + ((t_1 * t_6) - (t_2 * (((x1 * x1) * (6.0d0 + (4.0d0 * (((1.0d0 - (((2.0d0 * x2) - 3.0d0) / x1)) / x1) - 3.0d0)))) - (((x1 * 2.0d0) * t_6) * t_8)))))))
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = -1.0 - (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 * (x1 * x1);
double t_4 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_5 = (t_1 + (2.0 * x2)) - x1;
double t_6 = t_5 / t_2;
double t_7 = t_5 / t_0;
double t_8 = t_6 - 3.0;
double tmp;
if (x1 <= -3e+113) {
tmp = t_4;
} else if (x1 <= 1.9e-22) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_3 - ((t_1 * t_7) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * t_7))) + (t_8 * ((x1 * 2.0) * (x1 - (2.0 * x2))))))))));
} else if (x1 <= 5e+153) {
tmp = x1 + (9.0 + (x1 + (t_3 + ((t_1 * t_6) - (t_2 * (((x1 * x1) * (6.0 + (4.0 * (((1.0 - (((2.0 * x2) - 3.0) / x1)) / x1) - 3.0)))) - (((x1 * 2.0) * t_6) * t_8)))))));
} else {
tmp = t_4;
}
return tmp;
}
def code(x1, x2): t_0 = -1.0 - (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = x1 * (x1 * x1) t_4 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) t_5 = (t_1 + (2.0 * x2)) - x1 t_6 = t_5 / t_2 t_7 = t_5 / t_0 t_8 = t_6 - 3.0 tmp = 0 if x1 <= -3e+113: tmp = t_4 elif x1 <= 1.9e-22: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_3 - ((t_1 * t_7) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * t_7))) + (t_8 * ((x1 * 2.0) * (x1 - (2.0 * x2)))))))))) elif x1 <= 5e+153: tmp = x1 + (9.0 + (x1 + (t_3 + ((t_1 * t_6) - (t_2 * (((x1 * x1) * (6.0 + (4.0 * (((1.0 - (((2.0 * x2) - 3.0) / x1)) / x1) - 3.0)))) - (((x1 * 2.0) * t_6) * t_8))))))) else: tmp = t_4 return tmp
function code(x1, x2) t_0 = Float64(-1.0 - Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(x1 * Float64(x1 * x1)) t_4 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))) t_5 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) t_6 = Float64(t_5 / t_2) t_7 = Float64(t_5 / t_0) t_8 = Float64(t_6 - 3.0) tmp = 0.0 if (x1 <= -3e+113) tmp = t_4; elseif (x1 <= 1.9e-22) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(t_3 - Float64(Float64(t_1 * t_7) - Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_7))) + Float64(t_8 * Float64(Float64(x1 * 2.0) * Float64(x1 - Float64(2.0 * x2))))))))))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_3 + Float64(Float64(t_1 * t_6) - Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(Float64(Float64(1.0 - Float64(Float64(Float64(2.0 * x2) - 3.0) / x1)) / x1) - 3.0)))) - Float64(Float64(Float64(x1 * 2.0) * t_6) * t_8)))))))); else tmp = t_4; end return tmp end
function tmp_2 = code(x1, x2) t_0 = -1.0 - (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = x1 * (x1 * x1); t_4 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); t_5 = (t_1 + (2.0 * x2)) - x1; t_6 = t_5 / t_2; t_7 = t_5 / t_0; t_8 = t_6 - 3.0; tmp = 0.0; if (x1 <= -3e+113) tmp = t_4; elseif (x1 <= 1.9e-22) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_3 - ((t_1 * t_7) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * t_7))) + (t_8 * ((x1 * 2.0) * (x1 - (2.0 * x2)))))))))); elseif (x1 <= 5e+153) tmp = x1 + (9.0 + (x1 + (t_3 + ((t_1 * t_6) - (t_2 * (((x1 * x1) * (6.0 + (4.0 * (((1.0 - (((2.0 * x2) - 3.0) / x1)) / x1) - 3.0)))) - (((x1 * 2.0) * t_6) * t_8))))))); else tmp = t_4; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 / t$95$2), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$5 / t$95$0), $MachinePrecision]}, Block[{t$95$8 = N[(t$95$6 - 3.0), $MachinePrecision]}, If[LessEqual[x1, -3e+113], t$95$4, If[LessEqual[x1, 1.9e-22], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$3 - N[(N[(t$95$1 * t$95$7), $MachinePrecision] - N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$8 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(x1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$3 + N[(N[(t$95$1 * t$95$6), $MachinePrecision] - N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(N[(N[(1.0 - N[(N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$6), $MachinePrecision] * t$95$8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 - x1 \cdot x1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := x1 \cdot \left(x1 \cdot x1\right)\\
t_4 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
t_5 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_6 := \frac{t\_5}{t\_2}\\
t_7 := \frac{t\_5}{t\_0}\\
t_8 := t\_6 - 3\\
\mathbf{if}\;x1 \leq -3 \cdot 10^{+113}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 1.9 \cdot 10^{-22}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2} + \left(x1 + \left(t\_3 - \left(t\_1 \cdot t\_7 - t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_7\right) + t\_8 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x1 - 2 \cdot x2\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_3 + \left(t\_1 \cdot t\_6 - t\_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \left(\frac{1 - \frac{2 \cdot x2 - 3}{x1}}{x1} - 3\right)\right) - \left(\left(x1 \cdot 2\right) \cdot t\_6\right) \cdot t\_8\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if x1 < -3e113 or 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 64.2%
Taylor expanded in x2 around 0 94.0%
*-commutative94.0%
Simplified94.0%
if -3e113 < x1 < 1.90000000000000012e-22Initial program 99.4%
Taylor expanded in x1 around 0 97.1%
+-commutative97.1%
mul-1-neg97.1%
unsub-neg97.1%
Simplified97.1%
if 1.90000000000000012e-22 < x1 < 5.00000000000000018e153Initial program 99.5%
Taylor expanded in x1 around inf 99.5%
Taylor expanded in x1 around -inf 99.7%
Final simplification96.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* x1 (- (* x1 9.0) 2.0)))
(t_3 (+ x1 (+ (* x2 -6.0) t_2)))
(t_4 (- (+ t_1 (* 2.0 x2)) x1))
(t_5 (/ t_4 (- -1.0 (* x1 x1))))
(t_6
(+
x1
(-
9.0
(-
(-
(+
(* t_1 t_5)
(*
t_0
(+
(*
(* (* x1 2.0) (/ t_4 t_0))
(/ (- (+ 1.0 (/ 3.0 x1)) (* 2.0 (/ x2 x1))) x1))
(* (* x1 x1) (+ 6.0 (* 4.0 t_5))))))
(* x1 (* x1 x1)))
x1)))))
(if (<= x1 -1.2e+115)
t_3
(if (<= x1 -0.92)
t_6
(if (<= x1 2.2e-10)
(+ x1 (+ (* x2 -6.0) (+ t_2 (* x2 (* x2 (* x1 8.0))))))
(if (<= x1 5e+153) t_6 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 = x1 * ((x1 * 9.0) - 2.0);
double t_3 = x1 + ((x2 * -6.0) + t_2);
double t_4 = (t_1 + (2.0 * x2)) - x1;
double t_5 = t_4 / (-1.0 - (x1 * x1));
double t_6 = x1 + (9.0 - ((((t_1 * t_5) + (t_0 * ((((x1 * 2.0) * (t_4 / t_0)) * (((1.0 + (3.0 / x1)) - (2.0 * (x2 / x1))) / x1)) + ((x1 * x1) * (6.0 + (4.0 * t_5)))))) - (x1 * (x1 * x1))) - x1));
double tmp;
if (x1 <= -1.2e+115) {
tmp = t_3;
} else if (x1 <= -0.92) {
tmp = t_6;
} else if (x1 <= 2.2e-10) {
tmp = x1 + ((x2 * -6.0) + (t_2 + (x2 * (x2 * (x1 * 8.0)))));
} else if (x1 <= 5e+153) {
tmp = t_6;
} else {
tmp = 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 = x1 * ((x1 * 9.0d0) - 2.0d0)
t_3 = x1 + ((x2 * (-6.0d0)) + t_2)
t_4 = (t_1 + (2.0d0 * x2)) - x1
t_5 = t_4 / ((-1.0d0) - (x1 * x1))
t_6 = x1 + (9.0d0 - ((((t_1 * t_5) + (t_0 * ((((x1 * 2.0d0) * (t_4 / t_0)) * (((1.0d0 + (3.0d0 / x1)) - (2.0d0 * (x2 / x1))) / x1)) + ((x1 * x1) * (6.0d0 + (4.0d0 * t_5)))))) - (x1 * (x1 * x1))) - x1))
if (x1 <= (-1.2d+115)) then
tmp = t_3
else if (x1 <= (-0.92d0)) then
tmp = t_6
else if (x1 <= 2.2d-10) then
tmp = x1 + ((x2 * (-6.0d0)) + (t_2 + (x2 * (x2 * (x1 * 8.0d0)))))
else if (x1 <= 5d+153) then
tmp = t_6
else
tmp = 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 = x1 * ((x1 * 9.0) - 2.0);
double t_3 = x1 + ((x2 * -6.0) + t_2);
double t_4 = (t_1 + (2.0 * x2)) - x1;
double t_5 = t_4 / (-1.0 - (x1 * x1));
double t_6 = x1 + (9.0 - ((((t_1 * t_5) + (t_0 * ((((x1 * 2.0) * (t_4 / t_0)) * (((1.0 + (3.0 / x1)) - (2.0 * (x2 / x1))) / x1)) + ((x1 * x1) * (6.0 + (4.0 * t_5)))))) - (x1 * (x1 * x1))) - x1));
double tmp;
if (x1 <= -1.2e+115) {
tmp = t_3;
} else if (x1 <= -0.92) {
tmp = t_6;
} else if (x1 <= 2.2e-10) {
tmp = x1 + ((x2 * -6.0) + (t_2 + (x2 * (x2 * (x1 * 8.0)))));
} else if (x1 <= 5e+153) {
tmp = t_6;
} else {
tmp = t_3;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = x1 * ((x1 * 9.0) - 2.0) t_3 = x1 + ((x2 * -6.0) + t_2) t_4 = (t_1 + (2.0 * x2)) - x1 t_5 = t_4 / (-1.0 - (x1 * x1)) t_6 = x1 + (9.0 - ((((t_1 * t_5) + (t_0 * ((((x1 * 2.0) * (t_4 / t_0)) * (((1.0 + (3.0 / x1)) - (2.0 * (x2 / x1))) / x1)) + ((x1 * x1) * (6.0 + (4.0 * t_5)))))) - (x1 * (x1 * x1))) - x1)) tmp = 0 if x1 <= -1.2e+115: tmp = t_3 elif x1 <= -0.92: tmp = t_6 elif x1 <= 2.2e-10: tmp = x1 + ((x2 * -6.0) + (t_2 + (x2 * (x2 * (x1 * 8.0))))) elif x1 <= 5e+153: tmp = t_6 else: tmp = 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(x1 * Float64(Float64(x1 * 9.0) - 2.0)) t_3 = Float64(x1 + Float64(Float64(x2 * -6.0) + t_2)) t_4 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) t_5 = Float64(t_4 / Float64(-1.0 - Float64(x1 * x1))) t_6 = Float64(x1 + Float64(9.0 - Float64(Float64(Float64(Float64(t_1 * t_5) + Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * Float64(t_4 / t_0)) * Float64(Float64(Float64(1.0 + Float64(3.0 / x1)) - Float64(2.0 * Float64(x2 / x1))) / x1)) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5)))))) - Float64(x1 * Float64(x1 * x1))) - x1))) tmp = 0.0 if (x1 <= -1.2e+115) tmp = t_3; elseif (x1 <= -0.92) tmp = t_6; elseif (x1 <= 2.2e-10) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(t_2 + Float64(x2 * Float64(x2 * Float64(x1 * 8.0)))))); elseif (x1 <= 5e+153) tmp = t_6; else tmp = 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 = x1 * ((x1 * 9.0) - 2.0); t_3 = x1 + ((x2 * -6.0) + t_2); t_4 = (t_1 + (2.0 * x2)) - x1; t_5 = t_4 / (-1.0 - (x1 * x1)); t_6 = x1 + (9.0 - ((((t_1 * t_5) + (t_0 * ((((x1 * 2.0) * (t_4 / t_0)) * (((1.0 + (3.0 / x1)) - (2.0 * (x2 / x1))) / x1)) + ((x1 * x1) * (6.0 + (4.0 * t_5)))))) - (x1 * (x1 * x1))) - x1)); tmp = 0.0; if (x1 <= -1.2e+115) tmp = t_3; elseif (x1 <= -0.92) tmp = t_6; elseif (x1 <= 2.2e-10) tmp = x1 + ((x2 * -6.0) + (t_2 + (x2 * (x2 * (x1 * 8.0))))); elseif (x1 <= 5e+153) tmp = t_6; else tmp = 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[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(9.0 - N[(N[(N[(N[(t$95$1 * t$95$5), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(t$95$4 / t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 + N[(3.0 / x1), $MachinePrecision]), $MachinePrecision] - N[(2.0 * N[(x2 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.2e+115], t$95$3, If[LessEqual[x1, -0.92], t$95$6, If[LessEqual[x1, 2.2e-10], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$2 + N[(x2 * N[(x2 * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], t$95$6, t$95$3]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot \left(x1 \cdot 9 - 2\right)\\
t_3 := x1 + \left(x2 \cdot -6 + t\_2\right)\\
t_4 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_5 := \frac{t\_4}{-1 - x1 \cdot x1}\\
t_6 := x1 + \left(9 - \left(\left(\left(t\_1 \cdot t\_5 + t\_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{t\_4}{t\_0}\right) \cdot \frac{\left(1 + \frac{3}{x1}\right) - 2 \cdot \frac{x2}{x1}}{x1} + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right)\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\
\mathbf{if}\;x1 \leq -1.2 \cdot 10^{+115}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x1 \leq -0.92:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;x1 \leq 2.2 \cdot 10^{-10}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t\_2 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if x1 < -1.2e115 or 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 64.2%
Taylor expanded in x2 around 0 94.0%
*-commutative94.0%
Simplified94.0%
if -1.2e115 < x1 < -0.92000000000000004 or 2.1999999999999999e-10 < x1 < 5.00000000000000018e153Initial program 99.5%
Taylor expanded in x1 around inf 99.0%
Taylor expanded in x1 around inf 97.3%
associate-*r/97.3%
metadata-eval97.3%
Simplified97.3%
if -0.92000000000000004 < x1 < 2.1999999999999999e-10Initial program 99.4%
Simplified99.7%
Taylor expanded in x1 around 0 87.4%
Taylor expanded in x2 around 0 87.4%
Taylor expanded in x2 around 0 99.6%
Taylor expanded in x2 around inf 99.6%
associate-*r*99.6%
*-commutative99.6%
*-commutative99.6%
Simplified99.6%
Final simplification97.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- (+ t_1 (* 2.0 x2)) x1))
(t_3 (* x1 (- (* x1 9.0) 2.0)))
(t_4 (+ x1 (+ (* x2 -6.0) t_3)))
(t_5 (- -1.0 (* x1 x1)))
(t_6 (/ t_2 t_5))
(t_7 (* (* x1 x1) (+ 6.0 (* 4.0 t_6))))
(t_8 (+ (* x1 x1) 1.0)))
(if (<= x1 -6e+111)
t_4
(if (<= x1 -0.0024)
(+
x1
(+
9.0
(+
x1
(+
t_0
(+
(* t_5 (+ t_7 (* (* (* x1 2.0) (/ t_2 t_8)) (+ 3.0 t_6))))
(* t_1 (* 2.0 x2)))))))
(if (<= x1 7e+18)
(+ x1 (+ (* x2 -6.0) (+ t_3 (* x2 (* x2 (* x1 8.0))))))
(if (<= x1 5e+153)
(+
x1
(-
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_8))
(- (- (+ (* t_1 t_6) (* t_8 (- t_7 (* x1 2.0)))) t_0) x1)))
t_4))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = x1 * ((x1 * 9.0) - 2.0);
double t_4 = x1 + ((x2 * -6.0) + t_3);
double t_5 = -1.0 - (x1 * x1);
double t_6 = t_2 / t_5;
double t_7 = (x1 * x1) * (6.0 + (4.0 * t_6));
double t_8 = (x1 * x1) + 1.0;
double tmp;
if (x1 <= -6e+111) {
tmp = t_4;
} else if (x1 <= -0.0024) {
tmp = x1 + (9.0 + (x1 + (t_0 + ((t_5 * (t_7 + (((x1 * 2.0) * (t_2 / t_8)) * (3.0 + t_6)))) + (t_1 * (2.0 * x2))))));
} else if (x1 <= 7e+18) {
tmp = x1 + ((x2 * -6.0) + (t_3 + (x2 * (x2 * (x1 * 8.0)))));
} else if (x1 <= 5e+153) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_8)) - ((((t_1 * t_6) + (t_8 * (t_7 - (x1 * 2.0)))) - t_0) - x1));
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = (t_1 + (2.0d0 * x2)) - x1
t_3 = x1 * ((x1 * 9.0d0) - 2.0d0)
t_4 = x1 + ((x2 * (-6.0d0)) + t_3)
t_5 = (-1.0d0) - (x1 * x1)
t_6 = t_2 / t_5
t_7 = (x1 * x1) * (6.0d0 + (4.0d0 * t_6))
t_8 = (x1 * x1) + 1.0d0
if (x1 <= (-6d+111)) then
tmp = t_4
else if (x1 <= (-0.0024d0)) then
tmp = x1 + (9.0d0 + (x1 + (t_0 + ((t_5 * (t_7 + (((x1 * 2.0d0) * (t_2 / t_8)) * (3.0d0 + t_6)))) + (t_1 * (2.0d0 * x2))))))
else if (x1 <= 7d+18) then
tmp = x1 + ((x2 * (-6.0d0)) + (t_3 + (x2 * (x2 * (x1 * 8.0d0)))))
else if (x1 <= 5d+153) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_8)) - ((((t_1 * t_6) + (t_8 * (t_7 - (x1 * 2.0d0)))) - t_0) - x1))
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = x1 * ((x1 * 9.0) - 2.0);
double t_4 = x1 + ((x2 * -6.0) + t_3);
double t_5 = -1.0 - (x1 * x1);
double t_6 = t_2 / t_5;
double t_7 = (x1 * x1) * (6.0 + (4.0 * t_6));
double t_8 = (x1 * x1) + 1.0;
double tmp;
if (x1 <= -6e+111) {
tmp = t_4;
} else if (x1 <= -0.0024) {
tmp = x1 + (9.0 + (x1 + (t_0 + ((t_5 * (t_7 + (((x1 * 2.0) * (t_2 / t_8)) * (3.0 + t_6)))) + (t_1 * (2.0 * x2))))));
} else if (x1 <= 7e+18) {
tmp = x1 + ((x2 * -6.0) + (t_3 + (x2 * (x2 * (x1 * 8.0)))));
} else if (x1 <= 5e+153) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_8)) - ((((t_1 * t_6) + (t_8 * (t_7 - (x1 * 2.0)))) - t_0) - x1));
} else {
tmp = t_4;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = (t_1 + (2.0 * x2)) - x1 t_3 = x1 * ((x1 * 9.0) - 2.0) t_4 = x1 + ((x2 * -6.0) + t_3) t_5 = -1.0 - (x1 * x1) t_6 = t_2 / t_5 t_7 = (x1 * x1) * (6.0 + (4.0 * t_6)) t_8 = (x1 * x1) + 1.0 tmp = 0 if x1 <= -6e+111: tmp = t_4 elif x1 <= -0.0024: tmp = x1 + (9.0 + (x1 + (t_0 + ((t_5 * (t_7 + (((x1 * 2.0) * (t_2 / t_8)) * (3.0 + t_6)))) + (t_1 * (2.0 * x2)))))) elif x1 <= 7e+18: tmp = x1 + ((x2 * -6.0) + (t_3 + (x2 * (x2 * (x1 * 8.0))))) elif x1 <= 5e+153: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_8)) - ((((t_1 * t_6) + (t_8 * (t_7 - (x1 * 2.0)))) - t_0) - x1)) else: tmp = t_4 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) t_3 = Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) t_4 = Float64(x1 + Float64(Float64(x2 * -6.0) + t_3)) t_5 = Float64(-1.0 - Float64(x1 * x1)) t_6 = Float64(t_2 / t_5) t_7 = Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_6))) t_8 = Float64(Float64(x1 * x1) + 1.0) tmp = 0.0 if (x1 <= -6e+111) tmp = t_4; elseif (x1 <= -0.0024) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_0 + Float64(Float64(t_5 * Float64(t_7 + Float64(Float64(Float64(x1 * 2.0) * Float64(t_2 / t_8)) * Float64(3.0 + t_6)))) + Float64(t_1 * Float64(2.0 * x2))))))); elseif (x1 <= 7e+18) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(t_3 + Float64(x2 * Float64(x2 * Float64(x1 * 8.0)))))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_8)) - Float64(Float64(Float64(Float64(t_1 * t_6) + Float64(t_8 * Float64(t_7 - Float64(x1 * 2.0)))) - t_0) - x1))); else tmp = t_4; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = (t_1 + (2.0 * x2)) - x1; t_3 = x1 * ((x1 * 9.0) - 2.0); t_4 = x1 + ((x2 * -6.0) + t_3); t_5 = -1.0 - (x1 * x1); t_6 = t_2 / t_5; t_7 = (x1 * x1) * (6.0 + (4.0 * t_6)); t_8 = (x1 * x1) + 1.0; tmp = 0.0; if (x1 <= -6e+111) tmp = t_4; elseif (x1 <= -0.0024) tmp = x1 + (9.0 + (x1 + (t_0 + ((t_5 * (t_7 + (((x1 * 2.0) * (t_2 / t_8)) * (3.0 + t_6)))) + (t_1 * (2.0 * x2)))))); elseif (x1 <= 7e+18) tmp = x1 + ((x2 * -6.0) + (t_3 + (x2 * (x2 * (x1 * 8.0))))); elseif (x1 <= 5e+153) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_8)) - ((((t_1 * t_6) + (t_8 * (t_7 - (x1 * 2.0)))) - t_0) - x1)); else tmp = t_4; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$2 / t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[x1, -6e+111], t$95$4, If[LessEqual[x1, -0.0024], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$0 + N[(N[(t$95$5 * N[(t$95$7 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(t$95$2 / t$95$8), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 7e+18], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$3 + N[(x2 * N[(x2 * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$8), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(t$95$1 * t$95$6), $MachinePrecision] + N[(t$95$8 * N[(t$95$7 - N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := x1 \cdot \left(x1 \cdot 9 - 2\right)\\
t_4 := x1 + \left(x2 \cdot -6 + t\_3\right)\\
t_5 := -1 - x1 \cdot x1\\
t_6 := \frac{t\_2}{t\_5}\\
t_7 := \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_6\right)\\
t_8 := x1 \cdot x1 + 1\\
\mathbf{if}\;x1 \leq -6 \cdot 10^{+111}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq -0.0024:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_0 + \left(t\_5 \cdot \left(t\_7 + \left(\left(x1 \cdot 2\right) \cdot \frac{t\_2}{t\_8}\right) \cdot \left(3 + t\_6\right)\right) + t\_1 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 7 \cdot 10^{+18}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t\_3 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_8} - \left(\left(\left(t\_1 \cdot t\_6 + t\_8 \cdot \left(t\_7 - x1 \cdot 2\right)\right) - t\_0\right) - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if x1 < -6e111 or 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 64.2%
Taylor expanded in x2 around 0 94.0%
*-commutative94.0%
Simplified94.0%
if -6e111 < x1 < -0.00239999999999999979Initial program 99.5%
Taylor expanded in x1 around inf 98.2%
Taylor expanded in x1 around 0 87.8%
if -0.00239999999999999979 < x1 < 7e18Initial program 99.4%
Simplified99.7%
Taylor expanded in x1 around 0 86.0%
Taylor expanded in x2 around 0 86.0%
Taylor expanded in x2 around 0 97.6%
Taylor expanded in x2 around inf 97.6%
associate-*r*97.6%
*-commutative97.6%
*-commutative97.6%
Simplified97.6%
if 7e18 < x1 < 5.00000000000000018e153Initial program 99.4%
Taylor expanded in x1 around 0 79.7%
+-commutative79.7%
mul-1-neg79.7%
unsub-neg79.7%
Simplified79.7%
Taylor expanded in x1 around inf 94.4%
Final simplification95.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 x1)))
(t_2 (- -1.0 (* x1 x1)))
(t_3 (* x1 (- (* x1 9.0) 2.0)))
(t_4 (+ x1 (+ (* x2 -6.0) t_3)))
(t_5 (* x1 (* x1 3.0)))
(t_6 (- (+ t_5 (* 2.0 x2)) x1))
(t_7 (/ t_6 t_2))
(t_8 (* (* x1 x1) (+ 6.0 (* 4.0 t_7)))))
(if (<= x1 -1.9e+114)
t_4
(if (<= x1 -46.0)
(+
x1
(+
9.0
(+
x1
(+
t_1
(+
(* t_5 (/ t_6 t_0))
(* (+ (* (/ -1.0 x1) (* (* x1 2.0) t_7)) t_8) t_2))))))
(if (<= x1 7e+18)
(+ x1 (+ (* x2 -6.0) (+ t_3 (* x2 (* x2 (* x1 8.0))))))
(if (<= x1 5e+153)
(+
x1
(-
(* 3.0 (/ (- (- t_5 (* 2.0 x2)) x1) t_0))
(- (- (+ (* t_5 t_7) (* t_0 (- t_8 (* x1 2.0)))) t_1) x1)))
t_4))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = -1.0 - (x1 * x1);
double t_3 = x1 * ((x1 * 9.0) - 2.0);
double t_4 = x1 + ((x2 * -6.0) + t_3);
double t_5 = x1 * (x1 * 3.0);
double t_6 = (t_5 + (2.0 * x2)) - x1;
double t_7 = t_6 / t_2;
double t_8 = (x1 * x1) * (6.0 + (4.0 * t_7));
double tmp;
if (x1 <= -1.9e+114) {
tmp = t_4;
} else if (x1 <= -46.0) {
tmp = x1 + (9.0 + (x1 + (t_1 + ((t_5 * (t_6 / t_0)) + ((((-1.0 / x1) * ((x1 * 2.0) * t_7)) + t_8) * t_2)))));
} else if (x1 <= 7e+18) {
tmp = x1 + ((x2 * -6.0) + (t_3 + (x2 * (x2 * (x1 * 8.0)))));
} else if (x1 <= 5e+153) {
tmp = x1 + ((3.0 * (((t_5 - (2.0 * x2)) - x1) / t_0)) - ((((t_5 * t_7) + (t_0 * (t_8 - (x1 * 2.0)))) - t_1) - x1));
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * x1)
t_2 = (-1.0d0) - (x1 * x1)
t_3 = x1 * ((x1 * 9.0d0) - 2.0d0)
t_4 = x1 + ((x2 * (-6.0d0)) + t_3)
t_5 = x1 * (x1 * 3.0d0)
t_6 = (t_5 + (2.0d0 * x2)) - x1
t_7 = t_6 / t_2
t_8 = (x1 * x1) * (6.0d0 + (4.0d0 * t_7))
if (x1 <= (-1.9d+114)) then
tmp = t_4
else if (x1 <= (-46.0d0)) then
tmp = x1 + (9.0d0 + (x1 + (t_1 + ((t_5 * (t_6 / t_0)) + (((((-1.0d0) / x1) * ((x1 * 2.0d0) * t_7)) + t_8) * t_2)))))
else if (x1 <= 7d+18) then
tmp = x1 + ((x2 * (-6.0d0)) + (t_3 + (x2 * (x2 * (x1 * 8.0d0)))))
else if (x1 <= 5d+153) then
tmp = x1 + ((3.0d0 * (((t_5 - (2.0d0 * x2)) - x1) / t_0)) - ((((t_5 * t_7) + (t_0 * (t_8 - (x1 * 2.0d0)))) - t_1) - x1))
else
tmp = t_4
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 * x1);
double t_2 = -1.0 - (x1 * x1);
double t_3 = x1 * ((x1 * 9.0) - 2.0);
double t_4 = x1 + ((x2 * -6.0) + t_3);
double t_5 = x1 * (x1 * 3.0);
double t_6 = (t_5 + (2.0 * x2)) - x1;
double t_7 = t_6 / t_2;
double t_8 = (x1 * x1) * (6.0 + (4.0 * t_7));
double tmp;
if (x1 <= -1.9e+114) {
tmp = t_4;
} else if (x1 <= -46.0) {
tmp = x1 + (9.0 + (x1 + (t_1 + ((t_5 * (t_6 / t_0)) + ((((-1.0 / x1) * ((x1 * 2.0) * t_7)) + t_8) * t_2)))));
} else if (x1 <= 7e+18) {
tmp = x1 + ((x2 * -6.0) + (t_3 + (x2 * (x2 * (x1 * 8.0)))));
} else if (x1 <= 5e+153) {
tmp = x1 + ((3.0 * (((t_5 - (2.0 * x2)) - x1) / t_0)) - ((((t_5 * t_7) + (t_0 * (t_8 - (x1 * 2.0)))) - t_1) - x1));
} else {
tmp = t_4;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * x1) t_2 = -1.0 - (x1 * x1) t_3 = x1 * ((x1 * 9.0) - 2.0) t_4 = x1 + ((x2 * -6.0) + t_3) t_5 = x1 * (x1 * 3.0) t_6 = (t_5 + (2.0 * x2)) - x1 t_7 = t_6 / t_2 t_8 = (x1 * x1) * (6.0 + (4.0 * t_7)) tmp = 0 if x1 <= -1.9e+114: tmp = t_4 elif x1 <= -46.0: tmp = x1 + (9.0 + (x1 + (t_1 + ((t_5 * (t_6 / t_0)) + ((((-1.0 / x1) * ((x1 * 2.0) * t_7)) + t_8) * t_2))))) elif x1 <= 7e+18: tmp = x1 + ((x2 * -6.0) + (t_3 + (x2 * (x2 * (x1 * 8.0))))) elif x1 <= 5e+153: tmp = x1 + ((3.0 * (((t_5 - (2.0 * x2)) - x1) / t_0)) - ((((t_5 * t_7) + (t_0 * (t_8 - (x1 * 2.0)))) - t_1) - x1)) else: tmp = t_4 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(-1.0 - Float64(x1 * x1)) t_3 = Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) t_4 = Float64(x1 + Float64(Float64(x2 * -6.0) + t_3)) t_5 = Float64(x1 * Float64(x1 * 3.0)) t_6 = Float64(Float64(t_5 + Float64(2.0 * x2)) - x1) t_7 = Float64(t_6 / t_2) t_8 = Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_7))) tmp = 0.0 if (x1 <= -1.9e+114) tmp = t_4; elseif (x1 <= -46.0) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_1 + Float64(Float64(t_5 * Float64(t_6 / t_0)) + Float64(Float64(Float64(Float64(-1.0 / x1) * Float64(Float64(x1 * 2.0) * t_7)) + t_8) * t_2)))))); elseif (x1 <= 7e+18) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(t_3 + Float64(x2 * Float64(x2 * Float64(x1 * 8.0)))))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_5 - Float64(2.0 * x2)) - x1) / t_0)) - Float64(Float64(Float64(Float64(t_5 * t_7) + Float64(t_0 * Float64(t_8 - Float64(x1 * 2.0)))) - t_1) - x1))); else tmp = t_4; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * x1); t_2 = -1.0 - (x1 * x1); t_3 = x1 * ((x1 * 9.0) - 2.0); t_4 = x1 + ((x2 * -6.0) + t_3); t_5 = x1 * (x1 * 3.0); t_6 = (t_5 + (2.0 * x2)) - x1; t_7 = t_6 / t_2; t_8 = (x1 * x1) * (6.0 + (4.0 * t_7)); tmp = 0.0; if (x1 <= -1.9e+114) tmp = t_4; elseif (x1 <= -46.0) tmp = x1 + (9.0 + (x1 + (t_1 + ((t_5 * (t_6 / t_0)) + ((((-1.0 / x1) * ((x1 * 2.0) * t_7)) + t_8) * t_2))))); elseif (x1 <= 7e+18) tmp = x1 + ((x2 * -6.0) + (t_3 + (x2 * (x2 * (x1 * 8.0))))); elseif (x1 <= 5e+153) tmp = x1 + ((3.0 * (((t_5 - (2.0 * x2)) - x1) / t_0)) - ((((t_5 * t_7) + (t_0 * (t_8 - (x1 * 2.0)))) - t_1) - x1)); else tmp = t_4; 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 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(t$95$5 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$6 / t$95$2), $MachinePrecision]}, Block[{t$95$8 = N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.9e+114], t$95$4, If[LessEqual[x1, -46.0], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$1 + N[(N[(t$95$5 * N[(t$95$6 / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(-1.0 / x1), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * t$95$7), $MachinePrecision]), $MachinePrecision] + t$95$8), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 7e+18], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$3 + N[(x2 * N[(x2 * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$5 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(t$95$5 * t$95$7), $MachinePrecision] + N[(t$95$0 * N[(t$95$8 - N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := -1 - x1 \cdot x1\\
t_3 := x1 \cdot \left(x1 \cdot 9 - 2\right)\\
t_4 := x1 + \left(x2 \cdot -6 + t\_3\right)\\
t_5 := x1 \cdot \left(x1 \cdot 3\right)\\
t_6 := \left(t\_5 + 2 \cdot x2\right) - x1\\
t_7 := \frac{t\_6}{t\_2}\\
t_8 := \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_7\right)\\
\mathbf{if}\;x1 \leq -1.9 \cdot 10^{+114}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq -46:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_1 + \left(t\_5 \cdot \frac{t\_6}{t\_0} + \left(\frac{-1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot t\_7\right) + t\_8\right) \cdot t\_2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 7 \cdot 10^{+18}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t\_3 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_5 - 2 \cdot x2\right) - x1}{t\_0} - \left(\left(\left(t\_5 \cdot t\_7 + t\_0 \cdot \left(t\_8 - x1 \cdot 2\right)\right) - t\_1\right) - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if x1 < -1.9e114 or 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 64.2%
Taylor expanded in x2 around 0 94.0%
*-commutative94.0%
Simplified94.0%
if -1.9e114 < x1 < -46Initial program 99.5%
Taylor expanded in x1 around inf 98.1%
Taylor expanded in x1 around inf 89.3%
if -46 < x1 < 7e18Initial program 99.4%
Simplified99.7%
Taylor expanded in x1 around 0 85.5%
Taylor expanded in x2 around 0 85.5%
Taylor expanded in x2 around 0 97.0%
Taylor expanded in x2 around inf 97.0%
associate-*r*97.0%
*-commutative97.0%
*-commutative97.0%
Simplified97.0%
if 7e18 < x1 < 5.00000000000000018e153Initial program 99.4%
Taylor expanded in x1 around 0 79.7%
+-commutative79.7%
mul-1-neg79.7%
unsub-neg79.7%
Simplified79.7%
Taylor expanded in x1 around inf 94.4%
Final simplification95.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) (- -1.0 (* x1 x1))))
(t_3 (* x1 (- (* x1 9.0) 2.0)))
(t_4 (+ x1 (+ (* x2 -6.0) t_3)))
(t_5 (* (* x1 x1) (+ 6.0 (* 4.0 t_2))))
(t_6 (+ (* x1 x1) 1.0))
(t_7 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_6))))
(if (<= x1 -1.25e+110)
t_4
(if (<= x1 -21.0)
(+
x1
(+
t_7
(+
x1
(+
t_0
(-
(* t_1 (* 2.0 x2))
(* t_6 (+ (* 4.0 (* x1 (* x2 (- 3.0 (* 2.0 x2))))) t_5)))))))
(if (<= x1 7.1e+18)
(+ x1 (+ (* x2 -6.0) (+ t_3 (* x2 (* x2 (* x1 8.0))))))
(if (<= x1 5e+153)
(+
x1
(- t_7 (- (- (+ (* t_1 t_2) (* t_6 (- t_5 (* x1 2.0)))) t_0) x1)))
t_4))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / (-1.0 - (x1 * x1));
double t_3 = x1 * ((x1 * 9.0) - 2.0);
double t_4 = x1 + ((x2 * -6.0) + t_3);
double t_5 = (x1 * x1) * (6.0 + (4.0 * t_2));
double t_6 = (x1 * x1) + 1.0;
double t_7 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_6);
double tmp;
if (x1 <= -1.25e+110) {
tmp = t_4;
} else if (x1 <= -21.0) {
tmp = x1 + (t_7 + (x1 + (t_0 + ((t_1 * (2.0 * x2)) - (t_6 * ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) + t_5))))));
} else if (x1 <= 7.1e+18) {
tmp = x1 + ((x2 * -6.0) + (t_3 + (x2 * (x2 * (x1 * 8.0)))));
} else if (x1 <= 5e+153) {
tmp = x1 + (t_7 - ((((t_1 * t_2) + (t_6 * (t_5 - (x1 * 2.0)))) - t_0) - x1));
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = ((t_1 + (2.0d0 * x2)) - x1) / ((-1.0d0) - (x1 * x1))
t_3 = x1 * ((x1 * 9.0d0) - 2.0d0)
t_4 = x1 + ((x2 * (-6.0d0)) + t_3)
t_5 = (x1 * x1) * (6.0d0 + (4.0d0 * t_2))
t_6 = (x1 * x1) + 1.0d0
t_7 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_6)
if (x1 <= (-1.25d+110)) then
tmp = t_4
else if (x1 <= (-21.0d0)) then
tmp = x1 + (t_7 + (x1 + (t_0 + ((t_1 * (2.0d0 * x2)) - (t_6 * ((4.0d0 * (x1 * (x2 * (3.0d0 - (2.0d0 * x2))))) + t_5))))))
else if (x1 <= 7.1d+18) then
tmp = x1 + ((x2 * (-6.0d0)) + (t_3 + (x2 * (x2 * (x1 * 8.0d0)))))
else if (x1 <= 5d+153) then
tmp = x1 + (t_7 - ((((t_1 * t_2) + (t_6 * (t_5 - (x1 * 2.0d0)))) - t_0) - x1))
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / (-1.0 - (x1 * x1));
double t_3 = x1 * ((x1 * 9.0) - 2.0);
double t_4 = x1 + ((x2 * -6.0) + t_3);
double t_5 = (x1 * x1) * (6.0 + (4.0 * t_2));
double t_6 = (x1 * x1) + 1.0;
double t_7 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_6);
double tmp;
if (x1 <= -1.25e+110) {
tmp = t_4;
} else if (x1 <= -21.0) {
tmp = x1 + (t_7 + (x1 + (t_0 + ((t_1 * (2.0 * x2)) - (t_6 * ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) + t_5))))));
} else if (x1 <= 7.1e+18) {
tmp = x1 + ((x2 * -6.0) + (t_3 + (x2 * (x2 * (x1 * 8.0)))));
} else if (x1 <= 5e+153) {
tmp = x1 + (t_7 - ((((t_1 * t_2) + (t_6 * (t_5 - (x1 * 2.0)))) - t_0) - x1));
} else {
tmp = t_4;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / (-1.0 - (x1 * x1)) t_3 = x1 * ((x1 * 9.0) - 2.0) t_4 = x1 + ((x2 * -6.0) + t_3) t_5 = (x1 * x1) * (6.0 + (4.0 * t_2)) t_6 = (x1 * x1) + 1.0 t_7 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_6) tmp = 0 if x1 <= -1.25e+110: tmp = t_4 elif x1 <= -21.0: tmp = x1 + (t_7 + (x1 + (t_0 + ((t_1 * (2.0 * x2)) - (t_6 * ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) + t_5)))))) elif x1 <= 7.1e+18: tmp = x1 + ((x2 * -6.0) + (t_3 + (x2 * (x2 * (x1 * 8.0))))) elif x1 <= 5e+153: tmp = x1 + (t_7 - ((((t_1 * t_2) + (t_6 * (t_5 - (x1 * 2.0)))) - t_0) - x1)) else: tmp = t_4 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / Float64(-1.0 - Float64(x1 * x1))) t_3 = Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) t_4 = Float64(x1 + Float64(Float64(x2 * -6.0) + t_3)) t_5 = Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_2))) t_6 = Float64(Float64(x1 * x1) + 1.0) t_7 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_6)) tmp = 0.0 if (x1 <= -1.25e+110) tmp = t_4; elseif (x1 <= -21.0) tmp = Float64(x1 + Float64(t_7 + Float64(x1 + Float64(t_0 + Float64(Float64(t_1 * Float64(2.0 * x2)) - Float64(t_6 * Float64(Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))) + t_5))))))); elseif (x1 <= 7.1e+18) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(t_3 + Float64(x2 * Float64(x2 * Float64(x1 * 8.0)))))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(t_7 - Float64(Float64(Float64(Float64(t_1 * t_2) + Float64(t_6 * Float64(t_5 - Float64(x1 * 2.0)))) - t_0) - x1))); else tmp = t_4; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / (-1.0 - (x1 * x1)); t_3 = x1 * ((x1 * 9.0) - 2.0); t_4 = x1 + ((x2 * -6.0) + t_3); t_5 = (x1 * x1) * (6.0 + (4.0 * t_2)); t_6 = (x1 * x1) + 1.0; t_7 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_6); tmp = 0.0; if (x1 <= -1.25e+110) tmp = t_4; elseif (x1 <= -21.0) tmp = x1 + (t_7 + (x1 + (t_0 + ((t_1 * (2.0 * x2)) - (t_6 * ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) + t_5)))))); elseif (x1 <= 7.1e+18) tmp = x1 + ((x2 * -6.0) + (t_3 + (x2 * (x2 * (x1 * 8.0))))); elseif (x1 <= 5e+153) tmp = x1 + (t_7 - ((((t_1 * t_2) + (t_6 * (t_5 - (x1 * 2.0)))) - t_0) - x1)); else tmp = t_4; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$7 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$6), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.25e+110], t$95$4, If[LessEqual[x1, -21.0], N[(x1 + N[(t$95$7 + N[(x1 + N[(t$95$0 + N[(N[(t$95$1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - N[(t$95$6 * N[(N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 7.1e+18], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$3 + N[(x2 * N[(x2 * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(t$95$7 - N[(N[(N[(N[(t$95$1 * t$95$2), $MachinePrecision] + N[(t$95$6 * N[(t$95$5 - N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\\
t_3 := x1 \cdot \left(x1 \cdot 9 - 2\right)\\
t_4 := x1 + \left(x2 \cdot -6 + t\_3\right)\\
t_5 := \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_2\right)\\
t_6 := x1 \cdot x1 + 1\\
t_7 := 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_6}\\
\mathbf{if}\;x1 \leq -1.25 \cdot 10^{+110}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq -21:\\
\;\;\;\;x1 + \left(t\_7 + \left(x1 + \left(t\_0 + \left(t\_1 \cdot \left(2 \cdot x2\right) - t\_6 \cdot \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + t\_5\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 7.1 \cdot 10^{+18}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t\_3 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(t\_7 - \left(\left(\left(t\_1 \cdot t\_2 + t\_6 \cdot \left(t\_5 - x1 \cdot 2\right)\right) - t\_0\right) - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if x1 < -1.24999999999999995e110 or 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 64.2%
Taylor expanded in x2 around 0 94.0%
*-commutative94.0%
Simplified94.0%
if -1.24999999999999995e110 < x1 < -21Initial program 99.5%
Taylor expanded in x1 around 0 88.5%
+-commutative88.5%
mul-1-neg88.5%
unsub-neg88.5%
Simplified88.5%
Taylor expanded in x1 around 0 86.6%
Taylor expanded in x1 around 0 86.8%
if -21 < x1 < 7.1e18Initial program 99.4%
Simplified99.7%
Taylor expanded in x1 around 0 85.5%
Taylor expanded in x2 around 0 85.5%
Taylor expanded in x2 around 0 97.0%
Taylor expanded in x2 around inf 97.0%
associate-*r*97.0%
*-commutative97.0%
*-commutative97.0%
Simplified97.0%
if 7.1e18 < x1 < 5.00000000000000018e153Initial program 99.4%
Taylor expanded in x1 around 0 79.7%
+-commutative79.7%
mul-1-neg79.7%
unsub-neg79.7%
Simplified79.7%
Taylor expanded in x1 around inf 94.4%
Final simplification95.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) (- -1.0 (* x1 x1))))
(t_3 (* x1 (- (* x1 9.0) 2.0)))
(t_4 (+ x1 (+ (* x2 -6.0) t_3)))
(t_5 (+ (* x1 x1) 1.0))
(t_6
(*
t_5
(+
(* 4.0 (* x1 (* x2 (- 3.0 (* 2.0 x2)))))
(* (* x1 x1) (+ 6.0 (* 4.0 t_2)))))))
(if (<= x1 -7.6e+112)
t_4
(if (<= x1 -21.0)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_5))
(+ x1 (+ t_0 (- (* t_1 (* 2.0 x2)) t_6)))))
(if (<= x1 220000.0)
(+ x1 (+ (* x2 -6.0) (+ t_3 (* x2 (* x2 (* x1 8.0))))))
(if (<= x1 5e+153)
(+ x1 (+ 9.0 (- x1 (- (+ (* t_1 t_2) t_6) t_0))))
t_4))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / (-1.0 - (x1 * x1));
double t_3 = x1 * ((x1 * 9.0) - 2.0);
double t_4 = x1 + ((x2 * -6.0) + t_3);
double t_5 = (x1 * x1) + 1.0;
double t_6 = t_5 * ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) + ((x1 * x1) * (6.0 + (4.0 * t_2))));
double tmp;
if (x1 <= -7.6e+112) {
tmp = t_4;
} else if (x1 <= -21.0) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_5)) + (x1 + (t_0 + ((t_1 * (2.0 * x2)) - t_6))));
} else if (x1 <= 220000.0) {
tmp = x1 + ((x2 * -6.0) + (t_3 + (x2 * (x2 * (x1 * 8.0)))));
} else if (x1 <= 5e+153) {
tmp = x1 + (9.0 + (x1 - (((t_1 * t_2) + t_6) - t_0)));
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = ((t_1 + (2.0d0 * x2)) - x1) / ((-1.0d0) - (x1 * x1))
t_3 = x1 * ((x1 * 9.0d0) - 2.0d0)
t_4 = x1 + ((x2 * (-6.0d0)) + t_3)
t_5 = (x1 * x1) + 1.0d0
t_6 = t_5 * ((4.0d0 * (x1 * (x2 * (3.0d0 - (2.0d0 * x2))))) + ((x1 * x1) * (6.0d0 + (4.0d0 * t_2))))
if (x1 <= (-7.6d+112)) then
tmp = t_4
else if (x1 <= (-21.0d0)) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_5)) + (x1 + (t_0 + ((t_1 * (2.0d0 * x2)) - t_6))))
else if (x1 <= 220000.0d0) then
tmp = x1 + ((x2 * (-6.0d0)) + (t_3 + (x2 * (x2 * (x1 * 8.0d0)))))
else if (x1 <= 5d+153) then
tmp = x1 + (9.0d0 + (x1 - (((t_1 * t_2) + t_6) - t_0)))
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / (-1.0 - (x1 * x1));
double t_3 = x1 * ((x1 * 9.0) - 2.0);
double t_4 = x1 + ((x2 * -6.0) + t_3);
double t_5 = (x1 * x1) + 1.0;
double t_6 = t_5 * ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) + ((x1 * x1) * (6.0 + (4.0 * t_2))));
double tmp;
if (x1 <= -7.6e+112) {
tmp = t_4;
} else if (x1 <= -21.0) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_5)) + (x1 + (t_0 + ((t_1 * (2.0 * x2)) - t_6))));
} else if (x1 <= 220000.0) {
tmp = x1 + ((x2 * -6.0) + (t_3 + (x2 * (x2 * (x1 * 8.0)))));
} else if (x1 <= 5e+153) {
tmp = x1 + (9.0 + (x1 - (((t_1 * t_2) + t_6) - t_0)));
} else {
tmp = t_4;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / (-1.0 - (x1 * x1)) t_3 = x1 * ((x1 * 9.0) - 2.0) t_4 = x1 + ((x2 * -6.0) + t_3) t_5 = (x1 * x1) + 1.0 t_6 = t_5 * ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) + ((x1 * x1) * (6.0 + (4.0 * t_2)))) tmp = 0 if x1 <= -7.6e+112: tmp = t_4 elif x1 <= -21.0: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_5)) + (x1 + (t_0 + ((t_1 * (2.0 * x2)) - t_6)))) elif x1 <= 220000.0: tmp = x1 + ((x2 * -6.0) + (t_3 + (x2 * (x2 * (x1 * 8.0))))) elif x1 <= 5e+153: tmp = x1 + (9.0 + (x1 - (((t_1 * t_2) + t_6) - t_0))) else: tmp = t_4 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / Float64(-1.0 - Float64(x1 * x1))) t_3 = Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) t_4 = Float64(x1 + Float64(Float64(x2 * -6.0) + t_3)) t_5 = Float64(Float64(x1 * x1) + 1.0) t_6 = Float64(t_5 * Float64(Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_2))))) tmp = 0.0 if (x1 <= -7.6e+112) tmp = t_4; elseif (x1 <= -21.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_5)) + Float64(x1 + Float64(t_0 + Float64(Float64(t_1 * Float64(2.0 * x2)) - t_6))))); elseif (x1 <= 220000.0) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(t_3 + Float64(x2 * Float64(x2 * Float64(x1 * 8.0)))))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(9.0 + Float64(x1 - Float64(Float64(Float64(t_1 * t_2) + t_6) - t_0)))); else tmp = t_4; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / (-1.0 - (x1 * x1)); t_3 = x1 * ((x1 * 9.0) - 2.0); t_4 = x1 + ((x2 * -6.0) + t_3); t_5 = (x1 * x1) + 1.0; t_6 = t_5 * ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) + ((x1 * x1) * (6.0 + (4.0 * t_2)))); tmp = 0.0; if (x1 <= -7.6e+112) tmp = t_4; elseif (x1 <= -21.0) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_5)) + (x1 + (t_0 + ((t_1 * (2.0 * x2)) - t_6)))); elseif (x1 <= 220000.0) tmp = x1 + ((x2 * -6.0) + (t_3 + (x2 * (x2 * (x1 * 8.0))))); elseif (x1 <= 5e+153) tmp = x1 + (9.0 + (x1 - (((t_1 * t_2) + t_6) - t_0))); else tmp = t_4; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 * N[(N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -7.6e+112], t$95$4, If[LessEqual[x1, -21.0], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$5), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$0 + N[(N[(t$95$1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 220000.0], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$3 + N[(x2 * N[(x2 * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(9.0 + N[(x1 - N[(N[(N[(t$95$1 * t$95$2), $MachinePrecision] + t$95$6), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\\
t_3 := x1 \cdot \left(x1 \cdot 9 - 2\right)\\
t_4 := x1 + \left(x2 \cdot -6 + t\_3\right)\\
t_5 := x1 \cdot x1 + 1\\
t_6 := t\_5 \cdot \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_2\right)\right)\\
\mathbf{if}\;x1 \leq -7.6 \cdot 10^{+112}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq -21:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_5} + \left(x1 + \left(t\_0 + \left(t\_1 \cdot \left(2 \cdot x2\right) - t\_6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 220000:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t\_3 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(9 + \left(x1 - \left(\left(t\_1 \cdot t\_2 + t\_6\right) - t\_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if x1 < -7.60000000000000015e112 or 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 64.2%
Taylor expanded in x2 around 0 94.0%
*-commutative94.0%
Simplified94.0%
if -7.60000000000000015e112 < x1 < -21Initial program 99.5%
Taylor expanded in x1 around 0 88.5%
+-commutative88.5%
mul-1-neg88.5%
unsub-neg88.5%
Simplified88.5%
Taylor expanded in x1 around 0 86.6%
Taylor expanded in x1 around 0 86.8%
if -21 < x1 < 2.2e5Initial program 99.4%
Simplified99.7%
Taylor expanded in x1 around 0 86.5%
Taylor expanded in x2 around 0 86.5%
Taylor expanded in x2 around 0 98.3%
Taylor expanded in x2 around inf 98.3%
associate-*r*98.3%
*-commutative98.3%
*-commutative98.3%
Simplified98.3%
if 2.2e5 < x1 < 5.00000000000000018e153Initial program 99.4%
Taylor expanded in x1 around 0 78.4%
+-commutative78.4%
mul-1-neg78.4%
unsub-neg78.4%
Simplified78.4%
Taylor expanded in x1 around 0 75.6%
Taylor expanded in x1 around inf 75.6%
Final simplification93.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* x1 (- (* x1 9.0) 2.0)))
(t_2 (+ x1 (+ (* x2 -6.0) t_1)))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) (- -1.0 (* x1 x1))))
(t_4
(+
x1
(+
9.0
(-
x1
(-
(+
(* t_0 t_3)
(*
(+ (* x1 x1) 1.0)
(+
(* 4.0 (* x1 (* x2 (- 3.0 (* 2.0 x2)))))
(* (* x1 x1) (+ 6.0 (* 4.0 t_3))))))
(* x1 (* x1 x1))))))))
(if (<= x1 -1.25e+114)
t_2
(if (<= x1 -21.0)
t_4
(if (<= x1 220000.0)
(+ x1 (+ (* x2 -6.0) (+ t_1 (* x2 (* x2 (* x1 8.0))))))
(if (<= x1 5e+153) t_4 t_2))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * ((x1 * 9.0) - 2.0);
double t_2 = x1 + ((x2 * -6.0) + t_1);
double t_3 = ((t_0 + (2.0 * x2)) - x1) / (-1.0 - (x1 * x1));
double t_4 = x1 + (9.0 + (x1 - (((t_0 * t_3) + (((x1 * x1) + 1.0) * ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) + ((x1 * x1) * (6.0 + (4.0 * t_3)))))) - (x1 * (x1 * x1)))));
double tmp;
if (x1 <= -1.25e+114) {
tmp = t_2;
} else if (x1 <= -21.0) {
tmp = t_4;
} else if (x1 <= 220000.0) {
tmp = x1 + ((x2 * -6.0) + (t_1 + (x2 * (x2 * (x1 * 8.0)))));
} else if (x1 <= 5e+153) {
tmp = t_4;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = x1 * ((x1 * 9.0d0) - 2.0d0)
t_2 = x1 + ((x2 * (-6.0d0)) + t_1)
t_3 = ((t_0 + (2.0d0 * x2)) - x1) / ((-1.0d0) - (x1 * x1))
t_4 = x1 + (9.0d0 + (x1 - (((t_0 * t_3) + (((x1 * x1) + 1.0d0) * ((4.0d0 * (x1 * (x2 * (3.0d0 - (2.0d0 * x2))))) + ((x1 * x1) * (6.0d0 + (4.0d0 * t_3)))))) - (x1 * (x1 * x1)))))
if (x1 <= (-1.25d+114)) then
tmp = t_2
else if (x1 <= (-21.0d0)) then
tmp = t_4
else if (x1 <= 220000.0d0) then
tmp = x1 + ((x2 * (-6.0d0)) + (t_1 + (x2 * (x2 * (x1 * 8.0d0)))))
else if (x1 <= 5d+153) then
tmp = t_4
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * ((x1 * 9.0) - 2.0);
double t_2 = x1 + ((x2 * -6.0) + t_1);
double t_3 = ((t_0 + (2.0 * x2)) - x1) / (-1.0 - (x1 * x1));
double t_4 = x1 + (9.0 + (x1 - (((t_0 * t_3) + (((x1 * x1) + 1.0) * ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) + ((x1 * x1) * (6.0 + (4.0 * t_3)))))) - (x1 * (x1 * x1)))));
double tmp;
if (x1 <= -1.25e+114) {
tmp = t_2;
} else if (x1 <= -21.0) {
tmp = t_4;
} else if (x1 <= 220000.0) {
tmp = x1 + ((x2 * -6.0) + (t_1 + (x2 * (x2 * (x1 * 8.0)))));
} else if (x1 <= 5e+153) {
tmp = t_4;
} else {
tmp = t_2;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = x1 * ((x1 * 9.0) - 2.0) t_2 = x1 + ((x2 * -6.0) + t_1) t_3 = ((t_0 + (2.0 * x2)) - x1) / (-1.0 - (x1 * x1)) t_4 = x1 + (9.0 + (x1 - (((t_0 * t_3) + (((x1 * x1) + 1.0) * ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) + ((x1 * x1) * (6.0 + (4.0 * t_3)))))) - (x1 * (x1 * x1))))) tmp = 0 if x1 <= -1.25e+114: tmp = t_2 elif x1 <= -21.0: tmp = t_4 elif x1 <= 220000.0: tmp = x1 + ((x2 * -6.0) + (t_1 + (x2 * (x2 * (x1 * 8.0))))) elif x1 <= 5e+153: tmp = t_4 else: tmp = t_2 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) t_2 = Float64(x1 + Float64(Float64(x2 * -6.0) + t_1)) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / Float64(-1.0 - Float64(x1 * x1))) t_4 = Float64(x1 + Float64(9.0 + Float64(x1 - Float64(Float64(Float64(t_0 * t_3) + Float64(Float64(Float64(x1 * x1) + 1.0) * Float64(Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_3)))))) - Float64(x1 * Float64(x1 * x1)))))) tmp = 0.0 if (x1 <= -1.25e+114) tmp = t_2; elseif (x1 <= -21.0) tmp = t_4; elseif (x1 <= 220000.0) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(t_1 + Float64(x2 * Float64(x2 * Float64(x1 * 8.0)))))); elseif (x1 <= 5e+153) tmp = t_4; else tmp = t_2; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = x1 * ((x1 * 9.0) - 2.0); t_2 = x1 + ((x2 * -6.0) + t_1); t_3 = ((t_0 + (2.0 * x2)) - x1) / (-1.0 - (x1 * x1)); t_4 = x1 + (9.0 + (x1 - (((t_0 * t_3) + (((x1 * x1) + 1.0) * ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) + ((x1 * x1) * (6.0 + (4.0 * t_3)))))) - (x1 * (x1 * x1))))); tmp = 0.0; if (x1 <= -1.25e+114) tmp = t_2; elseif (x1 <= -21.0) tmp = t_4; elseif (x1 <= 220000.0) tmp = x1 + ((x2 * -6.0) + (t_1 + (x2 * (x2 * (x1 * 8.0))))); elseif (x1 <= 5e+153) tmp = t_4; else tmp = t_2; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(9.0 + N[(x1 - N[(N[(N[(t$95$0 * t$95$3), $MachinePrecision] + N[(N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.25e+114], t$95$2, If[LessEqual[x1, -21.0], t$95$4, If[LessEqual[x1, 220000.0], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$1 + N[(x2 * N[(x2 * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], t$95$4, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot \left(x1 \cdot 9 - 2\right)\\
t_2 := x1 + \left(x2 \cdot -6 + t\_1\right)\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\\
t_4 := x1 + \left(9 + \left(x1 - \left(\left(t\_0 \cdot t\_3 + \left(x1 \cdot x1 + 1\right) \cdot \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_3\right)\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -1.25 \cdot 10^{+114}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x1 \leq -21:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 220000:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t\_1 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x1 < -1.25e114 or 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 64.2%
Taylor expanded in x2 around 0 94.0%
*-commutative94.0%
Simplified94.0%
if -1.25e114 < x1 < -21 or 2.2e5 < x1 < 5.00000000000000018e153Initial program 99.5%
Taylor expanded in x1 around 0 82.4%
+-commutative82.4%
mul-1-neg82.4%
unsub-neg82.4%
Simplified82.4%
Taylor expanded in x1 around 0 80.0%
Taylor expanded in x1 around inf 80.0%
if -21 < x1 < 2.2e5Initial program 99.4%
Simplified99.7%
Taylor expanded in x1 around 0 86.5%
Taylor expanded in x2 around 0 86.5%
Taylor expanded in x2 around 0 98.3%
Taylor expanded in x2 around inf 98.3%
associate-*r*98.3%
*-commutative98.3%
*-commutative98.3%
Simplified98.3%
Final simplification93.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0)))))
(t_2 (* x1 (* x1 3.0))))
(if (<= x1 -6.1e+125)
t_1
(if (<= x1 6e+97)
(-
x1
(-
(-
(* x1 (- 2.0 (* x1 9.0)))
(* x2 (* x2 (+ (* -12.0 (/ x1 x2)) (* x1 8.0)))))
(* x2 -6.0)))
(if (<= x1 4.5e+153)
(+
x1
(+
9.0
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_2 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0))
(* t_0 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0))))))))))
t_1)))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_2 = x1 * (x1 * 3.0);
double tmp;
if (x1 <= -6.1e+125) {
tmp = t_1;
} else if (x1 <= 6e+97) {
tmp = x1 - (((x1 * (2.0 - (x1 * 9.0))) - (x2 * (x2 * ((-12.0 * (x1 / x2)) + (x1 * 8.0))))) - (x2 * -6.0));
} else if (x1 <= 4.5e+153) {
tmp = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_2 + (2.0 * x2)) - x1) / t_0)) + (t_0 * (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))))))));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
t_2 = x1 * (x1 * 3.0d0)
if (x1 <= (-6.1d+125)) then
tmp = t_1
else if (x1 <= 6d+97) then
tmp = x1 - (((x1 * (2.0d0 - (x1 * 9.0d0))) - (x2 * (x2 * (((-12.0d0) * (x1 / x2)) + (x1 * 8.0d0))))) - (x2 * (-6.0d0)))
else if (x1 <= 4.5d+153) then
tmp = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_2 + (2.0d0 * x2)) - x1) / t_0)) + (t_0 * (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0)))))))))
else
tmp = 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 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_2 = x1 * (x1 * 3.0);
double tmp;
if (x1 <= -6.1e+125) {
tmp = t_1;
} else if (x1 <= 6e+97) {
tmp = x1 - (((x1 * (2.0 - (x1 * 9.0))) - (x2 * (x2 * ((-12.0 * (x1 / x2)) + (x1 * 8.0))))) - (x2 * -6.0));
} else if (x1 <= 4.5e+153) {
tmp = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_2 + (2.0 * x2)) - x1) / t_0)) + (t_0 * (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) t_2 = x1 * (x1 * 3.0) tmp = 0 if x1 <= -6.1e+125: tmp = t_1 elif x1 <= 6e+97: tmp = x1 - (((x1 * (2.0 - (x1 * 9.0))) - (x2 * (x2 * ((-12.0 * (x1 / x2)) + (x1 * 8.0))))) - (x2 * -6.0)) elif x1 <= 4.5e+153: tmp = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_2 + (2.0 * x2)) - x1) / t_0)) + (t_0 * (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))))))) else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))) t_2 = Float64(x1 * Float64(x1 * 3.0)) tmp = 0.0 if (x1 <= -6.1e+125) tmp = t_1; elseif (x1 <= 6e+97) tmp = Float64(x1 - Float64(Float64(Float64(x1 * Float64(2.0 - Float64(x1 * 9.0))) - Float64(x2 * Float64(x2 * Float64(Float64(-12.0 * Float64(x1 / x2)) + Float64(x1 * 8.0))))) - Float64(x2 * -6.0))); elseif (x1 <= 4.5e+153) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0)) + Float64(t_0 * Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); t_2 = x1 * (x1 * 3.0); tmp = 0.0; if (x1 <= -6.1e+125) tmp = t_1; elseif (x1 <= 6e+97) tmp = x1 - (((x1 * (2.0 - (x1 * 9.0))) - (x2 * (x2 * ((-12.0 * (x1 / x2)) + (x1 * 8.0))))) - (x2 * -6.0)); elseif (x1 <= 4.5e+153) tmp = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_2 + (2.0 * x2)) - x1) / t_0)) + (t_0 * (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))))))); else tmp = 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[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -6.1e+125], t$95$1, If[LessEqual[x1, 6e+97], N[(x1 - N[(N[(N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * N[(x2 * N[(N[(-12.0 * N[(x1 / x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], N[(x1 + N[(9.0 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
\mathbf{if}\;x1 \leq -6.1 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq 6 \cdot 10^{+97}:\\
\;\;\;\;x1 - \left(\left(x1 \cdot \left(2 - x1 \cdot 9\right) - x2 \cdot \left(x2 \cdot \left(-12 \cdot \frac{x1}{x2} + x1 \cdot 8\right)\right)\right) - x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_2 \cdot \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_0} + t\_0 \cdot \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -6.09999999999999977e125 or 4.5000000000000001e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 65.1%
Taylor expanded in x2 around 0 95.4%
*-commutative95.4%
Simplified95.4%
if -6.09999999999999977e125 < x1 < 5.9999999999999997e97Initial program 98.9%
Simplified99.0%
Taylor expanded in x1 around 0 67.8%
Taylor expanded in x2 around 0 67.8%
Taylor expanded in x2 around 0 76.4%
Taylor expanded in x2 around inf 76.9%
if 5.9999999999999997e97 < x1 < 4.5000000000000001e153Initial program 100.0%
Taylor expanded in x1 around inf 100.0%
Taylor expanded in x1 around 0 90.9%
Final simplification81.8%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.9e+108)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0))))
(if (<= x1 1.85e-22)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(+
x1
(-
(* x2 -6.0)
(* x1 (+ 2.0 (- (* x2 (- 12.0 (* x2 8.0))) (* x1 9.0)))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.9e+108) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else if (x1 <= 1.85e-22) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x2 * (12.0 - (x2 * 8.0))) - (x1 * 9.0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-2.9d+108)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
else if (x1 <= 1.85d-22) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else
tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 + ((x2 * (12.0d0 - (x2 * 8.0d0))) - (x1 * 9.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.9e+108) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else if (x1 <= 1.85e-22) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x2 * (12.0 - (x2 * 8.0))) - (x1 * 9.0)))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.9e+108: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) elif x1 <= 1.85e-22: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 else: tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x2 * (12.0 - (x2 * 8.0))) - (x1 * 9.0))))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.9e+108) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))); elseif (x1 <= 1.85e-22) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 + Float64(Float64(x2 * Float64(12.0 - Float64(x2 * 8.0))) - Float64(x1 * 9.0)))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.9e+108) tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); elseif (x1 <= 1.85e-22) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; else tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x2 * (12.0 - (x2 * 8.0))) - (x1 * 9.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.9e+108], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.85e-22], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 + N[(N[(x2 * N[(12.0 - N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.9 \cdot 10^{+108}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 1.85 \cdot 10^{-22}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + \left(x2 \cdot \left(12 - x2 \cdot 8\right) - x1 \cdot 9\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.90000000000000007e108Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 63.2%
Taylor expanded in x2 around 0 89.5%
*-commutative89.5%
Simplified89.5%
if -2.90000000000000007e108 < x1 < 1.85e-22Initial program 99.4%
Simplified99.6%
Taylor expanded in x1 around 0 76.1%
fma-define76.2%
associate-*r*76.2%
fma-neg76.2%
fma-neg76.2%
metadata-eval76.2%
metadata-eval76.2%
Simplified76.2%
Taylor expanded in x2 around 0 86.3%
if 1.85e-22 < x1 Initial program 60.3%
Simplified60.3%
Taylor expanded in x1 around 0 39.2%
Taylor expanded in x2 around 0 53.2%
Taylor expanded in x2 around 0 53.2%
Final simplification78.2%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -8e+44)
(* x1 (+ -1.0 (* x2 -12.0)))
(if (or (<= x1 -4.4e-39) (not (<= x1 1.95e-151)))
(* x1 (+ -1.0 (* x2 (- (* x2 8.0) 12.0))))
(- (* x2 -6.0) x1))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -8e+44) {
tmp = x1 * (-1.0 + (x2 * -12.0));
} else if ((x1 <= -4.4e-39) || !(x1 <= 1.95e-151)) {
tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-8d+44)) then
tmp = x1 * ((-1.0d0) + (x2 * (-12.0d0)))
else if ((x1 <= (-4.4d-39)) .or. (.not. (x1 <= 1.95d-151))) then
tmp = x1 * ((-1.0d0) + (x2 * ((x2 * 8.0d0) - 12.0d0)))
else
tmp = (x2 * (-6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -8e+44) {
tmp = x1 * (-1.0 + (x2 * -12.0));
} else if ((x1 <= -4.4e-39) || !(x1 <= 1.95e-151)) {
tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -8e+44: tmp = x1 * (-1.0 + (x2 * -12.0)) elif (x1 <= -4.4e-39) or not (x1 <= 1.95e-151): tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))) else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -8e+44) tmp = Float64(x1 * Float64(-1.0 + Float64(x2 * -12.0))); elseif ((x1 <= -4.4e-39) || !(x1 <= 1.95e-151)) tmp = Float64(x1 * Float64(-1.0 + Float64(x2 * Float64(Float64(x2 * 8.0) - 12.0)))); else tmp = Float64(Float64(x2 * -6.0) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -8e+44) tmp = x1 * (-1.0 + (x2 * -12.0)); elseif ((x1 <= -4.4e-39) || ~((x1 <= 1.95e-151))) tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))); else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -8e+44], N[(x1 * N[(-1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -4.4e-39], N[Not[LessEqual[x1, 1.95e-151]], $MachinePrecision]], N[(x1 * N[(-1.0 + N[(x2 * N[(N[(x2 * 8.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -8 \cdot 10^{+44}:\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\
\mathbf{elif}\;x1 \leq -4.4 \cdot 10^{-39} \lor \neg \left(x1 \leq 1.95 \cdot 10^{-151}\right):\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x1 < -8.0000000000000007e44Initial program 27.0%
Simplified26.9%
Taylor expanded in x1 around 0 7.7%
fma-define7.7%
associate-*r*7.7%
fma-neg7.7%
fma-neg7.7%
metadata-eval7.7%
metadata-eval7.7%
Simplified7.7%
Taylor expanded in x2 around 0 20.8%
Taylor expanded in x1 around inf 20.8%
if -8.0000000000000007e44 < x1 < -4.40000000000000002e-39 or 1.95000000000000003e-151 < x1 Initial program 77.2%
Simplified77.4%
Taylor expanded in x1 around 0 49.6%
fma-define49.6%
associate-*r*49.6%
fma-neg49.6%
fma-neg49.6%
metadata-eval49.6%
metadata-eval49.6%
Simplified49.6%
Taylor expanded in x2 around 0 49.6%
Taylor expanded in x1 around inf 42.4%
if -4.40000000000000002e-39 < x1 < 1.95000000000000003e-151Initial program 99.5%
Simplified99.8%
Taylor expanded in x1 around 0 84.3%
fma-define84.5%
associate-*r*84.5%
fma-neg84.5%
fma-neg84.5%
metadata-eval84.5%
metadata-eval84.5%
Simplified84.5%
Taylor expanded in x2 around 0 80.7%
Taylor expanded in x1 around 0 80.7%
Final simplification52.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (- (* x1 9.0) 2.0))))
(if (<= x1 -2.02e+127)
(+ x1 (+ (* x2 -6.0) t_0))
(+ x1 (+ (* x2 -6.0) (+ t_0 (* x2 (* x2 (* x1 8.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 9.0) - 2.0);
double tmp;
if (x1 <= -2.02e+127) {
tmp = x1 + ((x2 * -6.0) + t_0);
} else {
tmp = x1 + ((x2 * -6.0) + (t_0 + (x2 * (x2 * (x1 * 8.0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 * ((x1 * 9.0d0) - 2.0d0)
if (x1 <= (-2.02d+127)) then
tmp = x1 + ((x2 * (-6.0d0)) + t_0)
else
tmp = x1 + ((x2 * (-6.0d0)) + (t_0 + (x2 * (x2 * (x1 * 8.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 9.0) - 2.0);
double tmp;
if (x1 <= -2.02e+127) {
tmp = x1 + ((x2 * -6.0) + t_0);
} else {
tmp = x1 + ((x2 * -6.0) + (t_0 + (x2 * (x2 * (x1 * 8.0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((x1 * 9.0) - 2.0) tmp = 0 if x1 <= -2.02e+127: tmp = x1 + ((x2 * -6.0) + t_0) else: tmp = x1 + ((x2 * -6.0) + (t_0 + (x2 * (x2 * (x1 * 8.0))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) tmp = 0.0 if (x1 <= -2.02e+127) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + t_0)); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(t_0 + Float64(x2 * Float64(x2 * Float64(x1 * 8.0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((x1 * 9.0) - 2.0); tmp = 0.0; if (x1 <= -2.02e+127) tmp = x1 + ((x2 * -6.0) + t_0); else tmp = x1 + ((x2 * -6.0) + (t_0 + (x2 * (x2 * (x1 * 8.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.02e+127], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$0 + N[(x2 * N[(x2 * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 9 - 2\right)\\
\mathbf{if}\;x1 \leq -2.02 \cdot 10^{+127}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t\_0 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.0200000000000001e127Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 66.7%
Taylor expanded in x2 around 0 94.5%
*-commutative94.5%
Simplified94.5%
if -2.0200000000000001e127 < x1 Initial program 87.0%
Simplified87.1%
Taylor expanded in x1 around 0 65.0%
Taylor expanded in x2 around 0 69.1%
Taylor expanded in x2 around 0 76.3%
Taylor expanded in x2 around inf 76.3%
associate-*r*76.3%
*-commutative76.3%
*-commutative76.3%
Simplified76.3%
Final simplification78.6%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -3.6e+114) (not (<= x1 7e+151))) (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0)))) (- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -3.6e+114) || !(x1 <= 7e+151)) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-3.6d+114)) .or. (.not. (x1 <= 7d+151))) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
else
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -3.6e+114) || !(x1 <= 7e+151)) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -3.6e+114) or not (x1 <= 7e+151): tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) else: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -3.6e+114) || !(x1 <= 7e+151)) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))); else tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -3.6e+114) || ~((x1 <= 7e+151))) tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); else tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -3.6e+114], N[Not[LessEqual[x1, 7e+151]], $MachinePrecision]], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.6 \cdot 10^{+114} \lor \neg \left(x1 \leq 7 \cdot 10^{+151}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\end{array}
\end{array}
if x1 < -3.6000000000000001e114 or 7.0000000000000006e151 < x1 Initial program 1.6%
Simplified1.6%
Taylor expanded in x1 around 0 63.3%
Taylor expanded in x2 around 0 92.7%
*-commutative92.7%
Simplified92.7%
if -3.6000000000000001e114 < x1 < 7.0000000000000006e151Initial program 99.4%
Simplified99.6%
Taylor expanded in x1 around 0 64.9%
fma-define65.0%
associate-*r*65.0%
fma-neg65.0%
fma-neg65.0%
metadata-eval65.0%
metadata-eval65.0%
Simplified65.0%
Taylor expanded in x2 around 0 73.0%
Final simplification77.8%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -1.3e+116) (not (<= x1 7e+151))) (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0)))) (+ (* x2 -6.0) (* x1 (+ -1.0 (* x2 (- (* x2 8.0) 12.0)))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.3e+116) || !(x1 <= 7e+151)) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-1.3d+116)) .or. (.not. (x1 <= 7d+151))) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x2 * ((x2 * 8.0d0) - 12.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.3e+116) || !(x1 <= 7e+151)) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -1.3e+116) or not (x1 <= 7e+151): tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -1.3e+116) || !(x1 <= 7e+151)) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x2 * Float64(Float64(x2 * 8.0) - 12.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -1.3e+116) || ~((x1 <= 7e+151))) tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -1.3e+116], N[Not[LessEqual[x1, 7e+151]], $MachinePrecision]], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x2 * N[(N[(x2 * 8.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.3 \cdot 10^{+116} \lor \neg \left(x1 \leq 7 \cdot 10^{+151}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\
\end{array}
\end{array}
if x1 < -1.29999999999999993e116 or 7.0000000000000006e151 < x1 Initial program 1.6%
Simplified1.6%
Taylor expanded in x1 around 0 63.3%
Taylor expanded in x2 around 0 92.7%
*-commutative92.7%
Simplified92.7%
if -1.29999999999999993e116 < x1 < 7.0000000000000006e151Initial program 99.4%
Simplified99.6%
Taylor expanded in x1 around 0 64.9%
fma-define65.0%
associate-*r*65.0%
fma-neg65.0%
fma-neg65.0%
metadata-eval65.0%
metadata-eval65.0%
Simplified65.0%
Taylor expanded in x2 around 0 65.0%
Taylor expanded in x1 around 0 64.9%
Final simplification71.6%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -1.8e+148) (not (<= x2 4.6e+209))) (* x1 (+ -1.0 (* x2 (- (* x2 8.0) 12.0)))) (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0))))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.8e+148) || !(x2 <= 4.6e+209)) {
tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 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 <= (-1.8d+148)) .or. (.not. (x2 <= 4.6d+209))) then
tmp = x1 * ((-1.0d0) + (x2 * ((x2 * 8.0d0) - 12.0d0)))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.8e+148) || !(x2 <= 4.6e+209)) {
tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -1.8e+148) or not (x2 <= 4.6e+209): tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -1.8e+148) || !(x2 <= 4.6e+209)) tmp = Float64(x1 * Float64(-1.0 + Float64(x2 * Float64(Float64(x2 * 8.0) - 12.0)))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -1.8e+148) || ~((x2 <= 4.6e+209))) tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))); else tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -1.8e+148], N[Not[LessEqual[x2, 4.6e+209]], $MachinePrecision]], N[(x1 * N[(-1.0 + N[(x2 * N[(N[(x2 * 8.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.8 \cdot 10^{+148} \lor \neg \left(x2 \leq 4.6 \cdot 10^{+209}\right):\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
\end{array}
\end{array}
if x2 < -1.80000000000000003e148 or 4.60000000000000019e209 < x2 Initial program 78.7%
Simplified78.7%
Taylor expanded in x1 around 0 59.2%
fma-define59.2%
associate-*r*59.2%
fma-neg59.2%
fma-neg59.2%
metadata-eval59.2%
metadata-eval59.2%
Simplified59.2%
Taylor expanded in x2 around 0 59.2%
Taylor expanded in x1 around inf 59.2%
if -1.80000000000000003e148 < x2 < 4.60000000000000019e209Initial program 75.1%
Simplified75.2%
Taylor expanded in x1 around 0 67.5%
Taylor expanded in x2 around 0 69.5%
*-commutative69.5%
Simplified69.5%
Final simplification67.6%
(FPCore (x1 x2)
:precision binary64
(if (<= x2 -2.1e-9)
(* x2 (- (* x1 -12.0) 6.0))
(if (<= x2 4.8e+206)
(- (* x2 -6.0) x1)
(* x1 (* x2 (- (- 12.0) (/ 6.0 x1)))))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -2.1e-9) {
tmp = x2 * ((x1 * -12.0) - 6.0);
} else if (x2 <= 4.8e+206) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = x1 * (x2 * (-12.0 - (6.0 / x1)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x2 <= (-2.1d-9)) then
tmp = x2 * ((x1 * (-12.0d0)) - 6.0d0)
else if (x2 <= 4.8d+206) then
tmp = (x2 * (-6.0d0)) - x1
else
tmp = x1 * (x2 * (-12.0d0 - (6.0d0 / x1)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= -2.1e-9) {
tmp = x2 * ((x1 * -12.0) - 6.0);
} else if (x2 <= 4.8e+206) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = x1 * (x2 * (-12.0 - (6.0 / x1)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -2.1e-9: tmp = x2 * ((x1 * -12.0) - 6.0) elif x2 <= 4.8e+206: tmp = (x2 * -6.0) - x1 else: tmp = x1 * (x2 * (-12.0 - (6.0 / x1))) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -2.1e-9) tmp = Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)); elseif (x2 <= 4.8e+206) tmp = Float64(Float64(x2 * -6.0) - x1); else tmp = Float64(x1 * Float64(x2 * Float64(Float64(-12.0) - Float64(6.0 / x1)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= -2.1e-9) tmp = x2 * ((x1 * -12.0) - 6.0); elseif (x2 <= 4.8e+206) tmp = (x2 * -6.0) - x1; else tmp = x1 * (x2 * (-12.0 - (6.0 / x1))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -2.1e-9], N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x2, 4.8e+206], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], N[(x1 * N[(x2 * N[((-12.0) - N[(6.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -2.1 \cdot 10^{-9}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right)\\
\mathbf{elif}\;x2 \leq 4.8 \cdot 10^{+206}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(x2 \cdot \left(\left(-12\right) - \frac{6}{x1}\right)\right)\\
\end{array}
\end{array}
if x2 < -2.10000000000000019e-9Initial program 79.0%
Simplified79.1%
Taylor expanded in x1 around 0 61.5%
fma-define61.6%
associate-*r*61.6%
fma-neg61.6%
fma-neg61.6%
metadata-eval61.6%
metadata-eval61.6%
Simplified61.6%
Taylor expanded in x2 around 0 39.5%
Taylor expanded in x2 around inf 39.6%
if -2.10000000000000019e-9 < x2 < 4.7999999999999999e206Initial program 76.0%
Simplified76.2%
Taylor expanded in x1 around 0 50.4%
fma-define50.5%
associate-*r*50.5%
fma-neg50.5%
fma-neg50.5%
metadata-eval50.5%
metadata-eval50.5%
Simplified50.5%
Taylor expanded in x2 around 0 47.1%
Taylor expanded in x1 around 0 47.1%
if 4.7999999999999999e206 < x2 Initial program 61.1%
Simplified61.1%
Taylor expanded in x1 around 0 61.6%
fma-define61.6%
associate-*r*61.6%
fma-neg61.6%
fma-neg61.6%
metadata-eval61.6%
metadata-eval61.6%
Simplified61.6%
Taylor expanded in x2 around 0 36.0%
Taylor expanded in x1 around inf 50.8%
Taylor expanded in x2 around inf 50.8%
associate-*r*50.8%
neg-mul-150.8%
associate-*r/50.8%
metadata-eval50.8%
Simplified50.8%
Final simplification45.4%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -8.5e-236) (not (<= x2 1.36e-120))) (* x2 (- (* x1 -12.0) 6.0)) (* x1 (+ -1.0 (* x2 -12.0)))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -8.5e-236) || !(x2 <= 1.36e-120)) {
tmp = x2 * ((x1 * -12.0) - 6.0);
} else {
tmp = x1 * (-1.0 + (x2 * -12.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-8.5d-236)) .or. (.not. (x2 <= 1.36d-120))) then
tmp = x2 * ((x1 * (-12.0d0)) - 6.0d0)
else
tmp = x1 * ((-1.0d0) + (x2 * (-12.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -8.5e-236) || !(x2 <= 1.36e-120)) {
tmp = x2 * ((x1 * -12.0) - 6.0);
} else {
tmp = x1 * (-1.0 + (x2 * -12.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -8.5e-236) or not (x2 <= 1.36e-120): tmp = x2 * ((x1 * -12.0) - 6.0) else: tmp = x1 * (-1.0 + (x2 * -12.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -8.5e-236) || !(x2 <= 1.36e-120)) tmp = Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)); else tmp = Float64(x1 * Float64(-1.0 + Float64(x2 * -12.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -8.5e-236) || ~((x2 <= 1.36e-120))) tmp = x2 * ((x1 * -12.0) - 6.0); else tmp = x1 * (-1.0 + (x2 * -12.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -8.5e-236], N[Not[LessEqual[x2, 1.36e-120]], $MachinePrecision]], N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(-1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -8.5 \cdot 10^{-236} \lor \neg \left(x2 \leq 1.36 \cdot 10^{-120}\right):\\
\;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\
\end{array}
\end{array}
if x2 < -8.49999999999999929e-236 or 1.36000000000000001e-120 < x2 Initial program 74.6%
Simplified74.6%
Taylor expanded in x1 around 0 54.9%
fma-define55.0%
associate-*r*55.0%
fma-neg55.0%
fma-neg55.0%
metadata-eval55.0%
metadata-eval55.0%
Simplified55.0%
Taylor expanded in x2 around 0 42.7%
Taylor expanded in x2 around inf 37.4%
if -8.49999999999999929e-236 < x2 < 1.36000000000000001e-120Initial program 80.2%
Simplified80.7%
Taylor expanded in x1 around 0 50.8%
fma-define50.8%
associate-*r*50.8%
fma-neg50.8%
fma-neg50.8%
metadata-eval50.8%
metadata-eval50.8%
Simplified50.8%
Taylor expanded in x2 around 0 50.8%
Taylor expanded in x1 around inf 40.7%
Final simplification38.1%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -5.2e-109) (not (<= x1 5e-102))) (* x1 (+ -1.0 (* x2 -12.0))) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -5.2e-109) || !(x1 <= 5e-102)) {
tmp = x1 * (-1.0 + (x2 * -12.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-5.2d-109)) .or. (.not. (x1 <= 5d-102))) then
tmp = x1 * ((-1.0d0) + (x2 * (-12.0d0)))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -5.2e-109) || !(x1 <= 5e-102)) {
tmp = x1 * (-1.0 + (x2 * -12.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -5.2e-109) or not (x1 <= 5e-102): tmp = x1 * (-1.0 + (x2 * -12.0)) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -5.2e-109) || !(x1 <= 5e-102)) tmp = Float64(x1 * Float64(-1.0 + Float64(x2 * -12.0))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -5.2e-109) || ~((x1 <= 5e-102))) tmp = x1 * (-1.0 + (x2 * -12.0)); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -5.2e-109], N[Not[LessEqual[x1, 5e-102]], $MachinePrecision]], N[(x1 * N[(-1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -5.2 \cdot 10^{-109} \lor \neg \left(x1 \leq 5 \cdot 10^{-102}\right):\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -5.1999999999999997e-109 or 5.00000000000000026e-102 < x1 Initial program 63.2%
Simplified63.4%
Taylor expanded in x1 around 0 38.0%
fma-define38.0%
associate-*r*38.0%
fma-neg38.0%
fma-neg38.0%
metadata-eval38.0%
metadata-eval38.0%
Simplified38.0%
Taylor expanded in x2 around 0 28.0%
Taylor expanded in x1 around inf 21.4%
if -5.1999999999999997e-109 < x1 < 5.00000000000000026e-102Initial program 99.6%
Simplified99.8%
Taylor expanded in x1 around 0 66.0%
*-commutative66.0%
Simplified66.0%
Final simplification36.7%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -3.4e-25) (* x1 (+ -1.0 (* x2 -12.0))) (if (<= x1 220000.0) (- (* x2 -6.0) x1) (* x2 (- (* x1 -12.0) 6.0)))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.4e-25) {
tmp = x1 * (-1.0 + (x2 * -12.0));
} else if (x1 <= 220000.0) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = x2 * ((x1 * -12.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 <= (-3.4d-25)) then
tmp = x1 * ((-1.0d0) + (x2 * (-12.0d0)))
else if (x1 <= 220000.0d0) then
tmp = (x2 * (-6.0d0)) - x1
else
tmp = x2 * ((x1 * (-12.0d0)) - 6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -3.4e-25) {
tmp = x1 * (-1.0 + (x2 * -12.0));
} else if (x1 <= 220000.0) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = x2 * ((x1 * -12.0) - 6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3.4e-25: tmp = x1 * (-1.0 + (x2 * -12.0)) elif x1 <= 220000.0: tmp = (x2 * -6.0) - x1 else: tmp = x2 * ((x1 * -12.0) - 6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3.4e-25) tmp = Float64(x1 * Float64(-1.0 + Float64(x2 * -12.0))); elseif (x1 <= 220000.0) tmp = Float64(Float64(x2 * -6.0) - x1); else tmp = Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -3.4e-25) tmp = x1 * (-1.0 + (x2 * -12.0)); elseif (x1 <= 220000.0) tmp = (x2 * -6.0) - x1; else tmp = x2 * ((x1 * -12.0) - 6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3.4e-25], N[(x1 * N[(-1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 220000.0], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.4 \cdot 10^{-25}:\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot -12\right)\\
\mathbf{elif}\;x1 \leq 220000:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right)\\
\end{array}
\end{array}
if x1 < -3.40000000000000002e-25Initial program 46.7%
Simplified46.7%
Taylor expanded in x1 around 0 17.4%
fma-define17.4%
associate-*r*17.4%
fma-neg17.4%
fma-neg17.4%
metadata-eval17.4%
metadata-eval17.4%
Simplified17.4%
Taylor expanded in x2 around 0 19.4%
Taylor expanded in x1 around inf 19.6%
if -3.40000000000000002e-25 < x1 < 2.2e5Initial program 99.5%
Simplified99.7%
Taylor expanded in x1 around 0 86.7%
fma-define86.8%
associate-*r*86.8%
fma-neg86.8%
fma-neg86.8%
metadata-eval86.8%
metadata-eval86.8%
Simplified86.8%
Taylor expanded in x2 around 0 74.1%
Taylor expanded in x1 around 0 74.1%
if 2.2e5 < x1 Initial program 57.7%
Simplified57.7%
Taylor expanded in x1 around 0 25.9%
fma-define25.9%
associate-*r*25.9%
fma-neg25.9%
fma-neg25.9%
metadata-eval25.9%
metadata-eval25.9%
Simplified25.9%
Taylor expanded in x2 around 0 9.6%
Taylor expanded in x2 around inf 10.6%
Final simplification44.7%
(FPCore (x1 x2) :precision binary64 (if (<= x1 1.95e-151) (* x2 (- (- (* x1 -12.0) (/ x1 x2)) 6.0)) (* x1 (+ -1.0 (* x2 (- (* x2 8.0) 12.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= 1.95e-151) {
tmp = x2 * (((x1 * -12.0) - (x1 / x2)) - 6.0);
} else {
tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= 1.95d-151) then
tmp = x2 * (((x1 * (-12.0d0)) - (x1 / x2)) - 6.0d0)
else
tmp = x1 * ((-1.0d0) + (x2 * ((x2 * 8.0d0) - 12.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 1.95e-151) {
tmp = x2 * (((x1 * -12.0) - (x1 / x2)) - 6.0);
} else {
tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 1.95e-151: tmp = x2 * (((x1 * -12.0) - (x1 / x2)) - 6.0) else: tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 1.95e-151) tmp = Float64(x2 * Float64(Float64(Float64(x1 * -12.0) - Float64(x1 / x2)) - 6.0)); else tmp = Float64(x1 * Float64(-1.0 + Float64(x2 * Float64(Float64(x2 * 8.0) - 12.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 1.95e-151) tmp = x2 * (((x1 * -12.0) - (x1 / x2)) - 6.0); else tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 1.95e-151], N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] - N[(x1 / x2), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(-1.0 + N[(x2 * N[(N[(x2 * 8.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 1.95 \cdot 10^{-151}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 - \frac{x1}{x2}\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\
\end{array}
\end{array}
if x1 < 1.95000000000000003e-151Initial program 77.8%
Simplified78.0%
Taylor expanded in x1 around 0 57.2%
fma-define57.3%
associate-*r*57.3%
fma-neg57.3%
fma-neg57.3%
metadata-eval57.3%
metadata-eval57.3%
Simplified57.3%
Taylor expanded in x2 around 0 55.5%
Taylor expanded in x2 around inf 62.4%
if 1.95000000000000003e-151 < x1 Initial program 72.2%
Simplified72.3%
Taylor expanded in x1 around 0 48.7%
fma-define48.7%
associate-*r*48.7%
fma-neg48.7%
fma-neg48.7%
metadata-eval48.7%
metadata-eval48.7%
Simplified48.7%
Taylor expanded in x2 around 0 48.7%
Taylor expanded in x1 around inf 40.9%
Final simplification54.4%
(FPCore (x1 x2) :precision binary64 (if (<= x1 1.95e-151) (- (* x2 (- (* x1 -12.0) 6.0)) x1) (* x1 (+ -1.0 (* x2 (- (* x2 8.0) 12.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= 1.95e-151) {
tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1;
} else {
tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= 1.95d-151) then
tmp = (x2 * ((x1 * (-12.0d0)) - 6.0d0)) - x1
else
tmp = x1 * ((-1.0d0) + (x2 * ((x2 * 8.0d0) - 12.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 1.95e-151) {
tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1;
} else {
tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 1.95e-151: tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1 else: tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 1.95e-151) tmp = Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) - x1); else tmp = Float64(x1 * Float64(-1.0 + Float64(x2 * Float64(Float64(x2 * 8.0) - 12.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 1.95e-151) tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1; else tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 1.95e-151], N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(x1 * N[(-1.0 + N[(x2 * N[(N[(x2 * 8.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 1.95 \cdot 10^{-151}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\
\end{array}
\end{array}
if x1 < 1.95000000000000003e-151Initial program 77.8%
Simplified78.0%
Taylor expanded in x1 around 0 57.2%
fma-define57.3%
associate-*r*57.3%
fma-neg57.3%
fma-neg57.3%
metadata-eval57.3%
metadata-eval57.3%
Simplified57.3%
Taylor expanded in x2 around 0 55.5%
if 1.95000000000000003e-151 < x1 Initial program 72.2%
Simplified72.3%
Taylor expanded in x1 around 0 48.7%
fma-define48.7%
associate-*r*48.7%
fma-neg48.7%
fma-neg48.7%
metadata-eval48.7%
metadata-eval48.7%
Simplified48.7%
Taylor expanded in x2 around 0 48.7%
Taylor expanded in x1 around inf 40.9%
Final simplification50.1%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -8.5e-236) (not (<= x2 4.2e-120))) (* x2 -6.0) (- x1)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -8.5e-236) || !(x2 <= 4.2e-120)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-8.5d-236)) .or. (.not. (x2 <= 4.2d-120))) then
tmp = x2 * (-6.0d0)
else
tmp = -x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -8.5e-236) || !(x2 <= 4.2e-120)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -8.5e-236) or not (x2 <= 4.2e-120): tmp = x2 * -6.0 else: tmp = -x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -8.5e-236) || !(x2 <= 4.2e-120)) tmp = Float64(x2 * -6.0); else tmp = Float64(-x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -8.5e-236) || ~((x2 <= 4.2e-120))) tmp = x2 * -6.0; else tmp = -x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -8.5e-236], N[Not[LessEqual[x2, 4.2e-120]], $MachinePrecision]], N[(x2 * -6.0), $MachinePrecision], (-x1)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -8.5 \cdot 10^{-236} \lor \neg \left(x2 \leq 4.2 \cdot 10^{-120}\right):\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;-x1\\
\end{array}
\end{array}
if x2 < -8.49999999999999929e-236 or 4.2000000000000001e-120 < x2 Initial program 74.6%
Simplified74.6%
Taylor expanded in x1 around 0 30.9%
*-commutative30.9%
Simplified30.9%
if -8.49999999999999929e-236 < x2 < 4.2000000000000001e-120Initial program 80.2%
Simplified80.7%
Taylor expanded in x1 around 0 50.8%
fma-define50.8%
associate-*r*50.8%
fma-neg50.8%
fma-neg50.8%
metadata-eval50.8%
metadata-eval50.8%
Simplified50.8%
Taylor expanded in x2 around 0 50.8%
Taylor expanded in x2 around 0 40.7%
neg-mul-140.7%
Simplified40.7%
Final simplification33.0%
(FPCore (x1 x2) :precision binary64 (- x1))
double code(double x1, double x2) {
return -x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = -x1
end function
public static double code(double x1, double x2) {
return -x1;
}
def code(x1, x2): return -x1
function code(x1, x2) return Float64(-x1) end
function tmp = code(x1, x2) tmp = -x1; end
code[x1_, x2_] := (-x1)
\begin{array}{l}
\\
-x1
\end{array}
Initial program 75.7%
Simplified75.9%
Taylor expanded in x1 around 0 54.1%
fma-define54.1%
associate-*r*54.1%
fma-neg54.1%
fma-neg54.1%
metadata-eval54.1%
metadata-eval54.1%
Simplified54.1%
Taylor expanded in x2 around 0 44.3%
Taylor expanded in x2 around 0 13.0%
neg-mul-113.0%
Simplified13.0%
herbie shell --seed 2024146
(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))))))