
(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 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3 (/ (fma x1 (* x1 3.0) (- (* 2.0 x2) x1)) (fma x1 x1 1.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_0 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_3 4.0 -6.0)) (* t_3 (* (* x1 2.0) (+ t_3 -3.0))))
(+
(*
(* 3.0 (* x1 x1))
(/ (- (fma (* x1 3.0) x1 (+ x2 x2)) x1) (fma x1 x1 1.0)))
(pow x1 3.0))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) (* 3.0 (* x2 -2.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = fma(x1, (x1 * 3.0), ((2.0 * x2) - x1)) / fma(x1, x1, 1.0);
double tmp;
if ((x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_3, 4.0, -6.0)), (t_3 * ((x1 * 2.0) * (t_3 + -3.0)))), (((3.0 * (x1 * x1)) * ((fma((x1 * 3.0), x1, (x2 + x2)) - x1) / fma(x1, x1, 1.0))) + pow(x1, 3.0)))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + (3.0 * (x2 * -2.0)));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(fma(x1, Float64(x1 * 3.0), Float64(Float64(2.0 * x2) - x1)) / fma(x1, x1, 1.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_3, 4.0, -6.0)), Float64(t_3 * Float64(Float64(x1 * 2.0) * Float64(t_3 + -3.0)))), Float64(Float64(Float64(3.0 * Float64(x1 * x1)) * Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(x2 + x2)) - x1) / fma(x1, x1, 1.0))) + (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + Float64(3.0 * Float64(x2 * -2.0)))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$0 - 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$3 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(t$95$3 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(x2 + x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_3 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_0 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_0 - \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_3, 4, -6\right), t_3 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(t_3 + -3\right)\right)\right), \left(3 \cdot \left(x1 \cdot x1\right)\right) \cdot \frac{\mathsf{fma}\left(x1 \cdot 3, x1, x2 + x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)} + {x1}^{3}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.6%
Simplified99.8%
fma-udef99.8%
*-commutative99.8%
*-commutative99.8%
fma-udef99.8%
*-commutative99.8%
*-commutative99.8%
associate--l+99.8%
fma-def99.8%
associate-*l*99.8%
fma-def99.8%
count-299.8%
fma-def99.8%
Applied egg-rr99.8%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 97.4%
*-commutative97.4%
Simplified97.4%
Final simplification99.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3 (/ (fma x1 (* x1 3.0) (- (* 2.0 x2) x1)) (fma x1 x1 1.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_0 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_3 4.0 -6.0)) (* t_3 (* (* x1 2.0) (+ t_3 -3.0))))
(+
(pow x1 3.0)
(* (* 3.0 (* x1 x1)) (/ (- t_0 x1) (fma x1 x1 1.0))))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) (* 3.0 (* x2 -2.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = fma(x1, (x1 * 3.0), ((2.0 * x2) - x1)) / fma(x1, x1, 1.0);
double tmp;
if ((x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_3, 4.0, -6.0)), (t_3 * ((x1 * 2.0) * (t_3 + -3.0)))), (pow(x1, 3.0) + ((3.0 * (x1 * x1)) * ((t_0 - x1) / fma(x1, x1, 1.0)))))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + (3.0 * (x2 * -2.0)));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(fma(x1, Float64(x1 * 3.0), Float64(Float64(2.0 * x2) - x1)) / fma(x1, x1, 1.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_3, 4.0, -6.0)), Float64(t_3 * Float64(Float64(x1 * 2.0) * Float64(t_3 + -3.0)))), Float64((x1 ^ 3.0) + Float64(Float64(3.0 * Float64(x1 * x1)) * Float64(Float64(t_0 - x1) / fma(x1, x1, 1.0)))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + Float64(3.0 * Float64(x2 * -2.0)))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$0 - 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$3 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(t$95$3 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[x1, 3.0], $MachinePrecision] + N[(N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_3 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_0 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_0 - \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_3, 4, -6\right), t_3 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(t_3 + -3\right)\right)\right), {x1}^{3} + \left(3 \cdot \left(x1 \cdot x1\right)\right) \cdot \frac{t_0 - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.6%
Simplified99.8%
fma-udef99.8%
*-commutative99.8%
*-commutative99.8%
fma-udef99.8%
*-commutative99.8%
*-commutative99.8%
associate--l+99.8%
fma-def99.8%
associate-*l*99.8%
fma-def99.8%
count-299.8%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in x2 around 0 99.7%
unpow299.7%
associate-*r*99.7%
*-commutative99.7%
+-commutative99.7%
unpow299.7%
fma-udef99.7%
Simplified99.7%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 97.4%
*-commutative97.4%
Simplified97.4%
Final simplification99.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
(if (<= t_3 INFINITY)
t_3
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) (* 3.0 (* x2 -2.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + (3.0 * (x2 * -2.0)));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + (3.0 * (x2 * -2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + (3.0 * (x2 * -2.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + Float64(3.0 * Float64(x2 * -2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + (3.0 * (x2 * -2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_0 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)\\
\mathbf{if}\;t_3 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.6%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 97.4%
*-commutative97.4%
Simplified97.4%
Final simplification98.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 6.0 (pow x1 4.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* 3.0 (* x2 -2.0)))
(t_3 (/ (- (+ (* x1 (* x1 3.0)) (* 2.0 x2)) x1) t_1)))
(if (<= x1 -5.5e+102)
(+ (* x1 2.0) t_0)
(if (<= x1 2.4e+49)
(+
x1
(+
t_2
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* x1 (* (* x1 3.0) (- 3.0 (/ 1.0 x1)))))))))
(+ x1 (+ (+ x1 t_0) t_2))))))
double code(double x1, double x2) {
double t_0 = 6.0 * pow(x1, 4.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 * (x2 * -2.0);
double t_3 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.5e+102) {
tmp = (x1 * 2.0) + t_0;
} else if (x1 <= 2.4e+49) {
tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (x1 * ((x1 * 3.0) * (3.0 - (1.0 / x1))))))));
} else {
tmp = x1 + ((x1 + t_0) + t_2);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = 6.0d0 * (x1 ** 4.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = 3.0d0 * (x2 * (-2.0d0))
t_3 = (((x1 * (x1 * 3.0d0)) + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-5.5d+102)) then
tmp = (x1 * 2.0d0) + t_0
else if (x1 <= 2.4d+49) then
tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_3) * (t_3 - 3.0d0)) + ((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)))) + (x1 * ((x1 * 3.0d0) * (3.0d0 - (1.0d0 / x1))))))))
else
tmp = x1 + ((x1 + t_0) + t_2)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 6.0 * Math.pow(x1, 4.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 * (x2 * -2.0);
double t_3 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.5e+102) {
tmp = (x1 * 2.0) + t_0;
} else if (x1 <= 2.4e+49) {
tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (x1 * ((x1 * 3.0) * (3.0 - (1.0 / x1))))))));
} else {
tmp = x1 + ((x1 + t_0) + t_2);
}
return tmp;
}
def code(x1, x2): t_0 = 6.0 * math.pow(x1, 4.0) t_1 = (x1 * x1) + 1.0 t_2 = 3.0 * (x2 * -2.0) t_3 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -5.5e+102: tmp = (x1 * 2.0) + t_0 elif x1 <= 2.4e+49: tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (x1 * ((x1 * 3.0) * (3.0 - (1.0 / x1)))))))) else: tmp = x1 + ((x1 + t_0) + t_2) return tmp
function code(x1, x2) t_0 = Float64(6.0 * (x1 ^ 4.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(3.0 * Float64(x2 * -2.0)) t_3 = Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -5.5e+102) tmp = Float64(Float64(x1 * 2.0) + t_0); elseif (x1 <= 2.4e+49) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(x1 * Float64(Float64(x1 * 3.0) * Float64(3.0 - Float64(1.0 / x1))))))))); else tmp = Float64(x1 + Float64(Float64(x1 + t_0) + t_2)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 6.0 * (x1 ^ 4.0); t_1 = (x1 * x1) + 1.0; t_2 = 3.0 * (x2 * -2.0); t_3 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -5.5e+102) tmp = (x1 * 2.0) + t_0; elseif (x1 <= 2.4e+49) tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (x1 * ((x1 * 3.0) * (3.0 - (1.0 / x1)))))))); else tmp = x1 + ((x1 + t_0) + t_2); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5.5e+102], N[(N[(x1 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[x1, 2.4e+49], N[(x1 + N[(t$95$2 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] * N[(3.0 - N[(1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + t$95$0), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot {x1}^{4}\\
t_1 := x1 \cdot x1 + 1\\
t_2 := 3 \cdot \left(x2 \cdot -2\right)\\
t_3 := \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+102}:\\
\;\;\;\;x1 \cdot 2 + t_0\\
\mathbf{elif}\;x1 \leq 2.4 \cdot 10^{+49}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - \frac{1}{x1}\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + t_0\right) + t_2\right)\\
\end{array}
\end{array}
if x1 < -5.49999999999999981e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x1 around inf 100.0%
if -5.49999999999999981e102 < x1 < 2.4e49Initial program 99.5%
Taylor expanded in x1 around 0 75.5%
*-commutative75.5%
Simplified75.5%
Taylor expanded in x1 around inf 92.6%
pow192.6%
*-commutative92.6%
*-commutative92.6%
Applied egg-rr92.6%
unpow192.6%
associate-*l*99.4%
Simplified99.4%
if 2.4e49 < x1 Initial program 42.8%
Taylor expanded in x1 around 0 42.8%
*-commutative42.8%
Simplified42.8%
Taylor expanded in x1 around inf 96.4%
*-commutative96.4%
Simplified96.4%
Final simplification98.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (/ (- (+ (* x1 (* x1 3.0)) (* 2.0 x2)) x1) t_0)))
(if (or (<= x1 -5.5e+102) (not (<= x1 2.4e+49)))
(+ (* x1 2.0) (* 6.0 (pow x1 4.0)))
(+
x1
(+
(* 3.0 (* x2 -2.0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_0
(+
(* (* (* x1 2.0) t_1) (- t_1 3.0))
(* (* x1 x1) (- (* t_1 4.0) 6.0))))
(* x1 (* (* x1 3.0) (- 3.0 (/ 1.0 x1))))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_0;
double tmp;
if ((x1 <= -5.5e+102) || !(x1 <= 2.4e+49)) {
tmp = (x1 * 2.0) + (6.0 * pow(x1, 4.0));
} else {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * ((((x1 * 2.0) * t_1) * (t_1 - 3.0)) + ((x1 * x1) * ((t_1 * 4.0) - 6.0)))) + (x1 * ((x1 * 3.0) * (3.0 - (1.0 / x1))))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = (((x1 * (x1 * 3.0d0)) + (2.0d0 * x2)) - x1) / t_0
if ((x1 <= (-5.5d+102)) .or. (.not. (x1 <= 2.4d+49))) then
tmp = (x1 * 2.0d0) + (6.0d0 * (x1 ** 4.0d0))
else
tmp = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * ((((x1 * 2.0d0) * t_1) * (t_1 - 3.0d0)) + ((x1 * x1) * ((t_1 * 4.0d0) - 6.0d0)))) + (x1 * ((x1 * 3.0d0) * (3.0d0 - (1.0d0 / x1))))))))
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)) + (2.0 * x2)) - x1) / t_0;
double tmp;
if ((x1 <= -5.5e+102) || !(x1 <= 2.4e+49)) {
tmp = (x1 * 2.0) + (6.0 * Math.pow(x1, 4.0));
} else {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * ((((x1 * 2.0) * t_1) * (t_1 - 3.0)) + ((x1 * x1) * ((t_1 * 4.0) - 6.0)))) + (x1 * ((x1 * 3.0) * (3.0 - (1.0 / x1))))))));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_0 tmp = 0 if (x1 <= -5.5e+102) or not (x1 <= 2.4e+49): tmp = (x1 * 2.0) + (6.0 * math.pow(x1, 4.0)) else: tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * ((((x1 * 2.0) * t_1) * (t_1 - 3.0)) + ((x1 * x1) * ((t_1 * 4.0) - 6.0)))) + (x1 * ((x1 * 3.0) * (3.0 - (1.0 / x1)))))))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) + Float64(2.0 * x2)) - x1) / t_0) tmp = 0.0 if ((x1 <= -5.5e+102) || !(x1 <= 2.4e+49)) tmp = Float64(Float64(x1 * 2.0) + Float64(6.0 * (x1 ^ 4.0))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_1) * Float64(t_1 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_1 * 4.0) - 6.0)))) + Float64(x1 * Float64(Float64(x1 * 3.0) * Float64(3.0 - Float64(1.0 / x1))))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_0; tmp = 0.0; if ((x1 <= -5.5e+102) || ~((x1 <= 2.4e+49))) tmp = (x1 * 2.0) + (6.0 * (x1 ^ 4.0)); else tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * ((((x1 * 2.0) * t_1) * (t_1 - 3.0)) + ((x1 * x1) * ((t_1 * 4.0) - 6.0)))) + (x1 * ((x1 * 3.0) * (3.0 - (1.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[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[Or[LessEqual[x1, -5.5e+102], N[Not[LessEqual[x1, 2.4e+49]], $MachinePrecision]], N[(N[(x1 * 2.0), $MachinePrecision] + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(t$95$1 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$1 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] * N[(3.0 - N[(1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{t_0}\\
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+102} \lor \neg \left(x1 \leq 2.4 \cdot 10^{+49}\right):\\
\;\;\;\;x1 \cdot 2 + 6 \cdot {x1}^{4}\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_1\right) \cdot \left(t_1 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_1 \cdot 4 - 6\right)\right) + x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - \frac{1}{x1}\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.49999999999999981e102 or 2.4e49 < x1 Initial program 24.0%
Taylor expanded in x1 around 0 24.0%
*-commutative24.0%
Simplified24.0%
Taylor expanded in x1 around inf 98.0%
*-commutative98.0%
Simplified98.0%
Taylor expanded in x1 around inf 98.0%
if -5.49999999999999981e102 < x1 < 2.4e49Initial program 99.5%
Taylor expanded in x1 around 0 75.5%
*-commutative75.5%
Simplified75.5%
Taylor expanded in x1 around inf 92.6%
pow192.6%
*-commutative92.6%
*-commutative92.6%
Applied egg-rr92.6%
unpow192.6%
associate-*l*99.4%
Simplified99.4%
Final simplification98.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* x2 x2) 36.0))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ (* x1 (* x1 3.0)) (* 2.0 x2)) x1) t_1)))
(if (<= x1 -2.7e+103)
(+
x1
(+
(+ x1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))
(/ (- t_0 (* (* x1 x1) 9.0)) (- (* x2 -6.0) (* x1 -3.0)))))
(if (<= x1 1.35e+154)
(+
x1
(+
(* 3.0 (* x2 -2.0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* x1 (* (* x1 3.0) (- 3.0 (/ 1.0 x1)))))))))
(/ (- (* x1 x1) t_0) (- x1 (* x2 -6.0)))))))
double code(double x1, double x2) {
double t_0 = (x2 * x2) * 36.0;
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -2.7e+103) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + ((t_0 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (x1 * ((x1 * 3.0) * (3.0 - (1.0 / x1))))))));
} else {
tmp = ((x1 * x1) - t_0) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (x2 * x2) * 36.0d0
t_1 = (x1 * x1) + 1.0d0
t_2 = (((x1 * (x1 * 3.0d0)) + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-2.7d+103)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))) + ((t_0 - ((x1 * x1) * 9.0d0)) / ((x2 * (-6.0d0)) - (x1 * (-3.0d0)))))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (x1 * ((x1 * 3.0d0) * (3.0d0 - (1.0d0 / x1))))))))
else
tmp = ((x1 * x1) - t_0) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x2 * x2) * 36.0;
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -2.7e+103) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + ((t_0 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (x1 * ((x1 * 3.0) * (3.0 - (1.0 / x1))))))));
} else {
tmp = ((x1 * x1) - t_0) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x2 * x2) * 36.0 t_1 = (x1 * x1) + 1.0 t_2 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -2.7e+103: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + ((t_0 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0)))) elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (x1 * ((x1 * 3.0) * (3.0 - (1.0 / x1)))))))) else: tmp = ((x1 * x1) - t_0) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x2 * x2) * 36.0) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -2.7e+103) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(Float64(t_0 - Float64(Float64(x1 * x1) * 9.0)) / Float64(Float64(x2 * -6.0) - Float64(x1 * -3.0))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(x1 * Float64(Float64(x1 * 3.0) * Float64(3.0 - Float64(1.0 / x1))))))))); else tmp = Float64(Float64(Float64(x1 * x1) - t_0) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x2 * x2) * 36.0; t_1 = (x1 * x1) + 1.0; t_2 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -2.7e+103) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + ((t_0 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0)))); elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (x1 * ((x1 * 3.0) * (3.0 - (1.0 / x1)))))))); else tmp = ((x1 * x1) - t_0) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -2.7e+103], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 - N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] * N[(3.0 - N[(1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x2 \cdot x2\right) \cdot 36\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -2.7 \cdot 10^{+103}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + \frac{t_0 - \left(x1 \cdot x1\right) \cdot 9}{x2 \cdot -6 - x1 \cdot -3}\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + x1 \cdot \left(\left(x1 \cdot 3\right) \cdot \left(3 - \frac{1}{x1}\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - t_0}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -2.69999999999999993e103Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 2.4%
flip-+41.0%
*-commutative41.0%
*-commutative41.0%
*-commutative41.0%
*-commutative41.0%
*-commutative41.0%
*-commutative41.0%
Applied egg-rr41.0%
swap-sqr41.0%
metadata-eval41.0%
swap-sqr41.0%
metadata-eval41.0%
*-commutative41.0%
Simplified41.0%
if -2.69999999999999993e103 < x1 < 1.35000000000000003e154Initial program 98.5%
Taylor expanded in x1 around 0 77.9%
*-commutative77.9%
Simplified77.9%
Taylor expanded in x1 around inf 92.5%
pow192.5%
*-commutative92.5%
*-commutative92.5%
Applied egg-rr92.5%
unpow192.5%
associate-*l*98.4%
Simplified98.4%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 7.4%
*-commutative7.4%
Simplified7.4%
flip-+66.7%
Applied egg-rr66.7%
swap-sqr66.7%
metadata-eval66.7%
*-commutative66.7%
Simplified66.7%
Final simplification84.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* 3.0 t_0))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2)))
(t_4 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_5 (- t_4 3.0))
(t_6 (* (* (* x1 2.0) t_4) t_5))
(t_7 (* (* x2 x2) 36.0))
(t_8 (* 3.0 (* x2 -2.0)))
(t_9 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))
(t_10 (+ x1 t_9))
(t_11 (* x1 (* x1 x1))))
(if (<= x1 -3.3e+94)
(+ x1 (+ t_10 (/ (- t_7 (* (* x1 x1) 9.0)) (- (* x2 -6.0) (* x1 -3.0)))))
(if (<= x1 -3.2e+21)
(+
x1
(+
t_8
(+
x1
(+
t_11
(+
t_1
(*
t_2
(+
(* (* x1 x1) (- (* t_4 4.0) 6.0))
(* t_5 (* (* x1 2.0) 3.0)))))))))
(if (<= x1 -2.7e-235)
(+
x1
(+ t_3 (+ x1 (+ t_11 (+ (* t_2 t_9) (* t_0 (- (* 2.0 x2) x1)))))))
(if (<= x1 3.4e-210)
(+
x1
(+ t_8 (+ x1 (+ t_11 (+ t_1 (* t_2 (+ t_6 (* x1 (* x1 6.0)))))))))
(if (<= x1 0.00032)
(+ x1 (+ t_3 t_10))
(if (<= x1 1.35e+154)
(+
x1
(+
t_8
(+
x1
(+
t_11
(+
(*
t_2
(+ t_6 (* (* x1 x1) (- (* 4.0 (- 3.0 (/ 1.0 x1))) 6.0))))
t_1)))))
(/ (- (* x1 x1) t_7) (- x1 (* x2 -6.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = 3.0 * t_0;
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_5 = t_4 - 3.0;
double t_6 = ((x1 * 2.0) * t_4) * t_5;
double t_7 = (x2 * x2) * 36.0;
double t_8 = 3.0 * (x2 * -2.0);
double t_9 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)));
double t_10 = x1 + t_9;
double t_11 = x1 * (x1 * x1);
double tmp;
if (x1 <= -3.3e+94) {
tmp = x1 + (t_10 + ((t_7 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= -3.2e+21) {
tmp = x1 + (t_8 + (x1 + (t_11 + (t_1 + (t_2 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (t_5 * ((x1 * 2.0) * 3.0))))))));
} else if (x1 <= -2.7e-235) {
tmp = x1 + (t_3 + (x1 + (t_11 + ((t_2 * t_9) + (t_0 * ((2.0 * x2) - x1))))));
} else if (x1 <= 3.4e-210) {
tmp = x1 + (t_8 + (x1 + (t_11 + (t_1 + (t_2 * (t_6 + (x1 * (x1 * 6.0))))))));
} else if (x1 <= 0.00032) {
tmp = x1 + (t_3 + t_10);
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_8 + (x1 + (t_11 + ((t_2 * (t_6 + ((x1 * x1) * ((4.0 * (3.0 - (1.0 / x1))) - 6.0)))) + t_1))));
} else {
tmp = ((x1 * x1) - t_7) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_10
real(8) :: t_11
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 = x1 * (x1 * 3.0d0)
t_1 = 3.0d0 * t_0
t_2 = (x1 * x1) + 1.0d0
t_3 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_2)
t_4 = ((t_0 + (2.0d0 * x2)) - x1) / t_2
t_5 = t_4 - 3.0d0
t_6 = ((x1 * 2.0d0) * t_4) * t_5
t_7 = (x2 * x2) * 36.0d0
t_8 = 3.0d0 * (x2 * (-2.0d0))
t_9 = 4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0)))
t_10 = x1 + t_9
t_11 = x1 * (x1 * x1)
if (x1 <= (-3.3d+94)) then
tmp = x1 + (t_10 + ((t_7 - ((x1 * x1) * 9.0d0)) / ((x2 * (-6.0d0)) - (x1 * (-3.0d0)))))
else if (x1 <= (-3.2d+21)) then
tmp = x1 + (t_8 + (x1 + (t_11 + (t_1 + (t_2 * (((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)) + (t_5 * ((x1 * 2.0d0) * 3.0d0))))))))
else if (x1 <= (-2.7d-235)) then
tmp = x1 + (t_3 + (x1 + (t_11 + ((t_2 * t_9) + (t_0 * ((2.0d0 * x2) - x1))))))
else if (x1 <= 3.4d-210) then
tmp = x1 + (t_8 + (x1 + (t_11 + (t_1 + (t_2 * (t_6 + (x1 * (x1 * 6.0d0))))))))
else if (x1 <= 0.00032d0) then
tmp = x1 + (t_3 + t_10)
else if (x1 <= 1.35d+154) then
tmp = x1 + (t_8 + (x1 + (t_11 + ((t_2 * (t_6 + ((x1 * x1) * ((4.0d0 * (3.0d0 - (1.0d0 / x1))) - 6.0d0)))) + t_1))))
else
tmp = ((x1 * x1) - t_7) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = 3.0 * t_0;
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_5 = t_4 - 3.0;
double t_6 = ((x1 * 2.0) * t_4) * t_5;
double t_7 = (x2 * x2) * 36.0;
double t_8 = 3.0 * (x2 * -2.0);
double t_9 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)));
double t_10 = x1 + t_9;
double t_11 = x1 * (x1 * x1);
double tmp;
if (x1 <= -3.3e+94) {
tmp = x1 + (t_10 + ((t_7 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= -3.2e+21) {
tmp = x1 + (t_8 + (x1 + (t_11 + (t_1 + (t_2 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (t_5 * ((x1 * 2.0) * 3.0))))))));
} else if (x1 <= -2.7e-235) {
tmp = x1 + (t_3 + (x1 + (t_11 + ((t_2 * t_9) + (t_0 * ((2.0 * x2) - x1))))));
} else if (x1 <= 3.4e-210) {
tmp = x1 + (t_8 + (x1 + (t_11 + (t_1 + (t_2 * (t_6 + (x1 * (x1 * 6.0))))))));
} else if (x1 <= 0.00032) {
tmp = x1 + (t_3 + t_10);
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_8 + (x1 + (t_11 + ((t_2 * (t_6 + ((x1 * x1) * ((4.0 * (3.0 - (1.0 / x1))) - 6.0)))) + t_1))));
} else {
tmp = ((x1 * x1) - t_7) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = 3.0 * t_0 t_2 = (x1 * x1) + 1.0 t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2) t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2 t_5 = t_4 - 3.0 t_6 = ((x1 * 2.0) * t_4) * t_5 t_7 = (x2 * x2) * 36.0 t_8 = 3.0 * (x2 * -2.0) t_9 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))) t_10 = x1 + t_9 t_11 = x1 * (x1 * x1) tmp = 0 if x1 <= -3.3e+94: tmp = x1 + (t_10 + ((t_7 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0)))) elif x1 <= -3.2e+21: tmp = x1 + (t_8 + (x1 + (t_11 + (t_1 + (t_2 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (t_5 * ((x1 * 2.0) * 3.0)))))))) elif x1 <= -2.7e-235: tmp = x1 + (t_3 + (x1 + (t_11 + ((t_2 * t_9) + (t_0 * ((2.0 * x2) - x1)))))) elif x1 <= 3.4e-210: tmp = x1 + (t_8 + (x1 + (t_11 + (t_1 + (t_2 * (t_6 + (x1 * (x1 * 6.0)))))))) elif x1 <= 0.00032: tmp = x1 + (t_3 + t_10) elif x1 <= 1.35e+154: tmp = x1 + (t_8 + (x1 + (t_11 + ((t_2 * (t_6 + ((x1 * x1) * ((4.0 * (3.0 - (1.0 / x1))) - 6.0)))) + t_1)))) else: tmp = ((x1 * x1) - t_7) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(3.0 * t_0) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)) t_4 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_5 = Float64(t_4 - 3.0) t_6 = Float64(Float64(Float64(x1 * 2.0) * t_4) * t_5) t_7 = Float64(Float64(x2 * x2) * 36.0) t_8 = Float64(3.0 * Float64(x2 * -2.0)) t_9 = Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))) t_10 = Float64(x1 + t_9) t_11 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -3.3e+94) tmp = Float64(x1 + Float64(t_10 + Float64(Float64(t_7 - Float64(Float64(x1 * x1) * 9.0)) / Float64(Float64(x2 * -6.0) - Float64(x1 * -3.0))))); elseif (x1 <= -3.2e+21) tmp = Float64(x1 + Float64(t_8 + Float64(x1 + Float64(t_11 + Float64(t_1 + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) + Float64(t_5 * Float64(Float64(x1 * 2.0) * 3.0))))))))); elseif (x1 <= -2.7e-235) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_11 + Float64(Float64(t_2 * t_9) + Float64(t_0 * Float64(Float64(2.0 * x2) - x1))))))); elseif (x1 <= 3.4e-210) tmp = Float64(x1 + Float64(t_8 + Float64(x1 + Float64(t_11 + Float64(t_1 + Float64(t_2 * Float64(t_6 + Float64(x1 * Float64(x1 * 6.0))))))))); elseif (x1 <= 0.00032) tmp = Float64(x1 + Float64(t_3 + t_10)); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(t_8 + Float64(x1 + Float64(t_11 + Float64(Float64(t_2 * Float64(t_6 + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(3.0 - Float64(1.0 / x1))) - 6.0)))) + t_1))))); else tmp = Float64(Float64(Float64(x1 * x1) - t_7) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = 3.0 * t_0; t_2 = (x1 * x1) + 1.0; t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2); t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2; t_5 = t_4 - 3.0; t_6 = ((x1 * 2.0) * t_4) * t_5; t_7 = (x2 * x2) * 36.0; t_8 = 3.0 * (x2 * -2.0); t_9 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))); t_10 = x1 + t_9; t_11 = x1 * (x1 * x1); tmp = 0.0; if (x1 <= -3.3e+94) tmp = x1 + (t_10 + ((t_7 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0)))); elseif (x1 <= -3.2e+21) tmp = x1 + (t_8 + (x1 + (t_11 + (t_1 + (t_2 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (t_5 * ((x1 * 2.0) * 3.0)))))))); elseif (x1 <= -2.7e-235) tmp = x1 + (t_3 + (x1 + (t_11 + ((t_2 * t_9) + (t_0 * ((2.0 * x2) - x1)))))); elseif (x1 <= 3.4e-210) tmp = x1 + (t_8 + (x1 + (t_11 + (t_1 + (t_2 * (t_6 + (x1 * (x1 * 6.0)))))))); elseif (x1 <= 0.00032) tmp = x1 + (t_3 + t_10); elseif (x1 <= 1.35e+154) tmp = x1 + (t_8 + (x1 + (t_11 + ((t_2 * (t_6 + ((x1 * x1) * ((4.0 * (3.0 - (1.0 / x1))) - 6.0)))) + t_1)))); else tmp = ((x1 * x1) - t_7) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 - 3.0), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]}, Block[{t$95$8 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$9 = N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$10 = N[(x1 + t$95$9), $MachinePrecision]}, Block[{t$95$11 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.3e+94], N[(x1 + N[(t$95$10 + N[(N[(t$95$7 - N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3.2e+21], N[(x1 + N[(t$95$8 + N[(x1 + N[(t$95$11 + N[(t$95$1 + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$5 * N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2.7e-235], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$11 + N[(N[(t$95$2 * t$95$9), $MachinePrecision] + N[(t$95$0 * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.4e-210], N[(x1 + N[(t$95$8 + N[(x1 + N[(t$95$11 + N[(t$95$1 + N[(t$95$2 * N[(t$95$6 + N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.00032], N[(x1 + N[(t$95$3 + t$95$10), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$8 + N[(x1 + N[(t$95$11 + N[(N[(t$95$2 * N[(t$95$6 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(3.0 - N[(1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - t$95$7), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := 3 \cdot t_0\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_2}\\
t_4 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_2}\\
t_5 := t_4 - 3\\
t_6 := \left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot t_5\\
t_7 := \left(x2 \cdot x2\right) \cdot 36\\
t_8 := 3 \cdot \left(x2 \cdot -2\right)\\
t_9 := 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
t_10 := x1 + t_9\\
t_11 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -3.3 \cdot 10^{+94}:\\
\;\;\;\;x1 + \left(t_10 + \frac{t_7 - \left(x1 \cdot x1\right) \cdot 9}{x2 \cdot -6 - x1 \cdot -3}\right)\\
\mathbf{elif}\;x1 \leq -3.2 \cdot 10^{+21}:\\
\;\;\;\;x1 + \left(t_8 + \left(x1 + \left(t_11 + \left(t_1 + t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right) + t_5 \cdot \left(\left(x1 \cdot 2\right) \cdot 3\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -2.7 \cdot 10^{-235}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_11 + \left(t_2 \cdot t_9 + t_0 \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 3.4 \cdot 10^{-210}:\\
\;\;\;\;x1 + \left(t_8 + \left(x1 + \left(t_11 + \left(t_1 + t_2 \cdot \left(t_6 + x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 0.00032:\\
\;\;\;\;x1 + \left(t_3 + t_10\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t_8 + \left(x1 + \left(t_11 + \left(t_2 \cdot \left(t_6 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 - \frac{1}{x1}\right) - 6\right)\right) + t_1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - t_7}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -3.3e94Initial program 4.3%
Taylor expanded in x1 around 0 2.2%
Taylor expanded in x1 around 0 4.5%
flip-+41.5%
*-commutative41.5%
*-commutative41.5%
*-commutative41.5%
*-commutative41.5%
*-commutative41.5%
*-commutative41.5%
Applied egg-rr41.5%
swap-sqr41.5%
metadata-eval41.5%
swap-sqr41.5%
metadata-eval41.5%
*-commutative41.5%
Simplified41.5%
if -3.3e94 < x1 < -3.2e21Initial program 99.4%
Taylor expanded in x1 around 0 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around inf 96.4%
if -3.2e21 < x1 < -2.7000000000000002e-235Initial program 99.4%
Taylor expanded in x1 around 0 91.9%
Taylor expanded in x1 around 0 89.0%
Taylor expanded in x1 around 0 89.2%
if -2.7000000000000002e-235 < x1 < 3.39999999999999974e-210Initial program 99.8%
Taylor expanded in x1 around 0 93.4%
*-commutative93.4%
Simplified93.4%
Taylor expanded in x1 around inf 93.4%
Taylor expanded in x1 around inf 93.4%
unpow293.4%
associate-*r*93.4%
Simplified93.4%
if 3.39999999999999974e-210 < x1 < 3.20000000000000026e-4Initial program 99.5%
Taylor expanded in x1 around 0 95.4%
if 3.20000000000000026e-4 < x1 < 1.35000000000000003e154Initial program 93.9%
Taylor expanded in x1 around 0 93.1%
*-commutative93.1%
Simplified93.1%
Taylor expanded in x1 around inf 92.8%
Taylor expanded in x1 around inf 92.3%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 7.4%
*-commutative7.4%
Simplified7.4%
flip-+66.7%
Applied egg-rr66.7%
swap-sqr66.7%
metadata-eval66.7%
*-commutative66.7%
Simplified66.7%
Final simplification80.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* x2 x2) 36.0))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ (* x1 (* x1 3.0)) (* 2.0 x2)) x1) t_1)))
(if (<= x1 -5.4e+103)
(+
x1
(+
(+ x1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))
(/ (- t_0 (* (* x1 x1) 9.0)) (- (* x2 -6.0) (* x1 -3.0)))))
(if (<= x1 1.35e+154)
(+
x1
(+
(* 3.0 (* x2 -2.0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* x1 -3.0))))))
(/ (- (* x1 x1) t_0) (- x1 (* x2 -6.0)))))))
double code(double x1, double x2) {
double t_0 = (x2 * x2) * 36.0;
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.4e+103) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + ((t_0 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (x1 * -3.0)))));
} else {
tmp = ((x1 * x1) - t_0) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (x2 * x2) * 36.0d0
t_1 = (x1 * x1) + 1.0d0
t_2 = (((x1 * (x1 * 3.0d0)) + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-5.4d+103)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))) + ((t_0 - ((x1 * x1) * 9.0d0)) / ((x2 * (-6.0d0)) - (x1 * (-3.0d0)))))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (x1 * (-3.0d0))))))
else
tmp = ((x1 * x1) - t_0) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x2 * x2) * 36.0;
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.4e+103) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + ((t_0 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (x1 * -3.0)))));
} else {
tmp = ((x1 * x1) - t_0) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x2 * x2) * 36.0 t_1 = (x1 * x1) + 1.0 t_2 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -5.4e+103: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + ((t_0 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0)))) elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (x1 * -3.0))))) else: tmp = ((x1 * x1) - t_0) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x2 * x2) * 36.0) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -5.4e+103) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(Float64(t_0 - Float64(Float64(x1 * x1) * 9.0)) / Float64(Float64(x2 * -6.0) - Float64(x1 * -3.0))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(x1 * -3.0)))))); else tmp = Float64(Float64(Float64(x1 * x1) - t_0) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x2 * x2) * 36.0; t_1 = (x1 * x1) + 1.0; t_2 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -5.4e+103) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + ((t_0 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0)))); elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (x1 * -3.0))))); else tmp = ((x1 * x1) - t_0) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5.4e+103], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 - N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x2 \cdot x2\right) \cdot 36\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -5.4 \cdot 10^{+103}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + \frac{t_0 - \left(x1 \cdot x1\right) \cdot 9}{x2 \cdot -6 - x1 \cdot -3}\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + x1 \cdot -3\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - t_0}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -5.39999999999999985e103Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 2.4%
flip-+41.0%
*-commutative41.0%
*-commutative41.0%
*-commutative41.0%
*-commutative41.0%
*-commutative41.0%
*-commutative41.0%
Applied egg-rr41.0%
swap-sqr41.0%
metadata-eval41.0%
swap-sqr41.0%
metadata-eval41.0%
*-commutative41.0%
Simplified41.0%
if -5.39999999999999985e103 < x1 < 1.35000000000000003e154Initial program 98.5%
Taylor expanded in x1 around 0 77.9%
*-commutative77.9%
Simplified77.9%
Taylor expanded in x1 around inf 92.5%
Taylor expanded in x1 around 0 96.9%
*-commutative96.9%
Simplified96.9%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 7.4%
*-commutative7.4%
Simplified7.4%
flip-+66.7%
Applied egg-rr66.7%
swap-sqr66.7%
metadata-eval66.7%
*-commutative66.7%
Simplified66.7%
Final simplification83.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3 (- 3.0 (/ 1.0 x1)))
(t_4 (* (* x2 x2) 36.0))
(t_5 (* 3.0 (* x2 -2.0)))
(t_6 (* x1 (* x1 x1)))
(t_7 (* (* x1 2.0) t_2)))
(if (<= x1 -3.2e+103)
(+
x1
(+
(+ x1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))
(/ (- t_4 (* (* x1 x1) 9.0)) (- (* x2 -6.0) (* x1 -3.0)))))
(if (<= x1 0.00037)
(+
x1
(+
t_5
(+
x1
(+
t_6
(+
(*
t_1
(+ (* (* x1 x1) (- (* t_2 4.0) 6.0)) (* t_7 (- (+ x2 x2) 3.0))))
(* t_0 t_3))))))
(if (<= x1 1.35e+154)
(+
x1
(+
t_5
(+
x1
(+
t_6
(+
(* t_1 (+ (* t_7 (- t_2 3.0)) (* (* x1 x1) (- (* 4.0 t_3) 6.0))))
(* 3.0 t_0))))))
(/ (- (* x1 x1) t_4) (- x1 (* x2 -6.0))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = 3.0 - (1.0 / x1);
double t_4 = (x2 * x2) * 36.0;
double t_5 = 3.0 * (x2 * -2.0);
double t_6 = x1 * (x1 * x1);
double t_7 = (x1 * 2.0) * t_2;
double tmp;
if (x1 <= -3.2e+103) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + ((t_4 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= 0.00037) {
tmp = x1 + (t_5 + (x1 + (t_6 + ((t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (t_7 * ((x2 + x2) - 3.0)))) + (t_0 * t_3)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_5 + (x1 + (t_6 + ((t_1 * ((t_7 * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0)))) + (3.0 * t_0)))));
} else {
tmp = ((x1 * x1) - t_4) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: 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 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
t_3 = 3.0d0 - (1.0d0 / x1)
t_4 = (x2 * x2) * 36.0d0
t_5 = 3.0d0 * (x2 * (-2.0d0))
t_6 = x1 * (x1 * x1)
t_7 = (x1 * 2.0d0) * t_2
if (x1 <= (-3.2d+103)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))) + ((t_4 - ((x1 * x1) * 9.0d0)) / ((x2 * (-6.0d0)) - (x1 * (-3.0d0)))))
else if (x1 <= 0.00037d0) then
tmp = x1 + (t_5 + (x1 + (t_6 + ((t_1 * (((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)) + (t_7 * ((x2 + x2) - 3.0d0)))) + (t_0 * t_3)))))
else if (x1 <= 1.35d+154) then
tmp = x1 + (t_5 + (x1 + (t_6 + ((t_1 * ((t_7 * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_3) - 6.0d0)))) + (3.0d0 * t_0)))))
else
tmp = ((x1 * x1) - t_4) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = 3.0 - (1.0 / x1);
double t_4 = (x2 * x2) * 36.0;
double t_5 = 3.0 * (x2 * -2.0);
double t_6 = x1 * (x1 * x1);
double t_7 = (x1 * 2.0) * t_2;
double tmp;
if (x1 <= -3.2e+103) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + ((t_4 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= 0.00037) {
tmp = x1 + (t_5 + (x1 + (t_6 + ((t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (t_7 * ((x2 + x2) - 3.0)))) + (t_0 * t_3)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_5 + (x1 + (t_6 + ((t_1 * ((t_7 * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0)))) + (3.0 * t_0)))));
} else {
tmp = ((x1 * x1) - t_4) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = 3.0 - (1.0 / x1) t_4 = (x2 * x2) * 36.0 t_5 = 3.0 * (x2 * -2.0) t_6 = x1 * (x1 * x1) t_7 = (x1 * 2.0) * t_2 tmp = 0 if x1 <= -3.2e+103: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + ((t_4 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0)))) elif x1 <= 0.00037: tmp = x1 + (t_5 + (x1 + (t_6 + ((t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (t_7 * ((x2 + x2) - 3.0)))) + (t_0 * t_3))))) elif x1 <= 1.35e+154: tmp = x1 + (t_5 + (x1 + (t_6 + ((t_1 * ((t_7 * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0)))) + (3.0 * t_0))))) else: tmp = ((x1 * x1) - t_4) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(3.0 - Float64(1.0 / x1)) t_4 = Float64(Float64(x2 * x2) * 36.0) t_5 = Float64(3.0 * Float64(x2 * -2.0)) t_6 = Float64(x1 * Float64(x1 * x1)) t_7 = Float64(Float64(x1 * 2.0) * t_2) tmp = 0.0 if (x1 <= -3.2e+103) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(Float64(t_4 - Float64(Float64(x1 * x1) * 9.0)) / Float64(Float64(x2 * -6.0) - Float64(x1 * -3.0))))); elseif (x1 <= 0.00037) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_6 + Float64(Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) + Float64(t_7 * Float64(Float64(x2 + x2) - 3.0)))) + Float64(t_0 * t_3)))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_6 + Float64(Float64(t_1 * Float64(Float64(t_7 * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_3) - 6.0)))) + Float64(3.0 * t_0)))))); else tmp = Float64(Float64(Float64(x1 * x1) - t_4) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = 3.0 - (1.0 / x1); t_4 = (x2 * x2) * 36.0; t_5 = 3.0 * (x2 * -2.0); t_6 = x1 * (x1 * x1); t_7 = (x1 * 2.0) * t_2; tmp = 0.0; if (x1 <= -3.2e+103) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + ((t_4 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0)))); elseif (x1 <= 0.00037) tmp = x1 + (t_5 + (x1 + (t_6 + ((t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (t_7 * ((x2 + x2) - 3.0)))) + (t_0 * t_3))))); elseif (x1 <= 1.35e+154) tmp = x1 + (t_5 + (x1 + (t_6 + ((t_1 * ((t_7 * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0)))) + (3.0 * t_0))))); else tmp = ((x1 * x1) - t_4) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 - N[(1.0 / x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision]}, If[LessEqual[x1, -3.2e+103], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$4 - N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.00037], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$6 + N[(N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$7 * N[(N[(x2 + x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$6 + N[(N[(t$95$1 * N[(N[(t$95$7 * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$3), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - t$95$4), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_3 := 3 - \frac{1}{x1}\\
t_4 := \left(x2 \cdot x2\right) \cdot 36\\
t_5 := 3 \cdot \left(x2 \cdot -2\right)\\
t_6 := x1 \cdot \left(x1 \cdot x1\right)\\
t_7 := \left(x1 \cdot 2\right) \cdot t_2\\
\mathbf{if}\;x1 \leq -3.2 \cdot 10^{+103}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + \frac{t_4 - \left(x1 \cdot x1\right) \cdot 9}{x2 \cdot -6 - x1 \cdot -3}\right)\\
\mathbf{elif}\;x1 \leq 0.00037:\\
\;\;\;\;x1 + \left(t_5 + \left(x1 + \left(t_6 + \left(t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right) + t_7 \cdot \left(\left(x2 + x2\right) - 3\right)\right) + t_0 \cdot t_3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t_5 + \left(x1 + \left(t_6 + \left(t_1 \cdot \left(t_7 \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_3 - 6\right)\right) + 3 \cdot t_0\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - t_4}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -3.19999999999999993e103Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 2.4%
flip-+41.0%
*-commutative41.0%
*-commutative41.0%
*-commutative41.0%
*-commutative41.0%
*-commutative41.0%
*-commutative41.0%
Applied egg-rr41.0%
swap-sqr41.0%
metadata-eval41.0%
swap-sqr41.0%
metadata-eval41.0%
*-commutative41.0%
Simplified41.0%
if -3.19999999999999993e103 < x1 < 3.6999999999999999e-4Initial program 99.5%
Taylor expanded in x1 around 0 74.5%
*-commutative74.5%
Simplified74.5%
Taylor expanded in x1 around inf 92.2%
Taylor expanded in x1 around 0 88.4%
count-288.4%
Simplified88.4%
if 3.6999999999999999e-4 < x1 < 1.35000000000000003e154Initial program 93.9%
Taylor expanded in x1 around 0 93.1%
*-commutative93.1%
Simplified93.1%
Taylor expanded in x1 around inf 92.8%
Taylor expanded in x1 around inf 92.3%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 7.4%
*-commutative7.4%
Simplified7.4%
flip-+66.7%
Applied egg-rr66.7%
swap-sqr66.7%
metadata-eval66.7%
*-commutative66.7%
Simplified66.7%
Final simplification78.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* x2 x2) 36.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2)))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_5 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))
(t_6 (+ x1 t_5))
(t_7 (* x1 (* x1 x1)))
(t_8
(+
x1
(+
(* 3.0 (* x2 -2.0))
(+
x1
(+
t_7
(+
(* 3.0 t_1)
(*
t_2
(+ (* (* (* x1 2.0) t_4) (- t_4 3.0)) (* x1 (* x1 6.0)))))))))))
(if (<= x1 -3.6e+103)
(+ x1 (+ t_6 (/ (- t_0 (* (* x1 x1) 9.0)) (- (* x2 -6.0) (* x1 -3.0)))))
(if (<= x1 -0.0255)
t_8
(if (<= x1 -3.2e-235)
(+ x1 (+ t_3 (+ x1 (+ t_7 (+ (* t_1 t_4) (* t_2 t_5))))))
(if (<= x1 2e-210)
t_8
(if (<= x1 0.000385)
(+ x1 (+ t_3 t_6))
(if (<= x1 1.35e+154)
t_8
(/ (- (* x1 x1) t_0) (- x1 (* x2 -6.0)))))))))))
double code(double x1, double x2) {
double t_0 = (x2 * x2) * 36.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_5 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)));
double t_6 = x1 + t_5;
double t_7 = x1 * (x1 * x1);
double t_8 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (t_7 + ((3.0 * t_1) + (t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + (x1 * (x1 * 6.0))))))));
double tmp;
if (x1 <= -3.6e+103) {
tmp = x1 + (t_6 + ((t_0 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= -0.0255) {
tmp = t_8;
} else if (x1 <= -3.2e-235) {
tmp = x1 + (t_3 + (x1 + (t_7 + ((t_1 * t_4) + (t_2 * t_5)))));
} else if (x1 <= 2e-210) {
tmp = t_8;
} else if (x1 <= 0.000385) {
tmp = x1 + (t_3 + t_6);
} else if (x1 <= 1.35e+154) {
tmp = t_8;
} else {
tmp = ((x1 * x1) - t_0) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: 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 = (x2 * x2) * 36.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)
t_4 = ((t_1 + (2.0d0 * x2)) - x1) / t_2
t_5 = 4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0)))
t_6 = x1 + t_5
t_7 = x1 * (x1 * x1)
t_8 = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + (t_7 + ((3.0d0 * t_1) + (t_2 * ((((x1 * 2.0d0) * t_4) * (t_4 - 3.0d0)) + (x1 * (x1 * 6.0d0))))))))
if (x1 <= (-3.6d+103)) then
tmp = x1 + (t_6 + ((t_0 - ((x1 * x1) * 9.0d0)) / ((x2 * (-6.0d0)) - (x1 * (-3.0d0)))))
else if (x1 <= (-0.0255d0)) then
tmp = t_8
else if (x1 <= (-3.2d-235)) then
tmp = x1 + (t_3 + (x1 + (t_7 + ((t_1 * t_4) + (t_2 * t_5)))))
else if (x1 <= 2d-210) then
tmp = t_8
else if (x1 <= 0.000385d0) then
tmp = x1 + (t_3 + t_6)
else if (x1 <= 1.35d+154) then
tmp = t_8
else
tmp = ((x1 * x1) - t_0) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x2 * x2) * 36.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_5 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)));
double t_6 = x1 + t_5;
double t_7 = x1 * (x1 * x1);
double t_8 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (t_7 + ((3.0 * t_1) + (t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + (x1 * (x1 * 6.0))))))));
double tmp;
if (x1 <= -3.6e+103) {
tmp = x1 + (t_6 + ((t_0 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= -0.0255) {
tmp = t_8;
} else if (x1 <= -3.2e-235) {
tmp = x1 + (t_3 + (x1 + (t_7 + ((t_1 * t_4) + (t_2 * t_5)))));
} else if (x1 <= 2e-210) {
tmp = t_8;
} else if (x1 <= 0.000385) {
tmp = x1 + (t_3 + t_6);
} else if (x1 <= 1.35e+154) {
tmp = t_8;
} else {
tmp = ((x1 * x1) - t_0) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x2 * x2) * 36.0 t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2) t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2 t_5 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))) t_6 = x1 + t_5 t_7 = x1 * (x1 * x1) t_8 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (t_7 + ((3.0 * t_1) + (t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + (x1 * (x1 * 6.0)))))))) tmp = 0 if x1 <= -3.6e+103: tmp = x1 + (t_6 + ((t_0 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0)))) elif x1 <= -0.0255: tmp = t_8 elif x1 <= -3.2e-235: tmp = x1 + (t_3 + (x1 + (t_7 + ((t_1 * t_4) + (t_2 * t_5))))) elif x1 <= 2e-210: tmp = t_8 elif x1 <= 0.000385: tmp = x1 + (t_3 + t_6) elif x1 <= 1.35e+154: tmp = t_8 else: tmp = ((x1 * x1) - t_0) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x2 * x2) * 36.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_5 = Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))) t_6 = Float64(x1 + t_5) t_7 = Float64(x1 * Float64(x1 * x1)) t_8 = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(t_7 + Float64(Float64(3.0 * t_1) + Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + Float64(x1 * Float64(x1 * 6.0))))))))) tmp = 0.0 if (x1 <= -3.6e+103) tmp = Float64(x1 + Float64(t_6 + Float64(Float64(t_0 - Float64(Float64(x1 * x1) * 9.0)) / Float64(Float64(x2 * -6.0) - Float64(x1 * -3.0))))); elseif (x1 <= -0.0255) tmp = t_8; elseif (x1 <= -3.2e-235) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_7 + Float64(Float64(t_1 * t_4) + Float64(t_2 * t_5)))))); elseif (x1 <= 2e-210) tmp = t_8; elseif (x1 <= 0.000385) tmp = Float64(x1 + Float64(t_3 + t_6)); elseif (x1 <= 1.35e+154) tmp = t_8; else tmp = Float64(Float64(Float64(x1 * x1) - t_0) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x2 * x2) * 36.0; t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2); t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2; t_5 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))); t_6 = x1 + t_5; t_7 = x1 * (x1 * x1); t_8 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (t_7 + ((3.0 * t_1) + (t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + (x1 * (x1 * 6.0)))))))); tmp = 0.0; if (x1 <= -3.6e+103) tmp = x1 + (t_6 + ((t_0 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0)))); elseif (x1 <= -0.0255) tmp = t_8; elseif (x1 <= -3.2e-235) tmp = x1 + (t_3 + (x1 + (t_7 + ((t_1 * t_4) + (t_2 * t_5))))); elseif (x1 <= 2e-210) tmp = t_8; elseif (x1 <= 0.000385) tmp = x1 + (t_3 + t_6); elseif (x1 <= 1.35e+154) tmp = t_8; else tmp = ((x1 * x1) - t_0) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x2 * x2), $MachinePrecision] * 36.0), $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[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$7 + N[(N[(3.0 * t$95$1), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.6e+103], N[(x1 + N[(t$95$6 + N[(N[(t$95$0 - N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.0255], t$95$8, If[LessEqual[x1, -3.2e-235], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$7 + N[(N[(t$95$1 * t$95$4), $MachinePrecision] + N[(t$95$2 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e-210], t$95$8, If[LessEqual[x1, 0.000385], N[(x1 + N[(t$95$3 + t$95$6), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$8, N[(N[(N[(x1 * x1), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x2 \cdot x2\right) \cdot 36\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\\
t_4 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
t_5 := 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
t_6 := x1 + t_5\\
t_7 := x1 \cdot \left(x1 \cdot x1\right)\\
t_8 := x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(t_7 + \left(3 \cdot t_1 + t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(t_4 - 3\right) + x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -3.6 \cdot 10^{+103}:\\
\;\;\;\;x1 + \left(t_6 + \frac{t_0 - \left(x1 \cdot x1\right) \cdot 9}{x2 \cdot -6 - x1 \cdot -3}\right)\\
\mathbf{elif}\;x1 \leq -0.0255:\\
\;\;\;\;t_8\\
\mathbf{elif}\;x1 \leq -3.2 \cdot 10^{-235}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_7 + \left(t_1 \cdot t_4 + t_2 \cdot t_5\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{-210}:\\
\;\;\;\;t_8\\
\mathbf{elif}\;x1 \leq 0.000385:\\
\;\;\;\;x1 + \left(t_3 + t_6\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_8\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - t_0}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -3.60000000000000017e103Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 2.4%
flip-+41.0%
*-commutative41.0%
*-commutative41.0%
*-commutative41.0%
*-commutative41.0%
*-commutative41.0%
*-commutative41.0%
Applied egg-rr41.0%
swap-sqr41.0%
metadata-eval41.0%
swap-sqr41.0%
metadata-eval41.0%
*-commutative41.0%
Simplified41.0%
if -3.60000000000000017e103 < x1 < -0.0254999999999999984 or -3.2000000000000001e-235 < x1 < 2.0000000000000001e-210 or 3.8499999999999998e-4 < x1 < 1.35000000000000003e154Initial program 97.6%
Taylor expanded in x1 around 0 94.0%
*-commutative94.0%
Simplified94.0%
Taylor expanded in x1 around inf 93.9%
Taylor expanded in x1 around inf 89.2%
unpow289.2%
associate-*r*89.3%
Simplified89.3%
if -0.0254999999999999984 < x1 < -3.2000000000000001e-235Initial program 99.4%
Taylor expanded in x1 around 0 97.2%
Taylor expanded in x1 around 0 94.2%
if 2.0000000000000001e-210 < x1 < 3.8499999999999998e-4Initial program 99.5%
Taylor expanded in x1 around 0 95.4%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 7.4%
*-commutative7.4%
Simplified7.4%
flip-+66.7%
Applied egg-rr66.7%
swap-sqr66.7%
metadata-eval66.7%
*-commutative66.7%
Simplified66.7%
Final simplification80.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* 3.0 t_0))
(t_2 (* (* x2 x2) 36.0))
(t_3 (* 3.0 (* x2 -2.0)))
(t_4 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))
(t_5 (+ x1 t_4))
(t_6 (* x1 (* x1 x1)))
(t_7 (+ (* x1 x1) 1.0))
(t_8 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_7)))
(t_9 (/ (- (+ t_0 (* 2.0 x2)) x1) t_7))
(t_10 (- t_9 3.0))
(t_11
(+
x1
(+
t_3
(+
x1
(+
t_6
(+
t_1
(* t_7 (+ (* (* (* x1 2.0) t_9) t_10) (* x1 (* x1 6.0)))))))))))
(if (<= x1 -3.3e+94)
(+ x1 (+ t_5 (/ (- t_2 (* (* x1 x1) 9.0)) (- (* x2 -6.0) (* x1 -3.0)))))
(if (<= x1 -3.2e+21)
(+
x1
(+
t_3
(+
x1
(+
t_6
(+
t_1
(*
t_7
(+
(* (* x1 x1) (- (* t_9 4.0) 6.0))
(* t_10 (* (* x1 2.0) 3.0)))))))))
(if (<= x1 -2.45e-235)
(+
x1
(+ t_8 (+ x1 (+ t_6 (+ (* t_7 t_4) (* t_0 (- (* 2.0 x2) x1)))))))
(if (<= x1 1.25e-210)
t_11
(if (<= x1 0.0003)
(+ x1 (+ t_8 t_5))
(if (<= x1 1.35e+154)
t_11
(/ (- (* x1 x1) t_2) (- x1 (* x2 -6.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = 3.0 * t_0;
double t_2 = (x2 * x2) * 36.0;
double t_3 = 3.0 * (x2 * -2.0);
double t_4 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)));
double t_5 = x1 + t_4;
double t_6 = x1 * (x1 * x1);
double t_7 = (x1 * x1) + 1.0;
double t_8 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_7);
double t_9 = ((t_0 + (2.0 * x2)) - x1) / t_7;
double t_10 = t_9 - 3.0;
double t_11 = x1 + (t_3 + (x1 + (t_6 + (t_1 + (t_7 * ((((x1 * 2.0) * t_9) * t_10) + (x1 * (x1 * 6.0))))))));
double tmp;
if (x1 <= -3.3e+94) {
tmp = x1 + (t_5 + ((t_2 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= -3.2e+21) {
tmp = x1 + (t_3 + (x1 + (t_6 + (t_1 + (t_7 * (((x1 * x1) * ((t_9 * 4.0) - 6.0)) + (t_10 * ((x1 * 2.0) * 3.0))))))));
} else if (x1 <= -2.45e-235) {
tmp = x1 + (t_8 + (x1 + (t_6 + ((t_7 * t_4) + (t_0 * ((2.0 * x2) - x1))))));
} else if (x1 <= 1.25e-210) {
tmp = t_11;
} else if (x1 <= 0.0003) {
tmp = x1 + (t_8 + t_5);
} else if (x1 <= 1.35e+154) {
tmp = t_11;
} else {
tmp = ((x1 * x1) - t_2) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_10
real(8) :: t_11
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 = x1 * (x1 * 3.0d0)
t_1 = 3.0d0 * t_0
t_2 = (x2 * x2) * 36.0d0
t_3 = 3.0d0 * (x2 * (-2.0d0))
t_4 = 4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0)))
t_5 = x1 + t_4
t_6 = x1 * (x1 * x1)
t_7 = (x1 * x1) + 1.0d0
t_8 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_7)
t_9 = ((t_0 + (2.0d0 * x2)) - x1) / t_7
t_10 = t_9 - 3.0d0
t_11 = x1 + (t_3 + (x1 + (t_6 + (t_1 + (t_7 * ((((x1 * 2.0d0) * t_9) * t_10) + (x1 * (x1 * 6.0d0))))))))
if (x1 <= (-3.3d+94)) then
tmp = x1 + (t_5 + ((t_2 - ((x1 * x1) * 9.0d0)) / ((x2 * (-6.0d0)) - (x1 * (-3.0d0)))))
else if (x1 <= (-3.2d+21)) then
tmp = x1 + (t_3 + (x1 + (t_6 + (t_1 + (t_7 * (((x1 * x1) * ((t_9 * 4.0d0) - 6.0d0)) + (t_10 * ((x1 * 2.0d0) * 3.0d0))))))))
else if (x1 <= (-2.45d-235)) then
tmp = x1 + (t_8 + (x1 + (t_6 + ((t_7 * t_4) + (t_0 * ((2.0d0 * x2) - x1))))))
else if (x1 <= 1.25d-210) then
tmp = t_11
else if (x1 <= 0.0003d0) then
tmp = x1 + (t_8 + t_5)
else if (x1 <= 1.35d+154) then
tmp = t_11
else
tmp = ((x1 * x1) - t_2) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = 3.0 * t_0;
double t_2 = (x2 * x2) * 36.0;
double t_3 = 3.0 * (x2 * -2.0);
double t_4 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)));
double t_5 = x1 + t_4;
double t_6 = x1 * (x1 * x1);
double t_7 = (x1 * x1) + 1.0;
double t_8 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_7);
double t_9 = ((t_0 + (2.0 * x2)) - x1) / t_7;
double t_10 = t_9 - 3.0;
double t_11 = x1 + (t_3 + (x1 + (t_6 + (t_1 + (t_7 * ((((x1 * 2.0) * t_9) * t_10) + (x1 * (x1 * 6.0))))))));
double tmp;
if (x1 <= -3.3e+94) {
tmp = x1 + (t_5 + ((t_2 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= -3.2e+21) {
tmp = x1 + (t_3 + (x1 + (t_6 + (t_1 + (t_7 * (((x1 * x1) * ((t_9 * 4.0) - 6.0)) + (t_10 * ((x1 * 2.0) * 3.0))))))));
} else if (x1 <= -2.45e-235) {
tmp = x1 + (t_8 + (x1 + (t_6 + ((t_7 * t_4) + (t_0 * ((2.0 * x2) - x1))))));
} else if (x1 <= 1.25e-210) {
tmp = t_11;
} else if (x1 <= 0.0003) {
tmp = x1 + (t_8 + t_5);
} else if (x1 <= 1.35e+154) {
tmp = t_11;
} else {
tmp = ((x1 * x1) - t_2) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = 3.0 * t_0 t_2 = (x2 * x2) * 36.0 t_3 = 3.0 * (x2 * -2.0) t_4 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))) t_5 = x1 + t_4 t_6 = x1 * (x1 * x1) t_7 = (x1 * x1) + 1.0 t_8 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_7) t_9 = ((t_0 + (2.0 * x2)) - x1) / t_7 t_10 = t_9 - 3.0 t_11 = x1 + (t_3 + (x1 + (t_6 + (t_1 + (t_7 * ((((x1 * 2.0) * t_9) * t_10) + (x1 * (x1 * 6.0)))))))) tmp = 0 if x1 <= -3.3e+94: tmp = x1 + (t_5 + ((t_2 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0)))) elif x1 <= -3.2e+21: tmp = x1 + (t_3 + (x1 + (t_6 + (t_1 + (t_7 * (((x1 * x1) * ((t_9 * 4.0) - 6.0)) + (t_10 * ((x1 * 2.0) * 3.0)))))))) elif x1 <= -2.45e-235: tmp = x1 + (t_8 + (x1 + (t_6 + ((t_7 * t_4) + (t_0 * ((2.0 * x2) - x1)))))) elif x1 <= 1.25e-210: tmp = t_11 elif x1 <= 0.0003: tmp = x1 + (t_8 + t_5) elif x1 <= 1.35e+154: tmp = t_11 else: tmp = ((x1 * x1) - t_2) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(3.0 * t_0) t_2 = Float64(Float64(x2 * x2) * 36.0) t_3 = Float64(3.0 * Float64(x2 * -2.0)) t_4 = Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))) t_5 = Float64(x1 + t_4) t_6 = Float64(x1 * Float64(x1 * x1)) t_7 = Float64(Float64(x1 * x1) + 1.0) t_8 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_7)) t_9 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_7) t_10 = Float64(t_9 - 3.0) t_11 = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_6 + Float64(t_1 + Float64(t_7 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_9) * t_10) + Float64(x1 * Float64(x1 * 6.0))))))))) tmp = 0.0 if (x1 <= -3.3e+94) tmp = Float64(x1 + Float64(t_5 + Float64(Float64(t_2 - Float64(Float64(x1 * x1) * 9.0)) / Float64(Float64(x2 * -6.0) - Float64(x1 * -3.0))))); elseif (x1 <= -3.2e+21) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_6 + Float64(t_1 + Float64(t_7 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_9 * 4.0) - 6.0)) + Float64(t_10 * Float64(Float64(x1 * 2.0) * 3.0))))))))); elseif (x1 <= -2.45e-235) tmp = Float64(x1 + Float64(t_8 + Float64(x1 + Float64(t_6 + Float64(Float64(t_7 * t_4) + Float64(t_0 * Float64(Float64(2.0 * x2) - x1))))))); elseif (x1 <= 1.25e-210) tmp = t_11; elseif (x1 <= 0.0003) tmp = Float64(x1 + Float64(t_8 + t_5)); elseif (x1 <= 1.35e+154) tmp = t_11; else tmp = Float64(Float64(Float64(x1 * x1) - t_2) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = 3.0 * t_0; t_2 = (x2 * x2) * 36.0; t_3 = 3.0 * (x2 * -2.0); t_4 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))); t_5 = x1 + t_4; t_6 = x1 * (x1 * x1); t_7 = (x1 * x1) + 1.0; t_8 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_7); t_9 = ((t_0 + (2.0 * x2)) - x1) / t_7; t_10 = t_9 - 3.0; t_11 = x1 + (t_3 + (x1 + (t_6 + (t_1 + (t_7 * ((((x1 * 2.0) * t_9) * t_10) + (x1 * (x1 * 6.0)))))))); tmp = 0.0; if (x1 <= -3.3e+94) tmp = x1 + (t_5 + ((t_2 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0)))); elseif (x1 <= -3.2e+21) tmp = x1 + (t_3 + (x1 + (t_6 + (t_1 + (t_7 * (((x1 * x1) * ((t_9 * 4.0) - 6.0)) + (t_10 * ((x1 * 2.0) * 3.0)))))))); elseif (x1 <= -2.45e-235) tmp = x1 + (t_8 + (x1 + (t_6 + ((t_7 * t_4) + (t_0 * ((2.0 * x2) - x1)))))); elseif (x1 <= 1.25e-210) tmp = t_11; elseif (x1 <= 0.0003) tmp = x1 + (t_8 + t_5); elseif (x1 <= 1.35e+154) tmp = t_11; else tmp = ((x1 * x1) - t_2) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$8 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$7), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$9 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$7), $MachinePrecision]}, Block[{t$95$10 = N[(t$95$9 - 3.0), $MachinePrecision]}, Block[{t$95$11 = N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$6 + N[(t$95$1 + N[(t$95$7 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$9), $MachinePrecision] * t$95$10), $MachinePrecision] + N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.3e+94], N[(x1 + N[(t$95$5 + N[(N[(t$95$2 - N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3.2e+21], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$6 + N[(t$95$1 + N[(t$95$7 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$9 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$10 * N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2.45e-235], N[(x1 + N[(t$95$8 + N[(x1 + N[(t$95$6 + N[(N[(t$95$7 * t$95$4), $MachinePrecision] + N[(t$95$0 * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.25e-210], t$95$11, If[LessEqual[x1, 0.0003], N[(x1 + N[(t$95$8 + t$95$5), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$11, N[(N[(N[(x1 * x1), $MachinePrecision] - t$95$2), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := 3 \cdot t_0\\
t_2 := \left(x2 \cdot x2\right) \cdot 36\\
t_3 := 3 \cdot \left(x2 \cdot -2\right)\\
t_4 := 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
t_5 := x1 + t_4\\
t_6 := x1 \cdot \left(x1 \cdot x1\right)\\
t_7 := x1 \cdot x1 + 1\\
t_8 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_7}\\
t_9 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_7}\\
t_10 := t_9 - 3\\
t_11 := x1 + \left(t_3 + \left(x1 + \left(t_6 + \left(t_1 + t_7 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_9\right) \cdot t_10 + x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -3.3 \cdot 10^{+94}:\\
\;\;\;\;x1 + \left(t_5 + \frac{t_2 - \left(x1 \cdot x1\right) \cdot 9}{x2 \cdot -6 - x1 \cdot -3}\right)\\
\mathbf{elif}\;x1 \leq -3.2 \cdot 10^{+21}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_6 + \left(t_1 + t_7 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_9 \cdot 4 - 6\right) + t_10 \cdot \left(\left(x1 \cdot 2\right) \cdot 3\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -2.45 \cdot 10^{-235}:\\
\;\;\;\;x1 + \left(t_8 + \left(x1 + \left(t_6 + \left(t_7 \cdot t_4 + t_0 \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.25 \cdot 10^{-210}:\\
\;\;\;\;t_11\\
\mathbf{elif}\;x1 \leq 0.0003:\\
\;\;\;\;x1 + \left(t_8 + t_5\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_11\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - t_2}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -3.3e94Initial program 4.3%
Taylor expanded in x1 around 0 2.2%
Taylor expanded in x1 around 0 4.5%
flip-+41.5%
*-commutative41.5%
*-commutative41.5%
*-commutative41.5%
*-commutative41.5%
*-commutative41.5%
*-commutative41.5%
Applied egg-rr41.5%
swap-sqr41.5%
metadata-eval41.5%
swap-sqr41.5%
metadata-eval41.5%
*-commutative41.5%
Simplified41.5%
if -3.3e94 < x1 < -3.2e21Initial program 99.4%
Taylor expanded in x1 around 0 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around inf 96.4%
if -3.2e21 < x1 < -2.44999999999999983e-235Initial program 99.4%
Taylor expanded in x1 around 0 91.9%
Taylor expanded in x1 around 0 89.0%
Taylor expanded in x1 around 0 89.2%
if -2.44999999999999983e-235 < x1 < 1.2500000000000001e-210 or 2.99999999999999974e-4 < x1 < 1.35000000000000003e154Initial program 97.0%
Taylor expanded in x1 around 0 93.3%
*-commutative93.3%
Simplified93.3%
Taylor expanded in x1 around inf 93.1%
Taylor expanded in x1 around inf 92.5%
unpow292.5%
associate-*r*92.5%
Simplified92.5%
if 1.2500000000000001e-210 < x1 < 2.99999999999999974e-4Initial program 99.5%
Taylor expanded in x1 around 0 95.4%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 7.4%
*-commutative7.4%
Simplified7.4%
flip-+66.7%
Applied egg-rr66.7%
swap-sqr66.7%
metadata-eval66.7%
*-commutative66.7%
Simplified66.7%
Final simplification80.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* t_2 t_1))
(t_4 (* x1 (* x1 x1)))
(t_5 (* (* x2 x2) 36.0))
(t_6 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))))
(if (<= x1 -3.3e+94)
(+
x1
(+ (+ x1 t_1) (/ (- t_5 (* (* x1 x1) 9.0)) (- (* x2 -6.0) (* x1 -3.0)))))
(if (<= x1 -2.1e-93)
(+ x1 (+ t_6 (+ x1 (+ t_4 (+ t_3 (* t_0 (- (* 2.0 x2) x1)))))))
(if (<= x1 8.2e-247)
(+ x1 (+ t_6 (+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (<= x1 1.35e+154)
(+
x1
(+
t_6
(+ x1 (+ t_4 (+ (* t_0 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2)) t_3)))))
(/ (- (* x1 x1) t_5) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)));
double t_2 = (x1 * x1) + 1.0;
double t_3 = t_2 * t_1;
double t_4 = x1 * (x1 * x1);
double t_5 = (x2 * x2) * 36.0;
double t_6 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2);
double tmp;
if (x1 <= -3.3e+94) {
tmp = x1 + ((x1 + t_1) + ((t_5 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= -2.1e-93) {
tmp = x1 + (t_6 + (x1 + (t_4 + (t_3 + (t_0 * ((2.0 * x2) - x1))))));
} else if (x1 <= 8.2e-247) {
tmp = x1 + (t_6 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_6 + (x1 + (t_4 + ((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_2)) + t_3))));
} else {
tmp = ((x1 * x1) - t_5) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = 4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0)))
t_2 = (x1 * x1) + 1.0d0
t_3 = t_2 * t_1
t_4 = x1 * (x1 * x1)
t_5 = (x2 * x2) * 36.0d0
t_6 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_2)
if (x1 <= (-3.3d+94)) then
tmp = x1 + ((x1 + t_1) + ((t_5 - ((x1 * x1) * 9.0d0)) / ((x2 * (-6.0d0)) - (x1 * (-3.0d0)))))
else if (x1 <= (-2.1d-93)) then
tmp = x1 + (t_6 + (x1 + (t_4 + (t_3 + (t_0 * ((2.0d0 * x2) - x1))))))
else if (x1 <= 8.2d-247) then
tmp = x1 + (t_6 + (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if (x1 <= 1.35d+154) then
tmp = x1 + (t_6 + (x1 + (t_4 + ((t_0 * (((t_0 + (2.0d0 * x2)) - x1) / t_2)) + t_3))))
else
tmp = ((x1 * x1) - t_5) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)));
double t_2 = (x1 * x1) + 1.0;
double t_3 = t_2 * t_1;
double t_4 = x1 * (x1 * x1);
double t_5 = (x2 * x2) * 36.0;
double t_6 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2);
double tmp;
if (x1 <= -3.3e+94) {
tmp = x1 + ((x1 + t_1) + ((t_5 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= -2.1e-93) {
tmp = x1 + (t_6 + (x1 + (t_4 + (t_3 + (t_0 * ((2.0 * x2) - x1))))));
} else if (x1 <= 8.2e-247) {
tmp = x1 + (t_6 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_6 + (x1 + (t_4 + ((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_2)) + t_3))));
} else {
tmp = ((x1 * x1) - t_5) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))) t_2 = (x1 * x1) + 1.0 t_3 = t_2 * t_1 t_4 = x1 * (x1 * x1) t_5 = (x2 * x2) * 36.0 t_6 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2) tmp = 0 if x1 <= -3.3e+94: tmp = x1 + ((x1 + t_1) + ((t_5 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0)))) elif x1 <= -2.1e-93: tmp = x1 + (t_6 + (x1 + (t_4 + (t_3 + (t_0 * ((2.0 * x2) - x1)))))) elif x1 <= 8.2e-247: tmp = x1 + (t_6 + (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif x1 <= 1.35e+154: tmp = x1 + (t_6 + (x1 + (t_4 + ((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_2)) + t_3)))) else: tmp = ((x1 * x1) - t_5) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(t_2 * t_1) t_4 = Float64(x1 * Float64(x1 * x1)) t_5 = Float64(Float64(x2 * x2) * 36.0) t_6 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)) tmp = 0.0 if (x1 <= -3.3e+94) tmp = Float64(x1 + Float64(Float64(x1 + t_1) + Float64(Float64(t_5 - Float64(Float64(x1 * x1) * 9.0)) / Float64(Float64(x2 * -6.0) - Float64(x1 * -3.0))))); elseif (x1 <= -2.1e-93) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(t_4 + Float64(t_3 + Float64(t_0 * Float64(Float64(2.0 * x2) - x1))))))); elseif (x1 <= 8.2e-247) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(t_4 + Float64(Float64(t_0 * Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2)) + t_3))))); else tmp = Float64(Float64(Float64(x1 * x1) - t_5) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))); t_2 = (x1 * x1) + 1.0; t_3 = t_2 * t_1; t_4 = x1 * (x1 * x1); t_5 = (x2 * x2) * 36.0; t_6 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2); tmp = 0.0; if (x1 <= -3.3e+94) tmp = x1 + ((x1 + t_1) + ((t_5 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0)))); elseif (x1 <= -2.1e-93) tmp = x1 + (t_6 + (x1 + (t_4 + (t_3 + (t_0 * ((2.0 * x2) - x1)))))); elseif (x1 <= 8.2e-247) tmp = x1 + (t_6 + (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif (x1 <= 1.35e+154) tmp = x1 + (t_6 + (x1 + (t_4 + ((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_2)) + t_3)))); else tmp = ((x1 * x1) - t_5) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]}, Block[{t$95$6 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.3e+94], N[(x1 + N[(N[(x1 + t$95$1), $MachinePrecision] + N[(N[(t$95$5 - N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2.1e-93], N[(x1 + N[(t$95$6 + N[(x1 + N[(t$95$4 + N[(t$95$3 + N[(t$95$0 * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8.2e-247], N[(x1 + N[(t$95$6 + N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$6 + N[(x1 + N[(t$95$4 + N[(N[(t$95$0 * N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - t$95$5), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := t_2 \cdot t_1\\
t_4 := x1 \cdot \left(x1 \cdot x1\right)\\
t_5 := \left(x2 \cdot x2\right) \cdot 36\\
t_6 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 \leq -3.3 \cdot 10^{+94}:\\
\;\;\;\;x1 + \left(\left(x1 + t_1\right) + \frac{t_5 - \left(x1 \cdot x1\right) \cdot 9}{x2 \cdot -6 - x1 \cdot -3}\right)\\
\mathbf{elif}\;x1 \leq -2.1 \cdot 10^{-93}:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_4 + \left(t_3 + t_0 \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 8.2 \cdot 10^{-247}:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_4 + \left(t_0 \cdot \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_2} + t_3\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - t_5}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -3.3e94Initial program 4.3%
Taylor expanded in x1 around 0 2.2%
Taylor expanded in x1 around 0 4.5%
flip-+41.5%
*-commutative41.5%
*-commutative41.5%
*-commutative41.5%
*-commutative41.5%
*-commutative41.5%
*-commutative41.5%
Applied egg-rr41.5%
swap-sqr41.5%
metadata-eval41.5%
swap-sqr41.5%
metadata-eval41.5%
*-commutative41.5%
Simplified41.5%
if -3.3e94 < x1 < -2.1000000000000001e-93Initial program 99.2%
Taylor expanded in x1 around 0 46.4%
Taylor expanded in x1 around 0 44.4%
Taylor expanded in x1 around 0 46.7%
if -2.1000000000000001e-93 < x1 < 8.1999999999999997e-247Initial program 99.6%
Taylor expanded in x1 around 0 87.3%
Taylor expanded in x2 around 0 96.2%
*-commutative96.2%
Simplified96.2%
if 8.1999999999999997e-247 < x1 < 1.35000000000000003e154Initial program 97.4%
Taylor expanded in x1 around 0 81.5%
Taylor expanded in x1 around 0 82.2%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 7.4%
*-commutative7.4%
Simplified7.4%
flip-+66.7%
Applied egg-rr66.7%
swap-sqr66.7%
metadata-eval66.7%
*-commutative66.7%
Simplified66.7%
Final simplification71.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* x1 x1) 9.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (* t_3 t_2))
(t_5 (* x1 (* x1 x1)))
(t_6 (* (* x2 x2) 36.0))
(t_7 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_3))))
(if (<= x1 -3.3e+94)
(+ x1 (+ (+ x1 t_2) (/ (- t_6 t_0) (- (* x2 -6.0) (* x1 -3.0)))))
(if (<= x1 -2.1e-93)
(+ x1 (+ t_7 (+ x1 (+ t_5 (+ t_4 (* t_1 (- (* 2.0 x2) x1)))))))
(if (<= x1 8e-247)
(+ x1 (+ t_7 (+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (<= x1 1.35e+154)
(+ x1 (+ t_7 (+ x1 (+ t_5 (+ t_0 t_4)))))
(/ (- (* x1 x1) t_6) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) * 9.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)));
double t_3 = (x1 * x1) + 1.0;
double t_4 = t_3 * t_2;
double t_5 = x1 * (x1 * x1);
double t_6 = (x2 * x2) * 36.0;
double t_7 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3);
double tmp;
if (x1 <= -3.3e+94) {
tmp = x1 + ((x1 + t_2) + ((t_6 - t_0) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= -2.1e-93) {
tmp = x1 + (t_7 + (x1 + (t_5 + (t_4 + (t_1 * ((2.0 * x2) - x1))))));
} else if (x1 <= 8e-247) {
tmp = x1 + (t_7 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_7 + (x1 + (t_5 + (t_0 + t_4))));
} else {
tmp = ((x1 * x1) - t_6) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: 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) * 9.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = 4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0)))
t_3 = (x1 * x1) + 1.0d0
t_4 = t_3 * t_2
t_5 = x1 * (x1 * x1)
t_6 = (x2 * x2) * 36.0d0
t_7 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_3)
if (x1 <= (-3.3d+94)) then
tmp = x1 + ((x1 + t_2) + ((t_6 - t_0) / ((x2 * (-6.0d0)) - (x1 * (-3.0d0)))))
else if (x1 <= (-2.1d-93)) then
tmp = x1 + (t_7 + (x1 + (t_5 + (t_4 + (t_1 * ((2.0d0 * x2) - x1))))))
else if (x1 <= 8d-247) then
tmp = x1 + (t_7 + (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if (x1 <= 1.35d+154) then
tmp = x1 + (t_7 + (x1 + (t_5 + (t_0 + t_4))))
else
tmp = ((x1 * x1) - t_6) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) * 9.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)));
double t_3 = (x1 * x1) + 1.0;
double t_4 = t_3 * t_2;
double t_5 = x1 * (x1 * x1);
double t_6 = (x2 * x2) * 36.0;
double t_7 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3);
double tmp;
if (x1 <= -3.3e+94) {
tmp = x1 + ((x1 + t_2) + ((t_6 - t_0) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= -2.1e-93) {
tmp = x1 + (t_7 + (x1 + (t_5 + (t_4 + (t_1 * ((2.0 * x2) - x1))))));
} else if (x1 <= 8e-247) {
tmp = x1 + (t_7 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_7 + (x1 + (t_5 + (t_0 + t_4))));
} else {
tmp = ((x1 * x1) - t_6) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) * 9.0 t_1 = x1 * (x1 * 3.0) t_2 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))) t_3 = (x1 * x1) + 1.0 t_4 = t_3 * t_2 t_5 = x1 * (x1 * x1) t_6 = (x2 * x2) * 36.0 t_7 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3) tmp = 0 if x1 <= -3.3e+94: tmp = x1 + ((x1 + t_2) + ((t_6 - t_0) / ((x2 * -6.0) - (x1 * -3.0)))) elif x1 <= -2.1e-93: tmp = x1 + (t_7 + (x1 + (t_5 + (t_4 + (t_1 * ((2.0 * x2) - x1)))))) elif x1 <= 8e-247: tmp = x1 + (t_7 + (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif x1 <= 1.35e+154: tmp = x1 + (t_7 + (x1 + (t_5 + (t_0 + t_4)))) else: tmp = ((x1 * x1) - t_6) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) * 9.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(t_3 * t_2) t_5 = Float64(x1 * Float64(x1 * x1)) t_6 = Float64(Float64(x2 * x2) * 36.0) t_7 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_3)) tmp = 0.0 if (x1 <= -3.3e+94) tmp = Float64(x1 + Float64(Float64(x1 + t_2) + Float64(Float64(t_6 - t_0) / Float64(Float64(x2 * -6.0) - Float64(x1 * -3.0))))); elseif (x1 <= -2.1e-93) tmp = Float64(x1 + Float64(t_7 + Float64(x1 + Float64(t_5 + Float64(t_4 + Float64(t_1 * Float64(Float64(2.0 * x2) - x1))))))); elseif (x1 <= 8e-247) tmp = Float64(x1 + Float64(t_7 + Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(t_7 + Float64(x1 + Float64(t_5 + Float64(t_0 + t_4))))); else tmp = Float64(Float64(Float64(x1 * x1) - t_6) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) * 9.0; t_1 = x1 * (x1 * 3.0); t_2 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))); t_3 = (x1 * x1) + 1.0; t_4 = t_3 * t_2; t_5 = x1 * (x1 * x1); t_6 = (x2 * x2) * 36.0; t_7 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3); tmp = 0.0; if (x1 <= -3.3e+94) tmp = x1 + ((x1 + t_2) + ((t_6 - t_0) / ((x2 * -6.0) - (x1 * -3.0)))); elseif (x1 <= -2.1e-93) tmp = x1 + (t_7 + (x1 + (t_5 + (t_4 + (t_1 * ((2.0 * x2) - x1)))))); elseif (x1 <= 8e-247) tmp = x1 + (t_7 + (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif (x1 <= 1.35e+154) tmp = x1 + (t_7 + (x1 + (t_5 + (t_0 + t_4)))); else tmp = ((x1 * x1) - t_6) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x2 * x2), $MachinePrecision] * 36.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$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.3e+94], N[(x1 + N[(N[(x1 + t$95$2), $MachinePrecision] + N[(N[(t$95$6 - t$95$0), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2.1e-93], N[(x1 + N[(t$95$7 + N[(x1 + N[(t$95$5 + N[(t$95$4 + N[(t$95$1 * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8e-247], N[(x1 + N[(t$95$7 + N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$7 + N[(x1 + N[(t$95$5 + N[(t$95$0 + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - t$95$6), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x1 \cdot x1\right) \cdot 9\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := t_3 \cdot t_2\\
t_5 := x1 \cdot \left(x1 \cdot x1\right)\\
t_6 := \left(x2 \cdot x2\right) \cdot 36\\
t_7 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_3}\\
\mathbf{if}\;x1 \leq -3.3 \cdot 10^{+94}:\\
\;\;\;\;x1 + \left(\left(x1 + t_2\right) + \frac{t_6 - t_0}{x2 \cdot -6 - x1 \cdot -3}\right)\\
\mathbf{elif}\;x1 \leq -2.1 \cdot 10^{-93}:\\
\;\;\;\;x1 + \left(t_7 + \left(x1 + \left(t_5 + \left(t_4 + t_1 \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 8 \cdot 10^{-247}:\\
\;\;\;\;x1 + \left(t_7 + \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t_7 + \left(x1 + \left(t_5 + \left(t_0 + t_4\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - t_6}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -3.3e94Initial program 4.3%
Taylor expanded in x1 around 0 2.2%
Taylor expanded in x1 around 0 4.5%
flip-+41.5%
*-commutative41.5%
*-commutative41.5%
*-commutative41.5%
*-commutative41.5%
*-commutative41.5%
*-commutative41.5%
Applied egg-rr41.5%
swap-sqr41.5%
metadata-eval41.5%
swap-sqr41.5%
metadata-eval41.5%
*-commutative41.5%
Simplified41.5%
if -3.3e94 < x1 < -2.1000000000000001e-93Initial program 99.2%
Taylor expanded in x1 around 0 46.4%
Taylor expanded in x1 around 0 44.4%
Taylor expanded in x1 around 0 46.7%
if -2.1000000000000001e-93 < x1 < 8.0000000000000002e-247Initial program 99.6%
Taylor expanded in x1 around 0 87.3%
Taylor expanded in x2 around 0 96.2%
*-commutative96.2%
Simplified96.2%
if 8.0000000000000002e-247 < x1 < 1.35000000000000003e154Initial program 97.4%
Taylor expanded in x1 around 0 81.5%
Taylor expanded in x1 around 0 82.2%
Taylor expanded in x1 around inf 82.1%
*-commutative82.1%
unpow282.1%
Simplified82.1%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 7.4%
*-commutative7.4%
Simplified7.4%
flip-+66.7%
Applied egg-rr66.7%
swap-sqr66.7%
metadata-eval66.7%
*-commutative66.7%
Simplified66.7%
Final simplification71.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* (* x2 x2) 36.0))
(t_2 (* (* x1 x1) 9.0))
(t_3 (* x2 (- (* 2.0 x2) 3.0)))
(t_4 (* 4.0 (* x1 t_3)))
(t_5 (* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) t_0))))
(if (<= x1 -3.8e+154)
(+ x1 (+ (+ x1 t_4) (/ (- t_1 t_2) (- (* x2 -6.0) (* x1 -3.0)))))
(if (<= x1 -2.1e-226)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* 4.0 t_3) 2.0))))
(if (<= x1 6e-247)
(+ x1 (+ t_5 (+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (<= x1 1.35e+154)
(+ x1 (+ t_5 (+ x1 (+ (* x1 (* x1 x1)) (+ t_2 (* t_0 t_4))))))
(/ (- (* x1 x1) t_1) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = (x2 * x2) * 36.0;
double t_2 = (x1 * x1) * 9.0;
double t_3 = x2 * ((2.0 * x2) - 3.0);
double t_4 = 4.0 * (x1 * t_3);
double t_5 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / t_0);
double tmp;
if (x1 <= -3.8e+154) {
tmp = x1 + ((x1 + t_4) + ((t_1 - t_2) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= -2.1e-226) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_3) - 2.0)));
} else if (x1 <= 6e-247) {
tmp = x1 + (t_5 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_5 + (x1 + ((x1 * (x1 * x1)) + (t_2 + (t_0 * t_4)))));
} else {
tmp = ((x1 * x1) - t_1) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: 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 = (x2 * x2) * 36.0d0
t_2 = (x1 * x1) * 9.0d0
t_3 = x2 * ((2.0d0 * x2) - 3.0d0)
t_4 = 4.0d0 * (x1 * t_3)
t_5 = 3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / t_0)
if (x1 <= (-3.8d+154)) then
tmp = x1 + ((x1 + t_4) + ((t_1 - t_2) / ((x2 * (-6.0d0)) - (x1 * (-3.0d0)))))
else if (x1 <= (-2.1d-226)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * t_3) - 2.0d0)))
else if (x1 <= 6d-247) then
tmp = x1 + (t_5 + (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if (x1 <= 1.35d+154) then
tmp = x1 + (t_5 + (x1 + ((x1 * (x1 * x1)) + (t_2 + (t_0 * t_4)))))
else
tmp = ((x1 * x1) - t_1) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = (x2 * x2) * 36.0;
double t_2 = (x1 * x1) * 9.0;
double t_3 = x2 * ((2.0 * x2) - 3.0);
double t_4 = 4.0 * (x1 * t_3);
double t_5 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / t_0);
double tmp;
if (x1 <= -3.8e+154) {
tmp = x1 + ((x1 + t_4) + ((t_1 - t_2) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= -2.1e-226) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_3) - 2.0)));
} else if (x1 <= 6e-247) {
tmp = x1 + (t_5 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_5 + (x1 + ((x1 * (x1 * x1)) + (t_2 + (t_0 * t_4)))));
} else {
tmp = ((x1 * x1) - t_1) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = (x2 * x2) * 36.0 t_2 = (x1 * x1) * 9.0 t_3 = x2 * ((2.0 * x2) - 3.0) t_4 = 4.0 * (x1 * t_3) t_5 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / t_0) tmp = 0 if x1 <= -3.8e+154: tmp = x1 + ((x1 + t_4) + ((t_1 - t_2) / ((x2 * -6.0) - (x1 * -3.0)))) elif x1 <= -2.1e-226: tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_3) - 2.0))) elif x1 <= 6e-247: tmp = x1 + (t_5 + (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif x1 <= 1.35e+154: tmp = x1 + (t_5 + (x1 + ((x1 * (x1 * x1)) + (t_2 + (t_0 * t_4))))) else: tmp = ((x1 * x1) - t_1) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(Float64(x2 * x2) * 36.0) t_2 = Float64(Float64(x1 * x1) * 9.0) t_3 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_4 = Float64(4.0 * Float64(x1 * t_3)) t_5 = Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / t_0)) tmp = 0.0 if (x1 <= -3.8e+154) tmp = Float64(x1 + Float64(Float64(x1 + t_4) + Float64(Float64(t_1 - t_2) / Float64(Float64(x2 * -6.0) - Float64(x1 * -3.0))))); elseif (x1 <= -2.1e-226) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * t_3) - 2.0)))); elseif (x1 <= 6e-247) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(t_2 + Float64(t_0 * t_4)))))); else tmp = Float64(Float64(Float64(x1 * x1) - t_1) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = (x2 * x2) * 36.0; t_2 = (x1 * x1) * 9.0; t_3 = x2 * ((2.0 * x2) - 3.0); t_4 = 4.0 * (x1 * t_3); t_5 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / t_0); tmp = 0.0; if (x1 <= -3.8e+154) tmp = x1 + ((x1 + t_4) + ((t_1 - t_2) / ((x2 * -6.0) - (x1 * -3.0)))); elseif (x1 <= -2.1e-226) tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_3) - 2.0))); elseif (x1 <= 6e-247) tmp = x1 + (t_5 + (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif (x1 <= 1.35e+154) tmp = x1 + (t_5 + (x1 + ((x1 * (x1 * x1)) + (t_2 + (t_0 * t_4))))); else tmp = ((x1 * x1) - t_1) / (x1 - (x2 * -6.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[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]}, Block[{t$95$3 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(4.0 * N[(x1 * t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.8e+154], N[(x1 + N[(N[(x1 + t$95$4), $MachinePrecision] + N[(N[(t$95$1 - t$95$2), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2.1e-226], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * t$95$3), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 6e-247], N[(x1 + N[(t$95$5 + N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$5 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(t$95$0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - t$95$1), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := \left(x2 \cdot x2\right) \cdot 36\\
t_2 := \left(x1 \cdot x1\right) \cdot 9\\
t_3 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_4 := 4 \cdot \left(x1 \cdot t_3\right)\\
t_5 := 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{t_0}\\
\mathbf{if}\;x1 \leq -3.8 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + t_4\right) + \frac{t_1 - t_2}{x2 \cdot -6 - x1 \cdot -3}\right)\\
\mathbf{elif}\;x1 \leq -2.1 \cdot 10^{-226}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot t_3 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 6 \cdot 10^{-247}:\\
\;\;\;\;x1 + \left(t_5 + \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t_5 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_2 + t_0 \cdot t_4\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - t_1}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -3.7999999999999998e154Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 2.8%
flip-+50.0%
*-commutative50.0%
*-commutative50.0%
*-commutative50.0%
*-commutative50.0%
*-commutative50.0%
*-commutative50.0%
Applied egg-rr50.0%
swap-sqr50.0%
metadata-eval50.0%
swap-sqr50.0%
metadata-eval50.0%
*-commutative50.0%
Simplified50.0%
if -3.7999999999999998e154 < x1 < -2.1000000000000002e-226Initial program 88.2%
Taylor expanded in x1 around 0 59.2%
Taylor expanded in x1 around 0 59.9%
if -2.1000000000000002e-226 < x1 < 5.9999999999999995e-247Initial program 99.7%
Taylor expanded in x1 around 0 79.1%
Taylor expanded in x2 around 0 96.3%
*-commutative96.3%
Simplified96.3%
if 5.9999999999999995e-247 < x1 < 1.35000000000000003e154Initial program 97.4%
Taylor expanded in x1 around 0 81.5%
Taylor expanded in x1 around 0 82.2%
Taylor expanded in x1 around inf 82.1%
*-commutative82.1%
unpow282.1%
Simplified82.1%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 7.4%
*-commutative7.4%
Simplified7.4%
flip-+66.7%
Applied egg-rr66.7%
swap-sqr66.7%
metadata-eval66.7%
*-commutative66.7%
Simplified66.7%
Final simplification71.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* x2 x2) 36.0))
(t_1 (* x2 (- (* 2.0 x2) 3.0)))
(t_2 (* 4.0 (* x1 t_1)))
(t_3
(*
3.0
(/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))))
(if (<= x1 -3.8e+154)
(+
x1
(+ (+ x1 t_2) (/ (- t_0 (* (* x1 x1) 9.0)) (- (* x2 -6.0) (* x1 -3.0)))))
(if (<= x1 -4.5e-230)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* 4.0 t_1) 2.0))))
(if (<= x1 8.2e-247)
(+ x1 (+ t_3 (+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (<= x1 1.35e+154)
(+ x1 (+ t_3 (+ x1 (+ (* x1 (* x1 x1)) t_2))))
(/ (- (* x1 x1) t_0) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = (x2 * x2) * 36.0;
double t_1 = x2 * ((2.0 * x2) - 3.0);
double t_2 = 4.0 * (x1 * t_1);
double t_3 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0));
double tmp;
if (x1 <= -3.8e+154) {
tmp = x1 + ((x1 + t_2) + ((t_0 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= -4.5e-230) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_1) - 2.0)));
} else if (x1 <= 8.2e-247) {
tmp = x1 + (t_3 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + t_2)));
} else {
tmp = ((x1 * x1) - t_0) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (x2 * x2) * 36.0d0
t_1 = x2 * ((2.0d0 * x2) - 3.0d0)
t_2 = 4.0d0 * (x1 * t_1)
t_3 = 3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))
if (x1 <= (-3.8d+154)) then
tmp = x1 + ((x1 + t_2) + ((t_0 - ((x1 * x1) * 9.0d0)) / ((x2 * (-6.0d0)) - (x1 * (-3.0d0)))))
else if (x1 <= (-4.5d-230)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * t_1) - 2.0d0)))
else if (x1 <= 8.2d-247) then
tmp = x1 + (t_3 + (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if (x1 <= 1.35d+154) then
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + t_2)))
else
tmp = ((x1 * x1) - t_0) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x2 * x2) * 36.0;
double t_1 = x2 * ((2.0 * x2) - 3.0);
double t_2 = 4.0 * (x1 * t_1);
double t_3 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0));
double tmp;
if (x1 <= -3.8e+154) {
tmp = x1 + ((x1 + t_2) + ((t_0 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= -4.5e-230) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_1) - 2.0)));
} else if (x1 <= 8.2e-247) {
tmp = x1 + (t_3 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + t_2)));
} else {
tmp = ((x1 * x1) - t_0) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x2 * x2) * 36.0 t_1 = x2 * ((2.0 * x2) - 3.0) t_2 = 4.0 * (x1 * t_1) t_3 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)) tmp = 0 if x1 <= -3.8e+154: tmp = x1 + ((x1 + t_2) + ((t_0 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0)))) elif x1 <= -4.5e-230: tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_1) - 2.0))) elif x1 <= 8.2e-247: tmp = x1 + (t_3 + (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif x1 <= 1.35e+154: tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + t_2))) else: tmp = ((x1 * x1) - t_0) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x2 * x2) * 36.0) t_1 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_2 = Float64(4.0 * Float64(x1 * t_1)) t_3 = Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) tmp = 0.0 if (x1 <= -3.8e+154) tmp = Float64(x1 + Float64(Float64(x1 + t_2) + Float64(Float64(t_0 - Float64(Float64(x1 * x1) * 9.0)) / Float64(Float64(x2 * -6.0) - Float64(x1 * -3.0))))); elseif (x1 <= -4.5e-230) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * t_1) - 2.0)))); elseif (x1 <= 8.2e-247) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + t_2)))); else tmp = Float64(Float64(Float64(x1 * x1) - t_0) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x2 * x2) * 36.0; t_1 = x2 * ((2.0 * x2) - 3.0); t_2 = 4.0 * (x1 * t_1); t_3 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)); tmp = 0.0; if (x1 <= -3.8e+154) tmp = x1 + ((x1 + t_2) + ((t_0 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0)))); elseif (x1 <= -4.5e-230) tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_1) - 2.0))); elseif (x1 <= 8.2e-247) tmp = x1 + (t_3 + (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif (x1 <= 1.35e+154) tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + t_2))); else tmp = ((x1 * x1) - t_0) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]}, Block[{t$95$1 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.8e+154], N[(x1 + N[(N[(x1 + t$95$2), $MachinePrecision] + N[(N[(t$95$0 - N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -4.5e-230], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * t$95$1), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8.2e-247], N[(x1 + N[(t$95$3 + N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x2 \cdot x2\right) \cdot 36\\
t_1 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_2 := 4 \cdot \left(x1 \cdot t_1\right)\\
t_3 := 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\\
\mathbf{if}\;x1 \leq -3.8 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + t_2\right) + \frac{t_0 - \left(x1 \cdot x1\right) \cdot 9}{x2 \cdot -6 - x1 \cdot -3}\right)\\
\mathbf{elif}\;x1 \leq -4.5 \cdot 10^{-230}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot t_1 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 8.2 \cdot 10^{-247}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + t_2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - t_0}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -3.7999999999999998e154Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 2.8%
flip-+50.0%
*-commutative50.0%
*-commutative50.0%
*-commutative50.0%
*-commutative50.0%
*-commutative50.0%
*-commutative50.0%
Applied egg-rr50.0%
swap-sqr50.0%
metadata-eval50.0%
swap-sqr50.0%
metadata-eval50.0%
*-commutative50.0%
Simplified50.0%
if -3.7999999999999998e154 < x1 < -4.50000000000000004e-230Initial program 88.2%
Taylor expanded in x1 around 0 59.2%
Taylor expanded in x1 around 0 59.9%
if -4.50000000000000004e-230 < x1 < 8.1999999999999997e-247Initial program 99.7%
Taylor expanded in x1 around 0 79.1%
Taylor expanded in x2 around 0 96.3%
*-commutative96.3%
Simplified96.3%
if 8.1999999999999997e-247 < x1 < 1.35000000000000003e154Initial program 97.4%
Taylor expanded in x1 around 0 81.5%
Taylor expanded in x1 around 0 82.2%
Taylor expanded in x1 around 0 79.2%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 7.4%
*-commutative7.4%
Simplified7.4%
flip-+66.7%
Applied egg-rr66.7%
swap-sqr66.7%
metadata-eval66.7%
*-commutative66.7%
Simplified66.7%
Final simplification70.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))))
(t_1 (* x2 (- (* 2.0 x2) 3.0))))
(if (<= x1 -4.6e+101)
(+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0)))))
(if (<= x1 -5.4e-226)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* 4.0 t_1) 2.0))))
(if (<= x1 8.2e-247)
(+ x1 (+ t_0 (+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (<= x1 1.35e+154)
(+ x1 (+ t_0 (+ x1 (* 4.0 (* x1 t_1)))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0));
double t_1 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -4.6e+101) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -5.4e-226) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_1) - 2.0)));
} else if (x1 <= 8.2e-247) {
tmp = x1 + (t_0 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_0 + (x1 + (4.0 * (x1 * t_1))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))
t_1 = x2 * ((2.0d0 * x2) - 3.0d0)
if (x1 <= (-4.6d+101)) then
tmp = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
else if (x1 <= (-5.4d-226)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * t_1) - 2.0d0)))
else if (x1 <= 8.2d-247) then
tmp = x1 + (t_0 + (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if (x1 <= 1.35d+154) then
tmp = x1 + (t_0 + (x1 + (4.0d0 * (x1 * t_1))))
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0));
double t_1 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -4.6e+101) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -5.4e-226) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_1) - 2.0)));
} else if (x1 <= 8.2e-247) {
tmp = x1 + (t_0 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_0 + (x1 + (4.0 * (x1 * t_1))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)) t_1 = x2 * ((2.0 * x2) - 3.0) tmp = 0 if x1 <= -4.6e+101: tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) elif x1 <= -5.4e-226: tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_1) - 2.0))) elif x1 <= 8.2e-247: tmp = x1 + (t_0 + (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif x1 <= 1.35e+154: tmp = x1 + (t_0 + (x1 + (4.0 * (x1 * t_1)))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) t_1 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) tmp = 0.0 if (x1 <= -4.6e+101) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))); elseif (x1 <= -5.4e-226) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * t_1) - 2.0)))); elseif (x1 <= 8.2e-247) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(4.0 * Float64(x1 * t_1))))); else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)); t_1 = x2 * ((2.0 * x2) - 3.0); tmp = 0.0; if (x1 <= -4.6e+101) tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); elseif (x1 <= -5.4e-226) tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_1) - 2.0))); elseif (x1 <= 8.2e-247) tmp = x1 + (t_0 + (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif (x1 <= 1.35e+154) tmp = x1 + (t_0 + (x1 + (4.0 * (x1 * t_1)))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.6e+101], N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5.4e-226], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * t$95$1), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8.2e-247], N[(x1 + N[(t$95$0 + N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$0 + N[(x1 + N[(4.0 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\\
t_1 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
\mathbf{if}\;x1 \leq -4.6 \cdot 10^{+101}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -5.4 \cdot 10^{-226}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot t_1 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 8.2 \cdot 10^{-247}:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + 4 \cdot \left(x1 \cdot t_1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -4.6000000000000003e101Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 2.4%
Taylor expanded in x2 around 0 18.8%
if -4.6000000000000003e101 < x1 < -5.40000000000000029e-226Initial program 99.4%
Taylor expanded in x1 around 0 66.8%
Taylor expanded in x1 around 0 67.5%
if -5.40000000000000029e-226 < x1 < 8.1999999999999997e-247Initial program 99.7%
Taylor expanded in x1 around 0 79.1%
Taylor expanded in x2 around 0 96.3%
*-commutative96.3%
Simplified96.3%
if 8.1999999999999997e-247 < x1 < 1.35000000000000003e154Initial program 97.4%
Taylor expanded in x1 around 0 65.1%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 7.4%
*-commutative7.4%
Simplified7.4%
flip-+66.7%
Applied egg-rr66.7%
swap-sqr66.7%
metadata-eval66.7%
*-commutative66.7%
Simplified66.7%
Final simplification61.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* x2 x2) 36.0))
(t_1 (* x2 (- (* 2.0 x2) 3.0)))
(t_2 (+ x1 (* 4.0 (* x1 t_1))))
(t_3
(*
3.0
(/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))))
(if (<= x1 -3.8e+154)
(+ x1 (+ t_2 (/ (- t_0 (* (* x1 x1) 9.0)) (- (* x2 -6.0) (* x1 -3.0)))))
(if (<= x1 -3e-227)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* 4.0 t_1) 2.0))))
(if (<= x1 1.05e-248)
(+ x1 (+ t_3 (+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (<= x1 1.35e+154)
(+ x1 (+ t_3 t_2))
(/ (- (* x1 x1) t_0) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = (x2 * x2) * 36.0;
double t_1 = x2 * ((2.0 * x2) - 3.0);
double t_2 = x1 + (4.0 * (x1 * t_1));
double t_3 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0));
double tmp;
if (x1 <= -3.8e+154) {
tmp = x1 + (t_2 + ((t_0 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= -3e-227) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_1) - 2.0)));
} else if (x1 <= 1.05e-248) {
tmp = x1 + (t_3 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_3 + t_2);
} else {
tmp = ((x1 * x1) - t_0) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (x2 * x2) * 36.0d0
t_1 = x2 * ((2.0d0 * x2) - 3.0d0)
t_2 = x1 + (4.0d0 * (x1 * t_1))
t_3 = 3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))
if (x1 <= (-3.8d+154)) then
tmp = x1 + (t_2 + ((t_0 - ((x1 * x1) * 9.0d0)) / ((x2 * (-6.0d0)) - (x1 * (-3.0d0)))))
else if (x1 <= (-3d-227)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * t_1) - 2.0d0)))
else if (x1 <= 1.05d-248) then
tmp = x1 + (t_3 + (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if (x1 <= 1.35d+154) then
tmp = x1 + (t_3 + t_2)
else
tmp = ((x1 * x1) - t_0) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x2 * x2) * 36.0;
double t_1 = x2 * ((2.0 * x2) - 3.0);
double t_2 = x1 + (4.0 * (x1 * t_1));
double t_3 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0));
double tmp;
if (x1 <= -3.8e+154) {
tmp = x1 + (t_2 + ((t_0 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0))));
} else if (x1 <= -3e-227) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_1) - 2.0)));
} else if (x1 <= 1.05e-248) {
tmp = x1 + (t_3 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_3 + t_2);
} else {
tmp = ((x1 * x1) - t_0) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x2 * x2) * 36.0 t_1 = x2 * ((2.0 * x2) - 3.0) t_2 = x1 + (4.0 * (x1 * t_1)) t_3 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)) tmp = 0 if x1 <= -3.8e+154: tmp = x1 + (t_2 + ((t_0 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0)))) elif x1 <= -3e-227: tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_1) - 2.0))) elif x1 <= 1.05e-248: tmp = x1 + (t_3 + (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif x1 <= 1.35e+154: tmp = x1 + (t_3 + t_2) else: tmp = ((x1 * x1) - t_0) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x2 * x2) * 36.0) t_1 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_2 = Float64(x1 + Float64(4.0 * Float64(x1 * t_1))) t_3 = Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) tmp = 0.0 if (x1 <= -3.8e+154) tmp = Float64(x1 + Float64(t_2 + Float64(Float64(t_0 - Float64(Float64(x1 * x1) * 9.0)) / Float64(Float64(x2 * -6.0) - Float64(x1 * -3.0))))); elseif (x1 <= -3e-227) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * t_1) - 2.0)))); elseif (x1 <= 1.05e-248) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(t_3 + t_2)); else tmp = Float64(Float64(Float64(x1 * x1) - t_0) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x2 * x2) * 36.0; t_1 = x2 * ((2.0 * x2) - 3.0); t_2 = x1 + (4.0 * (x1 * t_1)); t_3 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)); tmp = 0.0; if (x1 <= -3.8e+154) tmp = x1 + (t_2 + ((t_0 - ((x1 * x1) * 9.0)) / ((x2 * -6.0) - (x1 * -3.0)))); elseif (x1 <= -3e-227) tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_1) - 2.0))); elseif (x1 <= 1.05e-248) tmp = x1 + (t_3 + (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif (x1 <= 1.35e+154) tmp = x1 + (t_3 + t_2); else tmp = ((x1 * x1) - t_0) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]}, Block[{t$95$1 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(4.0 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.8e+154], N[(x1 + N[(t$95$2 + N[(N[(t$95$0 - N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3e-227], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * t$95$1), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.05e-248], N[(x1 + N[(t$95$3 + N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$3 + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x2 \cdot x2\right) \cdot 36\\
t_1 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_2 := x1 + 4 \cdot \left(x1 \cdot t_1\right)\\
t_3 := 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\\
\mathbf{if}\;x1 \leq -3.8 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t_2 + \frac{t_0 - \left(x1 \cdot x1\right) \cdot 9}{x2 \cdot -6 - x1 \cdot -3}\right)\\
\mathbf{elif}\;x1 \leq -3 \cdot 10^{-227}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot t_1 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 1.05 \cdot 10^{-248}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t_3 + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - t_0}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -3.7999999999999998e154Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 2.8%
flip-+50.0%
*-commutative50.0%
*-commutative50.0%
*-commutative50.0%
*-commutative50.0%
*-commutative50.0%
*-commutative50.0%
Applied egg-rr50.0%
swap-sqr50.0%
metadata-eval50.0%
swap-sqr50.0%
metadata-eval50.0%
*-commutative50.0%
Simplified50.0%
if -3.7999999999999998e154 < x1 < -3e-227Initial program 88.2%
Taylor expanded in x1 around 0 59.2%
Taylor expanded in x1 around 0 59.9%
if -3e-227 < x1 < 1.05e-248Initial program 99.7%
Taylor expanded in x1 around 0 79.1%
Taylor expanded in x2 around 0 96.3%
*-commutative96.3%
Simplified96.3%
if 1.05e-248 < x1 < 1.35000000000000003e154Initial program 97.4%
Taylor expanded in x1 around 0 65.1%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 7.4%
*-commutative7.4%
Simplified7.4%
flip-+66.7%
Applied egg-rr66.7%
swap-sqr66.7%
metadata-eval66.7%
*-commutative66.7%
Simplified66.7%
Final simplification65.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))))
(if (<= x1 -4.6e+101)
(+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0)))))
(if (<= x1 -3.9e-228)
t_0
(if (<= x1 6.5e-247)
(+
x1
(+
(*
3.0
(/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (<= x1 1.04e+121)
t_0
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double tmp;
if (x1 <= -4.6e+101) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -3.9e-228) {
tmp = t_0;
} else if (x1 <= 6.5e-247) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.04e+121) {
tmp = t_0;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
if (x1 <= (-4.6d+101)) then
tmp = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
else if (x1 <= (-3.9d-228)) then
tmp = t_0
else if (x1 <= 6.5d-247) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if (x1 <= 1.04d+121) then
tmp = t_0
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double tmp;
if (x1 <= -4.6e+101) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -3.9e-228) {
tmp = t_0;
} else if (x1 <= 6.5e-247) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.04e+121) {
tmp = t_0;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) tmp = 0 if x1 <= -4.6e+101: tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) elif x1 <= -3.9e-228: tmp = t_0 elif x1 <= 6.5e-247: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif x1 <= 1.04e+121: tmp = t_0 else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))) tmp = 0.0 if (x1 <= -4.6e+101) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))); elseif (x1 <= -3.9e-228) tmp = t_0; elseif (x1 <= 6.5e-247) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif (x1 <= 1.04e+121) tmp = t_0; else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); tmp = 0.0; if (x1 <= -4.6e+101) tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); elseif (x1 <= -3.9e-228) tmp = t_0; elseif (x1 <= 6.5e-247) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif (x1 <= 1.04e+121) tmp = t_0; else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.6e+101], N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3.9e-228], t$95$0, If[LessEqual[x1, 6.5e-247], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.04e+121], t$95$0, N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{if}\;x1 \leq -4.6 \cdot 10^{+101}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -3.9 \cdot 10^{-228}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 6.5 \cdot 10^{-247}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.04 \cdot 10^{+121}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -4.6000000000000003e101Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 2.4%
Taylor expanded in x2 around 0 18.8%
if -4.6000000000000003e101 < x1 < -3.90000000000000029e-228 or 6.4999999999999996e-247 < x1 < 1.04e121Initial program 98.8%
Taylor expanded in x1 around 0 69.2%
Taylor expanded in x1 around 0 69.1%
if -3.90000000000000029e-228 < x1 < 6.4999999999999996e-247Initial program 99.7%
Taylor expanded in x1 around 0 79.1%
Taylor expanded in x2 around 0 96.3%
*-commutative96.3%
Simplified96.3%
if 1.04e121 < x1 Initial program 18.4%
Taylor expanded in x1 around 0 0.9%
Taylor expanded in x1 around 0 6.6%
*-commutative6.6%
Simplified6.6%
flip-+53.4%
Applied egg-rr53.4%
swap-sqr53.4%
metadata-eval53.4%
*-commutative53.4%
Simplified53.4%
Final simplification61.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)))))
(t_1 (+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0)))))))
(if (<= x1 -4.6e+101)
t_1
(if (<= x1 -1.65e-227)
t_0
(if (<= x1 8.2e-247)
t_1
(if (<= x1 1.04e+121)
t_0
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double t_1 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
double tmp;
if (x1 <= -4.6e+101) {
tmp = t_1;
} else if (x1 <= -1.65e-227) {
tmp = t_0;
} else if (x1 <= 8.2e-247) {
tmp = t_1;
} else if (x1 <= 1.04e+121) {
tmp = t_0;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
t_1 = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
if (x1 <= (-4.6d+101)) then
tmp = t_1
else if (x1 <= (-1.65d-227)) then
tmp = t_0
else if (x1 <= 8.2d-247) then
tmp = t_1
else if (x1 <= 1.04d+121) then
tmp = t_0
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double t_1 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
double tmp;
if (x1 <= -4.6e+101) {
tmp = t_1;
} else if (x1 <= -1.65e-227) {
tmp = t_0;
} else if (x1 <= 8.2e-247) {
tmp = t_1;
} else if (x1 <= 1.04e+121) {
tmp = t_0;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) t_1 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) tmp = 0 if x1 <= -4.6e+101: tmp = t_1 elif x1 <= -1.65e-227: tmp = t_0 elif x1 <= 8.2e-247: tmp = t_1 elif x1 <= 1.04e+121: tmp = t_0 else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))) t_1 = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))) tmp = 0.0 if (x1 <= -4.6e+101) tmp = t_1; elseif (x1 <= -1.65e-227) tmp = t_0; elseif (x1 <= 8.2e-247) tmp = t_1; elseif (x1 <= 1.04e+121) tmp = t_0; else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); t_1 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); tmp = 0.0; if (x1 <= -4.6e+101) tmp = t_1; elseif (x1 <= -1.65e-227) tmp = t_0; elseif (x1 <= 8.2e-247) tmp = t_1; elseif (x1 <= 1.04e+121) tmp = t_0; else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.6e+101], t$95$1, If[LessEqual[x1, -1.65e-227], t$95$0, If[LessEqual[x1, 8.2e-247], t$95$1, If[LessEqual[x1, 1.04e+121], t$95$0, N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
t_1 := x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
\mathbf{if}\;x1 \leq -4.6 \cdot 10^{+101}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq -1.65 \cdot 10^{-227}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 8.2 \cdot 10^{-247}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 1.04 \cdot 10^{+121}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -4.6000000000000003e101 or -1.65e-227 < x1 < 8.1999999999999997e-247Initial program 39.6%
Taylor expanded in x1 around 0 31.4%
Taylor expanded in x1 around 0 32.8%
Taylor expanded in x2 around 0 49.6%
if -4.6000000000000003e101 < x1 < -1.65e-227 or 8.1999999999999997e-247 < x1 < 1.04e121Initial program 98.8%
Taylor expanded in x1 around 0 69.2%
Taylor expanded in x1 around 0 69.1%
if 1.04e121 < x1 Initial program 18.4%
Taylor expanded in x1 around 0 0.9%
Taylor expanded in x1 around 0 6.6%
*-commutative6.6%
Simplified6.6%
flip-+53.4%
Applied egg-rr53.4%
swap-sqr53.4%
metadata-eval53.4%
*-commutative53.4%
Simplified53.4%
Final simplification61.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))
(t_1 (+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0)))))))
(if (<= x1 -2.6e+140)
t_1
(if (<= x1 -320000000.0)
t_0
(if (<= x1 2.6e-48)
t_1
(if (<= x1 1.35e+154)
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))
t_0))))))
double code(double x1, double x2) {
double t_0 = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
double t_1 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
double tmp;
if (x1 <= -2.6e+140) {
tmp = t_1;
} else if (x1 <= -320000000.0) {
tmp = t_0;
} else if (x1 <= 2.6e-48) {
tmp = t_1;
} else if (x1 <= 1.35e+154) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
t_1 = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
if (x1 <= (-2.6d+140)) then
tmp = t_1
else if (x1 <= (-320000000.0d0)) then
tmp = t_0
else if (x1 <= 2.6d-48) then
tmp = t_1
else if (x1 <= 1.35d+154) then
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
double t_1 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
double tmp;
if (x1 <= -2.6e+140) {
tmp = t_1;
} else if (x1 <= -320000000.0) {
tmp = t_0;
} else if (x1 <= 2.6e-48) {
tmp = t_1;
} else if (x1 <= 1.35e+154) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) t_1 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) tmp = 0 if x1 <= -2.6e+140: tmp = t_1 elif x1 <= -320000000.0: tmp = t_0 elif x1 <= 2.6e-48: tmp = t_1 elif x1 <= 1.35e+154: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))) t_1 = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))) tmp = 0.0 if (x1 <= -2.6e+140) tmp = t_1; elseif (x1 <= -320000000.0) tmp = t_0; elseif (x1 <= 2.6e-48) tmp = t_1; elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); t_1 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); tmp = 0.0; if (x1 <= -2.6e+140) tmp = t_1; elseif (x1 <= -320000000.0) tmp = t_0; elseif (x1 <= 2.6e-48) tmp = t_1; elseif (x1 <= 1.35e+154) tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.6e+140], t$95$1, If[LessEqual[x1, -320000000.0], t$95$0, If[LessEqual[x1, 2.6e-48], t$95$1, If[LessEqual[x1, 1.35e+154], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
t_1 := x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
\mathbf{if}\;x1 \leq -2.6 \cdot 10^{+140}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq -320000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 2.6 \cdot 10^{-48}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -2.6000000000000001e140 or -3.2e8 < x1 < 2.59999999999999987e-48Initial program 75.1%
Taylor expanded in x1 around 0 65.4%
Taylor expanded in x1 around 0 65.9%
Taylor expanded in x2 around 0 67.1%
if -2.6000000000000001e140 < x1 < -3.2e8 or 1.35000000000000003e154 < x1 Initial program 37.3%
Taylor expanded in x1 around 0 7.6%
Taylor expanded in x1 around 0 4.8%
*-commutative4.8%
Simplified4.8%
flip-+44.9%
Applied egg-rr44.9%
swap-sqr44.9%
metadata-eval44.9%
*-commutative44.9%
Simplified44.9%
if 2.59999999999999987e-48 < x1 < 1.35000000000000003e154Initial program 94.9%
Taylor expanded in x1 around 0 37.5%
Taylor expanded in x1 around inf 32.7%
Final simplification56.7%
(FPCore (x1 x2) :precision binary64 (if (<= x1 1e-44) (+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0))))) (+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= 1e-44) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= 1d-44) then
tmp = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 1e-44) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 1e-44: tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 1e-44) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 1e-44) tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 1e-44], N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 10^{-44}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < 9.99999999999999953e-45Initial program 75.8%
Taylor expanded in x1 around 0 58.5%
Taylor expanded in x1 around 0 59.2%
Taylor expanded in x2 around 0 58.2%
if 9.99999999999999953e-45 < x1 Initial program 54.8%
Taylor expanded in x1 around 0 21.7%
Taylor expanded in x1 around inf 39.1%
Final simplification52.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* x2 x2) (* x1 8.0))) (t_1 (+ x1 (* x2 -6.0))))
(if (<= x2 -7e+196)
t_0
(if (<= x2 -5.5e-177)
t_1
(if (<= x2 9e-177) (+ x1 (* x1 -2.0)) (if (<= x2 6.6e+136) t_1 t_0))))))
double code(double x1, double x2) {
double t_0 = (x2 * x2) * (x1 * 8.0);
double t_1 = x1 + (x2 * -6.0);
double tmp;
if (x2 <= -7e+196) {
tmp = t_0;
} else if (x2 <= -5.5e-177) {
tmp = t_1;
} else if (x2 <= 9e-177) {
tmp = x1 + (x1 * -2.0);
} else if (x2 <= 6.6e+136) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x2 * x2) * (x1 * 8.0d0)
t_1 = x1 + (x2 * (-6.0d0))
if (x2 <= (-7d+196)) then
tmp = t_0
else if (x2 <= (-5.5d-177)) then
tmp = t_1
else if (x2 <= 9d-177) then
tmp = x1 + (x1 * (-2.0d0))
else if (x2 <= 6.6d+136) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x2 * x2) * (x1 * 8.0);
double t_1 = x1 + (x2 * -6.0);
double tmp;
if (x2 <= -7e+196) {
tmp = t_0;
} else if (x2 <= -5.5e-177) {
tmp = t_1;
} else if (x2 <= 9e-177) {
tmp = x1 + (x1 * -2.0);
} else if (x2 <= 6.6e+136) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = (x2 * x2) * (x1 * 8.0) t_1 = x1 + (x2 * -6.0) tmp = 0 if x2 <= -7e+196: tmp = t_0 elif x2 <= -5.5e-177: tmp = t_1 elif x2 <= 9e-177: tmp = x1 + (x1 * -2.0) elif x2 <= 6.6e+136: tmp = t_1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(Float64(x2 * x2) * Float64(x1 * 8.0)) t_1 = Float64(x1 + Float64(x2 * -6.0)) tmp = 0.0 if (x2 <= -7e+196) tmp = t_0; elseif (x2 <= -5.5e-177) tmp = t_1; elseif (x2 <= 9e-177) tmp = Float64(x1 + Float64(x1 * -2.0)); elseif (x2 <= 6.6e+136) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x2 * x2) * (x1 * 8.0); t_1 = x1 + (x2 * -6.0); tmp = 0.0; if (x2 <= -7e+196) tmp = t_0; elseif (x2 <= -5.5e-177) tmp = t_1; elseif (x2 <= 9e-177) tmp = x1 + (x1 * -2.0); elseif (x2 <= 6.6e+136) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x2 * x2), $MachinePrecision] * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -7e+196], t$95$0, If[LessEqual[x2, -5.5e-177], t$95$1, If[LessEqual[x2, 9e-177], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x2, 6.6e+136], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x2 \cdot x2\right) \cdot \left(x1 \cdot 8\right)\\
t_1 := x1 + x2 \cdot -6\\
\mathbf{if}\;x2 \leq -7 \cdot 10^{+196}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x2 \leq -5.5 \cdot 10^{-177}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x2 \leq 9 \cdot 10^{-177}:\\
\;\;\;\;x1 + x1 \cdot -2\\
\mathbf{elif}\;x2 \leq 6.6 \cdot 10^{+136}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x2 < -6.9999999999999997e196 or 6.59999999999999984e136 < x2 Initial program 62.2%
Taylor expanded in x1 around 0 42.3%
Taylor expanded in x1 around inf 59.4%
Taylor expanded in x2 around inf 59.4%
associate-*r*59.4%
unpow259.4%
Simplified59.4%
if -6.9999999999999997e196 < x2 < -5.4999999999999996e-177 or 9.0000000000000007e-177 < x2 < 6.59999999999999984e136Initial program 73.1%
Taylor expanded in x1 around 0 48.7%
Taylor expanded in x1 around 0 42.3%
*-commutative42.3%
Simplified42.3%
if -5.4999999999999996e-177 < x2 < 9.0000000000000007e-177Initial program 69.8%
Taylor expanded in x1 around 0 52.3%
Taylor expanded in x1 around 0 52.9%
Taylor expanded in x2 around 0 46.3%
distribute-rgt1-in46.7%
metadata-eval46.7%
*-commutative46.7%
Simplified46.7%
Final simplification46.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* x2 x2) (* x1 8.0))) (t_1 (+ x1 (+ x1 (* x2 -6.0)))))
(if (<= x2 -7.5e+196)
t_0
(if (<= x2 -6.8e-174)
t_1
(if (<= x2 1.8e-172)
(+ x1 (* x1 -2.0))
(if (<= x2 4.6e+138) t_1 t_0))))))
double code(double x1, double x2) {
double t_0 = (x2 * x2) * (x1 * 8.0);
double t_1 = x1 + (x1 + (x2 * -6.0));
double tmp;
if (x2 <= -7.5e+196) {
tmp = t_0;
} else if (x2 <= -6.8e-174) {
tmp = t_1;
} else if (x2 <= 1.8e-172) {
tmp = x1 + (x1 * -2.0);
} else if (x2 <= 4.6e+138) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x2 * x2) * (x1 * 8.0d0)
t_1 = x1 + (x1 + (x2 * (-6.0d0)))
if (x2 <= (-7.5d+196)) then
tmp = t_0
else if (x2 <= (-6.8d-174)) then
tmp = t_1
else if (x2 <= 1.8d-172) then
tmp = x1 + (x1 * (-2.0d0))
else if (x2 <= 4.6d+138) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x2 * x2) * (x1 * 8.0);
double t_1 = x1 + (x1 + (x2 * -6.0));
double tmp;
if (x2 <= -7.5e+196) {
tmp = t_0;
} else if (x2 <= -6.8e-174) {
tmp = t_1;
} else if (x2 <= 1.8e-172) {
tmp = x1 + (x1 * -2.0);
} else if (x2 <= 4.6e+138) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = (x2 * x2) * (x1 * 8.0) t_1 = x1 + (x1 + (x2 * -6.0)) tmp = 0 if x2 <= -7.5e+196: tmp = t_0 elif x2 <= -6.8e-174: tmp = t_1 elif x2 <= 1.8e-172: tmp = x1 + (x1 * -2.0) elif x2 <= 4.6e+138: tmp = t_1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(Float64(x2 * x2) * Float64(x1 * 8.0)) t_1 = Float64(x1 + Float64(x1 + Float64(x2 * -6.0))) tmp = 0.0 if (x2 <= -7.5e+196) tmp = t_0; elseif (x2 <= -6.8e-174) tmp = t_1; elseif (x2 <= 1.8e-172) tmp = Float64(x1 + Float64(x1 * -2.0)); elseif (x2 <= 4.6e+138) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x2 * x2) * (x1 * 8.0); t_1 = x1 + (x1 + (x2 * -6.0)); tmp = 0.0; if (x2 <= -7.5e+196) tmp = t_0; elseif (x2 <= -6.8e-174) tmp = t_1; elseif (x2 <= 1.8e-172) tmp = x1 + (x1 * -2.0); elseif (x2 <= 4.6e+138) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x2 * x2), $MachinePrecision] * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -7.5e+196], t$95$0, If[LessEqual[x2, -6.8e-174], t$95$1, If[LessEqual[x2, 1.8e-172], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x2, 4.6e+138], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x2 \cdot x2\right) \cdot \left(x1 \cdot 8\right)\\
t_1 := x1 + \left(x1 + x2 \cdot -6\right)\\
\mathbf{if}\;x2 \leq -7.5 \cdot 10^{+196}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x2 \leq -6.8 \cdot 10^{-174}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x2 \leq 1.8 \cdot 10^{-172}:\\
\;\;\;\;x1 + x1 \cdot -2\\
\mathbf{elif}\;x2 \leq 4.6 \cdot 10^{+138}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x2 < -7.5000000000000005e196 or 4.60000000000000015e138 < x2 Initial program 62.2%
Taylor expanded in x1 around 0 42.3%
Taylor expanded in x1 around inf 59.4%
Taylor expanded in x2 around inf 59.4%
associate-*r*59.4%
unpow259.4%
Simplified59.4%
if -7.5000000000000005e196 < x2 < -6.8000000000000004e-174 or 1.80000000000000007e-172 < x2 < 4.60000000000000015e138Initial program 73.1%
Taylor expanded in x1 around 0 67.6%
*-commutative67.6%
Simplified67.6%
Taylor expanded in x1 around inf 87.7%
*-commutative87.7%
Simplified87.7%
Taylor expanded in x1 around 0 42.3%
if -6.8000000000000004e-174 < x2 < 1.80000000000000007e-172Initial program 69.8%
Taylor expanded in x1 around 0 52.3%
Taylor expanded in x1 around 0 52.9%
Taylor expanded in x2 around 0 46.3%
distribute-rgt1-in46.7%
metadata-eval46.7%
*-commutative46.7%
Simplified46.7%
Final simplification47.0%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -7.4e-174) (not (<= x2 1.6e-172))) (+ x1 (* x2 -6.0)) (+ x1 (* x1 -2.0))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -7.4e-174) || !(x2 <= 1.6e-172)) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = x1 + (x1 * -2.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-7.4d-174)) .or. (.not. (x2 <= 1.6d-172))) then
tmp = x1 + (x2 * (-6.0d0))
else
tmp = x1 + (x1 * (-2.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -7.4e-174) || !(x2 <= 1.6e-172)) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = x1 + (x1 * -2.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -7.4e-174) or not (x2 <= 1.6e-172): tmp = x1 + (x2 * -6.0) else: tmp = x1 + (x1 * -2.0) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -7.4e-174) || !(x2 <= 1.6e-172)) tmp = Float64(x1 + Float64(x2 * -6.0)); else tmp = Float64(x1 + Float64(x1 * -2.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -7.4e-174) || ~((x2 <= 1.6e-172))) tmp = x1 + (x2 * -6.0); else tmp = x1 + (x1 * -2.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -7.4e-174], N[Not[LessEqual[x2, 1.6e-172]], $MachinePrecision]], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -7.4 \cdot 10^{-174} \lor \neg \left(x2 \leq 1.6 \cdot 10^{-172}\right):\\
\;\;\;\;x1 + x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot -2\\
\end{array}
\end{array}
if x2 < -7.40000000000000019e-174 or 1.6000000000000001e-172 < x2 Initial program 70.1%
Taylor expanded in x1 around 0 47.0%
Taylor expanded in x1 around 0 33.7%
*-commutative33.7%
Simplified33.7%
if -7.40000000000000019e-174 < x2 < 1.6000000000000001e-172Initial program 69.8%
Taylor expanded in x1 around 0 52.3%
Taylor expanded in x1 around 0 52.9%
Taylor expanded in x2 around 0 46.3%
distribute-rgt1-in46.7%
metadata-eval46.7%
*-commutative46.7%
Simplified46.7%
Final simplification36.9%
(FPCore (x1 x2) :precision binary64 (+ (* x1 2.0) 9.0))
double code(double x1, double x2) {
return (x1 * 2.0) + 9.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x1 * 2.0d0) + 9.0d0
end function
public static double code(double x1, double x2) {
return (x1 * 2.0) + 9.0;
}
def code(x1, x2): return (x1 * 2.0) + 9.0
function code(x1, x2) return Float64(Float64(x1 * 2.0) + 9.0) end
function tmp = code(x1, x2) tmp = (x1 * 2.0) + 9.0; end
code[x1_, x2_] := N[(N[(x1 * 2.0), $MachinePrecision] + 9.0), $MachinePrecision]
\begin{array}{l}
\\
x1 \cdot 2 + 9
\end{array}
Initial program 70.0%
Taylor expanded in x1 around 0 48.3%
Taylor expanded in x1 around inf 19.1%
Taylor expanded in x2 around 0 3.6%
Final simplification3.6%
(FPCore (x1 x2) :precision binary64 (+ x1 (* x1 -2.0)))
double code(double x1, double x2) {
return x1 + (x1 * -2.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + (x1 * (-2.0d0))
end function
public static double code(double x1, double x2) {
return x1 + (x1 * -2.0);
}
def code(x1, x2): return x1 + (x1 * -2.0)
function code(x1, x2) return Float64(x1 + Float64(x1 * -2.0)) end
function tmp = code(x1, x2) tmp = x1 + (x1 * -2.0); end
code[x1_, x2_] := N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + x1 \cdot -2
\end{array}
Initial program 70.0%
Taylor expanded in x1 around 0 48.3%
Taylor expanded in x1 around 0 53.5%
Taylor expanded in x2 around 0 15.2%
distribute-rgt1-in15.3%
metadata-eval15.3%
*-commutative15.3%
Simplified15.3%
Final simplification15.3%
(FPCore (x1 x2) :precision binary64 9.0)
double code(double x1, double x2) {
return 9.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = 9.0d0
end function
public static double code(double x1, double x2) {
return 9.0;
}
def code(x1, x2): return 9.0
function code(x1, x2) return 9.0 end
function tmp = code(x1, x2) tmp = 9.0; end
code[x1_, x2_] := 9.0
\begin{array}{l}
\\
9
\end{array}
Initial program 70.0%
Taylor expanded in x1 around 0 48.3%
Taylor expanded in x1 around inf 19.1%
Taylor expanded in x1 around 0 3.6%
Final simplification3.6%
herbie shell --seed 2023277
(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))))))