
(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 26 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (fma x1 (* x1 3.0) (fma 2.0 x2 (- x1))))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2)))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_1 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(fma
x1
(* x1 (/ t_0 (/ (fma x1 x1 1.0) 3.0)))
(*
(fma x1 x1 1.0)
(+
x1
(+
(* x1 (* x1 -6.0))
(*
(/ t_0 (fma x1 x1 1.0))
(+
(* x1 (+ -6.0 (/ t_0 (/ (fma x1 x1 1.0) 2.0))))
(* (* x1 x1) 4.0)))))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = fma(x1, (x1 * 3.0), fma(2.0, x2, -x1));
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double tmp;
if ((x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), fma(x1, (x1 * (t_0 / (fma(x1, x1, 1.0) / 3.0))), (fma(x1, x1, 1.0) * (x1 + ((x1 * (x1 * -6.0)) + ((t_0 / fma(x1, x1, 1.0)) * ((x1 * (-6.0 + (t_0 / (fma(x1, x1, 1.0) / 2.0)))) + ((x1 * x1) * 4.0))))))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
function code(x1, x2) t_0 = fma(x1, Float64(x1 * 3.0), fma(2.0, x2, Float64(-x1))) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), fma(x1, Float64(x1 * Float64(t_0 / Float64(fma(x1, x1, 1.0) / 3.0))), Float64(fma(x1, x1, 1.0) * Float64(x1 + Float64(Float64(x1 * Float64(x1 * -6.0)) + Float64(Float64(t_0 / fma(x1, x1, 1.0)) * Float64(Float64(x1 * Float64(-6.0 + Float64(t_0 / Float64(fma(x1, x1, 1.0) / 2.0)))) + Float64(Float64(x1 * x1) * 4.0))))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2 + (-x1)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$1 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * N[(t$95$0 / N[(N[(x1 * x1 + 1.0), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(N[(x1 * N[(x1 * -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(x1 * N[(-6.0 + N[(t$95$0 / N[(N[(x1 * x1 + 1.0), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1, x1 \cdot 3, \mathsf{fma}\left(2, x2, -x1\right)\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + t_1 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_1 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, \mathsf{fma}\left(x1, x1 \cdot \frac{t_0}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{3}}, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \left(x1 \cdot \left(x1 \cdot -6\right) + \frac{t_0}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(x1 \cdot \left(-6 + \frac{t_0}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{2}}\right) + \left(x1 \cdot x1\right) \cdot 4\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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.5%
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 inf 14.5%
Taylor expanded in x1 around inf 97.1%
Final simplification99.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (/ (- (fma (* x1 3.0) x1 (* 2.0 x2)) x1) (fma x1 x1 1.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
t_0))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(+
(+
t_0
(fma
(fma (* (* x1 2.0) t_4) (+ t_4 -3.0) (* (* x1 x1) (fma 4.0 t_4 -6.0)))
(fma x1 x1 1.0)
(* (* x1 3.0) (* x1 t_4))))
(+ x1 (* 3.0 (/ (- t_1 (+ x1 (* 2.0 x2))) (fma x1 x1 1.0))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = (fma((x1 * 3.0), x1, (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double tmp;
if ((x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + ((t_0 + fma(fma(((x1 * 2.0) * t_4), (t_4 + -3.0), ((x1 * x1) * fma(4.0, t_4, -6.0))), fma(x1, x1, 1.0), ((x1 * 3.0) * (x1 * t_4)))) + (x1 + (3.0 * ((t_1 - (x1 + (2.0 * x2))) / fma(x1, x1, 1.0)))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + t_0)) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + Float64(Float64(t_0 + fma(fma(Float64(Float64(x1 * 2.0) * t_4), Float64(t_4 + -3.0), Float64(Float64(x1 * x1) * fma(4.0, t_4, -6.0))), fma(x1, x1, 1.0), Float64(Float64(x1 * 3.0) * Float64(x1 * t_4)))) + Float64(x1 + Float64(3.0 * Float64(Float64(t_1 - Float64(x1 + Float64(2.0 * x2))) / fma(x1, x1, 1.0)))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(N[(t$95$0 + N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 + -3.0), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(4.0 * t$95$4 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x1 * x1 + 1.0), $MachinePrecision] + N[(N[(x1 * 3.0), $MachinePrecision] * N[(x1 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(3.0 * N[(N[(t$95$1 - N[(x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
t_4 := \frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + t_1 \cdot t_3\right) + t_0\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\right) \leq \infty:\\
\;\;\;\;x1 + \left(\left(t_0 + \mathsf{fma}\left(\mathsf{fma}\left(\left(x1 \cdot 2\right) \cdot t_4, t_4 + -3, \left(x1 \cdot x1\right) \cdot \mathsf{fma}\left(4, t_4, -6\right)\right), \mathsf{fma}\left(x1, x1, 1\right), \left(x1 \cdot 3\right) \cdot \left(x1 \cdot t_4\right)\right)\right) + \left(x1 + 3 \cdot \frac{t_1 - \left(x1 + 2 \cdot x2\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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.5%
Simplified99.5%
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 inf 14.5%
Taylor expanded in x1 around inf 97.1%
Final simplification98.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (/ (- (fma (* x1 3.0) x1 (* 2.0 x2)) x1) (fma x1 x1 1.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
t_4))
INFINITY)
(+
x1
(+
t_4
(+
x1
(+
(pow x1 3.0)
(fma
(fma
(* x1 (* 2.0 t_0))
(+ t_0 -3.0)
(* x1 (* x1 (fma 4.0 t_0 -6.0))))
(fma x1 x1 1.0)
(* t_0 (* 3.0 (* x1 x1))))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = (fma((x1 * 3.0), x1, (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double tmp;
if ((x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + t_4)) <= ((double) INFINITY)) {
tmp = x1 + (t_4 + (x1 + (pow(x1, 3.0) + fma(fma((x1 * (2.0 * t_0)), (t_0 + -3.0), (x1 * (x1 * fma(4.0, t_0, -6.0)))), fma(x1, x1, 1.0), (t_0 * (3.0 * (x1 * x1)))))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + t_4)) <= Inf) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64((x1 ^ 3.0) + fma(fma(Float64(x1 * Float64(2.0 * t_0)), Float64(t_0 + -3.0), Float64(x1 * Float64(x1 * fma(4.0, t_0, -6.0)))), fma(x1, x1, 1.0), Float64(t_0 * Float64(3.0 * Float64(x1 * x1)))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$4 + N[(x1 + N[(N[Power[x1, 3.0], $MachinePrecision] + N[(N[(N[(x1 * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + -3.0), $MachinePrecision] + N[(x1 * N[(x1 * N[(4.0 * t$95$0 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x1 * x1 + 1.0), $MachinePrecision] + N[(t$95$0 * N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
t_4 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + t_1 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + t_4\right) \leq \infty:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 + \left({x1}^{3} + \mathsf{fma}\left(\mathsf{fma}\left(x1 \cdot \left(2 \cdot t_0\right), t_0 + -3, x1 \cdot \left(x1 \cdot \mathsf{fma}\left(4, t_0, -6\right)\right)\right), \mathsf{fma}\left(x1, x1, 1\right), t_0 \cdot \left(3 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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.5%
Applied egg-rr99.5%
Simplified99.5%
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 inf 14.5%
Taylor expanded in x1 around inf 97.1%
Final simplification98.8%
(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))) 9.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))) + 9.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))) + 9.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))) + 9.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))) + 9.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))) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(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] + 9.0), $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) + 9\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.5%
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 inf 14.5%
Taylor expanded in x1 around inf 97.1%
Final simplification98.8%
(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)))
(if (or (<= x1 -1.15e+101) (not (<= x1 2.3e+30)))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_2)
(*
t_1
(+
(* (* x1 x1) (- (* t_2 4.0) 6.0))
(* (* (* x1 2.0) t_2) (- (* 2.0 x2) 3.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 tmp;
if ((x1 <= -1.15e+101) || !(x1 <= 2.3e+30)) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * ((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) :: t_0
real(8) :: t_1
real(8) :: t_2
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
if ((x1 <= (-1.15d+101)) .or. (.not. (x1 <= 2.3d+30))) then
tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * t_2) * ((2.0d0 * x2) - 3.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 tmp;
if ((x1 <= -1.15e+101) || !(x1 <= 2.3e+30)) {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * ((2.0 * x2) - 3.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 tmp = 0 if (x1 <= -1.15e+101) or not (x1 <= 2.3e+30): tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * ((2.0 * x2) - 3.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) tmp = 0.0 if ((x1 <= -1.15e+101) || !(x1 <= 2.3e+30)) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(Float64(2.0 * x2) - 3.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; tmp = 0.0; if ((x1 <= -1.15e+101) || ~((x1 <= 2.3e+30))) tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * ((2.0 * x2) - 3.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]}, If[Or[LessEqual[x1, -1.15e+101], N[Not[LessEqual[x1, 2.3e+30]], $MachinePrecision]], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}\\
\mathbf{if}\;x1 \leq -1.15 \cdot 10^{+101} \lor \neg \left(x1 \leq 2.3 \cdot 10^{+30}\right):\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot t_2 + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.1500000000000001e101 or 2.3e30 < x1 Initial program 28.8%
Taylor expanded in x1 around inf 35.7%
Taylor expanded in x1 around inf 94.5%
if -1.1500000000000001e101 < x1 < 2.3e30Initial program 99.4%
Taylor expanded in x1 around 0 96.0%
*-commutative94.1%
Simplified96.0%
Final simplification95.4%
(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)))
(if (or (<= x1 -1e+94) (not (<= x1 9.5e+77)))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 (* 2.0 x2))))))))))
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 tmp;
if ((x1 <= -1e+94) || !(x1 <= 9.5e+77)) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * (2.0 * x2))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
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
if ((x1 <= (-1d+94)) .or. (.not. (x1 <= 9.5d+77))) then
tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (t_0 * (2.0d0 * x2))))))
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 tmp;
if ((x1 <= -1e+94) || !(x1 <= 9.5e+77)) {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * (2.0 * x2))))));
}
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 tmp = 0 if (x1 <= -1e+94) or not (x1 <= 9.5e+77): tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * (2.0 * x2)))))) 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) tmp = 0.0 if ((x1 <= -1e+94) || !(x1 <= 9.5e+77)) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + 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(t_0 * Float64(2.0 * x2))))))); 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; tmp = 0.0; if ((x1 <= -1e+94) || ~((x1 <= 9.5e+77))) tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * (2.0 * x2)))))); 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]}, If[Or[LessEqual[x1, -1e+94], N[Not[LessEqual[x1, 9.5e+77]], $MachinePrecision]], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $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[(t$95$0 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}\\
\mathbf{if}\;x1 \leq -1 \cdot 10^{+94} \lor \neg \left(x1 \leq 9.5 \cdot 10^{+77}\right):\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} + \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) + t_0 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1e94 or 9.4999999999999998e77 < x1 Initial program 26.6%
Taylor expanded in x1 around inf 34.0%
Taylor expanded in x1 around inf 94.7%
if -1e94 < x1 < 9.4999999999999998e77Initial program 99.4%
Taylor expanded in x1 around 0 97.2%
*-commutative94.1%
Simplified97.2%
Final simplification96.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* 2.0 x2) x1))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2)))
(if (or (<= x1 -7e+93) (not (<= x1 2.3e+30)))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0))
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_2
(+
(* (* x1 x1) (- (* t_3 4.0) 6.0))
(* (- t_3 3.0) (* (* x1 2.0) t_0))))
(* t_1 t_0)))))))))
double code(double x1, double x2) {
double t_0 = (2.0 * x2) - x1;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double tmp;
if ((x1 <= -7e+93) || !(x1 <= 2.3e+30)) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
} else {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + ((t_3 - 3.0) * ((x1 * 2.0) * t_0)))) + (t_1 * 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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (2.0d0 * x2) - x1
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_1 + (2.0d0 * x2)) - x1) / t_2
if ((x1 <= (-7d+93)) .or. (.not. (x1 <= 2.3d+30))) then
tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
else
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)) + ((t_3 - 3.0d0) * ((x1 * 2.0d0) * t_0)))) + (t_1 * t_0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (2.0 * x2) - x1;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double tmp;
if ((x1 <= -7e+93) || !(x1 <= 2.3e+30)) {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
} else {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + ((t_3 - 3.0) * ((x1 * 2.0) * t_0)))) + (t_1 * t_0)))));
}
return tmp;
}
def code(x1, x2): t_0 = (2.0 * x2) - x1 t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2 tmp = 0 if (x1 <= -7e+93) or not (x1 <= 2.3e+30): tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) else: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + ((t_3 - 3.0) * ((x1 * 2.0) * t_0)))) + (t_1 * t_0))))) return tmp
function code(x1, x2) t_0 = Float64(Float64(2.0 * x2) - x1) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) tmp = 0.0 if ((x1 <= -7e+93) || !(x1 <= 2.3e+30)) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) + Float64(Float64(t_3 - 3.0) * Float64(Float64(x1 * 2.0) * t_0)))) + Float64(t_1 * t_0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (2.0 * x2) - x1; t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2; tmp = 0.0; if ((x1 <= -7e+93) || ~((x1 <= 2.3e+30))) tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); else tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + ((t_3 - 3.0) * ((x1 * 2.0) * t_0)))) + (t_1 * t_0))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[Or[LessEqual[x1, -7e+93], N[Not[LessEqual[x1, 2.3e+30]], $MachinePrecision]], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot x2 - x1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 \leq -7 \cdot 10^{+93} \lor \neg \left(x1 \leq 2.3 \cdot 10^{+30}\right):\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right) + \left(t_3 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot t_0\right)\right) + t_1 \cdot t_0\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -6.99999999999999996e93 or 2.3e30 < x1 Initial program 30.9%
Taylor expanded in x1 around inf 36.7%
Taylor expanded in x1 around inf 93.7%
if -6.99999999999999996e93 < x1 < 2.3e30Initial program 99.4%
Taylor expanded in x1 around 0 96.8%
+-commutative96.8%
neg-mul-196.8%
unsub-neg96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in x1 around 0 95.5%
+-commutative96.8%
neg-mul-196.8%
unsub-neg96.8%
*-commutative96.8%
Simplified95.5%
Final simplification94.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (- (* 2.0 x2) x1))
(t_2 (* x1 (* x1 x1)))
(t_3 (* x1 (* x1 3.0)))
(t_4 (/ (- (+ t_3 (* 2.0 x2)) x1) t_0))
(t_5 (* (* x1 x1) (- (* t_4 4.0) 6.0))))
(if (<= x1 -5.8e+102)
(+ x1 (+ (+ x1 (* 4.0 (* x1 (* x2 -3.0)))) (+ (* x1 -3.0) (* x2 -6.0))))
(if (<= x1 8.4e+37)
(+
x1
(+
(* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_0))
(+
x1
(+
t_2
(+
(* t_0 (+ t_5 (* (- t_4 3.0) (* (* x1 2.0) t_1))))
(* t_3 t_1))))))
(if (<= x1 8e+153)
(+
x1
(+
9.0
(+
x1
(+
t_2
(+
(* t_3 t_4)
(* t_0 (+ t_5 (* (* (* x1 2.0) t_4) (/ -1.0 x1)))))))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = (2.0 * x2) - x1;
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
double t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0)));
} else if (x1 <= 8.4e+37) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_2 + ((t_0 * (t_5 + ((t_4 - 3.0) * ((x1 * 2.0) * t_1)))) + (t_3 * t_1)))));
} else if (x1 <= 8e+153) {
tmp = x1 + (9.0 + (x1 + (t_2 + ((t_3 * t_4) + (t_0 * (t_5 + (((x1 * 2.0) * t_4) * (-1.0 / x1))))))));
} 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) :: 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 = (2.0d0 * x2) - x1
t_2 = x1 * (x1 * x1)
t_3 = x1 * (x1 * 3.0d0)
t_4 = ((t_3 + (2.0d0 * x2)) - x1) / t_0
t_5 = (x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)
if (x1 <= (-5.8d+102)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))) + ((x1 * (-3.0d0)) + (x2 * (-6.0d0))))
else if (x1 <= 8.4d+37) then
tmp = x1 + ((3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (t_2 + ((t_0 * (t_5 + ((t_4 - 3.0d0) * ((x1 * 2.0d0) * t_1)))) + (t_3 * t_1)))))
else if (x1 <= 8d+153) then
tmp = x1 + (9.0d0 + (x1 + (t_2 + ((t_3 * t_4) + (t_0 * (t_5 + (((x1 * 2.0d0) * t_4) * ((-1.0d0) / x1))))))))
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 * x1) + 1.0;
double t_1 = (2.0 * x2) - x1;
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
double t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0)));
} else if (x1 <= 8.4e+37) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_2 + ((t_0 * (t_5 + ((t_4 - 3.0) * ((x1 * 2.0) * t_1)))) + (t_3 * t_1)))));
} else if (x1 <= 8e+153) {
tmp = x1 + (9.0 + (x1 + (t_2 + ((t_3 * t_4) + (t_0 * (t_5 + (((x1 * 2.0) * t_4) * (-1.0 / x1))))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = (2.0 * x2) - x1 t_2 = x1 * (x1 * x1) t_3 = x1 * (x1 * 3.0) t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0 t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0) tmp = 0 if x1 <= -5.8e+102: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0))) elif x1 <= 8.4e+37: tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_2 + ((t_0 * (t_5 + ((t_4 - 3.0) * ((x1 * 2.0) * t_1)))) + (t_3 * t_1))))) elif x1 <= 8e+153: tmp = x1 + (9.0 + (x1 + (t_2 + ((t_3 * t_4) + (t_0 * (t_5 + (((x1 * 2.0) * t_4) * (-1.0 / x1)))))))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(Float64(2.0 * x2) - x1) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_0) t_5 = Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) tmp = 0.0 if (x1 <= -5.8e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))) + Float64(Float64(x1 * -3.0) + Float64(x2 * -6.0)))); elseif (x1 <= 8.4e+37) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(t_2 + Float64(Float64(t_0 * Float64(t_5 + Float64(Float64(t_4 - 3.0) * Float64(Float64(x1 * 2.0) * t_1)))) + Float64(t_3 * t_1)))))); elseif (x1 <= 8e+153) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_2 + Float64(Float64(t_3 * t_4) + Float64(t_0 * Float64(t_5 + Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(-1.0 / x1))))))))); 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 * x1) + 1.0; t_1 = (2.0 * x2) - x1; t_2 = x1 * (x1 * x1); t_3 = x1 * (x1 * 3.0); t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0; t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0); tmp = 0.0; if (x1 <= -5.8e+102) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0))); elseif (x1 <= 8.4e+37) tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_2 + ((t_0 * (t_5 + ((t_4 - 3.0) * ((x1 * 2.0) * t_1)))) + (t_3 * t_1))))); elseif (x1 <= 8e+153) tmp = x1 + (9.0 + (x1 + (t_2 + ((t_3 * t_4) + (t_0 * (t_5 + (((x1 * 2.0) * t_4) * (-1.0 / x1)))))))); 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[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8.4e+37], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$2 + N[(N[(t$95$0 * N[(t$95$5 + N[(N[(t$95$4 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8e+153], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$2 + N[(N[(t$95$3 * t$95$4), $MachinePrecision] + N[(t$95$0 * N[(t$95$5 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 := x1 \cdot x1 + 1\\
t_1 := 2 \cdot x2 - x1\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := \frac{\left(t_3 + 2 \cdot x2\right) - x1}{t_0}\\
t_5 := \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right) + \left(x1 \cdot -3 + x2 \cdot -6\right)\right)\\
\mathbf{elif}\;x1 \leq 8.4 \cdot 10^{+37}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + \left(t_2 + \left(t_0 \cdot \left(t_5 + \left(t_4 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot t_1\right)\right) + t_3 \cdot t_1\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 8 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_2 + \left(t_3 \cdot t_4 + t_0 \cdot \left(t_5 + \left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \frac{-1}{x1}\right)\right)\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 < -5.8000000000000005e102Initial program 4.3%
Taylor expanded in x1 around 0 4.4%
Taylor expanded in x2 around 0 8.9%
associate-*r*8.9%
Simplified8.9%
Taylor expanded in x1 around 0 27.0%
if -5.8000000000000005e102 < x1 < 8.4000000000000004e37Initial program 99.4%
Taylor expanded in x1 around 0 95.7%
+-commutative95.7%
neg-mul-195.7%
unsub-neg95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in x1 around 0 94.4%
+-commutative95.7%
neg-mul-195.7%
unsub-neg95.7%
*-commutative95.7%
Simplified94.4%
if 8.4000000000000004e37 < x1 < 8e153Initial program 92.4%
sub-neg92.4%
fma-def92.4%
*-commutative92.4%
fma-def92.4%
metadata-eval92.4%
add-cbrt-cube92.4%
Applied egg-rr92.4%
associate-*l*92.4%
cube-unmult92.4%
+-commutative92.4%
fma-udef92.4%
*-commutative92.4%
fma-def92.4%
*-commutative92.4%
Simplified92.4%
Taylor expanded in x1 around inf 92.4%
Taylor expanded in x1 around inf 92.4%
if 8e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.4%
flip-+82.6%
*-commutative82.6%
*-commutative82.6%
*-commutative82.6%
Applied egg-rr82.6%
swap-sqr82.6%
metadata-eval82.6%
Simplified82.6%
Final simplification81.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 x1)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0))
(t_4 (* (* x1 x1) (- (* t_3 4.0) 6.0))))
(if (<= x1 -5.8e+102)
(+ x1 (+ (+ x1 (* 4.0 (* x1 (* x2 -3.0)))) (+ (* x1 -3.0) (* x2 -6.0))))
(if (<= x1 3.1e+28)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
(+
x1
(+
t_1
(+
(* t_2 (- (* 2.0 x2) x1))
(* t_0 (+ t_4 (* (- t_3 3.0) (* (* x1 2.0) (* 2.0 x2))))))))))
(if (<= x1 8e+153)
(+
x1
(+
9.0
(+
x1
(+
t_1
(+
(* t_2 t_3)
(* t_0 (+ t_4 (* (* (* x1 2.0) t_3) (/ -1.0 x1)))))))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0)));
} else if (x1 <= 3.1e+28) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_1 + ((t_2 * ((2.0 * x2) - x1)) + (t_0 * (t_4 + ((t_3 - 3.0) * ((x1 * 2.0) * (2.0 * x2)))))))));
} else if (x1 <= 8e+153) {
tmp = x1 + (9.0 + (x1 + (t_1 + ((t_2 * t_3) + (t_0 * (t_4 + (((x1 * 2.0) * t_3) * (-1.0 / x1))))))));
} 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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * x1)
t_2 = x1 * (x1 * 3.0d0)
t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
t_4 = (x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)
if (x1 <= (-5.8d+102)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))) + ((x1 * (-3.0d0)) + (x2 * (-6.0d0))))
else if (x1 <= 3.1d+28) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (t_1 + ((t_2 * ((2.0d0 * x2) - x1)) + (t_0 * (t_4 + ((t_3 - 3.0d0) * ((x1 * 2.0d0) * (2.0d0 * x2)))))))))
else if (x1 <= 8d+153) then
tmp = x1 + (9.0d0 + (x1 + (t_1 + ((t_2 * t_3) + (t_0 * (t_4 + (((x1 * 2.0d0) * t_3) * ((-1.0d0) / x1))))))))
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 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0)));
} else if (x1 <= 3.1e+28) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_1 + ((t_2 * ((2.0 * x2) - x1)) + (t_0 * (t_4 + ((t_3 - 3.0) * ((x1 * 2.0) * (2.0 * x2)))))))));
} else if (x1 <= 8e+153) {
tmp = x1 + (9.0 + (x1 + (t_1 + ((t_2 * t_3) + (t_0 * (t_4 + (((x1 * 2.0) * t_3) * (-1.0 / x1))))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * x1) t_2 = x1 * (x1 * 3.0) t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0 t_4 = (x1 * x1) * ((t_3 * 4.0) - 6.0) tmp = 0 if x1 <= -5.8e+102: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0))) elif x1 <= 3.1e+28: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_1 + ((t_2 * ((2.0 * x2) - x1)) + (t_0 * (t_4 + ((t_3 - 3.0) * ((x1 * 2.0) * (2.0 * x2))))))))) elif x1 <= 8e+153: tmp = x1 + (9.0 + (x1 + (t_1 + ((t_2 * t_3) + (t_0 * (t_4 + (((x1 * 2.0) * t_3) * (-1.0 / x1)))))))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) t_4 = Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) tmp = 0.0 if (x1 <= -5.8e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))) + Float64(Float64(x1 * -3.0) + Float64(x2 * -6.0)))); elseif (x1 <= 3.1e+28) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(t_1 + Float64(Float64(t_2 * Float64(Float64(2.0 * x2) - x1)) + Float64(t_0 * Float64(t_4 + Float64(Float64(t_3 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(2.0 * x2)))))))))); elseif (x1 <= 8e+153) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_1 + Float64(Float64(t_2 * t_3) + Float64(t_0 * Float64(t_4 + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(-1.0 / x1))))))))); 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 * x1) + 1.0; t_1 = x1 * (x1 * x1); t_2 = x1 * (x1 * 3.0); t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0; t_4 = (x1 * x1) * ((t_3 * 4.0) - 6.0); tmp = 0.0; if (x1 <= -5.8e+102) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0))); elseif (x1 <= 3.1e+28) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_1 + ((t_2 * ((2.0 * x2) - x1)) + (t_0 * (t_4 + ((t_3 - 3.0) * ((x1 * 2.0) * (2.0 * x2))))))))); elseif (x1 <= 8e+153) tmp = x1 + (9.0 + (x1 + (t_1 + ((t_2 * t_3) + (t_0 * (t_4 + (((x1 * 2.0) * t_3) * (-1.0 / x1)))))))); 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[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.1e+28], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$1 + N[(N[(t$95$2 * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(t$95$4 + N[(N[(t$95$3 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8e+153], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$1 + N[(N[(t$95$2 * t$95$3), $MachinePrecision] + N[(t$95$0 * N[(t$95$4 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_0}\\
t_4 := \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right) + \left(x1 \cdot -3 + x2 \cdot -6\right)\right)\\
\mathbf{elif}\;x1 \leq 3.1 \cdot 10^{+28}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + \left(t_1 + \left(t_2 \cdot \left(2 \cdot x2 - x1\right) + t_0 \cdot \left(t_4 + \left(t_3 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 8 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_1 + \left(t_2 \cdot t_3 + t_0 \cdot \left(t_4 + \left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \frac{-1}{x1}\right)\right)\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 < -5.8000000000000005e102Initial program 4.3%
Taylor expanded in x1 around 0 4.4%
Taylor expanded in x2 around 0 8.9%
associate-*r*8.9%
Simplified8.9%
Taylor expanded in x1 around 0 27.0%
if -5.8000000000000005e102 < x1 < 3.1000000000000001e28Initial program 99.4%
Taylor expanded in x1 around 0 95.6%
+-commutative95.6%
neg-mul-195.6%
unsub-neg95.6%
*-commutative95.6%
Simplified95.6%
Taylor expanded in x1 around 0 94.0%
*-commutative94.1%
Simplified94.0%
if 3.1000000000000001e28 < x1 < 8e153Initial program 92.7%
sub-neg92.7%
fma-def92.7%
*-commutative92.7%
fma-def92.7%
metadata-eval92.7%
add-cbrt-cube92.7%
Applied egg-rr92.7%
associate-*l*92.7%
cube-unmult92.7%
+-commutative92.7%
fma-udef92.7%
*-commutative92.7%
fma-def92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in x1 around inf 92.7%
Taylor expanded in x1 around inf 92.7%
if 8e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.4%
flip-+82.6%
*-commutative82.6%
*-commutative82.6%
*-commutative82.6%
Applied egg-rr82.6%
swap-sqr82.6%
metadata-eval82.6%
Simplified82.6%
Final simplification80.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 x1)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0))
(t_4 (* (* x1 2.0) t_3))
(t_5 (* (* x1 x1) (- (* t_3 4.0) 6.0))))
(if (<= x1 -5.8e+102)
(+ x1 (+ (+ x1 (* 4.0 (* x1 (* x2 -3.0)))) (+ (* x1 -3.0) (* x2 -6.0))))
(if (<= x1 8.5e+29)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
(+
x1
(+
t_1
(+
(* t_0 (+ t_5 (* t_4 (- (* 2.0 x2) 3.0))))
(* t_2 (- (* 2.0 x2) x1)))))))
(if (<= x1 8e+153)
(+
x1
(+
9.0
(+ x1 (+ t_1 (+ (* t_2 t_3) (* t_0 (+ t_5 (* t_4 (/ -1.0 x1)))))))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = (x1 * 2.0) * t_3;
double t_5 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0)));
} else if (x1 <= 8.5e+29) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_1 + ((t_0 * (t_5 + (t_4 * ((2.0 * x2) - 3.0)))) + (t_2 * ((2.0 * x2) - x1))))));
} else if (x1 <= 8e+153) {
tmp = x1 + (9.0 + (x1 + (t_1 + ((t_2 * t_3) + (t_0 * (t_5 + (t_4 * (-1.0 / x1))))))));
} 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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * x1)
t_2 = x1 * (x1 * 3.0d0)
t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
t_4 = (x1 * 2.0d0) * t_3
t_5 = (x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)
if (x1 <= (-5.8d+102)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))) + ((x1 * (-3.0d0)) + (x2 * (-6.0d0))))
else if (x1 <= 8.5d+29) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (t_1 + ((t_0 * (t_5 + (t_4 * ((2.0d0 * x2) - 3.0d0)))) + (t_2 * ((2.0d0 * x2) - x1))))))
else if (x1 <= 8d+153) then
tmp = x1 + (9.0d0 + (x1 + (t_1 + ((t_2 * t_3) + (t_0 * (t_5 + (t_4 * ((-1.0d0) / x1))))))))
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 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = (x1 * 2.0) * t_3;
double t_5 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0)));
} else if (x1 <= 8.5e+29) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_1 + ((t_0 * (t_5 + (t_4 * ((2.0 * x2) - 3.0)))) + (t_2 * ((2.0 * x2) - x1))))));
} else if (x1 <= 8e+153) {
tmp = x1 + (9.0 + (x1 + (t_1 + ((t_2 * t_3) + (t_0 * (t_5 + (t_4 * (-1.0 / x1))))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * x1) t_2 = x1 * (x1 * 3.0) t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0 t_4 = (x1 * 2.0) * t_3 t_5 = (x1 * x1) * ((t_3 * 4.0) - 6.0) tmp = 0 if x1 <= -5.8e+102: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0))) elif x1 <= 8.5e+29: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_1 + ((t_0 * (t_5 + (t_4 * ((2.0 * x2) - 3.0)))) + (t_2 * ((2.0 * x2) - x1)))))) elif x1 <= 8e+153: tmp = x1 + (9.0 + (x1 + (t_1 + ((t_2 * t_3) + (t_0 * (t_5 + (t_4 * (-1.0 / x1)))))))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) t_4 = Float64(Float64(x1 * 2.0) * t_3) t_5 = Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) tmp = 0.0 if (x1 <= -5.8e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))) + Float64(Float64(x1 * -3.0) + Float64(x2 * -6.0)))); elseif (x1 <= 8.5e+29) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(t_1 + Float64(Float64(t_0 * Float64(t_5 + Float64(t_4 * Float64(Float64(2.0 * x2) - 3.0)))) + Float64(t_2 * Float64(Float64(2.0 * x2) - x1))))))); elseif (x1 <= 8e+153) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_1 + Float64(Float64(t_2 * t_3) + Float64(t_0 * Float64(t_5 + Float64(t_4 * Float64(-1.0 / x1))))))))); 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 * x1) + 1.0; t_1 = x1 * (x1 * x1); t_2 = x1 * (x1 * 3.0); t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0; t_4 = (x1 * 2.0) * t_3; t_5 = (x1 * x1) * ((t_3 * 4.0) - 6.0); tmp = 0.0; if (x1 <= -5.8e+102) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0))); elseif (x1 <= 8.5e+29) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_1 + ((t_0 * (t_5 + (t_4 * ((2.0 * x2) - 3.0)))) + (t_2 * ((2.0 * x2) - x1)))))); elseif (x1 <= 8e+153) tmp = x1 + (9.0 + (x1 + (t_1 + ((t_2 * t_3) + (t_0 * (t_5 + (t_4 * (-1.0 / x1)))))))); 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[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8.5e+29], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$1 + N[(N[(t$95$0 * N[(t$95$5 + N[(t$95$4 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8e+153], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$1 + N[(N[(t$95$2 * t$95$3), $MachinePrecision] + N[(t$95$0 * N[(t$95$5 + N[(t$95$4 * N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_0}\\
t_4 := \left(x1 \cdot 2\right) \cdot t_3\\
t_5 := \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right) + \left(x1 \cdot -3 + x2 \cdot -6\right)\right)\\
\mathbf{elif}\;x1 \leq 8.5 \cdot 10^{+29}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + \left(t_1 + \left(t_0 \cdot \left(t_5 + t_4 \cdot \left(2 \cdot x2 - 3\right)\right) + t_2 \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 8 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_1 + \left(t_2 \cdot t_3 + t_0 \cdot \left(t_5 + t_4 \cdot \frac{-1}{x1}\right)\right)\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 < -5.8000000000000005e102Initial program 4.3%
Taylor expanded in x1 around 0 4.4%
Taylor expanded in x2 around 0 8.9%
associate-*r*8.9%
Simplified8.9%
Taylor expanded in x1 around 0 27.0%
if -5.8000000000000005e102 < x1 < 8.5000000000000006e29Initial program 99.4%
Taylor expanded in x1 around 0 95.6%
+-commutative95.6%
neg-mul-195.6%
unsub-neg95.6%
*-commutative95.6%
Simplified95.6%
Taylor expanded in x1 around 0 94.1%
*-commutative94.1%
Simplified94.1%
if 8.5000000000000006e29 < x1 < 8e153Initial program 92.7%
sub-neg92.7%
fma-def92.7%
*-commutative92.7%
fma-def92.7%
metadata-eval92.7%
add-cbrt-cube92.7%
Applied egg-rr92.7%
associate-*l*92.7%
cube-unmult92.7%
+-commutative92.7%
fma-udef92.7%
*-commutative92.7%
fma-def92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in x1 around inf 92.7%
Taylor expanded in x1 around inf 92.7%
if 8e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.4%
flip-+82.6%
*-commutative82.6%
*-commutative82.6%
*-commutative82.6%
Applied egg-rr82.6%
swap-sqr82.6%
metadata-eval82.6%
Simplified82.6%
Final simplification80.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 x1)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0))
(t_4 (* (* x1 x1) (- (* t_3 4.0) 6.0))))
(if (<= x1 -5.8e+102)
(+ x1 (+ (+ x1 (* 4.0 (* x1 (* x2 -3.0)))) (+ (* x1 -3.0) (* x2 -6.0))))
(if (<= x1 2.4e+28)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
(+
x1
(+
t_1
(+
(* t_2 (- (* 2.0 x2) x1))
(*
t_0
(+ t_4 (* (* (* x1 2.0) (* 2.0 x2)) (- (* 2.0 x2) 3.0)))))))))
(if (<= x1 8e+153)
(+
x1
(+
9.0
(+
x1
(+
t_1
(+
(* t_2 t_3)
(* t_0 (+ t_4 (* (* (* x1 2.0) t_3) (/ -1.0 x1)))))))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0)));
} else if (x1 <= 2.4e+28) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_1 + ((t_2 * ((2.0 * x2) - x1)) + (t_0 * (t_4 + (((x1 * 2.0) * (2.0 * x2)) * ((2.0 * x2) - 3.0))))))));
} else if (x1 <= 8e+153) {
tmp = x1 + (9.0 + (x1 + (t_1 + ((t_2 * t_3) + (t_0 * (t_4 + (((x1 * 2.0) * t_3) * (-1.0 / x1))))))));
} 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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * x1)
t_2 = x1 * (x1 * 3.0d0)
t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
t_4 = (x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)
if (x1 <= (-5.8d+102)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))) + ((x1 * (-3.0d0)) + (x2 * (-6.0d0))))
else if (x1 <= 2.4d+28) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (t_1 + ((t_2 * ((2.0d0 * x2) - x1)) + (t_0 * (t_4 + (((x1 * 2.0d0) * (2.0d0 * x2)) * ((2.0d0 * x2) - 3.0d0))))))))
else if (x1 <= 8d+153) then
tmp = x1 + (9.0d0 + (x1 + (t_1 + ((t_2 * t_3) + (t_0 * (t_4 + (((x1 * 2.0d0) * t_3) * ((-1.0d0) / x1))))))))
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 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0)));
} else if (x1 <= 2.4e+28) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_1 + ((t_2 * ((2.0 * x2) - x1)) + (t_0 * (t_4 + (((x1 * 2.0) * (2.0 * x2)) * ((2.0 * x2) - 3.0))))))));
} else if (x1 <= 8e+153) {
tmp = x1 + (9.0 + (x1 + (t_1 + ((t_2 * t_3) + (t_0 * (t_4 + (((x1 * 2.0) * t_3) * (-1.0 / x1))))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * x1) t_2 = x1 * (x1 * 3.0) t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0 t_4 = (x1 * x1) * ((t_3 * 4.0) - 6.0) tmp = 0 if x1 <= -5.8e+102: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0))) elif x1 <= 2.4e+28: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_1 + ((t_2 * ((2.0 * x2) - x1)) + (t_0 * (t_4 + (((x1 * 2.0) * (2.0 * x2)) * ((2.0 * x2) - 3.0)))))))) elif x1 <= 8e+153: tmp = x1 + (9.0 + (x1 + (t_1 + ((t_2 * t_3) + (t_0 * (t_4 + (((x1 * 2.0) * t_3) * (-1.0 / x1)))))))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) t_4 = Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) tmp = 0.0 if (x1 <= -5.8e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))) + Float64(Float64(x1 * -3.0) + Float64(x2 * -6.0)))); elseif (x1 <= 2.4e+28) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(t_1 + Float64(Float64(t_2 * Float64(Float64(2.0 * x2) - x1)) + Float64(t_0 * Float64(t_4 + Float64(Float64(Float64(x1 * 2.0) * Float64(2.0 * x2)) * Float64(Float64(2.0 * x2) - 3.0))))))))); elseif (x1 <= 8e+153) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_1 + Float64(Float64(t_2 * t_3) + Float64(t_0 * Float64(t_4 + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(-1.0 / x1))))))))); 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 * x1) + 1.0; t_1 = x1 * (x1 * x1); t_2 = x1 * (x1 * 3.0); t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0; t_4 = (x1 * x1) * ((t_3 * 4.0) - 6.0); tmp = 0.0; if (x1 <= -5.8e+102) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0))); elseif (x1 <= 2.4e+28) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_1 + ((t_2 * ((2.0 * x2) - x1)) + (t_0 * (t_4 + (((x1 * 2.0) * (2.0 * x2)) * ((2.0 * x2) - 3.0)))))))); elseif (x1 <= 8e+153) tmp = x1 + (9.0 + (x1 + (t_1 + ((t_2 * t_3) + (t_0 * (t_4 + (((x1 * 2.0) * t_3) * (-1.0 / x1)))))))); 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[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.4e+28], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$1 + N[(N[(t$95$2 * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(t$95$4 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8e+153], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$1 + N[(N[(t$95$2 * t$95$3), $MachinePrecision] + N[(t$95$0 * N[(t$95$4 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_0}\\
t_4 := \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right) + \left(x1 \cdot -3 + x2 \cdot -6\right)\right)\\
\mathbf{elif}\;x1 \leq 2.4 \cdot 10^{+28}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + \left(t_1 + \left(t_2 \cdot \left(2 \cdot x2 - x1\right) + t_0 \cdot \left(t_4 + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right) \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 8 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_1 + \left(t_2 \cdot t_3 + t_0 \cdot \left(t_4 + \left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \frac{-1}{x1}\right)\right)\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 < -5.8000000000000005e102Initial program 4.3%
Taylor expanded in x1 around 0 4.4%
Taylor expanded in x2 around 0 8.9%
associate-*r*8.9%
Simplified8.9%
Taylor expanded in x1 around 0 27.0%
if -5.8000000000000005e102 < x1 < 2.39999999999999981e28Initial program 99.4%
Taylor expanded in x1 around 0 95.6%
+-commutative95.6%
neg-mul-195.6%
unsub-neg95.6%
*-commutative95.6%
Simplified95.6%
Taylor expanded in x1 around 0 94.1%
*-commutative94.1%
Simplified94.1%
Taylor expanded in x1 around 0 93.4%
*-commutative94.1%
Simplified93.4%
if 2.39999999999999981e28 < x1 < 8e153Initial program 92.7%
sub-neg92.7%
fma-def92.7%
*-commutative92.7%
fma-def92.7%
metadata-eval92.7%
add-cbrt-cube92.7%
Applied egg-rr92.7%
associate-*l*92.7%
cube-unmult92.7%
+-commutative92.7%
fma-udef92.7%
*-commutative92.7%
fma-def92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in x1 around inf 92.7%
Taylor expanded in x1 around inf 92.7%
if 8e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.4%
flip-+82.6%
*-commutative82.6%
*-commutative82.6%
*-commutative82.6%
Applied egg-rr82.6%
swap-sqr82.6%
metadata-eval82.6%
Simplified82.6%
Final simplification80.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* 2.0 x2) 3.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* x1 (* x1 x1)))
(t_3 (* 4.0 (* x2 (* x1 t_0))))
(t_4 (+ (* x1 x1) 1.0))
(t_5 (/ (- (+ t_1 (* 2.0 x2)) x1) t_4))
(t_6
(+
x1
(+
9.0
(+
x1
(+
t_2
(+
(*
t_4
(+
(* (* x1 x1) (- (* t_5 4.0) 6.0))
(* (* (* x1 2.0) t_5) t_0)))
(* t_1 (- (* 2.0 x2) x1))))))))
(t_7 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_4))))
(if (<= x1 -5e+102)
(+ x1 (+ (+ x1 (* 4.0 (* x1 (* x2 -3.0)))) (+ (* x1 -3.0) (* x2 -6.0))))
(if (<= x1 -1750.0)
t_6
(if (<= x1 0.0007)
(+ x1 (+ t_7 (+ x1 t_3)))
(if (<= x1 3.9e+102)
t_6
(if (<= x1 1.35e+154)
(+ x1 (+ t_7 (+ x1 (+ t_2 t_3))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))))))
double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 * (x1 * x1);
double t_3 = 4.0 * (x2 * (x1 * t_0));
double t_4 = (x1 * x1) + 1.0;
double t_5 = ((t_1 + (2.0 * x2)) - x1) / t_4;
double t_6 = x1 + (9.0 + (x1 + (t_2 + ((t_4 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + (((x1 * 2.0) * t_5) * t_0))) + (t_1 * ((2.0 * x2) - x1))))));
double t_7 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_4);
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0)));
} else if (x1 <= -1750.0) {
tmp = t_6;
} else if (x1 <= 0.0007) {
tmp = x1 + (t_7 + (x1 + t_3));
} else if (x1 <= 3.9e+102) {
tmp = t_6;
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_7 + (x1 + (t_2 + t_3)));
} 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) :: 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 = (2.0d0 * x2) - 3.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = x1 * (x1 * x1)
t_3 = 4.0d0 * (x2 * (x1 * t_0))
t_4 = (x1 * x1) + 1.0d0
t_5 = ((t_1 + (2.0d0 * x2)) - x1) / t_4
t_6 = x1 + (9.0d0 + (x1 + (t_2 + ((t_4 * (((x1 * x1) * ((t_5 * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * t_5) * t_0))) + (t_1 * ((2.0d0 * x2) - x1))))))
t_7 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_4)
if (x1 <= (-5d+102)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))) + ((x1 * (-3.0d0)) + (x2 * (-6.0d0))))
else if (x1 <= (-1750.0d0)) then
tmp = t_6
else if (x1 <= 0.0007d0) then
tmp = x1 + (t_7 + (x1 + t_3))
else if (x1 <= 3.9d+102) then
tmp = t_6
else if (x1 <= 1.35d+154) then
tmp = x1 + (t_7 + (x1 + (t_2 + t_3)))
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 = (2.0 * x2) - 3.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 * (x1 * x1);
double t_3 = 4.0 * (x2 * (x1 * t_0));
double t_4 = (x1 * x1) + 1.0;
double t_5 = ((t_1 + (2.0 * x2)) - x1) / t_4;
double t_6 = x1 + (9.0 + (x1 + (t_2 + ((t_4 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + (((x1 * 2.0) * t_5) * t_0))) + (t_1 * ((2.0 * x2) - x1))))));
double t_7 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_4);
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0)));
} else if (x1 <= -1750.0) {
tmp = t_6;
} else if (x1 <= 0.0007) {
tmp = x1 + (t_7 + (x1 + t_3));
} else if (x1 <= 3.9e+102) {
tmp = t_6;
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_7 + (x1 + (t_2 + t_3)));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = (2.0 * x2) - 3.0 t_1 = x1 * (x1 * 3.0) t_2 = x1 * (x1 * x1) t_3 = 4.0 * (x2 * (x1 * t_0)) t_4 = (x1 * x1) + 1.0 t_5 = ((t_1 + (2.0 * x2)) - x1) / t_4 t_6 = x1 + (9.0 + (x1 + (t_2 + ((t_4 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + (((x1 * 2.0) * t_5) * t_0))) + (t_1 * ((2.0 * x2) - x1)))))) t_7 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_4) tmp = 0 if x1 <= -5e+102: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0))) elif x1 <= -1750.0: tmp = t_6 elif x1 <= 0.0007: tmp = x1 + (t_7 + (x1 + t_3)) elif x1 <= 3.9e+102: tmp = t_6 elif x1 <= 1.35e+154: tmp = x1 + (t_7 + (x1 + (t_2 + t_3))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(2.0 * x2) - 3.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(4.0 * Float64(x2 * Float64(x1 * t_0))) t_4 = Float64(Float64(x1 * x1) + 1.0) t_5 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_4) t_6 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_2 + Float64(Float64(t_4 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_5) * t_0))) + Float64(t_1 * Float64(Float64(2.0 * x2) - x1))))))) t_7 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_4)) tmp = 0.0 if (x1 <= -5e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))) + Float64(Float64(x1 * -3.0) + Float64(x2 * -6.0)))); elseif (x1 <= -1750.0) tmp = t_6; elseif (x1 <= 0.0007) tmp = Float64(x1 + Float64(t_7 + Float64(x1 + t_3))); elseif (x1 <= 3.9e+102) tmp = t_6; elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(t_7 + Float64(x1 + Float64(t_2 + t_3)))); 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 = (2.0 * x2) - 3.0; t_1 = x1 * (x1 * 3.0); t_2 = x1 * (x1 * x1); t_3 = 4.0 * (x2 * (x1 * t_0)); t_4 = (x1 * x1) + 1.0; t_5 = ((t_1 + (2.0 * x2)) - x1) / t_4; t_6 = x1 + (9.0 + (x1 + (t_2 + ((t_4 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + (((x1 * 2.0) * t_5) * t_0))) + (t_1 * ((2.0 * x2) - x1)))))); t_7 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_4); tmp = 0.0; if (x1 <= -5e+102) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0))); elseif (x1 <= -1750.0) tmp = t_6; elseif (x1 <= 0.0007) tmp = x1 + (t_7 + (x1 + t_3)); elseif (x1 <= 3.9e+102) tmp = t_6; elseif (x1 <= 1.35e+154) tmp = x1 + (t_7 + (x1 + (t_2 + t_3))); 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[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(4.0 * N[(x2 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(9.0 + N[(x1 + N[(t$95$2 + N[(N[(t$95$4 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+102], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1750.0], t$95$6, If[LessEqual[x1, 0.0007], N[(x1 + N[(t$95$7 + N[(x1 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.9e+102], t$95$6, If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$7 + N[(x1 + N[(t$95$2 + t$95$3), $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 := 2 \cdot x2 - 3\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := 4 \cdot \left(x2 \cdot \left(x1 \cdot t_0\right)\right)\\
t_4 := x1 \cdot x1 + 1\\
t_5 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_4}\\
t_6 := x1 + \left(9 + \left(x1 + \left(t_2 + \left(t_4 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_5 \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t_5\right) \cdot t_0\right) + t_1 \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\\
t_7 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_4}\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right) + \left(x1 \cdot -3 + x2 \cdot -6\right)\right)\\
\mathbf{elif}\;x1 \leq -1750:\\
\;\;\;\;t_6\\
\mathbf{elif}\;x1 \leq 0.0007:\\
\;\;\;\;x1 + \left(t_7 + \left(x1 + t_3\right)\right)\\
\mathbf{elif}\;x1 \leq 3.9 \cdot 10^{+102}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t_7 + \left(x1 + \left(t_2 + t_3\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 < -5e102Initial program 4.3%
Taylor expanded in x1 around 0 4.4%
Taylor expanded in x2 around 0 8.9%
associate-*r*8.9%
Simplified8.9%
Taylor expanded in x1 around 0 27.0%
if -5e102 < x1 < -1750 or 6.99999999999999993e-4 < x1 < 3.8999999999999998e102Initial program 99.4%
Taylor expanded in x1 around 0 85.1%
+-commutative85.1%
neg-mul-185.1%
unsub-neg85.1%
*-commutative85.1%
Simplified85.1%
Taylor expanded in x1 around 0 76.8%
*-commutative76.8%
Simplified76.8%
Taylor expanded in x1 around inf 76.8%
if -1750 < x1 < 6.99999999999999993e-4Initial program 99.4%
Taylor expanded in x1 around 0 98.0%
if 3.8999999999999998e102 < x1 < 1.35000000000000003e154Initial program 87.5%
Taylor expanded in x1 around 0 12.5%
+-commutative12.5%
neg-mul-112.5%
unsub-neg12.5%
*-commutative12.5%
Simplified12.5%
Taylor expanded in x1 around 0 12.5%
*-commutative12.5%
Simplified12.5%
Taylor expanded in x1 around 0 87.5%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.4%
flip-+82.6%
*-commutative82.6%
*-commutative82.6%
*-commutative82.6%
Applied egg-rr82.6%
swap-sqr82.6%
metadata-eval82.6%
Simplified82.6%
Final simplification80.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0)))
(t_3 (* x1 (* x1 x1)))
(t_4 (- (* 2.0 x2) 3.0)))
(if (<= x1 -5.8e+102)
(+ x1 (+ (+ x1 (* 4.0 (* x1 (* x2 -3.0)))) (+ (* x1 -3.0) (* x2 -6.0))))
(if (<= x1 3.9e+102)
(+
x1
(+
t_2
(+
x1
(+
t_3
(+
(* t_1 (- (* 2.0 x2) x1))
(*
t_0
(+
(* (* x1 x1) (- (* (/ (- (+ t_1 (* 2.0 x2)) x1) t_0) 4.0) 6.0))
(* (* (* x1 2.0) (* 2.0 x2)) t_4))))))))
(if (<= x1 1.35e+154)
(+ x1 (+ t_2 (+ x1 (+ t_3 (* 4.0 (* x2 (* x1 t_4)))))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0);
double t_3 = x1 * (x1 * x1);
double t_4 = (2.0 * x2) - 3.0;
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0)));
} else if (x1 <= 3.9e+102) {
tmp = x1 + (t_2 + (x1 + (t_3 + ((t_1 * ((2.0 * x2) - x1)) + (t_0 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * t_4)))))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_2 + (x1 + (t_3 + (4.0 * (x2 * (x1 * t_4))))));
} 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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)
t_3 = x1 * (x1 * x1)
t_4 = (2.0d0 * x2) - 3.0d0
if (x1 <= (-5.8d+102)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))) + ((x1 * (-3.0d0)) + (x2 * (-6.0d0))))
else if (x1 <= 3.9d+102) then
tmp = x1 + (t_2 + (x1 + (t_3 + ((t_1 * ((2.0d0 * x2) - x1)) + (t_0 * (((x1 * x1) * (((((t_1 + (2.0d0 * x2)) - x1) / t_0) * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * (2.0d0 * x2)) * t_4)))))))
else if (x1 <= 1.35d+154) then
tmp = x1 + (t_2 + (x1 + (t_3 + (4.0d0 * (x2 * (x1 * t_4))))))
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 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0);
double t_3 = x1 * (x1 * x1);
double t_4 = (2.0 * x2) - 3.0;
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0)));
} else if (x1 <= 3.9e+102) {
tmp = x1 + (t_2 + (x1 + (t_3 + ((t_1 * ((2.0 * x2) - x1)) + (t_0 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * t_4)))))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_2 + (x1 + (t_3 + (4.0 * (x2 * (x1 * t_4))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0) t_3 = x1 * (x1 * x1) t_4 = (2.0 * x2) - 3.0 tmp = 0 if x1 <= -5.8e+102: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0))) elif x1 <= 3.9e+102: tmp = x1 + (t_2 + (x1 + (t_3 + ((t_1 * ((2.0 * x2) - x1)) + (t_0 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * t_4))))))) elif x1 <= 1.35e+154: tmp = x1 + (t_2 + (x1 + (t_3 + (4.0 * (x2 * (x1 * t_4)))))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)) t_3 = Float64(x1 * Float64(x1 * x1)) t_4 = Float64(Float64(2.0 * x2) - 3.0) tmp = 0.0 if (x1 <= -5.8e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))) + Float64(Float64(x1 * -3.0) + Float64(x2 * -6.0)))); elseif (x1 <= 3.9e+102) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(t_3 + Float64(Float64(t_1 * Float64(Float64(2.0 * x2) - x1)) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * Float64(2.0 * x2)) * t_4)))))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(t_3 + Float64(4.0 * Float64(x2 * Float64(x1 * t_4))))))); 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 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0); t_3 = x1 * (x1 * x1); t_4 = (2.0 * x2) - 3.0; tmp = 0.0; if (x1 <= -5.8e+102) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0))); elseif (x1 <= 3.9e+102) tmp = x1 + (t_2 + (x1 + (t_3 + ((t_1 * ((2.0 * x2) - x1)) + (t_0 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * t_4))))))); elseif (x1 <= 1.35e+154) tmp = x1 + (t_2 + (x1 + (t_3 + (4.0 * (x2 * (x1 * t_4)))))); 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[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.9e+102], N[(x1 + N[(t$95$2 + N[(x1 + N[(t$95$3 + N[(N[(t$95$1 * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$2 + N[(x1 + N[(t$95$3 + N[(4.0 * N[(x2 * N[(x1 * t$95$4), $MachinePrecision]), $MachinePrecision]), $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 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0}\\
t_3 := x1 \cdot \left(x1 \cdot x1\right)\\
t_4 := 2 \cdot x2 - 3\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right) + \left(x1 \cdot -3 + x2 \cdot -6\right)\right)\\
\mathbf{elif}\;x1 \leq 3.9 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + \left(t_3 + \left(t_1 \cdot \left(2 \cdot x2 - x1\right) + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0} \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right) \cdot t_4\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + \left(t_3 + 4 \cdot \left(x2 \cdot \left(x1 \cdot t_4\right)\right)\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 < -5.8000000000000005e102Initial program 4.3%
Taylor expanded in x1 around 0 4.4%
Taylor expanded in x2 around 0 8.9%
associate-*r*8.9%
Simplified8.9%
Taylor expanded in x1 around 0 27.0%
if -5.8000000000000005e102 < x1 < 3.8999999999999998e102Initial program 99.4%
Taylor expanded in x1 around 0 95.7%
+-commutative95.7%
neg-mul-195.7%
unsub-neg95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in x1 around 0 93.2%
*-commutative93.2%
Simplified93.2%
Taylor expanded in x1 around 0 91.7%
*-commutative93.2%
Simplified91.7%
if 3.8999999999999998e102 < x1 < 1.35000000000000003e154Initial program 87.5%
Taylor expanded in x1 around 0 12.5%
+-commutative12.5%
neg-mul-112.5%
unsub-neg12.5%
*-commutative12.5%
Simplified12.5%
Taylor expanded in x1 around 0 12.5%
*-commutative12.5%
Simplified12.5%
Taylor expanded in x1 around 0 87.5%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.4%
flip-+82.6%
*-commutative82.6%
*-commutative82.6%
*-commutative82.6%
Applied egg-rr82.6%
swap-sqr82.6%
metadata-eval82.6%
Simplified82.6%
Final simplification79.0%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -6.5e+95)
(+ x1 (+ (+ x1 (* 4.0 (* x1 (* x2 -3.0)))) (+ (* x1 -3.0) (* x2 -6.0))))
(if (<= x1 1.35e+154)
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (+ (* x1 (* x1 x1)) (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0))))))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -6.5e+95) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.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) :: tmp
if (x1 <= (-6.5d+95)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))) + ((x1 * (-3.0d0)) + (x2 * (-6.0d0))))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + ((x1 * (x1 * x1)) + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0)))))))
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 tmp;
if (x1 <= -6.5e+95) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -6.5e+95: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0))) elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -6.5e+95) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))) + Float64(Float64(x1 * -3.0) + Float64(x2 * -6.0)))); elseif (x1 <= 1.35e+154) 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(Float64(x1 * Float64(x1 * x1)) + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.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) tmp = 0.0; if (x1 <= -6.5e+95) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0))); elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -6.5e+95], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], 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[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}
\mathbf{if}\;x1 \leq -6.5 \cdot 10^{+95}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right) + \left(x1 \cdot -3 + x2 \cdot -6\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\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 < -6.5e95Initial program 6.4%
Taylor expanded in x1 around 0 4.3%
Taylor expanded in x2 around 0 8.8%
associate-*r*8.8%
Simplified8.8%
Taylor expanded in x1 around 0 26.5%
if -6.5e95 < x1 < 1.35000000000000003e154Initial program 98.4%
Taylor expanded in x1 around 0 88.6%
+-commutative88.6%
neg-mul-188.6%
unsub-neg88.6%
*-commutative88.6%
Simplified88.6%
Taylor expanded in x1 around 0 86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in x1 around 0 82.0%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.4%
flip-+82.6%
*-commutative82.6%
*-commutative82.6%
*-commutative82.6%
Applied egg-rr82.6%
swap-sqr82.6%
metadata-eval82.6%
Simplified82.6%
Final simplification71.9%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.1e+95)
(+ x1 (+ (+ x1 (* 4.0 (* x1 (* x2 -3.0)))) (+ (* x1 -3.0) (* x2 -6.0))))
(if (<= x1 1.35e+154)
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.1e+95) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.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) :: tmp
if (x1 <= (-1.1d+95)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))) + ((x1 * (-3.0d0)) + (x2 * (-6.0d0))))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
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 tmp;
if (x1 <= -1.1e+95) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.1e+95: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0))) elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.1e+95) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))) + Float64(Float64(x1 * -3.0) + Float64(x2 * -6.0)))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.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) tmp = 0.0; if (x1 <= -1.1e+95) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0))); elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.1e+95], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $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}
\mathbf{if}\;x1 \leq -1.1 \cdot 10^{+95}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right) + \left(x1 \cdot -3 + x2 \cdot -6\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\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 < -1.0999999999999999e95Initial program 6.4%
Taylor expanded in x1 around 0 4.3%
Taylor expanded in x2 around 0 8.8%
associate-*r*8.8%
Simplified8.8%
Taylor expanded in x1 around 0 26.5%
if -1.0999999999999999e95 < x1 < 1.35000000000000003e154Initial program 98.4%
Taylor expanded in x1 around 0 77.3%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.4%
flip-+82.6%
*-commutative82.6%
*-commutative82.6%
*-commutative82.6%
Applied egg-rr82.6%
swap-sqr82.6%
metadata-eval82.6%
Simplified82.6%
Final simplification68.5%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -3.4e+104)
(+ x1 (+ (+ x1 (* 4.0 (* x1 (* x2 -3.0)))) (+ (* x1 -3.0) (* x2 -6.0))))
(if (<= x1 6.4e+131)
(+
x1
(+
(+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))
(* 3.0 (- (* x2 -2.0) x1))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.4e+104) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0)));
} else if (x1 <= 6.4e+131) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (3.0 * ((x2 * -2.0) - x1)));
} 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) :: tmp
if (x1 <= (-3.4d+104)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))) + ((x1 * (-3.0d0)) + (x2 * (-6.0d0))))
else if (x1 <= 6.4d+131) then
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
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 tmp;
if (x1 <= -3.4e+104) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0)));
} else if (x1 <= 6.4e+131) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3.4e+104: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0))) elif x1 <= 6.4e+131: tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3.4e+104) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))) + Float64(Float64(x1 * -3.0) + Float64(x2 * -6.0)))); elseif (x1 <= 6.4e+131) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); 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) tmp = 0.0; if (x1 <= -3.4e+104) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0))); elseif (x1 <= 6.4e+131) tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3.4e+104], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 6.4e+131], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $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}
\mathbf{if}\;x1 \leq -3.4 \cdot 10^{+104}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right) + \left(x1 \cdot -3 + x2 \cdot -6\right)\right)\\
\mathbf{elif}\;x1 \leq 6.4 \cdot 10^{+131}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\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 < -3.3999999999999997e104Initial program 4.4%
Taylor expanded in x1 around 0 4.5%
Taylor expanded in x2 around 0 9.1%
associate-*r*9.1%
Simplified9.1%
Taylor expanded in x1 around 0 27.5%
if -3.3999999999999997e104 < x1 < 6.4000000000000004e131Initial program 98.9%
Taylor expanded in x1 around 0 79.2%
Taylor expanded in x1 around 0 79.1%
if 6.4000000000000004e131 < x1 Initial program 19.4%
Taylor expanded in x1 around 0 4.0%
Taylor expanded in x1 around 0 5.7%
flip-+65.2%
*-commutative65.2%
*-commutative65.2%
*-commutative65.2%
Applied egg-rr65.2%
swap-sqr65.2%
metadata-eval65.2%
Simplified65.2%
Final simplification68.4%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -3.4e+104)
(+ 9.0 (* x1 (+ 2.0 (* x2 -12.0))))
(if (<= x1 -9.8e-83)
(+ x1 (+ 9.0 (+ x1 (* x1 (* x2 (* x2 8.0))))))
(if (<= x1 4.2e-82)
(* x2 -6.0)
(if (<= x1 1.35e+154)
(* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.4e+104) {
tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0)));
} else if (x1 <= -9.8e-83) {
tmp = x1 + (9.0 + (x1 + (x1 * (x2 * (x2 * 8.0)))));
} else if (x1 <= 4.2e-82) {
tmp = x2 * -6.0;
} else if (x1 <= 1.35e+154) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.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) :: tmp
if (x1 <= (-3.4d+104)) then
tmp = 9.0d0 + (x1 * (2.0d0 + (x2 * (-12.0d0))))
else if (x1 <= (-9.8d-83)) then
tmp = x1 + (9.0d0 + (x1 + (x1 * (x2 * (x2 * 8.0d0)))))
else if (x1 <= 4.2d-82) then
tmp = x2 * (-6.0d0)
else if (x1 <= 1.35d+154) then
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
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 tmp;
if (x1 <= -3.4e+104) {
tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0)));
} else if (x1 <= -9.8e-83) {
tmp = x1 + (9.0 + (x1 + (x1 * (x2 * (x2 * 8.0)))));
} else if (x1 <= 4.2e-82) {
tmp = x2 * -6.0;
} else if (x1 <= 1.35e+154) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3.4e+104: tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0))) elif x1 <= -9.8e-83: tmp = x1 + (9.0 + (x1 + (x1 * (x2 * (x2 * 8.0))))) elif x1 <= 4.2e-82: tmp = x2 * -6.0 elif x1 <= 1.35e+154: tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3.4e+104) tmp = Float64(9.0 + Float64(x1 * Float64(2.0 + Float64(x2 * -12.0)))); elseif (x1 <= -9.8e-83) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(x1 * Float64(x2 * Float64(x2 * 8.0)))))); elseif (x1 <= 4.2e-82) tmp = Float64(x2 * -6.0); elseif (x1 <= 1.35e+154) tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.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) tmp = 0.0; if (x1 <= -3.4e+104) tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0))); elseif (x1 <= -9.8e-83) tmp = x1 + (9.0 + (x1 + (x1 * (x2 * (x2 * 8.0))))); elseif (x1 <= 4.2e-82) tmp = x2 * -6.0; elseif (x1 <= 1.35e+154) tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3.4e+104], N[(9.0 + N[(x1 * N[(2.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -9.8e-83], N[(x1 + N[(9.0 + N[(x1 + N[(x1 * N[(x2 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.2e-82], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $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}
\mathbf{if}\;x1 \leq -3.4 \cdot 10^{+104}:\\
\;\;\;\;9 + x1 \cdot \left(2 + x2 \cdot -12\right)\\
\mathbf{elif}\;x1 \leq -9.8 \cdot 10^{-83}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + x1 \cdot \left(x2 \cdot \left(x2 \cdot 8\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.2 \cdot 10^{-82}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\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 < -3.3999999999999997e104Initial program 4.4%
Taylor expanded in x1 around 0 4.5%
Taylor expanded in x1 around inf 4.5%
Taylor expanded in x2 around 0 25.1%
associate-*r*25.1%
distribute-rgt-out25.1%
*-commutative25.1%
Simplified25.1%
if -3.3999999999999997e104 < x1 < -9.8e-83Initial program 96.8%
Taylor expanded in x1 around 0 55.5%
Taylor expanded in x1 around inf 40.3%
Taylor expanded in x2 around inf 38.2%
associate-*r*38.2%
*-commutative38.2%
unpow238.2%
associate-*r*38.2%
*-commutative38.2%
Simplified38.2%
if -9.8e-83 < x1 < 4.2000000000000001e-82Initial program 99.5%
Taylor expanded in x1 around 0 99.5%
Taylor expanded in x1 around 0 63.3%
Taylor expanded in x1 around 0 63.8%
*-commutative63.8%
Simplified63.8%
if 4.2000000000000001e-82 < x1 < 1.35000000000000003e154Initial program 95.5%
Taylor expanded in x1 around 0 47.9%
Taylor expanded in x1 around inf 34.3%
Taylor expanded in x1 around inf 34.3%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.4%
flip-+82.6%
*-commutative82.6%
*-commutative82.6%
*-commutative82.6%
Applied egg-rr82.6%
swap-sqr82.6%
metadata-eval82.6%
Simplified82.6%
Final simplification48.9%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -3.5e+104)
(+ 9.0 (* x1 (+ 2.0 (* x2 -12.0))))
(if (<= x1 6.4e+131)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.5e+104) {
tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0)));
} else if (x1 <= 6.4e+131) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.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) :: tmp
if (x1 <= (-3.5d+104)) then
tmp = 9.0d0 + (x1 * (2.0d0 + (x2 * (-12.0d0))))
else if (x1 <= 6.4d+131) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
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 tmp;
if (x1 <= -3.5e+104) {
tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0)));
} else if (x1 <= 6.4e+131) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3.5e+104: tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0))) elif x1 <= 6.4e+131: tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3.5e+104) tmp = Float64(9.0 + Float64(x1 * Float64(2.0 + Float64(x2 * -12.0)))); elseif (x1 <= 6.4e+131) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.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) tmp = 0.0; if (x1 <= -3.5e+104) tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0))); elseif (x1 <= 6.4e+131) tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3.5e+104], N[(9.0 + N[(x1 * N[(2.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 6.4e+131], 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], 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}
\mathbf{if}\;x1 \leq -3.5 \cdot 10^{+104}:\\
\;\;\;\;9 + x1 \cdot \left(2 + x2 \cdot -12\right)\\
\mathbf{elif}\;x1 \leq 6.4 \cdot 10^{+131}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\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 < -3.5000000000000002e104Initial program 4.4%
Taylor expanded in x1 around 0 4.5%
Taylor expanded in x1 around inf 4.5%
Taylor expanded in x2 around 0 25.1%
associate-*r*25.1%
distribute-rgt-out25.1%
*-commutative25.1%
Simplified25.1%
if -3.5000000000000002e104 < x1 < 6.4000000000000004e131Initial program 98.9%
Taylor expanded in x1 around 0 79.2%
Taylor expanded in x1 around 0 73.2%
if 6.4000000000000004e131 < x1 Initial program 19.4%
Taylor expanded in x1 around 0 4.0%
Taylor expanded in x1 around 0 5.7%
flip-+65.2%
*-commutative65.2%
*-commutative65.2%
*-commutative65.2%
Applied egg-rr65.2%
swap-sqr65.2%
metadata-eval65.2%
Simplified65.2%
Final simplification63.8%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -3.4e+104)
(+ x1 (+ (+ x1 (* 4.0 (* x1 (* x2 -3.0)))) (+ (* x1 -3.0) (* x2 -6.0))))
(if (<= x1 6.4e+131)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.4e+104) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0)));
} else if (x1 <= 6.4e+131) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.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) :: tmp
if (x1 <= (-3.4d+104)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))) + ((x1 * (-3.0d0)) + (x2 * (-6.0d0))))
else if (x1 <= 6.4d+131) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
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 tmp;
if (x1 <= -3.4e+104) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0)));
} else if (x1 <= 6.4e+131) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3.4e+104: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0))) elif x1 <= 6.4e+131: tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3.4e+104) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))) + Float64(Float64(x1 * -3.0) + Float64(x2 * -6.0)))); elseif (x1 <= 6.4e+131) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.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) tmp = 0.0; if (x1 <= -3.4e+104) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + ((x1 * -3.0) + (x2 * -6.0))); elseif (x1 <= 6.4e+131) tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3.4e+104], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 6.4e+131], 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], 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}
\mathbf{if}\;x1 \leq -3.4 \cdot 10^{+104}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right) + \left(x1 \cdot -3 + x2 \cdot -6\right)\right)\\
\mathbf{elif}\;x1 \leq 6.4 \cdot 10^{+131}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\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 < -3.3999999999999997e104Initial program 4.4%
Taylor expanded in x1 around 0 4.5%
Taylor expanded in x2 around 0 9.1%
associate-*r*9.1%
Simplified9.1%
Taylor expanded in x1 around 0 27.5%
if -3.3999999999999997e104 < x1 < 6.4000000000000004e131Initial program 98.9%
Taylor expanded in x1 around 0 79.2%
Taylor expanded in x1 around 0 73.2%
if 6.4000000000000004e131 < x1 Initial program 19.4%
Taylor expanded in x1 around 0 4.0%
Taylor expanded in x1 around 0 5.7%
flip-+65.2%
*-commutative65.2%
*-commutative65.2%
*-commutative65.2%
Applied egg-rr65.2%
swap-sqr65.2%
metadata-eval65.2%
Simplified65.2%
Final simplification64.2%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -3.4e+104)
(+ 9.0 (* x1 (+ 2.0 (* x2 -12.0))))
(if (<= x1 -1.45e-82)
(+ x1 (* x1 (* (* x2 x2) 8.0)))
(if (<= x1 1.16e-82)
(* x2 -6.0)
(* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.4e+104) {
tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0)));
} else if (x1 <= -1.45e-82) {
tmp = x1 + (x1 * ((x2 * x2) * 8.0));
} else if (x1 <= 1.16e-82) {
tmp = x2 * -6.0;
} else {
tmp = x1 * (2.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 <= (-3.4d+104)) then
tmp = 9.0d0 + (x1 * (2.0d0 + (x2 * (-12.0d0))))
else if (x1 <= (-1.45d-82)) then
tmp = x1 + (x1 * ((x2 * x2) * 8.0d0))
else if (x1 <= 1.16d-82) then
tmp = x2 * (-6.0d0)
else
tmp = x1 * (2.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 <= -3.4e+104) {
tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0)));
} else if (x1 <= -1.45e-82) {
tmp = x1 + (x1 * ((x2 * x2) * 8.0));
} else if (x1 <= 1.16e-82) {
tmp = x2 * -6.0;
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3.4e+104: tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0))) elif x1 <= -1.45e-82: tmp = x1 + (x1 * ((x2 * x2) * 8.0)) elif x1 <= 1.16e-82: tmp = x2 * -6.0 else: tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3.4e+104) tmp = Float64(9.0 + Float64(x1 * Float64(2.0 + Float64(x2 * -12.0)))); elseif (x1 <= -1.45e-82) tmp = Float64(x1 + Float64(x1 * Float64(Float64(x2 * x2) * 8.0))); elseif (x1 <= 1.16e-82) tmp = Float64(x2 * -6.0); else tmp = Float64(x1 * Float64(2.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 <= -3.4e+104) tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0))); elseif (x1 <= -1.45e-82) tmp = x1 + (x1 * ((x2 * x2) * 8.0)); elseif (x1 <= 1.16e-82) tmp = x2 * -6.0; else tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3.4e+104], N[(9.0 + N[(x1 * N[(2.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.45e-82], N[(x1 + N[(x1 * N[(N[(x2 * x2), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.16e-82], N[(x2 * -6.0), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.4 \cdot 10^{+104}:\\
\;\;\;\;9 + x1 \cdot \left(2 + x2 \cdot -12\right)\\
\mathbf{elif}\;x1 \leq -1.45 \cdot 10^{-82}:\\
\;\;\;\;x1 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\\
\mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-82}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -3.3999999999999997e104Initial program 4.4%
Taylor expanded in x1 around 0 4.5%
Taylor expanded in x1 around inf 4.5%
Taylor expanded in x2 around 0 25.1%
associate-*r*25.1%
distribute-rgt-out25.1%
*-commutative25.1%
Simplified25.1%
if -3.3999999999999997e104 < x1 < -1.44999999999999989e-82Initial program 96.8%
Taylor expanded in x1 around 0 55.5%
Taylor expanded in x2 around inf 36.8%
*-commutative36.8%
*-commutative36.8%
associate-*l*36.8%
unpow236.8%
Simplified36.8%
if -1.44999999999999989e-82 < x1 < 1.16e-82Initial program 99.5%
Taylor expanded in x1 around 0 99.5%
Taylor expanded in x1 around 0 63.3%
Taylor expanded in x1 around 0 63.8%
*-commutative63.8%
Simplified63.8%
if 1.16e-82 < x1 Initial program 64.5%
Taylor expanded in x1 around 0 32.4%
Taylor expanded in x1 around inf 37.2%
Taylor expanded in x1 around inf 37.2%
Final simplification45.2%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -3.4e+104)
(+ 9.0 (* x1 (+ 2.0 (* x2 -12.0))))
(if (<= x1 -7e-83)
(+ x1 (+ 9.0 (+ x1 (* x1 (* x2 (* x2 8.0))))))
(if (<= x1 1.9e-83)
(* x2 -6.0)
(* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.4e+104) {
tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0)));
} else if (x1 <= -7e-83) {
tmp = x1 + (9.0 + (x1 + (x1 * (x2 * (x2 * 8.0)))));
} else if (x1 <= 1.9e-83) {
tmp = x2 * -6.0;
} else {
tmp = x1 * (2.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 <= (-3.4d+104)) then
tmp = 9.0d0 + (x1 * (2.0d0 + (x2 * (-12.0d0))))
else if (x1 <= (-7d-83)) then
tmp = x1 + (9.0d0 + (x1 + (x1 * (x2 * (x2 * 8.0d0)))))
else if (x1 <= 1.9d-83) then
tmp = x2 * (-6.0d0)
else
tmp = x1 * (2.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 <= -3.4e+104) {
tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0)));
} else if (x1 <= -7e-83) {
tmp = x1 + (9.0 + (x1 + (x1 * (x2 * (x2 * 8.0)))));
} else if (x1 <= 1.9e-83) {
tmp = x2 * -6.0;
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3.4e+104: tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0))) elif x1 <= -7e-83: tmp = x1 + (9.0 + (x1 + (x1 * (x2 * (x2 * 8.0))))) elif x1 <= 1.9e-83: tmp = x2 * -6.0 else: tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3.4e+104) tmp = Float64(9.0 + Float64(x1 * Float64(2.0 + Float64(x2 * -12.0)))); elseif (x1 <= -7e-83) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(x1 * Float64(x2 * Float64(x2 * 8.0)))))); elseif (x1 <= 1.9e-83) tmp = Float64(x2 * -6.0); else tmp = Float64(x1 * Float64(2.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 <= -3.4e+104) tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0))); elseif (x1 <= -7e-83) tmp = x1 + (9.0 + (x1 + (x1 * (x2 * (x2 * 8.0))))); elseif (x1 <= 1.9e-83) tmp = x2 * -6.0; else tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3.4e+104], N[(9.0 + N[(x1 * N[(2.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -7e-83], N[(x1 + N[(9.0 + N[(x1 + N[(x1 * N[(x2 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.9e-83], N[(x2 * -6.0), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.4 \cdot 10^{+104}:\\
\;\;\;\;9 + x1 \cdot \left(2 + x2 \cdot -12\right)\\
\mathbf{elif}\;x1 \leq -7 \cdot 10^{-83}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + x1 \cdot \left(x2 \cdot \left(x2 \cdot 8\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.9 \cdot 10^{-83}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -3.3999999999999997e104Initial program 4.4%
Taylor expanded in x1 around 0 4.5%
Taylor expanded in x1 around inf 4.5%
Taylor expanded in x2 around 0 25.1%
associate-*r*25.1%
distribute-rgt-out25.1%
*-commutative25.1%
Simplified25.1%
if -3.3999999999999997e104 < x1 < -7.00000000000000061e-83Initial program 96.8%
Taylor expanded in x1 around 0 55.5%
Taylor expanded in x1 around inf 40.3%
Taylor expanded in x2 around inf 38.2%
associate-*r*38.2%
*-commutative38.2%
unpow238.2%
associate-*r*38.2%
*-commutative38.2%
Simplified38.2%
if -7.00000000000000061e-83 < x1 < 1.89999999999999988e-83Initial program 99.5%
Taylor expanded in x1 around 0 99.5%
Taylor expanded in x1 around 0 63.3%
Taylor expanded in x1 around 0 63.8%
*-commutative63.8%
Simplified63.8%
if 1.89999999999999988e-83 < x1 Initial program 64.5%
Taylor expanded in x1 around 0 32.4%
Taylor expanded in x1 around inf 37.2%
Taylor expanded in x1 around inf 37.2%
Final simplification45.4%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -2.8e+85) (not (<= x2 6.9e+152))) (+ x1 (+ 9.0 (+ x1 (* 4.0 (* x2 (* 2.0 (* x1 x2))))))) (/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -2.8e+85) || !(x2 <= 6.9e+152)) {
tmp = x1 + (9.0 + (x1 + (4.0 * (x2 * (2.0 * (x1 * x2))))));
} 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) :: tmp
if ((x2 <= (-2.8d+85)) .or. (.not. (x2 <= 6.9d+152))) then
tmp = x1 + (9.0d0 + (x1 + (4.0d0 * (x2 * (2.0d0 * (x1 * x2))))))
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 tmp;
if ((x2 <= -2.8e+85) || !(x2 <= 6.9e+152)) {
tmp = x1 + (9.0 + (x1 + (4.0 * (x2 * (2.0 * (x1 * x2))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -2.8e+85) or not (x2 <= 6.9e+152): tmp = x1 + (9.0 + (x1 + (4.0 * (x2 * (2.0 * (x1 * x2)))))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -2.8e+85) || !(x2 <= 6.9e+152)) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(2.0 * Float64(x1 * x2))))))); 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) tmp = 0.0; if ((x2 <= -2.8e+85) || ~((x2 <= 6.9e+152))) tmp = x1 + (9.0 + (x1 + (4.0 * (x2 * (2.0 * (x1 * x2)))))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -2.8e+85], N[Not[LessEqual[x2, 6.9e+152]], $MachinePrecision]], N[(x1 + N[(9.0 + N[(x1 + N[(4.0 * N[(x2 * N[(2.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $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}
\mathbf{if}\;x2 \leq -2.8 \cdot 10^{+85} \lor \neg \left(x2 \leq 6.9 \cdot 10^{+152}\right):\\
\;\;\;\;x1 + \left(9 + \left(x1 + 4 \cdot \left(x2 \cdot \left(2 \cdot \left(x1 \cdot x2\right)\right)\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 x2 < -2.7999999999999999e85 or 6.9e152 < x2 Initial program 67.8%
Taylor expanded in x1 around 0 63.2%
Taylor expanded in x1 around inf 63.0%
Taylor expanded in x2 around inf 63.0%
if -2.7999999999999999e85 < x2 < 6.9e152Initial program 74.9%
Taylor expanded in x1 around 0 54.1%
Taylor expanded in x1 around 0 34.5%
flip-+39.2%
*-commutative39.2%
*-commutative39.2%
*-commutative39.2%
Applied egg-rr39.2%
swap-sqr39.1%
metadata-eval39.1%
Simplified39.1%
Final simplification46.7%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -3.4e+104)
(+ 9.0 (* x1 (+ 2.0 (* x2 -12.0))))
(if (or (<= x1 -8.5e-83) (not (<= x1 3.3e-81)))
(+ x1 (* x1 (* (* x2 x2) 8.0)))
(* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.4e+104) {
tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0)));
} else if ((x1 <= -8.5e-83) || !(x1 <= 3.3e-81)) {
tmp = x1 + (x1 * ((x2 * x2) * 8.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-3.4d+104)) then
tmp = 9.0d0 + (x1 * (2.0d0 + (x2 * (-12.0d0))))
else if ((x1 <= (-8.5d-83)) .or. (.not. (x1 <= 3.3d-81))) then
tmp = x1 + (x1 * ((x2 * x2) * 8.0d0))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -3.4e+104) {
tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0)));
} else if ((x1 <= -8.5e-83) || !(x1 <= 3.3e-81)) {
tmp = x1 + (x1 * ((x2 * x2) * 8.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3.4e+104: tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0))) elif (x1 <= -8.5e-83) or not (x1 <= 3.3e-81): tmp = x1 + (x1 * ((x2 * x2) * 8.0)) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3.4e+104) tmp = Float64(9.0 + Float64(x1 * Float64(2.0 + Float64(x2 * -12.0)))); elseif ((x1 <= -8.5e-83) || !(x1 <= 3.3e-81)) tmp = Float64(x1 + Float64(x1 * Float64(Float64(x2 * x2) * 8.0))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -3.4e+104) tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0))); elseif ((x1 <= -8.5e-83) || ~((x1 <= 3.3e-81))) tmp = x1 + (x1 * ((x2 * x2) * 8.0)); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3.4e+104], N[(9.0 + N[(x1 * N[(2.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -8.5e-83], N[Not[LessEqual[x1, 3.3e-81]], $MachinePrecision]], N[(x1 + N[(x1 * N[(N[(x2 * x2), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.4 \cdot 10^{+104}:\\
\;\;\;\;9 + x1 \cdot \left(2 + x2 \cdot -12\right)\\
\mathbf{elif}\;x1 \leq -8.5 \cdot 10^{-83} \lor \neg \left(x1 \leq 3.3 \cdot 10^{-81}\right):\\
\;\;\;\;x1 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -3.3999999999999997e104Initial program 4.4%
Taylor expanded in x1 around 0 4.5%
Taylor expanded in x1 around inf 4.5%
Taylor expanded in x2 around 0 25.1%
associate-*r*25.1%
distribute-rgt-out25.1%
*-commutative25.1%
Simplified25.1%
if -3.3999999999999997e104 < x1 < -8.49999999999999938e-83 or 3.29999999999999987e-81 < x1 Initial program 76.5%
Taylor expanded in x1 around 0 41.0%
Taylor expanded in x2 around inf 37.1%
*-commutative37.1%
*-commutative37.1%
associate-*l*37.1%
unpow237.1%
Simplified37.1%
if -8.49999999999999938e-83 < x1 < 3.29999999999999987e-81Initial program 99.5%
Taylor expanded in x1 around 0 99.5%
Taylor expanded in x1 around 0 63.3%
Taylor expanded in x1 around 0 63.8%
*-commutative63.8%
Simplified63.8%
Final simplification45.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ 9.0 (* x1 (+ 2.0 (* x2 -12.0))))))
(if (<= x1 -7.5e-45)
t_0
(if (<= x1 1.4)
(* x2 -6.0)
(if (<= x1 2.3e+284) t_0 (+ (* x1 2.0) 9.0))))))
double code(double x1, double x2) {
double t_0 = 9.0 + (x1 * (2.0 + (x2 * -12.0)));
double tmp;
if (x1 <= -7.5e-45) {
tmp = t_0;
} else if (x1 <= 1.4) {
tmp = x2 * -6.0;
} else if (x1 <= 2.3e+284) {
tmp = t_0;
} else {
tmp = (x1 * 2.0) + 9.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = 9.0d0 + (x1 * (2.0d0 + (x2 * (-12.0d0))))
if (x1 <= (-7.5d-45)) then
tmp = t_0
else if (x1 <= 1.4d0) then
tmp = x2 * (-6.0d0)
else if (x1 <= 2.3d+284) then
tmp = t_0
else
tmp = (x1 * 2.0d0) + 9.0d0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 9.0 + (x1 * (2.0 + (x2 * -12.0)));
double tmp;
if (x1 <= -7.5e-45) {
tmp = t_0;
} else if (x1 <= 1.4) {
tmp = x2 * -6.0;
} else if (x1 <= 2.3e+284) {
tmp = t_0;
} else {
tmp = (x1 * 2.0) + 9.0;
}
return tmp;
}
def code(x1, x2): t_0 = 9.0 + (x1 * (2.0 + (x2 * -12.0))) tmp = 0 if x1 <= -7.5e-45: tmp = t_0 elif x1 <= 1.4: tmp = x2 * -6.0 elif x1 <= 2.3e+284: tmp = t_0 else: tmp = (x1 * 2.0) + 9.0 return tmp
function code(x1, x2) t_0 = Float64(9.0 + Float64(x1 * Float64(2.0 + Float64(x2 * -12.0)))) tmp = 0.0 if (x1 <= -7.5e-45) tmp = t_0; elseif (x1 <= 1.4) tmp = Float64(x2 * -6.0); elseif (x1 <= 2.3e+284) tmp = t_0; else tmp = Float64(Float64(x1 * 2.0) + 9.0); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 9.0 + (x1 * (2.0 + (x2 * -12.0))); tmp = 0.0; if (x1 <= -7.5e-45) tmp = t_0; elseif (x1 <= 1.4) tmp = x2 * -6.0; elseif (x1 <= 2.3e+284) tmp = t_0; else tmp = (x1 * 2.0) + 9.0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(9.0 + N[(x1 * N[(2.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -7.5e-45], t$95$0, If[LessEqual[x1, 1.4], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x1, 2.3e+284], t$95$0, N[(N[(x1 * 2.0), $MachinePrecision] + 9.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 9 + x1 \cdot \left(2 + x2 \cdot -12\right)\\
\mathbf{if}\;x1 \leq -7.5 \cdot 10^{-45}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 1.4:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+284}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot 2 + 9\\
\end{array}
\end{array}
if x1 < -7.5000000000000006e-45 or 1.3999999999999999 < x1 < 2.29999999999999984e284Initial program 50.1%
Taylor expanded in x1 around 0 20.1%
Taylor expanded in x1 around inf 23.2%
Taylor expanded in x2 around 0 15.2%
associate-*r*15.2%
distribute-rgt-out15.2%
*-commutative15.2%
Simplified15.2%
if -7.5000000000000006e-45 < x1 < 1.3999999999999999Initial program 99.4%
Taylor expanded in x1 around 0 99.3%
Taylor expanded in x1 around 0 54.1%
Taylor expanded in x1 around 0 54.7%
*-commutative54.7%
Simplified54.7%
if 2.29999999999999984e284 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 40.7%
Taylor expanded in x2 around 0 10.4%
Final simplification33.6%
(FPCore (x1 x2) :precision binary64 (* x2 -6.0))
double code(double x1, double x2) {
return x2 * -6.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * (-6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * -6.0;
}
def code(x1, x2): return x2 * -6.0
function code(x1, x2) return Float64(x2 * -6.0) end
function tmp = code(x1, x2) tmp = x2 * -6.0; end
code[x1_, x2_] := N[(x2 * -6.0), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6
\end{array}
Initial program 72.6%
Taylor expanded in x1 around 0 57.0%
Taylor expanded in x1 around 0 26.8%
Taylor expanded in x1 around 0 26.8%
*-commutative26.8%
Simplified26.8%
Final simplification26.8%
(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 72.6%
Taylor expanded in x1 around 0 57.0%
Taylor expanded in x1 around inf 25.5%
Taylor expanded in x1 around 0 3.4%
Final simplification3.4%
herbie shell --seed 2023240
(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))))))