
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 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 (* (* x1 2.0) t_3))
(t_5 (* t_1 t_3))
(t_6 (* (* x1 x1) (- (* t_3 4.0) 6.0)))
(t_7 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
(if (<=
(+
x1
(+ (+ x1 (+ (+ (* t_2 (+ (* t_4 (- t_3 3.0)) t_6)) t_5) t_0)) t_7))
INFINITY)
(+
x1
(+
t_7
(+
x1
(+
t_0
(+
t_5
(*
t_2
(+
t_6
(*
t_4
(-
(* (- (fma (* x1 3.0) x1 (* 2.0 x2)) x1) (/ 1.0 (fma x1 x1 1.0)))
3.0)))))))))
(+ x1 (* 6.0 (pow x1 4.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 = (x1 * 2.0) * t_3;
double t_5 = t_1 * t_3;
double t_6 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double t_7 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double tmp;
if ((x1 + ((x1 + (((t_2 * ((t_4 * (t_3 - 3.0)) + t_6)) + t_5) + t_0)) + t_7)) <= ((double) INFINITY)) {
tmp = x1 + (t_7 + (x1 + (t_0 + (t_5 + (t_2 * (t_6 + (t_4 * (((fma((x1 * 3.0), x1, (2.0 * x2)) - x1) * (1.0 / fma(x1, x1, 1.0))) - 3.0))))))));
} else {
tmp = x1 + (6.0 * pow(x1, 4.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(x1 * 2.0) * t_3) t_5 = Float64(t_1 * t_3) t_6 = Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) t_7 = 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(t_4 * Float64(t_3 - 3.0)) + t_6)) + t_5) + t_0)) + t_7)) <= Inf) tmp = Float64(x1 + Float64(t_7 + Float64(x1 + Float64(t_0 + Float64(t_5 + Float64(t_2 * Float64(t_6 + Float64(t_4 * Float64(Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(2.0 * x2)) - x1) * Float64(1.0 / fma(x1, x1, 1.0))) - 3.0))))))))); else tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.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[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$1 * t$95$3), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $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$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(t$95$4 * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + t$95$7), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$7 + N[(x1 + N[(t$95$0 + N[(t$95$5 + N[(t$95$2 * N[(t$95$6 + N[(t$95$4 * N[(N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] * N[(1.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $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 := \left(x1 \cdot 2\right) \cdot t_3\\
t_5 := t_1 \cdot t_3\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\\
t_7 := 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(t_4 \cdot \left(t_3 - 3\right) + t_6\right) + t_5\right) + t_0\right)\right) + t_7\right) \leq \infty:\\
\;\;\;\;x1 + \left(t_7 + \left(x1 + \left(t_0 + \left(t_5 + t_2 \cdot \left(t_6 + t_4 \cdot \left(\left(\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1\right) \cdot \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)} - 3\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\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%
fma-def99.5%
div-inv99.5%
fma-def99.5%
Applied egg-rr99.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 19.7%
*-commutative19.7%
Simplified19.7%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.6%
(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 (* 6.0 (pow x1 4.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 + (6.0 * pow(x1, 4.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 + (6.0 * Math.pow(x1, 4.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 + (6.0 * math.pow(x1, 4.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(6.0 * (x1 ^ 4.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 + (6.0 * (x1 ^ 4.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[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_3 := 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 + 6 \cdot {x1}^{4}\\
\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 19.7%
*-commutative19.7%
Simplified19.7%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.6%
(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.12e+97) (not (<= x1 8.5e+70)))
(+ x1 (* 6.0 (pow x1 4.0)))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_2)
(*
t_1
(+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -1.12e+97) || !(x1 <= 8.5e+70)) {
tmp = x1 + (6.0 * pow(x1, 4.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 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 <= (-1.12d+97)) .or. (.not. (x1 <= 8.5d+70))) then
tmp = x1 + (6.0d0 * (x1 ** 4.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 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -1.12e+97) || !(x1 <= 8.5e+70)) {
tmp = x1 + (6.0 * Math.pow(x1, 4.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 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 <= -1.12e+97) or not (x1 <= 8.5e+70): tmp = x1 + (6.0 * math.pow(x1, 4.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 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if ((x1 <= -1.12e+97) || !(x1 <= 8.5e+70)) tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.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(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 <= -1.12e+97) || ~((x1 <= 8.5e+70))) tmp = x1 + (6.0 * (x1 ^ 4.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 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -1.12e+97], N[Not[LessEqual[x1, 8.5e+70]], $MachinePrecision]], N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $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[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $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.12 \cdot 10^{+97} \lor \neg \left(x1 \leq 8.5 \cdot 10^{+70}\right):\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\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(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.12e97 or 8.4999999999999996e70 < x1 Initial program 26.0%
Taylor expanded in x1 around inf 40.4%
*-commutative40.4%
Simplified40.4%
Taylor expanded in x1 around inf 99.7%
*-commutative99.7%
Simplified99.7%
if -1.12e97 < x1 < 8.4999999999999996e70Initial program 99.4%
fma-def99.4%
div-inv99.4%
fma-def99.4%
Applied egg-rr99.4%
Taylor expanded in x1 around inf 96.0%
Final simplification97.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 -2.7e+44) (not (<= x1 4.9e+69)))
(+ x1 (* 6.0 (pow x1 4.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) (* 2.0 x2)) (- (- (* 2.0 x2) x1) 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 <= -2.7e+44) || !(x1 <= 4.9e+69)) {
tmp = x1 + (6.0 * pow(x1, 4.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) * (2.0 * x2)) * (((2.0 * x2) - x1) - 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 <= (-2.7d+44)) .or. (.not. (x1 <= 4.9d+69))) then
tmp = x1 + (6.0d0 * (x1 ** 4.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) * (2.0d0 * x2)) * (((2.0d0 * x2) - x1) - 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 <= -2.7e+44) || !(x1 <= 4.9e+69)) {
tmp = x1 + (6.0 * Math.pow(x1, 4.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) * (2.0 * x2)) * (((2.0 * x2) - x1) - 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 <= -2.7e+44) or not (x1 <= 4.9e+69): tmp = x1 + (6.0 * math.pow(x1, 4.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) * (2.0 * x2)) * (((2.0 * x2) - x1) - 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 <= -2.7e+44) || !(x1 <= 4.9e+69)) tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.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) * Float64(2.0 * x2)) * Float64(Float64(Float64(2.0 * x2) - x1) - 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 <= -2.7e+44) || ~((x1 <= 4.9e+69))) tmp = x1 + (6.0 * (x1 ^ 4.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) * (2.0 * x2)) * (((2.0 * x2) - x1) - 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, -2.7e+44], N[Not[LessEqual[x1, 4.9e+69]], $MachinePrecision]], N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $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] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(2.0 * x2), $MachinePrecision] - x1), $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 -2.7 \cdot 10^{+44} \lor \neg \left(x1 \leq 4.9 \cdot 10^{+69}\right):\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\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 \left(2 \cdot x2\right)\right) \cdot \left(\left(2 \cdot x2 - x1\right) - 3\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.7e44 or 4.9e69 < x1 Initial program 33.6%
Taylor expanded in x1 around inf 45.5%
*-commutative45.5%
Simplified45.5%
Taylor expanded in x1 around inf 98.8%
*-commutative98.8%
Simplified98.8%
if -2.7e44 < x1 < 4.9e69Initial program 99.4%
Taylor expanded in x1 around 0 88.8%
Taylor expanded in x1 around 0 94.6%
Final simplification96.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0)))
(if (<= x1 -4.9e+88)
(+ x1 (+ (+ x1 (* 4.0 (* -3.0 (* x1 x2)))) (* 3.0 (* x2 -2.0))))
(if (<= x1 1.35e+154)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_1 t_2)
(*
t_0
(+
(* (* x1 x1) (- (* t_2 4.0) 6.0))
(* (* (* x1 2.0) (* 2.0 x2)) (- (- (* 2.0 x2) x1) 3.0)))))))))
(/ (- (* 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 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double tmp;
if (x1 <= -4.9e+88) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 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) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = ((t_1 + (2.0d0 * x2)) - x1) / t_0
if (x1 <= (-4.9d+88)) then
tmp = x1 + ((x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))) + (3.0d0 * (x2 * (-2.0d0))))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * (((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * (2.0d0 * x2)) * (((2.0d0 * x2) - x1) - 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 t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double tmp;
if (x1 <= -4.9e+88) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0))))))));
} 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 = ((t_1 + (2.0 * x2)) - x1) / t_0 tmp = 0 if x1 <= -4.9e+88: tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0))) elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0)))))))) 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(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) tmp = 0.0 if (x1 <= -4.9e+88) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))) + Float64(3.0 * Float64(x2 * -2.0)))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * t_2) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * Float64(2.0 * x2)) * Float64(Float64(Float64(2.0 * x2) - x1) - 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) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0; tmp = 0.0; if (x1 <= -4.9e+88) tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0))); elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0)))))))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x1, -4.9e+88], N[(x1 + N[(N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * t$95$2), $MachinePrecision] + N[(t$95$0 * 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] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision] - 3.0), $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 3\right)\\
t_2 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0}\\
\mathbf{if}\;x1 \leq -4.9 \cdot 10^{+88}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot t_2 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right) \cdot \left(\left(2 \cdot x2 - x1\right) - 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 < -4.9000000000000002e88Initial program 6.3%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 0.1%
*-commutative0.1%
Simplified0.1%
Taylor expanded in x2 around 0 21.8%
if -4.9000000000000002e88 < x1 < 1.35000000000000003e154Initial program 99.5%
Taylor expanded in x1 around 0 79.6%
Taylor expanded in x1 around 0 90.7%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.0%
*-commutative6.0%
Simplified6.0%
flip-+80.8%
Applied egg-rr80.8%
swap-sqr80.8%
metadata-eval80.8%
Simplified80.8%
Final simplification76.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- (* 2.0 x2) x1)))
(if (<= x1 -1.2e+51)
(+ x1 (+ (+ x1 (* 4.0 (* -3.0 (* x1 x2)))) (* 3.0 (* x2 -2.0))))
(if (<= x1 5.5e+153)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_1 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0))
(*
t_0
(+
(* (- t_2 3.0) (* (* x1 2.0) t_2))
(* (* x1 x1) (- (* (* 2.0 x2) 4.0) 6.0)))))))))
(/ (- (* 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 = (2.0 * x2) - x1;
double tmp;
if (x1 <= -1.2e+51) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0)));
} else if (x1 <= 5.5e+153) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0 * x2)) - x1) / t_0)) + (t_0 * (((t_2 - 3.0) * ((x1 * 2.0) * t_2)) + ((x1 * x1) * (((2.0 * x2) * 4.0) - 6.0))))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = (2.0d0 * x2) - x1
if (x1 <= (-1.2d+51)) then
tmp = x1 + ((x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))) + (3.0d0 * (x2 * (-2.0d0))))
else if (x1 <= 5.5d+153) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0d0 * x2)) - x1) / t_0)) + (t_0 * (((t_2 - 3.0d0) * ((x1 * 2.0d0) * t_2)) + ((x1 * x1) * (((2.0d0 * x2) * 4.0d0) - 6.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 t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (2.0 * x2) - x1;
double tmp;
if (x1 <= -1.2e+51) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0)));
} else if (x1 <= 5.5e+153) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0 * x2)) - x1) / t_0)) + (t_0 * (((t_2 - 3.0) * ((x1 * 2.0) * t_2)) + ((x1 * x1) * (((2.0 * x2) * 4.0) - 6.0))))))));
} 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 = (2.0 * x2) - x1 tmp = 0 if x1 <= -1.2e+51: tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0))) elif x1 <= 5.5e+153: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0 * x2)) - x1) / t_0)) + (t_0 * (((t_2 - 3.0) * ((x1 * 2.0) * t_2)) + ((x1 * x1) * (((2.0 * x2) * 4.0) - 6.0)))))))) 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(Float64(2.0 * x2) - x1) tmp = 0.0 if (x1 <= -1.2e+51) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))) + Float64(3.0 * Float64(x2 * -2.0)))); elseif (x1 <= 5.5e+153) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0)) + Float64(t_0 * Float64(Float64(Float64(t_2 - 3.0) * Float64(Float64(x1 * 2.0) * t_2)) + Float64(Float64(x1 * x1) * Float64(Float64(Float64(2.0 * x2) * 4.0) - 6.0))))))))); else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = (2.0 * x2) - x1; tmp = 0.0; if (x1 <= -1.2e+51) tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0))); elseif (x1 <= 5.5e+153) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0 * x2)) - x1) / t_0)) + (t_0 * (((t_2 - 3.0) * ((x1 * 2.0) * t_2)) + ((x1 * x1) * (((2.0 * x2) * 4.0) - 6.0)))))))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]}, If[LessEqual[x1, -1.2e+51], N[(x1 + N[(N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.5e+153], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(t$95$2 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(2.0 * x2), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $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 3\right)\\
t_2 := 2 \cdot x2 - x1\\
\mathbf{if}\;x1 \leq -1.2 \cdot 10^{+51}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{elif}\;x1 \leq 5.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0} + t_0 \cdot \left(\left(t_2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot \left(\left(2 \cdot x2\right) \cdot 4 - 6\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 < -1.1999999999999999e51Initial program 21.0%
Taylor expanded in x1 around 0 1.9%
Taylor expanded in x1 around 0 1.9%
*-commutative1.9%
Simplified1.9%
Taylor expanded in x2 around 0 20.2%
if -1.1999999999999999e51 < x1 < 5.5000000000000003e153Initial program 99.5%
Taylor expanded in x1 around 0 82.9%
Taylor expanded in x1 around 0 78.7%
Taylor expanded in x1 around 0 87.6%
if 5.5000000000000003e153 < x1 Initial program 3.7%
Taylor expanded in x1 around 0 0.2%
Taylor expanded in x1 around 0 6.0%
*-commutative6.0%
Simplified6.0%
flip-+78.0%
Applied egg-rr78.0%
swap-sqr78.0%
metadata-eval78.0%
Simplified78.0%
Final simplification71.6%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.4e+52)
(+ x1 (+ (+ x1 (* 4.0 (* -3.0 (* x1 x2)))) (* 3.0 (* x2 -2.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 <= -1.4e+52) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.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 <= (-1.4d+52)) then
tmp = x1 + ((x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))) + (3.0d0 * (x2 * (-2.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 <= -1.4e+52) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.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 <= -1.4e+52: tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.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 <= -1.4e+52) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))) + Float64(3.0 * Float64(x2 * -2.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 <= -1.4e+52) tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.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, -1.4e+52], N[(x1 + N[(N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.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 -1.4 \cdot 10^{+52}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\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 < -1.4e52Initial program 21.0%
Taylor expanded in x1 around 0 1.9%
Taylor expanded in x1 around 0 1.9%
*-commutative1.9%
Simplified1.9%
Taylor expanded in x2 around 0 20.2%
if -1.4e52 < x1 < 1.35000000000000003e154Initial program 99.5%
Taylor expanded in x1 around 0 82.4%
Taylor expanded in x1 around 0 85.1%
Taylor expanded in x1 around 0 85.2%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.0%
*-commutative6.0%
Simplified6.0%
flip-+80.8%
Applied egg-rr80.8%
swap-sqr80.8%
metadata-eval80.8%
Simplified80.8%
Final simplification70.3%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.4e+52)
(+ x1 (+ (+ x1 (* 4.0 (* -3.0 (* x1 x2)))) (* 3.0 (* x2 -2.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.4e+52) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.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.4d+52)) then
tmp = x1 + ((x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))) + (3.0d0 * (x2 * (-2.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.4e+52) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.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.4e+52: tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.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.4e+52) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))) + Float64(3.0 * Float64(x2 * -2.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.4e+52) tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.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.4e+52], N[(x1 + N[(N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.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.4 \cdot 10^{+52}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\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.4e52Initial program 21.0%
Taylor expanded in x1 around 0 1.9%
Taylor expanded in x1 around 0 1.9%
*-commutative1.9%
Simplified1.9%
Taylor expanded in x2 around 0 20.2%
if -1.4e52 < x1 < 1.35000000000000003e154Initial program 99.5%
Taylor expanded in x1 around 0 78.9%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.0%
*-commutative6.0%
Simplified6.0%
flip-+80.8%
Applied egg-rr80.8%
swap-sqr80.8%
metadata-eval80.8%
Simplified80.8%
Final simplification66.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))))
(if (<= x1 -2.65e+88)
(+ x1 (+ (+ x1 (* 4.0 (* -3.0 (* x1 x2)))) (* 3.0 (* x2 -2.0))))
(if (<= x1 -3.9e-218)
t_0
(if (<= x1 8.5e-236)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 1.05e+136)
t_0
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double tmp;
if (x1 <= -2.65e+88) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0)));
} else if (x1 <= -3.9e-218) {
tmp = t_0;
} else if (x1 <= 8.5e-236) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 1.05e+136) {
tmp = t_0;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
if (x1 <= (-2.65d+88)) then
tmp = x1 + ((x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))) + (3.0d0 * (x2 * (-2.0d0))))
else if (x1 <= (-3.9d-218)) then
tmp = t_0
else if (x1 <= 8.5d-236) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 1.05d+136) then
tmp = t_0
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double tmp;
if (x1 <= -2.65e+88) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0)));
} else if (x1 <= -3.9e-218) {
tmp = t_0;
} else if (x1 <= 8.5e-236) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 1.05e+136) {
tmp = t_0;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) tmp = 0 if x1 <= -2.65e+88: tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0))) elif x1 <= -3.9e-218: tmp = t_0 elif x1 <= 8.5e-236: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 1.05e+136: tmp = t_0 else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))) tmp = 0.0 if (x1 <= -2.65e+88) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))) + Float64(3.0 * Float64(x2 * -2.0)))); elseif (x1 <= -3.9e-218) tmp = t_0; elseif (x1 <= 8.5e-236) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 1.05e+136) tmp = t_0; else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); tmp = 0.0; if (x1 <= -2.65e+88) tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0))); elseif (x1 <= -3.9e-218) tmp = t_0; elseif (x1 <= 8.5e-236) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 1.05e+136) tmp = t_0; else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.65e+88], N[(x1 + N[(N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3.9e-218], t$95$0, If[LessEqual[x1, 8.5e-236], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.05e+136], t$95$0, N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{if}\;x1 \leq -2.65 \cdot 10^{+88}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{elif}\;x1 \leq -3.9 \cdot 10^{-218}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 8.5 \cdot 10^{-236}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 1.05 \cdot 10^{+136}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -2.64999999999999994e88Initial program 6.3%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 0.1%
*-commutative0.1%
Simplified0.1%
Taylor expanded in x2 around 0 21.8%
if -2.64999999999999994e88 < x1 < -3.9e-218 or 8.49999999999999929e-236 < x1 < 1.05e136Initial program 99.4%
Taylor expanded in x1 around 0 72.1%
Taylor expanded in x1 around 0 65.7%
if -3.9e-218 < x1 < 8.49999999999999929e-236Initial program 99.8%
Taylor expanded in x1 around inf 96.9%
*-commutative96.9%
Simplified96.9%
Taylor expanded in x1 around 0 96.9%
if 1.05e136 < x1 Initial program 16.1%
Taylor expanded in x1 around 0 0.7%
Taylor expanded in x1 around 0 5.8%
*-commutative5.8%
Simplified5.8%
flip-+68.5%
Applied egg-rr68.5%
swap-sqr68.5%
metadata-eval68.5%
Simplified68.5%
Final simplification62.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)))))
(t_1 (* 3.0 (* x2 -2.0))))
(if (<= x1 -2.45e+88)
(+ x1 (+ (+ x1 (* 4.0 (* -3.0 (* x1 x2)))) t_1))
(if (<= x1 -6.8e-146)
t_0
(if (<= x1 8.8e-179)
(+ x1 (+ t_1 (+ x1 (* 4.0 (* x2 (* (* x1 2.0) x2))))))
(if (<= x1 1.05e+136)
t_0
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double t_1 = 3.0 * (x2 * -2.0);
double tmp;
if (x1 <= -2.45e+88) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + t_1);
} else if (x1 <= -6.8e-146) {
tmp = t_0;
} else if (x1 <= 8.8e-179) {
tmp = x1 + (t_1 + (x1 + (4.0 * (x2 * ((x1 * 2.0) * x2)))));
} else if (x1 <= 1.05e+136) {
tmp = t_0;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
t_1 = 3.0d0 * (x2 * (-2.0d0))
if (x1 <= (-2.45d+88)) then
tmp = x1 + ((x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))) + t_1)
else if (x1 <= (-6.8d-146)) then
tmp = t_0
else if (x1 <= 8.8d-179) then
tmp = x1 + (t_1 + (x1 + (4.0d0 * (x2 * ((x1 * 2.0d0) * x2)))))
else if (x1 <= 1.05d+136) then
tmp = t_0
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double t_1 = 3.0 * (x2 * -2.0);
double tmp;
if (x1 <= -2.45e+88) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + t_1);
} else if (x1 <= -6.8e-146) {
tmp = t_0;
} else if (x1 <= 8.8e-179) {
tmp = x1 + (t_1 + (x1 + (4.0 * (x2 * ((x1 * 2.0) * x2)))));
} else if (x1 <= 1.05e+136) {
tmp = t_0;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) t_1 = 3.0 * (x2 * -2.0) tmp = 0 if x1 <= -2.45e+88: tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + t_1) elif x1 <= -6.8e-146: tmp = t_0 elif x1 <= 8.8e-179: tmp = x1 + (t_1 + (x1 + (4.0 * (x2 * ((x1 * 2.0) * x2))))) elif x1 <= 1.05e+136: tmp = t_0 else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))) t_1 = Float64(3.0 * Float64(x2 * -2.0)) tmp = 0.0 if (x1 <= -2.45e+88) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))) + t_1)); elseif (x1 <= -6.8e-146) tmp = t_0; elseif (x1 <= 8.8e-179) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(Float64(x1 * 2.0) * x2)))))); elseif (x1 <= 1.05e+136) tmp = t_0; else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); t_1 = 3.0 * (x2 * -2.0); tmp = 0.0; if (x1 <= -2.45e+88) tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + t_1); elseif (x1 <= -6.8e-146) tmp = t_0; elseif (x1 <= 8.8e-179) tmp = x1 + (t_1 + (x1 + (4.0 * (x2 * ((x1 * 2.0) * x2))))); elseif (x1 <= 1.05e+136) tmp = t_0; else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.45e+88], N[(x1 + N[(N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -6.8e-146], t$95$0, If[LessEqual[x1, 8.8e-179], N[(x1 + N[(t$95$1 + N[(x1 + N[(4.0 * N[(x2 * N[(N[(x1 * 2.0), $MachinePrecision] * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.05e+136], t$95$0, N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
t_1 := 3 \cdot \left(x2 \cdot -2\right)\\
\mathbf{if}\;x1 \leq -2.45 \cdot 10^{+88}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right) + t_1\right)\\
\mathbf{elif}\;x1 \leq -6.8 \cdot 10^{-146}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 8.8 \cdot 10^{-179}:\\
\;\;\;\;x1 + \left(t_1 + \left(x1 + 4 \cdot \left(x2 \cdot \left(\left(x1 \cdot 2\right) \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.05 \cdot 10^{+136}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -2.4500000000000001e88Initial program 6.3%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 0.1%
*-commutative0.1%
Simplified0.1%
Taylor expanded in x2 around 0 21.8%
if -2.4500000000000001e88 < x1 < -6.8000000000000001e-146 or 8.80000000000000018e-179 < x1 < 1.05e136Initial program 99.3%
Taylor expanded in x1 around 0 65.3%
Taylor expanded in x1 around 0 62.2%
if -6.8000000000000001e-146 < x1 < 8.80000000000000018e-179Initial program 99.8%
Taylor expanded in x1 around 0 99.8%
Taylor expanded in x1 around 0 92.8%
*-commutative92.8%
Simplified92.8%
Taylor expanded in x2 around inf 92.8%
*-commutative92.8%
associate-*l*92.8%
Simplified92.8%
if 1.05e136 < x1 Initial program 16.1%
Taylor expanded in x1 around 0 0.7%
Taylor expanded in x1 around 0 5.8%
*-commutative5.8%
Simplified5.8%
flip-+68.5%
Applied egg-rr68.5%
swap-sqr68.5%
metadata-eval68.5%
Simplified68.5%
Final simplification62.9%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -4.6e+88)
(+ x1 (+ (+ x1 (* 4.0 (* -3.0 (* x1 x2)))) (* 3.0 (* x2 -2.0))))
(if (<= x1 1.05e+136)
(+
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 <= -4.6e+88) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0)));
} else if (x1 <= 1.05e+136) {
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 <= (-4.6d+88)) then
tmp = x1 + ((x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))) + (3.0d0 * (x2 * (-2.0d0))))
else if (x1 <= 1.05d+136) 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 <= -4.6e+88) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0)));
} else if (x1 <= 1.05e+136) {
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 <= -4.6e+88: tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0))) elif x1 <= 1.05e+136: 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 <= -4.6e+88) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))) + Float64(3.0 * Float64(x2 * -2.0)))); elseif (x1 <= 1.05e+136) 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 <= -4.6e+88) tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0))); elseif (x1 <= 1.05e+136) 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, -4.6e+88], N[(x1 + N[(N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.05e+136], 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 -4.6 \cdot 10^{+88}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{elif}\;x1 \leq 1.05 \cdot 10^{+136}:\\
\;\;\;\;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 < -4.6000000000000003e88Initial program 6.3%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 0.1%
*-commutative0.1%
Simplified0.1%
Taylor expanded in x2 around 0 21.8%
if -4.6000000000000003e88 < x1 < 1.05e136Initial program 99.5%
Taylor expanded in x1 around 0 77.6%
Taylor expanded in x1 around 0 76.9%
+-commutative76.9%
neg-mul-176.9%
unsub-neg76.9%
*-commutative76.9%
Simplified76.9%
if 1.05e136 < x1 Initial program 16.1%
Taylor expanded in x1 around 0 0.7%
Taylor expanded in x1 around 0 5.8%
*-commutative5.8%
Simplified5.8%
flip-+68.5%
Applied egg-rr68.5%
swap-sqr68.5%
metadata-eval68.5%
Simplified68.5%
Final simplification65.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* 8.0 (* x2 (* x1 x2))))))
(if (<= x1 -1.4e+52)
(+ (* x1 2.0) (* x2 (- (* x1 -12.0) 6.0)))
(if (<= x1 -1.12e-82)
t_0
(if (<= x1 4.6e-50)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 4.8e+148)
t_0
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 + (8.0 * (x2 * (x1 * x2)));
double tmp;
if (x1 <= -1.4e+52) {
tmp = (x1 * 2.0) + (x2 * ((x1 * -12.0) - 6.0));
} else if (x1 <= -1.12e-82) {
tmp = t_0;
} else if (x1 <= 4.6e-50) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 4.8e+148) {
tmp = t_0;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + (8.0d0 * (x2 * (x1 * x2)))
if (x1 <= (-1.4d+52)) then
tmp = (x1 * 2.0d0) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))
else if (x1 <= (-1.12d-82)) then
tmp = t_0
else if (x1 <= 4.6d-50) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 4.8d+148) then
tmp = t_0
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (8.0 * (x2 * (x1 * x2)));
double tmp;
if (x1 <= -1.4e+52) {
tmp = (x1 * 2.0) + (x2 * ((x1 * -12.0) - 6.0));
} else if (x1 <= -1.12e-82) {
tmp = t_0;
} else if (x1 <= 4.6e-50) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 4.8e+148) {
tmp = t_0;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (8.0 * (x2 * (x1 * x2))) tmp = 0 if x1 <= -1.4e+52: tmp = (x1 * 2.0) + (x2 * ((x1 * -12.0) - 6.0)) elif x1 <= -1.12e-82: tmp = t_0 elif x1 <= 4.6e-50: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 4.8e+148: tmp = t_0 else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(8.0 * Float64(x2 * Float64(x1 * x2)))) tmp = 0.0 if (x1 <= -1.4e+52) tmp = Float64(Float64(x1 * 2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))); elseif (x1 <= -1.12e-82) tmp = t_0; elseif (x1 <= 4.6e-50) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 4.8e+148) tmp = t_0; else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (8.0 * (x2 * (x1 * x2))); tmp = 0.0; if (x1 <= -1.4e+52) tmp = (x1 * 2.0) + (x2 * ((x1 * -12.0) - 6.0)); elseif (x1 <= -1.12e-82) tmp = t_0; elseif (x1 <= 4.6e-50) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 4.8e+148) tmp = t_0; else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.4e+52], N[(N[(x1 * 2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.12e-82], t$95$0, If[LessEqual[x1, 4.6e-50], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.8e+148], t$95$0, N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\
\mathbf{if}\;x1 \leq -1.4 \cdot 10^{+52}:\\
\;\;\;\;x1 \cdot 2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\\
\mathbf{elif}\;x1 \leq -1.12 \cdot 10^{-82}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 4.6 \cdot 10^{-50}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 4.8 \cdot 10^{+148}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -1.4e52Initial program 21.0%
Taylor expanded in x1 around 0 1.9%
Taylor expanded in x1 around 0 1.9%
*-commutative1.9%
Simplified1.9%
Taylor expanded in x2 around 0 20.2%
if -1.4e52 < x1 < -1.12e-82 or 4.60000000000000039e-50 < x1 < 4.79999999999999989e148Initial program 99.4%
Taylor expanded in x1 around 0 51.2%
Taylor expanded in x1 around 0 38.7%
*-commutative38.7%
Simplified38.7%
Taylor expanded in x2 around inf 36.7%
unpow236.7%
associate-*l*38.0%
Simplified38.0%
if -1.12e-82 < x1 < 4.60000000000000039e-50Initial program 99.5%
Taylor expanded in x1 around inf 79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in x1 around 0 79.7%
if 4.79999999999999989e148 < x1 Initial program 7.1%
Taylor expanded in x1 around 0 0.3%
Taylor expanded in x1 around 0 5.9%
*-commutative5.9%
Simplified5.9%
flip-+75.3%
Applied egg-rr75.3%
swap-sqr75.3%
metadata-eval75.3%
Simplified75.3%
Final simplification54.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* 8.0 (* x2 (* x1 x2))))))
(if (<= x1 -1.4e+52)
(+ x1 (+ (+ x1 (* 4.0 (* -3.0 (* x1 x2)))) (* 3.0 (* x2 -2.0))))
(if (<= x1 -1.12e-82)
t_0
(if (<= x1 3.1e-53)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 4.8e+148)
t_0
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 + (8.0 * (x2 * (x1 * x2)));
double tmp;
if (x1 <= -1.4e+52) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0)));
} else if (x1 <= -1.12e-82) {
tmp = t_0;
} else if (x1 <= 3.1e-53) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 4.8e+148) {
tmp = t_0;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + (8.0d0 * (x2 * (x1 * x2)))
if (x1 <= (-1.4d+52)) then
tmp = x1 + ((x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))) + (3.0d0 * (x2 * (-2.0d0))))
else if (x1 <= (-1.12d-82)) then
tmp = t_0
else if (x1 <= 3.1d-53) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 4.8d+148) then
tmp = t_0
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (8.0 * (x2 * (x1 * x2)));
double tmp;
if (x1 <= -1.4e+52) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0)));
} else if (x1 <= -1.12e-82) {
tmp = t_0;
} else if (x1 <= 3.1e-53) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 4.8e+148) {
tmp = t_0;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (8.0 * (x2 * (x1 * x2))) tmp = 0 if x1 <= -1.4e+52: tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0))) elif x1 <= -1.12e-82: tmp = t_0 elif x1 <= 3.1e-53: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 4.8e+148: tmp = t_0 else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(8.0 * Float64(x2 * Float64(x1 * x2)))) tmp = 0.0 if (x1 <= -1.4e+52) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))) + Float64(3.0 * Float64(x2 * -2.0)))); elseif (x1 <= -1.12e-82) tmp = t_0; elseif (x1 <= 3.1e-53) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 4.8e+148) tmp = t_0; else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (8.0 * (x2 * (x1 * x2))); tmp = 0.0; if (x1 <= -1.4e+52) tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0))); elseif (x1 <= -1.12e-82) tmp = t_0; elseif (x1 <= 3.1e-53) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 4.8e+148) tmp = t_0; else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.4e+52], N[(x1 + N[(N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.12e-82], t$95$0, If[LessEqual[x1, 3.1e-53], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.8e+148], t$95$0, N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\
\mathbf{if}\;x1 \leq -1.4 \cdot 10^{+52}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{elif}\;x1 \leq -1.12 \cdot 10^{-82}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 3.1 \cdot 10^{-53}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 4.8 \cdot 10^{+148}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -1.4e52Initial program 21.0%
Taylor expanded in x1 around 0 1.9%
Taylor expanded in x1 around 0 1.9%
*-commutative1.9%
Simplified1.9%
Taylor expanded in x2 around 0 20.2%
if -1.4e52 < x1 < -1.12e-82 or 3.10000000000000015e-53 < x1 < 4.79999999999999989e148Initial program 99.4%
Taylor expanded in x1 around 0 51.2%
Taylor expanded in x1 around 0 38.7%
*-commutative38.7%
Simplified38.7%
Taylor expanded in x2 around inf 36.7%
unpow236.7%
associate-*l*38.0%
Simplified38.0%
if -1.12e-82 < x1 < 3.10000000000000015e-53Initial program 99.5%
Taylor expanded in x1 around inf 79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in x1 around 0 79.7%
if 4.79999999999999989e148 < x1 Initial program 7.1%
Taylor expanded in x1 around 0 0.3%
Taylor expanded in x1 around 0 5.9%
*-commutative5.9%
Simplified5.9%
flip-+75.3%
Applied egg-rr75.3%
swap-sqr75.3%
metadata-eval75.3%
Simplified75.3%
Final simplification54.6%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.3e+52)
(+ x1 (+ (+ x1 (* 4.0 (* -3.0 (* x1 x2)))) (* 3.0 (* x2 -2.0))))
(if (<= x1 -1.32e-217)
(+ (* x2 -6.0) (* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))
(if (<= x1 4.9e-51)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 4.8e+148)
(+ x1 (* 8.0 (* x2 (* x1 x2))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.3e+52) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0)));
} else if (x1 <= -1.32e-217) {
tmp = (x2 * -6.0) + (x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else if (x1 <= 4.9e-51) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 4.8e+148) {
tmp = x1 + (8.0 * (x2 * (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 (x1 <= (-1.3d+52)) then
tmp = x1 + ((x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))) + (3.0d0 * (x2 * (-2.0d0))))
else if (x1 <= (-1.32d-217)) then
tmp = (x2 * (-6.0d0)) + (x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
else if (x1 <= 4.9d-51) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 4.8d+148) then
tmp = x1 + (8.0d0 * (x2 * (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 (x1 <= -1.3e+52) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0)));
} else if (x1 <= -1.32e-217) {
tmp = (x2 * -6.0) + (x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else if (x1 <= 4.9e-51) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 4.8e+148) {
tmp = x1 + (8.0 * (x2 * (x1 * x2)));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.3e+52: tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0))) elif x1 <= -1.32e-217: tmp = (x2 * -6.0) + (x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) elif x1 <= 4.9e-51: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 4.8e+148: tmp = x1 + (8.0 * (x2 * (x1 * x2))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.3e+52) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))) + Float64(3.0 * Float64(x2 * -2.0)))); elseif (x1 <= -1.32e-217) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); elseif (x1 <= 4.9e-51) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 4.8e+148) tmp = Float64(x1 + Float64(8.0 * Float64(x2 * 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 (x1 <= -1.3e+52) tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0))); elseif (x1 <= -1.32e-217) tmp = (x2 * -6.0) + (x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); elseif (x1 <= 4.9e-51) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 4.8e+148) tmp = x1 + (8.0 * (x2 * (x1 * x2))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.3e+52], N[(x1 + N[(N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.32e-217], N[(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]), $MachinePrecision], If[LessEqual[x1, 4.9e-51], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.8e+148], N[(x1 + N[(8.0 * N[(x2 * N[(x1 * x2), $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.3 \cdot 10^{+52}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{elif}\;x1 \leq -1.32 \cdot 10^{-217}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-51}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 4.8 \cdot 10^{+148}:\\
\;\;\;\;x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\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.3e52Initial program 21.0%
Taylor expanded in x1 around 0 1.9%
Taylor expanded in x1 around 0 1.9%
*-commutative1.9%
Simplified1.9%
Taylor expanded in x2 around 0 20.2%
if -1.3e52 < x1 < -1.32000000000000009e-217Initial program 99.4%
Taylor expanded in x1 around 0 81.7%
Taylor expanded in x1 around 0 64.1%
*-commutative64.1%
Simplified64.1%
Taylor expanded in x1 around 0 58.4%
if -1.32000000000000009e-217 < x1 < 4.89999999999999974e-51Initial program 99.5%
Taylor expanded in x1 around inf 83.9%
*-commutative83.9%
Simplified83.9%
Taylor expanded in x1 around 0 84.3%
if 4.89999999999999974e-51 < x1 < 4.79999999999999989e148Initial program 99.6%
Taylor expanded in x1 around 0 39.9%
Taylor expanded in x1 around 0 30.4%
*-commutative30.4%
Simplified30.4%
Taylor expanded in x2 around inf 30.4%
unpow230.4%
associate-*l*30.4%
Simplified30.4%
if 4.79999999999999989e148 < x1 Initial program 7.1%
Taylor expanded in x1 around 0 0.3%
Taylor expanded in x1 around 0 5.9%
*-commutative5.9%
Simplified5.9%
flip-+75.3%
Applied egg-rr75.3%
swap-sqr75.3%
metadata-eval75.3%
Simplified75.3%
Final simplification55.3%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -1.06e-157) (not (<= x1 7.5e-183))) (+ x1 (* 8.0 (* x2 (* x1 x2)))) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.06e-157) || !(x1 <= 7.5e-183)) {
tmp = x1 + (8.0 * (x2 * (x1 * x2)));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-1.06d-157)) .or. (.not. (x1 <= 7.5d-183))) then
tmp = x1 + (8.0d0 * (x2 * (x1 * x2)))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.06e-157) || !(x1 <= 7.5e-183)) {
tmp = x1 + (8.0 * (x2 * (x1 * x2)));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -1.06e-157) or not (x1 <= 7.5e-183): tmp = x1 + (8.0 * (x2 * (x1 * x2))) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -1.06e-157) || !(x1 <= 7.5e-183)) tmp = Float64(x1 + Float64(8.0 * Float64(x2 * Float64(x1 * x2)))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -1.06e-157) || ~((x1 <= 7.5e-183))) tmp = x1 + (8.0 * (x2 * (x1 * x2))); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -1.06e-157], N[Not[LessEqual[x1, 7.5e-183]], $MachinePrecision]], N[(x1 + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.06 \cdot 10^{-157} \lor \neg \left(x1 \leq 7.5 \cdot 10^{-183}\right):\\
\;\;\;\;x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -1.06e-157 or 7.5000000000000004e-183 < x1 Initial program 63.6%
Taylor expanded in x1 around 0 39.9%
Taylor expanded in x1 around 0 30.3%
*-commutative30.3%
Simplified30.3%
Taylor expanded in x2 around inf 23.9%
unpow223.9%
associate-*l*25.7%
Simplified25.7%
if -1.06e-157 < x1 < 7.5000000000000004e-183Initial program 99.8%
Taylor expanded in x1 around 0 99.8%
Taylor expanded in x1 around 0 82.3%
*-commutative82.3%
Simplified82.3%
Taylor expanded in x1 around 0 82.5%
*-commutative82.5%
Simplified82.5%
Final simplification38.8%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -4.7e+139) (not (<= x2 2.9e+143))) (+ x1 (* 8.0 (* x2 (* x1 x2)))) (+ x1 (+ (* x2 -6.0) (* x1 -2.0)))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -4.7e+139) || !(x2 <= 2.9e+143)) {
tmp = x1 + (8.0 * (x2 * (x1 * x2)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-4.7d+139)) .or. (.not. (x2 <= 2.9d+143))) then
tmp = x1 + (8.0d0 * (x2 * (x1 * x2)))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -4.7e+139) || !(x2 <= 2.9e+143)) {
tmp = x1 + (8.0 * (x2 * (x1 * x2)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -4.7e+139) or not (x2 <= 2.9e+143): tmp = x1 + (8.0 * (x2 * (x1 * x2))) else: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -4.7e+139) || !(x2 <= 2.9e+143)) tmp = Float64(x1 + Float64(8.0 * Float64(x2 * Float64(x1 * x2)))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -4.7e+139) || ~((x2 <= 2.9e+143))) tmp = x1 + (8.0 * (x2 * (x1 * x2))); else tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -4.7e+139], N[Not[LessEqual[x2, 2.9e+143]], $MachinePrecision]], N[(x1 + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -4.7 \cdot 10^{+139} \lor \neg \left(x2 \leq 2.9 \cdot 10^{+143}\right):\\
\;\;\;\;x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\end{array}
\end{array}
if x2 < -4.7000000000000001e139 or 2.8999999999999998e143 < x2 Initial program 76.7%
Taylor expanded in x1 around 0 73.8%
Taylor expanded in x1 around 0 81.1%
*-commutative81.1%
Simplified81.1%
Taylor expanded in x2 around inf 55.2%
unpow255.2%
associate-*l*65.2%
Simplified65.2%
if -4.7000000000000001e139 < x2 < 2.8999999999999998e143Initial program 70.1%
Taylor expanded in x1 around inf 69.6%
*-commutative69.6%
Simplified69.6%
Taylor expanded in x1 around 0 43.6%
Final simplification49.4%
(FPCore (x1 x2) :precision binary64 (+ x1 (* x2 -6.0)))
double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + (x2 * (-6.0d0))
end function
public static double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
def code(x1, x2): return x1 + (x2 * -6.0)
function code(x1, x2) return Float64(x1 + Float64(x2 * -6.0)) end
function tmp = code(x1, x2) tmp = x1 + (x2 * -6.0); end
code[x1_, x2_] := N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + x2 \cdot -6
\end{array}
Initial program 71.9%
Taylor expanded in x1 around 0 53.7%
Taylor expanded in x1 around 0 24.5%
*-commutative24.5%
Simplified24.5%
Final simplification24.5%
(FPCore (x1 x2) :precision binary64 (* x2 -6.0))
double code(double x1, double x2) {
return x2 * -6.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * (-6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * -6.0;
}
def code(x1, x2): return x2 * -6.0
function code(x1, x2) return Float64(x2 * -6.0) end
function tmp = code(x1, x2) tmp = x2 * -6.0; end
code[x1_, x2_] := N[(x2 * -6.0), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6
\end{array}
Initial program 71.9%
Taylor expanded in x1 around 0 53.7%
Taylor expanded in x1 around 0 24.5%
*-commutative24.5%
Simplified24.5%
Taylor expanded in x1 around 0 24.5%
*-commutative24.5%
Simplified24.5%
Final simplification24.5%
herbie shell --seed 2023257
(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))))))