
(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 21 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 (* 3.0 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ t_1 (* 2.0 x2)))
(t_3 (fma x1 (* x1 3.0) (* 2.0 x2)))
(t_4 (/ (- t_3 x1) (fma x1 x1 1.0)))
(t_5 (+ (* x1 x1) 1.0))
(t_6 (/ (- x1 t_2) t_5))
(t_7 (/ (- x1 t_3) (fma x1 x1 1.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_5
(-
(* (* (* x1 2.0) t_6) (+ 3.0 t_6))
(* (* x1 x1) (+ 6.0 (* 4.0 t_6)))))
(* t_1 (/ (- t_2 x1) t_5)))
(* x1 (* x1 x1))))
(* 3.0 (/ (- x1 (- t_1 (* 2.0 x2))) (- -1.0 (* x1 x1))))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_0 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_4 4.0 -6.0)) (* (* x1 (* 2.0 t_7)) (- t_7 -3.0)))
(fma t_0 t_4 (pow x1 3.0))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = 3.0 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = t_1 + (2.0 * x2);
double t_3 = fma(x1, (x1 * 3.0), (2.0 * x2));
double t_4 = (t_3 - x1) / fma(x1, x1, 1.0);
double t_5 = (x1 * x1) + 1.0;
double t_6 = (x1 - t_2) / t_5;
double t_7 = (x1 - t_3) / fma(x1, x1, 1.0);
double tmp;
if ((x1 + ((x1 + (((t_5 * ((((x1 * 2.0) * t_6) * (3.0 + t_6)) - ((x1 * x1) * (6.0 + (4.0 * t_6))))) + (t_1 * ((t_2 - x1) / t_5))) + (x1 * (x1 * x1)))) + (3.0 * ((x1 - (t_1 - (2.0 * x2))) / (-1.0 - (x1 * x1)))))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_4, 4.0, -6.0)), ((x1 * (2.0 * t_7)) * (t_7 - -3.0))), fma(t_0, t_4, pow(x1, 3.0)))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(3.0 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(t_1 + Float64(2.0 * x2)) t_3 = fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) t_4 = Float64(Float64(t_3 - x1) / fma(x1, x1, 1.0)) t_5 = Float64(Float64(x1 * x1) + 1.0) t_6 = Float64(Float64(x1 - t_2) / t_5) t_7 = Float64(Float64(x1 - t_3) / fma(x1, x1, 1.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_5 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_6) * Float64(3.0 + t_6)) - Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_6))))) + Float64(t_1 * Float64(Float64(t_2 - x1) / t_5))) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(x1 - Float64(t_1 - Float64(2.0 * x2))) / Float64(-1.0 - Float64(x1 * x1)))))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_4, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_7)) * Float64(t_7 - -3.0))), fma(t_0, t_4, (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 - t$95$2), $MachinePrecision] / t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 - t$95$3), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$5 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$6), $MachinePrecision] * N[(3.0 + t$95$6), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(N[(t$95$2 - x1), $MachinePrecision] / t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x1 - N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$0 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$4 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$7), $MachinePrecision]), $MachinePrecision] * N[(t$95$7 - -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$4 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := t\_1 + 2 \cdot x2\\
t_3 := \mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right)\\
t_4 := \frac{t\_3 - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_5 := x1 \cdot x1 + 1\\
t_6 := \frac{x1 - t\_2}{t\_5}\\
t_7 := \frac{x1 - t\_3}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_5 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_6\right) \cdot \left(3 + t\_6\right) - \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_6\right)\right) + t\_1 \cdot \frac{t\_2 - x1}{t\_5}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{x1 - \left(t\_1 - 2 \cdot x2\right)}{-1 - x1 \cdot x1}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_0 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_4, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_7\right)\right) \cdot \left(t\_7 - -3\right)\right), \mathsf{fma}\left(t\_0, t\_4, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
Simplified99.6%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification99.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (/ (- (fma (* x1 3.0) x1 (* 2.0 x2)) x1) (fma x1 x1 1.0)))
(t_1 (* x1 (* x1 x1)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (+ t_2 (* 2.0 x2)))
(t_4 (+ (* x1 x1) 1.0))
(t_5 (/ (- x1 t_3) t_4)))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_4
(-
(* (* (* x1 2.0) t_5) (+ 3.0 t_5))
(* (* x1 x1) (+ 6.0 (* 4.0 t_5)))))
(* t_2 (/ (- t_3 x1) t_4)))
t_1))
(* 3.0 (/ (- x1 (- t_2 (* 2.0 x2))) (- -1.0 (* x1 x1))))))
INFINITY)
(+
x1
(+
(+
t_1
(fma
(fma (* (* x1 2.0) t_0) (+ -3.0 t_0) (* (* x1 x1) (fma 4.0 t_0 -6.0)))
(fma x1 x1 1.0)
(* t_2 t_0)))
(- x1 (* 3.0 (/ (- (+ x1 (* 2.0 x2)) t_2) (fma x1 x1 1.0))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = (fma((x1 * 3.0), x1, (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = t_2 + (2.0 * x2);
double t_4 = (x1 * x1) + 1.0;
double t_5 = (x1 - t_3) / t_4;
double tmp;
if ((x1 + ((x1 + (((t_4 * ((((x1 * 2.0) * t_5) * (3.0 + t_5)) - ((x1 * x1) * (6.0 + (4.0 * t_5))))) + (t_2 * ((t_3 - x1) / t_4))) + t_1)) + (3.0 * ((x1 - (t_2 - (2.0 * x2))) / (-1.0 - (x1 * x1)))))) <= ((double) INFINITY)) {
tmp = x1 + ((t_1 + fma(fma(((x1 * 2.0) * t_0), (-3.0 + t_0), ((x1 * x1) * fma(4.0, t_0, -6.0))), fma(x1, x1, 1.0), (t_2 * t_0))) + (x1 - (3.0 * (((x1 + (2.0 * x2)) - t_2) / fma(x1, x1, 1.0)))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(t_2 + Float64(2.0 * x2)) t_4 = Float64(Float64(x1 * x1) + 1.0) t_5 = Float64(Float64(x1 - t_3) / t_4) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_4 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_5) * Float64(3.0 + t_5)) - Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))))) + Float64(t_2 * Float64(Float64(t_3 - x1) / t_4))) + t_1)) + Float64(3.0 * Float64(Float64(x1 - Float64(t_2 - Float64(2.0 * x2))) / Float64(-1.0 - Float64(x1 * x1)))))) <= Inf) tmp = Float64(x1 + Float64(Float64(t_1 + fma(fma(Float64(Float64(x1 * 2.0) * t_0), Float64(-3.0 + t_0), Float64(Float64(x1 * x1) * fma(4.0, t_0, -6.0))), fma(x1, x1, 1.0), Float64(t_2 * t_0))) + Float64(x1 - Float64(3.0 * Float64(Float64(Float64(x1 + Float64(2.0 * x2)) - t_2) / fma(x1, x1, 1.0)))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 - t$95$3), $MachinePrecision] / t$95$4), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$4 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(N[(t$95$3 - x1), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x1 - N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(N[(t$95$1 + N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(-3.0 + t$95$0), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(4.0 * t$95$0 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x1 * x1 + 1.0), $MachinePrecision] + N[(t$95$2 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 - N[(3.0 * N[(N[(N[(x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := t\_2 + 2 \cdot x2\\
t_4 := x1 \cdot x1 + 1\\
t_5 := \frac{x1 - t\_3}{t\_4}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_4 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_5\right) \cdot \left(3 + t\_5\right) - \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right)\right) + t\_2 \cdot \frac{t\_3 - x1}{t\_4}\right) + t\_1\right)\right) + 3 \cdot \frac{x1 - \left(t\_2 - 2 \cdot x2\right)}{-1 - x1 \cdot x1}\right) \leq \infty:\\
\;\;\;\;x1 + \left(\left(t\_1 + \mathsf{fma}\left(\mathsf{fma}\left(\left(x1 \cdot 2\right) \cdot t\_0, -3 + t\_0, \left(x1 \cdot x1\right) \cdot \mathsf{fma}\left(4, t\_0, -6\right)\right), \mathsf{fma}\left(x1, x1, 1\right), t\_2 \cdot t\_0\right)\right) + \left(x1 - 3 \cdot \frac{\left(x1 + 2 \cdot x2\right) - t\_2}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
Simplified99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ t_1 (* 2.0 x2)))
(t_3 (- x1 (- t_1 (* 2.0 x2))))
(t_4 (- -1.0 (* x1 x1)))
(t_5 (+ (* x1 x1) 1.0))
(t_6 (* t_1 (/ (- t_2 x1) t_5)))
(t_7 (/ (- x1 t_2) t_5))
(t_8 (* (* x1 2.0) t_7))
(t_9 (* (* x1 x1) (+ 6.0 (* 4.0 t_7)))))
(if (<=
(+
x1
(+
(+ x1 (+ (+ (* t_5 (- (* t_8 (+ 3.0 t_7)) t_9)) t_6) t_0))
(* 3.0 (/ t_3 t_4))))
INFINITY)
(-
x1
(-
(* 3.0 (/ t_3 t_5))
(+
x1
(+
t_0
(-
t_6
(*
(-
(*
t_8
(+
3.0
(*
(/ 1.0 (fma x1 x1 1.0))
(- x1 (fma 3.0 (pow x1 2.0) (* 2.0 x2))))))
t_9)
t_4))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = t_1 + (2.0 * x2);
double t_3 = x1 - (t_1 - (2.0 * x2));
double t_4 = -1.0 - (x1 * x1);
double t_5 = (x1 * x1) + 1.0;
double t_6 = t_1 * ((t_2 - x1) / t_5);
double t_7 = (x1 - t_2) / t_5;
double t_8 = (x1 * 2.0) * t_7;
double t_9 = (x1 * x1) * (6.0 + (4.0 * t_7));
double tmp;
if ((x1 + ((x1 + (((t_5 * ((t_8 * (3.0 + t_7)) - t_9)) + t_6) + t_0)) + (3.0 * (t_3 / t_4)))) <= ((double) INFINITY)) {
tmp = x1 - ((3.0 * (t_3 / t_5)) - (x1 + (t_0 + (t_6 - (((t_8 * (3.0 + ((1.0 / fma(x1, x1, 1.0)) * (x1 - fma(3.0, pow(x1, 2.0), (2.0 * x2)))))) - t_9) * t_4)))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(t_1 + Float64(2.0 * x2)) t_3 = Float64(x1 - Float64(t_1 - Float64(2.0 * x2))) t_4 = Float64(-1.0 - Float64(x1 * x1)) t_5 = Float64(Float64(x1 * x1) + 1.0) t_6 = Float64(t_1 * Float64(Float64(t_2 - x1) / t_5)) t_7 = Float64(Float64(x1 - t_2) / t_5) t_8 = Float64(Float64(x1 * 2.0) * t_7) t_9 = Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_7))) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_5 * Float64(Float64(t_8 * Float64(3.0 + t_7)) - t_9)) + t_6) + t_0)) + Float64(3.0 * Float64(t_3 / t_4)))) <= Inf) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(t_3 / t_5)) - Float64(x1 + Float64(t_0 + Float64(t_6 - Float64(Float64(Float64(t_8 * Float64(3.0 + Float64(Float64(1.0 / fma(x1, x1, 1.0)) * Float64(x1 - fma(3.0, (x1 ^ 2.0), Float64(2.0 * x2)))))) - t_9) * t_4)))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 - N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$1 * N[(N[(t$95$2 - x1), $MachinePrecision] / t$95$5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 - t$95$2), $MachinePrecision] / t$95$5), $MachinePrecision]}, Block[{t$95$8 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$7), $MachinePrecision]}, Block[{t$95$9 = N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$5 * N[(N[(t$95$8 * N[(3.0 + t$95$7), $MachinePrecision]), $MachinePrecision] - t$95$9), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(t$95$3 / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 - N[(N[(3.0 * N[(t$95$3 / t$95$5), $MachinePrecision]), $MachinePrecision] - N[(x1 + N[(t$95$0 + N[(t$95$6 - N[(N[(N[(t$95$8 * N[(3.0 + N[(N[(1.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] * N[(x1 - N[(3.0 * N[Power[x1, 2.0], $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$9), $MachinePrecision] * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := t\_1 + 2 \cdot x2\\
t_3 := x1 - \left(t\_1 - 2 \cdot x2\right)\\
t_4 := -1 - x1 \cdot x1\\
t_5 := x1 \cdot x1 + 1\\
t_6 := t\_1 \cdot \frac{t\_2 - x1}{t\_5}\\
t_7 := \frac{x1 - t\_2}{t\_5}\\
t_8 := \left(x1 \cdot 2\right) \cdot t\_7\\
t_9 := \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_7\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_5 \cdot \left(t\_8 \cdot \left(3 + t\_7\right) - t\_9\right) + t\_6\right) + t\_0\right)\right) + 3 \cdot \frac{t\_3}{t\_4}\right) \leq \infty:\\
\;\;\;\;x1 - \left(3 \cdot \frac{t\_3}{t\_5} - \left(x1 + \left(t\_0 + \left(t\_6 - \left(t\_8 \cdot \left(3 + \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(x1 - \mathsf{fma}\left(3, {x1}^{2}, 2 \cdot x2\right)\right)\right) - t\_9\right) \cdot t\_4\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
fma-define99.4%
div-inv99.4%
associate-*r*99.4%
fma-define99.4%
pow299.4%
Applied egg-rr99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ t_0 (* 2.0 x2)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- x1 t_1) t_2))
(t_4
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(-
(* (* (* x1 2.0) t_3) (+ 3.0 t_3))
(* (* x1 x1) (+ 6.0 (* 4.0 t_3)))))
(* t_0 (/ (- t_1 x1) t_2)))
(* x1 (* x1 x1))))
(* 3.0 (/ (- x1 (- t_0 (* 2.0 x2))) (- -1.0 (* x1 x1))))))))
(if (<= t_4 INFINITY) t_4 (+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = t_0 + (2.0 * x2);
double t_2 = (x1 * x1) + 1.0;
double t_3 = (x1 - t_1) / t_2;
double t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (3.0 + t_3)) - ((x1 * x1) * (6.0 + (4.0 * t_3))))) + (t_0 * ((t_1 - x1) / t_2))) + (x1 * (x1 * x1)))) + (3.0 * ((x1 - (t_0 - (2.0 * x2))) / (-1.0 - (x1 * x1)))));
double tmp;
if (t_4 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = t_0 + (2.0 * x2);
double t_2 = (x1 * x1) + 1.0;
double t_3 = (x1 - t_1) / t_2;
double t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (3.0 + t_3)) - ((x1 * x1) * (6.0 + (4.0 * t_3))))) + (t_0 * ((t_1 - x1) / t_2))) + (x1 * (x1 * x1)))) + (3.0 * ((x1 - (t_0 - (2.0 * x2))) / (-1.0 - (x1 * x1)))));
double tmp;
if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = t_4;
} else {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = t_0 + (2.0 * x2) t_2 = (x1 * x1) + 1.0 t_3 = (x1 - t_1) / t_2 t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (3.0 + t_3)) - ((x1 * x1) * (6.0 + (4.0 * t_3))))) + (t_0 * ((t_1 - x1) / t_2))) + (x1 * (x1 * x1)))) + (3.0 * ((x1 - (t_0 - (2.0 * x2))) / (-1.0 - (x1 * x1))))) tmp = 0 if t_4 <= math.inf: tmp = t_4 else: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(t_0 + Float64(2.0 * x2)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(x1 - t_1) / t_2) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_3)) - Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_3))))) + Float64(t_0 * Float64(Float64(t_1 - x1) / t_2))) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(x1 - Float64(t_0 - Float64(2.0 * x2))) / Float64(-1.0 - Float64(x1 * x1)))))) tmp = 0.0 if (t_4 <= Inf) tmp = t_4; else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = t_0 + (2.0 * x2); t_2 = (x1 * x1) + 1.0; t_3 = (x1 - t_1) / t_2; t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (3.0 + t_3)) - ((x1 * x1) * (6.0 + (4.0 * t_3))))) + (t_0 * ((t_1 - x1) / t_2))) + (x1 * (x1 * x1)))) + (3.0 * ((x1 - (t_0 - (2.0 * x2))) / (-1.0 - (x1 * x1))))); tmp = 0.0; if (t_4 <= Inf) tmp = t_4; else tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 - t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$3), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(t$95$1 - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x1 - N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, Infinity], t$95$4, N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := t\_0 + 2 \cdot x2\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{x1 - t\_1}{t\_2}\\
t_4 := x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_3\right) - \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_3\right)\right) + t\_0 \cdot \frac{t\_1 - x1}{t\_2}\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{x1 - \left(t\_0 - 2 \cdot x2\right)}{-1 - x1 \cdot x1}\right)\\
\mathbf{if}\;t\_4 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* x1 (- 2.0 (* x1 9.0))))
(t_3 (+ t_1 (* 2.0 x2)))
(t_4 (/ (- x1 t_3) t_0))
(t_5
(+
x1
(-
9.0
(-
(-
(+
(* t_1 t_4)
(*
t_0
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_4)))
(* (- (/ (- t_3 x1) t_0) 3.0) (* (* x1 2.0) t_4)))))
(* x1 (* x1 x1)))
x1)))))
(if (<= x1 -9.5e+115)
(- x1 (* x2 (+ 6.0 (/ t_2 x2))))
(if (<= x1 -0.0025)
t_5
(if (<= x1 4e-18)
(+
(* x2 -6.0)
(+
(* x1 (+ -1.0 (* x1 9.0)))
(* x2 (+ (* 8.0 (* x1 x2)) (* x1 (- (* x1 12.0) 12.0))))))
(if (<= x1 4e+150) t_5 (- x1 t_2)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 * (2.0 - (x1 * 9.0));
double t_3 = t_1 + (2.0 * x2);
double t_4 = (x1 - t_3) / t_0;
double t_5 = x1 + (9.0 - ((((t_1 * t_4) + (t_0 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + ((((t_3 - x1) / t_0) - 3.0) * ((x1 * 2.0) * t_4))))) - (x1 * (x1 * x1))) - x1));
double tmp;
if (x1 <= -9.5e+115) {
tmp = x1 - (x2 * (6.0 + (t_2 / x2)));
} else if (x1 <= -0.0025) {
tmp = t_5;
} else if (x1 <= 4e-18) {
tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))));
} else if (x1 <= 4e+150) {
tmp = t_5;
} else {
tmp = x1 - t_2;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = x1 * (2.0d0 - (x1 * 9.0d0))
t_3 = t_1 + (2.0d0 * x2)
t_4 = (x1 - t_3) / t_0
t_5 = x1 + (9.0d0 - ((((t_1 * t_4) + (t_0 * (((x1 * x1) * (6.0d0 + (4.0d0 * t_4))) + ((((t_3 - x1) / t_0) - 3.0d0) * ((x1 * 2.0d0) * t_4))))) - (x1 * (x1 * x1))) - x1))
if (x1 <= (-9.5d+115)) then
tmp = x1 - (x2 * (6.0d0 + (t_2 / x2)))
else if (x1 <= (-0.0025d0)) then
tmp = t_5
else if (x1 <= 4d-18) then
tmp = (x2 * (-6.0d0)) + ((x1 * ((-1.0d0) + (x1 * 9.0d0))) + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * ((x1 * 12.0d0) - 12.0d0)))))
else if (x1 <= 4d+150) then
tmp = t_5
else
tmp = x1 - t_2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 * (2.0 - (x1 * 9.0));
double t_3 = t_1 + (2.0 * x2);
double t_4 = (x1 - t_3) / t_0;
double t_5 = x1 + (9.0 - ((((t_1 * t_4) + (t_0 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + ((((t_3 - x1) / t_0) - 3.0) * ((x1 * 2.0) * t_4))))) - (x1 * (x1 * x1))) - x1));
double tmp;
if (x1 <= -9.5e+115) {
tmp = x1 - (x2 * (6.0 + (t_2 / x2)));
} else if (x1 <= -0.0025) {
tmp = t_5;
} else if (x1 <= 4e-18) {
tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))));
} else if (x1 <= 4e+150) {
tmp = t_5;
} else {
tmp = x1 - t_2;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = x1 * (2.0 - (x1 * 9.0)) t_3 = t_1 + (2.0 * x2) t_4 = (x1 - t_3) / t_0 t_5 = x1 + (9.0 - ((((t_1 * t_4) + (t_0 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + ((((t_3 - x1) / t_0) - 3.0) * ((x1 * 2.0) * t_4))))) - (x1 * (x1 * x1))) - x1)) tmp = 0 if x1 <= -9.5e+115: tmp = x1 - (x2 * (6.0 + (t_2 / x2))) elif x1 <= -0.0025: tmp = t_5 elif x1 <= 4e-18: tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))) elif x1 <= 4e+150: tmp = t_5 else: tmp = x1 - t_2 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(x1 * Float64(2.0 - Float64(x1 * 9.0))) t_3 = Float64(t_1 + Float64(2.0 * x2)) t_4 = Float64(Float64(x1 - t_3) / t_0) t_5 = Float64(x1 + Float64(9.0 - Float64(Float64(Float64(Float64(t_1 * t_4) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_4))) + Float64(Float64(Float64(Float64(t_3 - x1) / t_0) - 3.0) * Float64(Float64(x1 * 2.0) * t_4))))) - Float64(x1 * Float64(x1 * x1))) - x1))) tmp = 0.0 if (x1 <= -9.5e+115) tmp = Float64(x1 - Float64(x2 * Float64(6.0 + Float64(t_2 / x2)))); elseif (x1 <= -0.0025) tmp = t_5; elseif (x1 <= 4e-18) tmp = Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0))) + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(x1 * 12.0) - 12.0)))))); elseif (x1 <= 4e+150) tmp = t_5; else tmp = Float64(x1 - t_2); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = x1 * (2.0 - (x1 * 9.0)); t_3 = t_1 + (2.0 * x2); t_4 = (x1 - t_3) / t_0; t_5 = x1 + (9.0 - ((((t_1 * t_4) + (t_0 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + ((((t_3 - x1) / t_0) - 3.0) * ((x1 * 2.0) * t_4))))) - (x1 * (x1 * x1))) - x1)); tmp = 0.0; if (x1 <= -9.5e+115) tmp = x1 - (x2 * (6.0 + (t_2 / x2))); elseif (x1 <= -0.0025) tmp = t_5; elseif (x1 <= 4e-18) tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))); elseif (x1 <= 4e+150) tmp = t_5; else tmp = x1 - t_2; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 - t$95$3), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(9.0 - N[(N[(N[(N[(t$95$1 * t$95$4), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(t$95$3 - x1), $MachinePrecision] / t$95$0), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -9.5e+115], N[(x1 - N[(x2 * N[(6.0 + N[(t$95$2 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.0025], t$95$5, If[LessEqual[x1, 4e-18], N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 12.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4e+150], t$95$5, N[(x1 - t$95$2), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot \left(2 - x1 \cdot 9\right)\\
t_3 := t\_1 + 2 \cdot x2\\
t_4 := \frac{x1 - t\_3}{t\_0}\\
t_5 := x1 + \left(9 - \left(\left(\left(t\_1 \cdot t\_4 + t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_4\right) + \left(\frac{t\_3 - x1}{t\_0} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot t\_4\right)\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{+115}:\\
\;\;\;\;x1 - x2 \cdot \left(6 + \frac{t\_2}{x2}\right)\\
\mathbf{elif}\;x1 \leq -0.0025:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{-18}:\\
\;\;\;\;x2 \cdot -6 + \left(x1 \cdot \left(-1 + x1 \cdot 9\right) + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(x1 \cdot 12 - 12\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{+150}:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;x1 - t\_2\\
\end{array}
\end{array}
if x1 < -9.4999999999999997e115Initial program 0.0%
Simplified32.5%
Taylor expanded in x1 around 0 44.8%
Taylor expanded in x2 around 0 70.2%
Taylor expanded in x2 around inf 95.4%
if -9.4999999999999997e115 < x1 < -0.00250000000000000005 or 4.0000000000000003e-18 < x1 < 3.99999999999999992e150Initial program 99.4%
Taylor expanded in x1 around inf 98.4%
metadata-eval73.7%
Applied egg-rr98.4%
if -0.00250000000000000005 < x1 < 4.0000000000000003e-18Initial program 99.5%
Simplified89.4%
Taylor expanded in x1 around 0 89.5%
Taylor expanded in x2 around 0 99.9%
if 3.99999999999999992e150 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 70.7%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Final simplification98.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- x1 (+ t_2 (* 2.0 x2))) t_1))
(t_4 (+ 3.0 t_3))
(t_5 (* (* x1 x1) (+ 6.0 (* 4.0 t_3)))))
(if (<= x1 -9.5e+115)
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0))
(if (<= x1 4e-18)
(+
x1
(-
(* 3.0 (/ (- x1 (- t_2 (* 2.0 x2))) (- -1.0 (* x1 x1))))
(-
(-
(+
(* t_2 t_3)
(* t_1 (+ t_5 (* (* (* x1 2.0) (- (* 2.0 x2) x1)) t_4))))
t_0)
x1)))
(if (<= x1 4e+150)
(+
x1
(+
9.0
(+
x1
(+
t_0
(+
(* t_1 (- (* (* (* x1 2.0) t_3) t_4) t_5))
(* t_2 (+ 3.0 (/ (- -1.0 (/ (- 3.0 (* 2.0 x2)) x1)) x1))))))))
(- x1 (* x1 (- 2.0 (* x1 9.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 - (t_2 + (2.0 * x2))) / t_1;
double t_4 = 3.0 + t_3;
double t_5 = (x1 * x1) * (6.0 + (4.0 * t_3));
double tmp;
if (x1 <= -9.5e+115) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
} else if (x1 <= 4e-18) {
tmp = x1 + ((3.0 * ((x1 - (t_2 - (2.0 * x2))) / (-1.0 - (x1 * x1)))) - ((((t_2 * t_3) + (t_1 * (t_5 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * t_4)))) - t_0) - x1));
} else if (x1 <= 4e+150) {
tmp = x1 + (9.0 + (x1 + (t_0 + ((t_1 * ((((x1 * 2.0) * t_3) * t_4) - t_5)) + (t_2 * (3.0 + ((-1.0 - ((3.0 - (2.0 * x2)) / x1)) / x1)))))));
} else {
tmp = x1 - (x1 * (2.0 - (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 * (x1 * 3.0d0)
t_3 = (x1 - (t_2 + (2.0d0 * x2))) / t_1
t_4 = 3.0d0 + t_3
t_5 = (x1 * x1) * (6.0d0 + (4.0d0 * t_3))
if (x1 <= (-9.5d+115)) then
tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
else if (x1 <= 4d-18) then
tmp = x1 + ((3.0d0 * ((x1 - (t_2 - (2.0d0 * x2))) / ((-1.0d0) - (x1 * x1)))) - ((((t_2 * t_3) + (t_1 * (t_5 + (((x1 * 2.0d0) * ((2.0d0 * x2) - x1)) * t_4)))) - t_0) - x1))
else if (x1 <= 4d+150) then
tmp = x1 + (9.0d0 + (x1 + (t_0 + ((t_1 * ((((x1 * 2.0d0) * t_3) * t_4) - t_5)) + (t_2 * (3.0d0 + (((-1.0d0) - ((3.0d0 - (2.0d0 * x2)) / x1)) / x1)))))))
else
tmp = x1 - (x1 * (2.0d0 - (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 - (t_2 + (2.0 * x2))) / t_1;
double t_4 = 3.0 + t_3;
double t_5 = (x1 * x1) * (6.0 + (4.0 * t_3));
double tmp;
if (x1 <= -9.5e+115) {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
} else if (x1 <= 4e-18) {
tmp = x1 + ((3.0 * ((x1 - (t_2 - (2.0 * x2))) / (-1.0 - (x1 * x1)))) - ((((t_2 * t_3) + (t_1 * (t_5 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * t_4)))) - t_0) - x1));
} else if (x1 <= 4e+150) {
tmp = x1 + (9.0 + (x1 + (t_0 + ((t_1 * ((((x1 * 2.0) * t_3) * t_4) - t_5)) + (t_2 * (3.0 + ((-1.0 - ((3.0 - (2.0 * x2)) / x1)) / x1)))))));
} else {
tmp = x1 - (x1 * (2.0 - (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = (x1 * x1) + 1.0 t_2 = x1 * (x1 * 3.0) t_3 = (x1 - (t_2 + (2.0 * x2))) / t_1 t_4 = 3.0 + t_3 t_5 = (x1 * x1) * (6.0 + (4.0 * t_3)) tmp = 0 if x1 <= -9.5e+115: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) elif x1 <= 4e-18: tmp = x1 + ((3.0 * ((x1 - (t_2 - (2.0 * x2))) / (-1.0 - (x1 * x1)))) - ((((t_2 * t_3) + (t_1 * (t_5 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * t_4)))) - t_0) - x1)) elif x1 <= 4e+150: tmp = x1 + (9.0 + (x1 + (t_0 + ((t_1 * ((((x1 * 2.0) * t_3) * t_4) - t_5)) + (t_2 * (3.0 + ((-1.0 - ((3.0 - (2.0 * x2)) / x1)) / x1))))))) else: tmp = x1 - (x1 * (2.0 - (x1 * 9.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(x1 - Float64(t_2 + Float64(2.0 * x2))) / t_1) t_4 = Float64(3.0 + t_3) t_5 = Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_3))) tmp = 0.0 if (x1 <= -9.5e+115) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); elseif (x1 <= 4e-18) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x1 - Float64(t_2 - Float64(2.0 * x2))) / Float64(-1.0 - Float64(x1 * x1)))) - Float64(Float64(Float64(Float64(t_2 * t_3) + Float64(t_1 * Float64(t_5 + Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)) * t_4)))) - t_0) - x1))); elseif (x1 <= 4e+150) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_0 + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * t_4) - t_5)) + Float64(t_2 * Float64(3.0 + Float64(Float64(-1.0 - Float64(Float64(3.0 - Float64(2.0 * x2)) / x1)) / x1)))))))); else tmp = Float64(x1 - Float64(x1 * Float64(2.0 - Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = (x1 * x1) + 1.0; t_2 = x1 * (x1 * 3.0); t_3 = (x1 - (t_2 + (2.0 * x2))) / t_1; t_4 = 3.0 + t_3; t_5 = (x1 * x1) * (6.0 + (4.0 * t_3)); tmp = 0.0; if (x1 <= -9.5e+115) tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); elseif (x1 <= 4e-18) tmp = x1 + ((3.0 * ((x1 - (t_2 - (2.0 * x2))) / (-1.0 - (x1 * x1)))) - ((((t_2 * t_3) + (t_1 * (t_5 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * t_4)))) - t_0) - x1)); elseif (x1 <= 4e+150) tmp = x1 + (9.0 + (x1 + (t_0 + ((t_1 * ((((x1 * 2.0) * t_3) * t_4) - t_5)) + (t_2 * (3.0 + ((-1.0 - ((3.0 - (2.0 * x2)) / x1)) / x1))))))); else tmp = x1 - (x1 * (2.0 - (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 - N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 + t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -9.5e+115], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4e-18], N[(x1 + N[(N[(3.0 * N[(N[(x1 - N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(t$95$2 * t$95$3), $MachinePrecision] + N[(t$95$1 * N[(t$95$5 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4e+150], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$0 + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * t$95$4), $MachinePrecision] - t$95$5), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(3.0 + N[(N[(-1.0 - N[(N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 - N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{x1 - \left(t\_2 + 2 \cdot x2\right)}{t\_1}\\
t_4 := 3 + t\_3\\
t_5 := \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_3\right)\\
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{+115}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{-18}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{x1 - \left(t\_2 - 2 \cdot x2\right)}{-1 - x1 \cdot x1} - \left(\left(\left(t\_2 \cdot t\_3 + t\_1 \cdot \left(t\_5 + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right) \cdot t\_4\right)\right) - t\_0\right) - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{+150}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_0 + \left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot t\_4 - t\_5\right) + t\_2 \cdot \left(3 + \frac{-1 - \frac{3 - 2 \cdot x2}{x1}}{x1}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 - x1 \cdot \left(2 - x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -9.4999999999999997e115Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
metadata-eval100.0%
Applied egg-rr100.0%
if -9.4999999999999997e115 < x1 < 4.0000000000000003e-18Initial program 99.5%
Taylor expanded in x1 around 0 97.6%
+-commutative97.6%
mul-1-neg97.6%
unsub-neg97.6%
Simplified97.6%
if 4.0000000000000003e-18 < x1 < 3.99999999999999992e150Initial program 99.4%
Taylor expanded in x1 around inf 98.0%
Taylor expanded in x1 around -inf 99.4%
if 3.99999999999999992e150 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 70.7%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Final simplification98.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ t_1 (* 2.0 x2)))
(t_3 (/ (- x1 t_2) t_0)))
(if (<= x1 -2.1e+14)
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0))
(if (<= x1 4e-18)
(+
(* x2 -6.0)
(+
(* x1 (+ -1.0 (* x1 9.0)))
(* x2 (+ (* 8.0 (* x1 x2)) (* x1 (- (* x1 12.0) 12.0))))))
(if (<= x1 4e+150)
(+
x1
(-
9.0
(-
(-
(+
(* t_1 t_3)
(*
t_0
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_3)))
(* (- (/ (- t_2 x1) t_0) 3.0) (* (* x1 2.0) t_3)))))
(* x1 (* x1 x1)))
x1)))
(- x1 (* x1 (- 2.0 (* x1 9.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);
double t_3 = (x1 - t_2) / t_0;
double tmp;
if (x1 <= -2.1e+14) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
} else if (x1 <= 4e-18) {
tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))));
} else if (x1 <= 4e+150) {
tmp = x1 + (9.0 - ((((t_1 * t_3) + (t_0 * (((x1 * x1) * (6.0 + (4.0 * t_3))) + ((((t_2 - x1) / t_0) - 3.0) * ((x1 * 2.0) * t_3))))) - (x1 * (x1 * x1))) - x1));
} else {
tmp = x1 - (x1 * (2.0 - (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = t_1 + (2.0d0 * x2)
t_3 = (x1 - t_2) / t_0
if (x1 <= (-2.1d+14)) then
tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
else if (x1 <= 4d-18) then
tmp = (x2 * (-6.0d0)) + ((x1 * ((-1.0d0) + (x1 * 9.0d0))) + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * ((x1 * 12.0d0) - 12.0d0)))))
else if (x1 <= 4d+150) then
tmp = x1 + (9.0d0 - ((((t_1 * t_3) + (t_0 * (((x1 * x1) * (6.0d0 + (4.0d0 * t_3))) + ((((t_2 - x1) / t_0) - 3.0d0) * ((x1 * 2.0d0) * t_3))))) - (x1 * (x1 * x1))) - x1))
else
tmp = x1 - (x1 * (2.0d0 - (x1 * 9.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);
double t_3 = (x1 - t_2) / t_0;
double tmp;
if (x1 <= -2.1e+14) {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
} else if (x1 <= 4e-18) {
tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))));
} else if (x1 <= 4e+150) {
tmp = x1 + (9.0 - ((((t_1 * t_3) + (t_0 * (((x1 * x1) * (6.0 + (4.0 * t_3))) + ((((t_2 - x1) / t_0) - 3.0) * ((x1 * 2.0) * t_3))))) - (x1 * (x1 * x1))) - x1));
} else {
tmp = x1 - (x1 * (2.0 - (x1 * 9.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) t_3 = (x1 - t_2) / t_0 tmp = 0 if x1 <= -2.1e+14: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) elif x1 <= 4e-18: tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))) elif x1 <= 4e+150: tmp = x1 + (9.0 - ((((t_1 * t_3) + (t_0 * (((x1 * x1) * (6.0 + (4.0 * t_3))) + ((((t_2 - x1) / t_0) - 3.0) * ((x1 * 2.0) * t_3))))) - (x1 * (x1 * x1))) - x1)) else: tmp = x1 - (x1 * (2.0 - (x1 * 9.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(t_1 + Float64(2.0 * x2)) t_3 = Float64(Float64(x1 - t_2) / t_0) tmp = 0.0 if (x1 <= -2.1e+14) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); elseif (x1 <= 4e-18) tmp = Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0))) + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(x1 * 12.0) - 12.0)))))); elseif (x1 <= 4e+150) tmp = Float64(x1 + Float64(9.0 - Float64(Float64(Float64(Float64(t_1 * t_3) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_3))) + Float64(Float64(Float64(Float64(t_2 - x1) / t_0) - 3.0) * Float64(Float64(x1 * 2.0) * t_3))))) - Float64(x1 * Float64(x1 * x1))) - x1))); else tmp = Float64(x1 - Float64(x1 * Float64(2.0 - Float64(x1 * 9.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); t_3 = (x1 - t_2) / t_0; tmp = 0.0; if (x1 <= -2.1e+14) tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); elseif (x1 <= 4e-18) tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))); elseif (x1 <= 4e+150) tmp = x1 + (9.0 - ((((t_1 * t_3) + (t_0 * (((x1 * x1) * (6.0 + (4.0 * t_3))) + ((((t_2 - x1) / t_0) - 3.0) * ((x1 * 2.0) * t_3))))) - (x1 * (x1 * x1))) - x1)); else tmp = x1 - (x1 * (2.0 - (x1 * 9.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[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 - t$95$2), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x1, -2.1e+14], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4e-18], N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 12.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4e+150], N[(x1 + N[(9.0 - N[(N[(N[(N[(t$95$1 * t$95$3), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(t$95$2 - x1), $MachinePrecision] / t$95$0), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 - N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := t\_1 + 2 \cdot x2\\
t_3 := \frac{x1 - t\_2}{t\_0}\\
\mathbf{if}\;x1 \leq -2.1 \cdot 10^{+14}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{-18}:\\
\;\;\;\;x2 \cdot -6 + \left(x1 \cdot \left(-1 + x1 \cdot 9\right) + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(x1 \cdot 12 - 12\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{+150}:\\
\;\;\;\;x1 + \left(9 - \left(\left(\left(t\_1 \cdot t\_3 + t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_3\right) + \left(\frac{t\_2 - x1}{t\_0} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot t\_3\right)\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 - x1 \cdot \left(2 - x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -2.1e14Initial program 30.8%
Taylor expanded in x1 around inf 30.8%
Taylor expanded in x1 around inf 95.0%
*-commutative95.0%
Simplified95.0%
metadata-eval95.0%
Applied egg-rr95.0%
if -2.1e14 < x1 < 4.0000000000000003e-18Initial program 99.5%
Simplified89.7%
Taylor expanded in x1 around 0 89.0%
Taylor expanded in x2 around 0 99.1%
if 4.0000000000000003e-18 < x1 < 3.99999999999999992e150Initial program 99.4%
Taylor expanded in x1 around inf 98.0%
metadata-eval73.9%
Applied egg-rr98.0%
if 3.99999999999999992e150 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 70.7%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Final simplification98.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (- 2.0 (* x1 9.0))))
(t_2 (* x1 (* x1 3.0)))
(t_3 (+ t_2 (* 2.0 x2)))
(t_4 (/ (- x1 t_3) t_0))
(t_5
(+
x1
(+
9.0
(+
x1
(+
(* x1 (* x1 x1))
(-
(* t_2 (/ (- t_3 x1) t_0))
(*
t_0
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_4)))
(*
(/ (+ (* 2.0 (/ x2 x1)) (- -1.0 (/ 3.0 x1))) x1)
(* (* x1 2.0) t_4)))))))))))
(if (<= x1 -9.5e+115)
(- x1 (* x2 (+ 6.0 (/ t_1 x2))))
(if (<= x1 -0.86)
t_5
(if (<= x1 0.72)
(+
(* x2 -6.0)
(+
(* x1 (+ -1.0 (* x1 9.0)))
(* x2 (+ (* 8.0 (* x1 x2)) (* x1 (- (* x1 12.0) 12.0))))))
(if (<= x1 5e+153) t_5 (- x1 t_1)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (2.0 - (x1 * 9.0));
double t_2 = x1 * (x1 * 3.0);
double t_3 = t_2 + (2.0 * x2);
double t_4 = (x1 - t_3) / t_0;
double t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * ((t_3 - x1) / t_0)) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + ((((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1) * ((x1 * 2.0) * t_4))))))));
double tmp;
if (x1 <= -9.5e+115) {
tmp = x1 - (x2 * (6.0 + (t_1 / x2)));
} else if (x1 <= -0.86) {
tmp = t_5;
} else if (x1 <= 0.72) {
tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))));
} else if (x1 <= 5e+153) {
tmp = t_5;
} else {
tmp = x1 - t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (2.0d0 - (x1 * 9.0d0))
t_2 = x1 * (x1 * 3.0d0)
t_3 = t_2 + (2.0d0 * x2)
t_4 = (x1 - t_3) / t_0
t_5 = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * ((t_3 - x1) / t_0)) - (t_0 * (((x1 * x1) * (6.0d0 + (4.0d0 * t_4))) + ((((2.0d0 * (x2 / x1)) + ((-1.0d0) - (3.0d0 / x1))) / x1) * ((x1 * 2.0d0) * t_4))))))))
if (x1 <= (-9.5d+115)) then
tmp = x1 - (x2 * (6.0d0 + (t_1 / x2)))
else if (x1 <= (-0.86d0)) then
tmp = t_5
else if (x1 <= 0.72d0) then
tmp = (x2 * (-6.0d0)) + ((x1 * ((-1.0d0) + (x1 * 9.0d0))) + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * ((x1 * 12.0d0) - 12.0d0)))))
else if (x1 <= 5d+153) then
tmp = t_5
else
tmp = x1 - t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (2.0 - (x1 * 9.0));
double t_2 = x1 * (x1 * 3.0);
double t_3 = t_2 + (2.0 * x2);
double t_4 = (x1 - t_3) / t_0;
double t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * ((t_3 - x1) / t_0)) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + ((((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1) * ((x1 * 2.0) * t_4))))))));
double tmp;
if (x1 <= -9.5e+115) {
tmp = x1 - (x2 * (6.0 + (t_1 / x2)));
} else if (x1 <= -0.86) {
tmp = t_5;
} else if (x1 <= 0.72) {
tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))));
} else if (x1 <= 5e+153) {
tmp = t_5;
} else {
tmp = x1 - t_1;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (2.0 - (x1 * 9.0)) t_2 = x1 * (x1 * 3.0) t_3 = t_2 + (2.0 * x2) t_4 = (x1 - t_3) / t_0 t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * ((t_3 - x1) / t_0)) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + ((((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1) * ((x1 * 2.0) * t_4)))))))) tmp = 0 if x1 <= -9.5e+115: tmp = x1 - (x2 * (6.0 + (t_1 / x2))) elif x1 <= -0.86: tmp = t_5 elif x1 <= 0.72: tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))) elif x1 <= 5e+153: tmp = t_5 else: tmp = x1 - t_1 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(2.0 - Float64(x1 * 9.0))) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(t_2 + Float64(2.0 * x2)) t_4 = Float64(Float64(x1 - t_3) / t_0) t_5 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * Float64(Float64(t_3 - x1) / t_0)) - Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_4))) + Float64(Float64(Float64(Float64(2.0 * Float64(x2 / x1)) + Float64(-1.0 - Float64(3.0 / x1))) / x1) * Float64(Float64(x1 * 2.0) * t_4))))))))) tmp = 0.0 if (x1 <= -9.5e+115) tmp = Float64(x1 - Float64(x2 * Float64(6.0 + Float64(t_1 / x2)))); elseif (x1 <= -0.86) tmp = t_5; elseif (x1 <= 0.72) tmp = Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0))) + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(x1 * 12.0) - 12.0)))))); elseif (x1 <= 5e+153) tmp = t_5; else tmp = Float64(x1 - t_1); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (2.0 - (x1 * 9.0)); t_2 = x1 * (x1 * 3.0); t_3 = t_2 + (2.0 * x2); t_4 = (x1 - t_3) / t_0; t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * ((t_3 - x1) / t_0)) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + ((((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1) * ((x1 * 2.0) * t_4)))))))); tmp = 0.0; if (x1 <= -9.5e+115) tmp = x1 - (x2 * (6.0 + (t_1 / x2))); elseif (x1 <= -0.86) tmp = t_5; elseif (x1 <= 0.72) tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))); elseif (x1 <= 5e+153) tmp = t_5; else tmp = x1 - t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 - t$95$3), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(9.0 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * N[(N[(t$95$3 - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(2.0 * N[(x2 / x1), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - N[(3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -9.5e+115], N[(x1 - N[(x2 * N[(6.0 + N[(t$95$1 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.86], t$95$5, If[LessEqual[x1, 0.72], N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 12.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], t$95$5, N[(x1 - t$95$1), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(2 - x1 \cdot 9\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := t\_2 + 2 \cdot x2\\
t_4 := \frac{x1 - t\_3}{t\_0}\\
t_5 := x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_2 \cdot \frac{t\_3 - x1}{t\_0} - t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_4\right) + \frac{2 \cdot \frac{x2}{x1} + \left(-1 - \frac{3}{x1}\right)}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot t\_4\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{+115}:\\
\;\;\;\;x1 - x2 \cdot \left(6 + \frac{t\_1}{x2}\right)\\
\mathbf{elif}\;x1 \leq -0.86:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;x1 \leq 0.72:\\
\;\;\;\;x2 \cdot -6 + \left(x1 \cdot \left(-1 + x1 \cdot 9\right) + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(x1 \cdot 12 - 12\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;x1 - t\_1\\
\end{array}
\end{array}
if x1 < -9.4999999999999997e115Initial program 0.0%
Simplified32.5%
Taylor expanded in x1 around 0 44.8%
Taylor expanded in x2 around 0 70.2%
Taylor expanded in x2 around inf 95.4%
if -9.4999999999999997e115 < x1 < -0.859999999999999987 or 0.71999999999999997 < x1 < 5.00000000000000018e153Initial program 99.4%
Taylor expanded in x1 around inf 98.4%
Taylor expanded in x1 around inf 97.9%
associate-*r/97.9%
metadata-eval97.9%
Simplified97.9%
if -0.859999999999999987 < x1 < 0.71999999999999997Initial program 99.4%
Simplified89.6%
Taylor expanded in x1 around 0 89.7%
Taylor expanded in x2 around 0 99.9%
if 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 70.7%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Final simplification98.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- x1 (+ t_0 (* 2.0 x2))) t_1)))
(if (<= x1 -62000000000000.0)
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0))
(if (<= x1 4e-18)
(+
(* x2 -6.0)
(+
(* x1 (+ -1.0 (* x1 9.0)))
(* x2 (+ (* 8.0 (* x1 x2)) (* x1 (- (* x1 12.0) 12.0))))))
(if (<= x1 4e+150)
(+
x1
(+
9.0
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(-
(* (* (* x1 2.0) t_2) (+ 3.0 t_2))
(* (* x1 x1) (+ 6.0 (* 4.0 t_2)))))
(* t_0 (+ 3.0 (/ (- -1.0 (/ (- 3.0 (* 2.0 x2)) x1)) x1))))))))
(- x1 (* x1 (- 2.0 (* x1 9.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (x1 - (t_0 + (2.0 * x2))) / t_1;
double tmp;
if (x1 <= -62000000000000.0) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
} else if (x1 <= 4e-18) {
tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))));
} else if (x1 <= 4e+150) {
tmp = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (3.0 + t_2)) - ((x1 * x1) * (6.0 + (4.0 * t_2))))) + (t_0 * (3.0 + ((-1.0 - ((3.0 - (2.0 * x2)) / x1)) / x1)))))));
} else {
tmp = x1 - (x1 * (2.0 - (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = (x1 - (t_0 + (2.0d0 * x2))) / t_1
if (x1 <= (-62000000000000.0d0)) then
tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
else if (x1 <= 4d-18) then
tmp = (x2 * (-6.0d0)) + ((x1 * ((-1.0d0) + (x1 * 9.0d0))) + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * ((x1 * 12.0d0) - 12.0d0)))))
else if (x1 <= 4d+150) then
tmp = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (3.0d0 + t_2)) - ((x1 * x1) * (6.0d0 + (4.0d0 * t_2))))) + (t_0 * (3.0d0 + (((-1.0d0) - ((3.0d0 - (2.0d0 * x2)) / x1)) / x1)))))))
else
tmp = x1 - (x1 * (2.0d0 - (x1 * 9.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 = (x1 - (t_0 + (2.0 * x2))) / t_1;
double tmp;
if (x1 <= -62000000000000.0) {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
} else if (x1 <= 4e-18) {
tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))));
} else if (x1 <= 4e+150) {
tmp = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (3.0 + t_2)) - ((x1 * x1) * (6.0 + (4.0 * t_2))))) + (t_0 * (3.0 + ((-1.0 - ((3.0 - (2.0 * x2)) / x1)) / x1)))))));
} else {
tmp = x1 - (x1 * (2.0 - (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = (x1 - (t_0 + (2.0 * x2))) / t_1 tmp = 0 if x1 <= -62000000000000.0: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) elif x1 <= 4e-18: tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))) elif x1 <= 4e+150: tmp = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (3.0 + t_2)) - ((x1 * x1) * (6.0 + (4.0 * t_2))))) + (t_0 * (3.0 + ((-1.0 - ((3.0 - (2.0 * x2)) / x1)) / x1))))))) else: tmp = x1 - (x1 * (2.0 - (x1 * 9.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(x1 - Float64(t_0 + Float64(2.0 * x2))) / t_1) tmp = 0.0 if (x1 <= -62000000000000.0) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); elseif (x1 <= 4e-18) tmp = Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0))) + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(x1 * 12.0) - 12.0)))))); elseif (x1 <= 4e+150) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(3.0 + t_2)) - Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_2))))) + Float64(t_0 * Float64(3.0 + Float64(Float64(-1.0 - Float64(Float64(3.0 - Float64(2.0 * x2)) / x1)) / x1)))))))); else tmp = Float64(x1 - Float64(x1 * Float64(2.0 - Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = (x1 - (t_0 + (2.0 * x2))) / t_1; tmp = 0.0; if (x1 <= -62000000000000.0) tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); elseif (x1 <= 4e-18) tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))); elseif (x1 <= 4e+150) tmp = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (3.0 + t_2)) - ((x1 * x1) * (6.0 + (4.0 * t_2))))) + (t_0 * (3.0 + ((-1.0 - ((3.0 - (2.0 * x2)) / x1)) / x1))))))); else tmp = x1 - (x1 * (2.0 - (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 - N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -62000000000000.0], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4e-18], N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 12.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4e+150], N[(x1 + N[(9.0 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(3.0 + t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(3.0 + N[(N[(-1.0 - N[(N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 - N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{x1 - \left(t\_0 + 2 \cdot x2\right)}{t\_1}\\
\mathbf{if}\;x1 \leq -62000000000000:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{-18}:\\
\;\;\;\;x2 \cdot -6 + \left(x1 \cdot \left(-1 + x1 \cdot 9\right) + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(x1 \cdot 12 - 12\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{+150}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(3 + t\_2\right) - \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_2\right)\right) + t\_0 \cdot \left(3 + \frac{-1 - \frac{3 - 2 \cdot x2}{x1}}{x1}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 - x1 \cdot \left(2 - x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -6.2e13Initial program 30.8%
Taylor expanded in x1 around inf 30.8%
Taylor expanded in x1 around inf 95.0%
*-commutative95.0%
Simplified95.0%
metadata-eval95.0%
Applied egg-rr95.0%
if -6.2e13 < x1 < 4.0000000000000003e-18Initial program 99.5%
Simplified89.7%
Taylor expanded in x1 around 0 89.0%
Taylor expanded in x2 around 0 99.1%
if 4.0000000000000003e-18 < x1 < 3.99999999999999992e150Initial program 99.4%
Taylor expanded in x1 around inf 98.0%
Taylor expanded in x1 around -inf 99.4%
if 3.99999999999999992e150 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 70.7%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Final simplification98.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (/ (- x1 (+ t_0 (* 2.0 x2))) (+ (* x1 x1) 1.0)))
(t_2
(+
x1
(+
9.0
(+
x1
(-
(* x1 (* x1 x1))
(-
(*
(-
(* (* (* x1 2.0) t_1) (+ 3.0 t_1))
(*
(* x1 x1)
(+
6.0
(* 4.0 (- (/ (+ 1.0 (/ (- 3.0 (* 2.0 x2)) x1)) x1) 3.0)))))
(- -1.0 (* x1 x1)))
(* t_0 (* 2.0 x2))))))))
(t_3 (* x1 (- 2.0 (* x1 9.0)))))
(if (<= x1 -9.5e+115)
(- x1 (* x2 (+ 6.0 (/ t_3 x2))))
(if (<= x1 -0.15)
t_2
(if (<= x1 4e-18)
(+
(* x2 -6.0)
(+
(* x1 (+ -1.0 (* x1 9.0)))
(* x2 (+ (* 8.0 (* x1 x2)) (* x1 (- (* x1 12.0) 12.0))))))
(if (<= x1 4.4e+153) t_2 (- x1 t_3)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 - (t_0 + (2.0 * x2))) / ((x1 * x1) + 1.0);
double t_2 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) - ((((((x1 * 2.0) * t_1) * (3.0 + t_1)) - ((x1 * x1) * (6.0 + (4.0 * (((1.0 + ((3.0 - (2.0 * x2)) / x1)) / x1) - 3.0))))) * (-1.0 - (x1 * x1))) - (t_0 * (2.0 * x2))))));
double t_3 = x1 * (2.0 - (x1 * 9.0));
double tmp;
if (x1 <= -9.5e+115) {
tmp = x1 - (x2 * (6.0 + (t_3 / x2)));
} else if (x1 <= -0.15) {
tmp = t_2;
} else if (x1 <= 4e-18) {
tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))));
} else if (x1 <= 4.4e+153) {
tmp = t_2;
} else {
tmp = x1 - t_3;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 - (t_0 + (2.0d0 * x2))) / ((x1 * x1) + 1.0d0)
t_2 = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) - ((((((x1 * 2.0d0) * t_1) * (3.0d0 + t_1)) - ((x1 * x1) * (6.0d0 + (4.0d0 * (((1.0d0 + ((3.0d0 - (2.0d0 * x2)) / x1)) / x1) - 3.0d0))))) * ((-1.0d0) - (x1 * x1))) - (t_0 * (2.0d0 * x2))))))
t_3 = x1 * (2.0d0 - (x1 * 9.0d0))
if (x1 <= (-9.5d+115)) then
tmp = x1 - (x2 * (6.0d0 + (t_3 / x2)))
else if (x1 <= (-0.15d0)) then
tmp = t_2
else if (x1 <= 4d-18) then
tmp = (x2 * (-6.0d0)) + ((x1 * ((-1.0d0) + (x1 * 9.0d0))) + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * ((x1 * 12.0d0) - 12.0d0)))))
else if (x1 <= 4.4d+153) then
tmp = t_2
else
tmp = x1 - t_3
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 - (t_0 + (2.0 * x2))) / ((x1 * x1) + 1.0);
double t_2 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) - ((((((x1 * 2.0) * t_1) * (3.0 + t_1)) - ((x1 * x1) * (6.0 + (4.0 * (((1.0 + ((3.0 - (2.0 * x2)) / x1)) / x1) - 3.0))))) * (-1.0 - (x1 * x1))) - (t_0 * (2.0 * x2))))));
double t_3 = x1 * (2.0 - (x1 * 9.0));
double tmp;
if (x1 <= -9.5e+115) {
tmp = x1 - (x2 * (6.0 + (t_3 / x2)));
} else if (x1 <= -0.15) {
tmp = t_2;
} else if (x1 <= 4e-18) {
tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))));
} else if (x1 <= 4.4e+153) {
tmp = t_2;
} else {
tmp = x1 - t_3;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 - (t_0 + (2.0 * x2))) / ((x1 * x1) + 1.0) t_2 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) - ((((((x1 * 2.0) * t_1) * (3.0 + t_1)) - ((x1 * x1) * (6.0 + (4.0 * (((1.0 + ((3.0 - (2.0 * x2)) / x1)) / x1) - 3.0))))) * (-1.0 - (x1 * x1))) - (t_0 * (2.0 * x2)))))) t_3 = x1 * (2.0 - (x1 * 9.0)) tmp = 0 if x1 <= -9.5e+115: tmp = x1 - (x2 * (6.0 + (t_3 / x2))) elif x1 <= -0.15: tmp = t_2 elif x1 <= 4e-18: tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))) elif x1 <= 4.4e+153: tmp = t_2 else: tmp = x1 - t_3 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 - Float64(t_0 + Float64(2.0 * x2))) / Float64(Float64(x1 * x1) + 1.0)) t_2 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) - Float64(Float64(Float64(Float64(Float64(Float64(x1 * 2.0) * t_1) * Float64(3.0 + t_1)) - Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(Float64(Float64(1.0 + Float64(Float64(3.0 - Float64(2.0 * x2)) / x1)) / x1) - 3.0))))) * Float64(-1.0 - Float64(x1 * x1))) - Float64(t_0 * Float64(2.0 * x2))))))) t_3 = Float64(x1 * Float64(2.0 - Float64(x1 * 9.0))) tmp = 0.0 if (x1 <= -9.5e+115) tmp = Float64(x1 - Float64(x2 * Float64(6.0 + Float64(t_3 / x2)))); elseif (x1 <= -0.15) tmp = t_2; elseif (x1 <= 4e-18) tmp = Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0))) + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(x1 * 12.0) - 12.0)))))); elseif (x1 <= 4.4e+153) tmp = t_2; else tmp = Float64(x1 - t_3); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 - (t_0 + (2.0 * x2))) / ((x1 * x1) + 1.0); t_2 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) - ((((((x1 * 2.0) * t_1) * (3.0 + t_1)) - ((x1 * x1) * (6.0 + (4.0 * (((1.0 + ((3.0 - (2.0 * x2)) / x1)) / x1) - 3.0))))) * (-1.0 - (x1 * x1))) - (t_0 * (2.0 * x2)))))); t_3 = x1 * (2.0 - (x1 * 9.0)); tmp = 0.0; if (x1 <= -9.5e+115) tmp = x1 - (x2 * (6.0 + (t_3 / x2))); elseif (x1 <= -0.15) tmp = t_2; elseif (x1 <= 4e-18) tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))); elseif (x1 <= 4.4e+153) tmp = t_2; else tmp = x1 - t_3; 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 - N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(9.0 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(3.0 + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(N[(N[(1.0 + N[(N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -9.5e+115], N[(x1 - N[(x2 * N[(6.0 + N[(t$95$3 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.15], t$95$2, If[LessEqual[x1, 4e-18], N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 12.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.4e+153], t$95$2, N[(x1 - t$95$3), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := \frac{x1 - \left(t\_0 + 2 \cdot x2\right)}{x1 \cdot x1 + 1}\\
t_2 := x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) - \left(\left(\left(\left(x1 \cdot 2\right) \cdot t\_1\right) \cdot \left(3 + t\_1\right) - \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \left(\frac{1 + \frac{3 - 2 \cdot x2}{x1}}{x1} - 3\right)\right)\right) \cdot \left(-1 - x1 \cdot x1\right) - t\_0 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\
t_3 := x1 \cdot \left(2 - x1 \cdot 9\right)\\
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{+115}:\\
\;\;\;\;x1 - x2 \cdot \left(6 + \frac{t\_3}{x2}\right)\\
\mathbf{elif}\;x1 \leq -0.15:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{-18}:\\
\;\;\;\;x2 \cdot -6 + \left(x1 \cdot \left(-1 + x1 \cdot 9\right) + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(x1 \cdot 12 - 12\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+153}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x1 - t\_3\\
\end{array}
\end{array}
if x1 < -9.4999999999999997e115Initial program 0.0%
Simplified32.5%
Taylor expanded in x1 around 0 44.8%
Taylor expanded in x2 around 0 70.2%
Taylor expanded in x2 around inf 95.4%
if -9.4999999999999997e115 < x1 < -0.149999999999999994 or 4.0000000000000003e-18 < x1 < 4.3999999999999999e153Initial program 99.4%
Taylor expanded in x1 around inf 98.4%
Taylor expanded in x1 around 0 92.3%
Taylor expanded in x1 around -inf 92.4%
if -0.149999999999999994 < x1 < 4.0000000000000003e-18Initial program 99.5%
Simplified89.4%
Taylor expanded in x1 around 0 89.5%
Taylor expanded in x2 around 0 99.9%
if 4.3999999999999999e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 70.7%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Final simplification97.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- x1 (+ t_0 (* 2.0 x2))) t_1))
(t_3
(+
x1
(-
9.0
(-
(-
(-
(*
t_1
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_2)))
(*
(/ (+ (* 2.0 (/ x2 x1)) (- -1.0 (/ 3.0 x1))) x1)
(* (* x1 2.0) t_2))))
(* t_0 (* 2.0 x2)))
(* x1 (* x1 x1)))
x1))))
(t_4 (* x1 (- 2.0 (* x1 9.0)))))
(if (<= x1 -9.5e+115)
(- x1 (* x2 (+ 6.0 (/ t_4 x2))))
(if (<= x1 -0.82)
t_3
(if (<= x1 0.7)
(+
(* x2 -6.0)
(+
(* x1 (+ -1.0 (* x1 9.0)))
(* x2 (+ (* 8.0 (* x1 x2)) (* x1 (- (* x1 12.0) 12.0))))))
(if (<= x1 4.4e+153) t_3 (- x1 t_4)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (x1 - (t_0 + (2.0 * x2))) / t_1;
double t_3 = x1 + (9.0 - ((((t_1 * (((x1 * x1) * (6.0 + (4.0 * t_2))) + ((((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1) * ((x1 * 2.0) * t_2)))) - (t_0 * (2.0 * x2))) - (x1 * (x1 * x1))) - x1));
double t_4 = x1 * (2.0 - (x1 * 9.0));
double tmp;
if (x1 <= -9.5e+115) {
tmp = x1 - (x2 * (6.0 + (t_4 / x2)));
} else if (x1 <= -0.82) {
tmp = t_3;
} else if (x1 <= 0.7) {
tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))));
} else if (x1 <= 4.4e+153) {
tmp = t_3;
} else {
tmp = x1 - t_4;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = (x1 - (t_0 + (2.0d0 * x2))) / t_1
t_3 = x1 + (9.0d0 - ((((t_1 * (((x1 * x1) * (6.0d0 + (4.0d0 * t_2))) + ((((2.0d0 * (x2 / x1)) + ((-1.0d0) - (3.0d0 / x1))) / x1) * ((x1 * 2.0d0) * t_2)))) - (t_0 * (2.0d0 * x2))) - (x1 * (x1 * x1))) - x1))
t_4 = x1 * (2.0d0 - (x1 * 9.0d0))
if (x1 <= (-9.5d+115)) then
tmp = x1 - (x2 * (6.0d0 + (t_4 / x2)))
else if (x1 <= (-0.82d0)) then
tmp = t_3
else if (x1 <= 0.7d0) then
tmp = (x2 * (-6.0d0)) + ((x1 * ((-1.0d0) + (x1 * 9.0d0))) + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * ((x1 * 12.0d0) - 12.0d0)))))
else if (x1 <= 4.4d+153) then
tmp = t_3
else
tmp = x1 - t_4
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 = (x1 - (t_0 + (2.0 * x2))) / t_1;
double t_3 = x1 + (9.0 - ((((t_1 * (((x1 * x1) * (6.0 + (4.0 * t_2))) + ((((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1) * ((x1 * 2.0) * t_2)))) - (t_0 * (2.0 * x2))) - (x1 * (x1 * x1))) - x1));
double t_4 = x1 * (2.0 - (x1 * 9.0));
double tmp;
if (x1 <= -9.5e+115) {
tmp = x1 - (x2 * (6.0 + (t_4 / x2)));
} else if (x1 <= -0.82) {
tmp = t_3;
} else if (x1 <= 0.7) {
tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))));
} else if (x1 <= 4.4e+153) {
tmp = t_3;
} else {
tmp = x1 - t_4;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = (x1 - (t_0 + (2.0 * x2))) / t_1 t_3 = x1 + (9.0 - ((((t_1 * (((x1 * x1) * (6.0 + (4.0 * t_2))) + ((((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1) * ((x1 * 2.0) * t_2)))) - (t_0 * (2.0 * x2))) - (x1 * (x1 * x1))) - x1)) t_4 = x1 * (2.0 - (x1 * 9.0)) tmp = 0 if x1 <= -9.5e+115: tmp = x1 - (x2 * (6.0 + (t_4 / x2))) elif x1 <= -0.82: tmp = t_3 elif x1 <= 0.7: tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))) elif x1 <= 4.4e+153: tmp = t_3 else: tmp = x1 - t_4 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(x1 - Float64(t_0 + Float64(2.0 * x2))) / t_1) t_3 = Float64(x1 + Float64(9.0 - Float64(Float64(Float64(Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_2))) + Float64(Float64(Float64(Float64(2.0 * Float64(x2 / x1)) + Float64(-1.0 - Float64(3.0 / x1))) / x1) * Float64(Float64(x1 * 2.0) * t_2)))) - Float64(t_0 * Float64(2.0 * x2))) - Float64(x1 * Float64(x1 * x1))) - x1))) t_4 = Float64(x1 * Float64(2.0 - Float64(x1 * 9.0))) tmp = 0.0 if (x1 <= -9.5e+115) tmp = Float64(x1 - Float64(x2 * Float64(6.0 + Float64(t_4 / x2)))); elseif (x1 <= -0.82) tmp = t_3; elseif (x1 <= 0.7) tmp = Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0))) + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(x1 * 12.0) - 12.0)))))); elseif (x1 <= 4.4e+153) tmp = t_3; else tmp = Float64(x1 - t_4); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = (x1 - (t_0 + (2.0 * x2))) / t_1; t_3 = x1 + (9.0 - ((((t_1 * (((x1 * x1) * (6.0 + (4.0 * t_2))) + ((((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1) * ((x1 * 2.0) * t_2)))) - (t_0 * (2.0 * x2))) - (x1 * (x1 * x1))) - x1)); t_4 = x1 * (2.0 - (x1 * 9.0)); tmp = 0.0; if (x1 <= -9.5e+115) tmp = x1 - (x2 * (6.0 + (t_4 / x2))); elseif (x1 <= -0.82) tmp = t_3; elseif (x1 <= 0.7) tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))); elseif (x1 <= 4.4e+153) tmp = t_3; else tmp = x1 - t_4; 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[(x1 - N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(9.0 - N[(N[(N[(N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(2.0 * N[(x2 / x1), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - N[(3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -9.5e+115], N[(x1 - N[(x2 * N[(6.0 + N[(t$95$4 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.82], t$95$3, If[LessEqual[x1, 0.7], N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 12.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.4e+153], t$95$3, N[(x1 - t$95$4), $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{x1 - \left(t\_0 + 2 \cdot x2\right)}{t\_1}\\
t_3 := x1 + \left(9 - \left(\left(\left(t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_2\right) + \frac{2 \cdot \frac{x2}{x1} + \left(-1 - \frac{3}{x1}\right)}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot t\_2\right)\right) - t\_0 \cdot \left(2 \cdot x2\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\
t_4 := x1 \cdot \left(2 - x1 \cdot 9\right)\\
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{+115}:\\
\;\;\;\;x1 - x2 \cdot \left(6 + \frac{t\_4}{x2}\right)\\
\mathbf{elif}\;x1 \leq -0.82:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x1 \leq 0.7:\\
\;\;\;\;x2 \cdot -6 + \left(x1 \cdot \left(-1 + x1 \cdot 9\right) + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(x1 \cdot 12 - 12\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+153}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x1 - t\_4\\
\end{array}
\end{array}
if x1 < -9.4999999999999997e115Initial program 0.0%
Simplified32.5%
Taylor expanded in x1 around 0 44.8%
Taylor expanded in x2 around 0 70.2%
Taylor expanded in x2 around inf 95.4%
if -9.4999999999999997e115 < x1 < -0.819999999999999951 or 0.69999999999999996 < x1 < 4.3999999999999999e153Initial program 99.4%
Taylor expanded in x1 around inf 98.4%
Taylor expanded in x1 around 0 92.1%
Taylor expanded in x1 around inf 92.1%
associate-*r/97.9%
metadata-eval97.9%
Simplified92.1%
if -0.819999999999999951 < x1 < 0.69999999999999996Initial program 99.4%
Simplified89.6%
Taylor expanded in x1 around 0 89.7%
Taylor expanded in x2 around 0 99.9%
if 4.3999999999999999e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 70.7%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Final simplification97.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 x1)))
(t_2 (* x1 (- 2.0 (* x1 9.0))))
(t_3 (* x1 (* x1 3.0)))
(t_4 (+ t_3 (* 2.0 x2)))
(t_5 (* t_3 (* 2.0 x2)))
(t_6 (/ (- x1 t_4) t_0))
(t_7 (* (* x1 x1) (+ 6.0 (* 4.0 t_6)))))
(if (<= x1 -9.5e+115)
(- x1 (* x2 (+ 6.0 (/ t_2 x2))))
(if (<= x1 -550.0)
(+
x1
(+
9.0
(+
x1
(+ t_1 (- t_5 (* t_0 (+ t_7 (* (/ -1.0 x1) (* (* x1 2.0) t_6)))))))))
(if (<= x1 4e-18)
(+
(* x2 -6.0)
(+
(* x1 (+ -1.0 (* x1 9.0)))
(* x2 (+ (* 8.0 (* x1 x2)) (* x1 (- (* x1 12.0) 12.0))))))
(if (<= x1 4.4e+153)
(+
x1
(+
9.0
(+
x1
(+
t_1
(+
t_5
(*
t_0
(-
(* (- (/ (- t_4 x1) t_0) 3.0) (* (* x1 2.0) (* 2.0 x2)))
t_7)))))))
(- x1 t_2)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (2.0 - (x1 * 9.0));
double t_3 = x1 * (x1 * 3.0);
double t_4 = t_3 + (2.0 * x2);
double t_5 = t_3 * (2.0 * x2);
double t_6 = (x1 - t_4) / t_0;
double t_7 = (x1 * x1) * (6.0 + (4.0 * t_6));
double tmp;
if (x1 <= -9.5e+115) {
tmp = x1 - (x2 * (6.0 + (t_2 / x2)));
} else if (x1 <= -550.0) {
tmp = x1 + (9.0 + (x1 + (t_1 + (t_5 - (t_0 * (t_7 + ((-1.0 / x1) * ((x1 * 2.0) * t_6))))))));
} else if (x1 <= 4e-18) {
tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))));
} else if (x1 <= 4.4e+153) {
tmp = x1 + (9.0 + (x1 + (t_1 + (t_5 + (t_0 * (((((t_4 - x1) / t_0) - 3.0) * ((x1 * 2.0) * (2.0 * x2))) - t_7))))));
} else {
tmp = x1 - t_2;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * x1)
t_2 = x1 * (2.0d0 - (x1 * 9.0d0))
t_3 = x1 * (x1 * 3.0d0)
t_4 = t_3 + (2.0d0 * x2)
t_5 = t_3 * (2.0d0 * x2)
t_6 = (x1 - t_4) / t_0
t_7 = (x1 * x1) * (6.0d0 + (4.0d0 * t_6))
if (x1 <= (-9.5d+115)) then
tmp = x1 - (x2 * (6.0d0 + (t_2 / x2)))
else if (x1 <= (-550.0d0)) then
tmp = x1 + (9.0d0 + (x1 + (t_1 + (t_5 - (t_0 * (t_7 + (((-1.0d0) / x1) * ((x1 * 2.0d0) * t_6))))))))
else if (x1 <= 4d-18) then
tmp = (x2 * (-6.0d0)) + ((x1 * ((-1.0d0) + (x1 * 9.0d0))) + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * ((x1 * 12.0d0) - 12.0d0)))))
else if (x1 <= 4.4d+153) then
tmp = x1 + (9.0d0 + (x1 + (t_1 + (t_5 + (t_0 * (((((t_4 - x1) / t_0) - 3.0d0) * ((x1 * 2.0d0) * (2.0d0 * x2))) - t_7))))))
else
tmp = x1 - t_2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (2.0 - (x1 * 9.0));
double t_3 = x1 * (x1 * 3.0);
double t_4 = t_3 + (2.0 * x2);
double t_5 = t_3 * (2.0 * x2);
double t_6 = (x1 - t_4) / t_0;
double t_7 = (x1 * x1) * (6.0 + (4.0 * t_6));
double tmp;
if (x1 <= -9.5e+115) {
tmp = x1 - (x2 * (6.0 + (t_2 / x2)));
} else if (x1 <= -550.0) {
tmp = x1 + (9.0 + (x1 + (t_1 + (t_5 - (t_0 * (t_7 + ((-1.0 / x1) * ((x1 * 2.0) * t_6))))))));
} else if (x1 <= 4e-18) {
tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))));
} else if (x1 <= 4.4e+153) {
tmp = x1 + (9.0 + (x1 + (t_1 + (t_5 + (t_0 * (((((t_4 - x1) / t_0) - 3.0) * ((x1 * 2.0) * (2.0 * x2))) - t_7))))));
} else {
tmp = x1 - t_2;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * x1) t_2 = x1 * (2.0 - (x1 * 9.0)) t_3 = x1 * (x1 * 3.0) t_4 = t_3 + (2.0 * x2) t_5 = t_3 * (2.0 * x2) t_6 = (x1 - t_4) / t_0 t_7 = (x1 * x1) * (6.0 + (4.0 * t_6)) tmp = 0 if x1 <= -9.5e+115: tmp = x1 - (x2 * (6.0 + (t_2 / x2))) elif x1 <= -550.0: tmp = x1 + (9.0 + (x1 + (t_1 + (t_5 - (t_0 * (t_7 + ((-1.0 / x1) * ((x1 * 2.0) * t_6)))))))) elif x1 <= 4e-18: tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))) elif x1 <= 4.4e+153: tmp = x1 + (9.0 + (x1 + (t_1 + (t_5 + (t_0 * (((((t_4 - x1) / t_0) - 3.0) * ((x1 * 2.0) * (2.0 * x2))) - t_7)))))) else: tmp = x1 - t_2 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(x1 * Float64(2.0 - Float64(x1 * 9.0))) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(t_3 + Float64(2.0 * x2)) t_5 = Float64(t_3 * Float64(2.0 * x2)) t_6 = Float64(Float64(x1 - t_4) / t_0) t_7 = Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_6))) tmp = 0.0 if (x1 <= -9.5e+115) tmp = Float64(x1 - Float64(x2 * Float64(6.0 + Float64(t_2 / x2)))); elseif (x1 <= -550.0) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_1 + Float64(t_5 - Float64(t_0 * Float64(t_7 + Float64(Float64(-1.0 / x1) * Float64(Float64(x1 * 2.0) * t_6))))))))); elseif (x1 <= 4e-18) tmp = Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0))) + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(x1 * 12.0) - 12.0)))))); elseif (x1 <= 4.4e+153) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_1 + Float64(t_5 + Float64(t_0 * Float64(Float64(Float64(Float64(Float64(t_4 - x1) / t_0) - 3.0) * Float64(Float64(x1 * 2.0) * Float64(2.0 * x2))) - t_7))))))); else tmp = Float64(x1 - t_2); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * x1); t_2 = x1 * (2.0 - (x1 * 9.0)); t_3 = x1 * (x1 * 3.0); t_4 = t_3 + (2.0 * x2); t_5 = t_3 * (2.0 * x2); t_6 = (x1 - t_4) / t_0; t_7 = (x1 * x1) * (6.0 + (4.0 * t_6)); tmp = 0.0; if (x1 <= -9.5e+115) tmp = x1 - (x2 * (6.0 + (t_2 / x2))); elseif (x1 <= -550.0) tmp = x1 + (9.0 + (x1 + (t_1 + (t_5 - (t_0 * (t_7 + ((-1.0 / x1) * ((x1 * 2.0) * t_6)))))))); elseif (x1 <= 4e-18) tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))); elseif (x1 <= 4.4e+153) tmp = x1 + (9.0 + (x1 + (t_1 + (t_5 + (t_0 * (((((t_4 - x1) / t_0) - 3.0) * ((x1 * 2.0) * (2.0 * x2))) - t_7)))))); else tmp = x1 - t_2; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$3 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 - t$95$4), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -9.5e+115], N[(x1 - N[(x2 * N[(6.0 + N[(t$95$2 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -550.0], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$1 + N[(t$95$5 - N[(t$95$0 * N[(t$95$7 + N[(N[(-1.0 / x1), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4e-18], N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 12.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.4e+153], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$1 + N[(t$95$5 + N[(t$95$0 * N[(N[(N[(N[(N[(t$95$4 - x1), $MachinePrecision] / t$95$0), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 - t$95$2), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot \left(2 - x1 \cdot 9\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := t\_3 + 2 \cdot x2\\
t_5 := t\_3 \cdot \left(2 \cdot x2\right)\\
t_6 := \frac{x1 - t\_4}{t\_0}\\
t_7 := \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_6\right)\\
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{+115}:\\
\;\;\;\;x1 - x2 \cdot \left(6 + \frac{t\_2}{x2}\right)\\
\mathbf{elif}\;x1 \leq -550:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_1 + \left(t\_5 - t\_0 \cdot \left(t\_7 + \frac{-1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot t\_6\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{-18}:\\
\;\;\;\;x2 \cdot -6 + \left(x1 \cdot \left(-1 + x1 \cdot 9\right) + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(x1 \cdot 12 - 12\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_1 + \left(t\_5 + t\_0 \cdot \left(\left(\frac{t\_4 - x1}{t\_0} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right) - t\_7\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 - t\_2\\
\end{array}
\end{array}
if x1 < -9.4999999999999997e115Initial program 0.0%
Simplified32.5%
Taylor expanded in x1 around 0 44.8%
Taylor expanded in x2 around 0 70.2%
Taylor expanded in x2 around inf 95.4%
if -9.4999999999999997e115 < x1 < -550Initial program 99.5%
Taylor expanded in x1 around inf 99.2%
Taylor expanded in x1 around 0 91.0%
Taylor expanded in x1 around inf 88.9%
if -550 < x1 < 4.0000000000000003e-18Initial program 99.5%
Simplified89.4%
Taylor expanded in x1 around 0 89.5%
Taylor expanded in x2 around 0 99.9%
if 4.0000000000000003e-18 < x1 < 4.3999999999999999e153Initial program 99.4%
Taylor expanded in x1 around inf 98.0%
Taylor expanded in x1 around 0 93.0%
Taylor expanded in x1 around 0 86.6%
if 4.3999999999999999e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 70.7%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Final simplification96.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (- 2.0 (* x1 9.0))))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- x1 (+ t_2 (* 2.0 x2))) t_0))
(t_4
(+
x1
(+
9.0
(+
x1
(+
(* x1 (* x1 x1))
(-
(* t_2 (* 2.0 x2))
(*
t_0
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_3)))
(* (/ -1.0 x1) (* (* x1 2.0) t_3)))))))))))
(if (<= x1 -9.5e+115)
(- x1 (* x2 (+ 6.0 (/ t_1 x2))))
(if (<= x1 -400.0)
t_4
(if (<= x1 450000.0)
(+
(* x2 -6.0)
(+
(* x1 (+ -1.0 (* x1 9.0)))
(* x2 (+ (* 8.0 (* x1 x2)) (* x1 (- (* x1 12.0) 12.0))))))
(if (<= x1 4.4e+153) t_4 (- x1 t_1)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (2.0 - (x1 * 9.0));
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 - (t_2 + (2.0 * x2))) / t_0;
double t_4 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (2.0 * x2)) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * t_3))) + ((-1.0 / x1) * ((x1 * 2.0) * t_3))))))));
double tmp;
if (x1 <= -9.5e+115) {
tmp = x1 - (x2 * (6.0 + (t_1 / x2)));
} else if (x1 <= -400.0) {
tmp = t_4;
} else if (x1 <= 450000.0) {
tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))));
} else if (x1 <= 4.4e+153) {
tmp = t_4;
} else {
tmp = x1 - t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (2.0d0 - (x1 * 9.0d0))
t_2 = x1 * (x1 * 3.0d0)
t_3 = (x1 - (t_2 + (2.0d0 * x2))) / t_0
t_4 = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (2.0d0 * x2)) - (t_0 * (((x1 * x1) * (6.0d0 + (4.0d0 * t_3))) + (((-1.0d0) / x1) * ((x1 * 2.0d0) * t_3))))))))
if (x1 <= (-9.5d+115)) then
tmp = x1 - (x2 * (6.0d0 + (t_1 / x2)))
else if (x1 <= (-400.0d0)) then
tmp = t_4
else if (x1 <= 450000.0d0) then
tmp = (x2 * (-6.0d0)) + ((x1 * ((-1.0d0) + (x1 * 9.0d0))) + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * ((x1 * 12.0d0) - 12.0d0)))))
else if (x1 <= 4.4d+153) then
tmp = t_4
else
tmp = x1 - t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (2.0 - (x1 * 9.0));
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 - (t_2 + (2.0 * x2))) / t_0;
double t_4 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (2.0 * x2)) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * t_3))) + ((-1.0 / x1) * ((x1 * 2.0) * t_3))))))));
double tmp;
if (x1 <= -9.5e+115) {
tmp = x1 - (x2 * (6.0 + (t_1 / x2)));
} else if (x1 <= -400.0) {
tmp = t_4;
} else if (x1 <= 450000.0) {
tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))));
} else if (x1 <= 4.4e+153) {
tmp = t_4;
} else {
tmp = x1 - t_1;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (2.0 - (x1 * 9.0)) t_2 = x1 * (x1 * 3.0) t_3 = (x1 - (t_2 + (2.0 * x2))) / t_0 t_4 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (2.0 * x2)) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * t_3))) + ((-1.0 / x1) * ((x1 * 2.0) * t_3)))))))) tmp = 0 if x1 <= -9.5e+115: tmp = x1 - (x2 * (6.0 + (t_1 / x2))) elif x1 <= -400.0: tmp = t_4 elif x1 <= 450000.0: tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))) elif x1 <= 4.4e+153: tmp = t_4 else: tmp = x1 - t_1 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(2.0 - Float64(x1 * 9.0))) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(x1 - Float64(t_2 + Float64(2.0 * x2))) / t_0) t_4 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * Float64(2.0 * x2)) - Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_3))) + Float64(Float64(-1.0 / x1) * Float64(Float64(x1 * 2.0) * t_3))))))))) tmp = 0.0 if (x1 <= -9.5e+115) tmp = Float64(x1 - Float64(x2 * Float64(6.0 + Float64(t_1 / x2)))); elseif (x1 <= -400.0) tmp = t_4; elseif (x1 <= 450000.0) tmp = Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0))) + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(x1 * 12.0) - 12.0)))))); elseif (x1 <= 4.4e+153) tmp = t_4; else tmp = Float64(x1 - t_1); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (2.0 - (x1 * 9.0)); t_2 = x1 * (x1 * 3.0); t_3 = (x1 - (t_2 + (2.0 * x2))) / t_0; t_4 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (2.0 * x2)) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * t_3))) + ((-1.0 / x1) * ((x1 * 2.0) * t_3)))))))); tmp = 0.0; if (x1 <= -9.5e+115) tmp = x1 - (x2 * (6.0 + (t_1 / x2))); elseif (x1 <= -400.0) tmp = t_4; elseif (x1 <= 450000.0) tmp = (x2 * -6.0) + ((x1 * (-1.0 + (x1 * 9.0))) + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))); elseif (x1 <= 4.4e+153) tmp = t_4; else tmp = x1 - t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 - N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(9.0 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / x1), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -9.5e+115], N[(x1 - N[(x2 * N[(6.0 + N[(t$95$1 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -400.0], t$95$4, If[LessEqual[x1, 450000.0], N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 12.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.4e+153], t$95$4, N[(x1 - t$95$1), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(2 - x1 \cdot 9\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{x1 - \left(t\_2 + 2 \cdot x2\right)}{t\_0}\\
t_4 := x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_2 \cdot \left(2 \cdot x2\right) - t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_3\right) + \frac{-1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot t\_3\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{+115}:\\
\;\;\;\;x1 - x2 \cdot \left(6 + \frac{t\_1}{x2}\right)\\
\mathbf{elif}\;x1 \leq -400:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 450000:\\
\;\;\;\;x2 \cdot -6 + \left(x1 \cdot \left(-1 + x1 \cdot 9\right) + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(x1 \cdot 12 - 12\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;x1 - t\_1\\
\end{array}
\end{array}
if x1 < -9.4999999999999997e115Initial program 0.0%
Simplified32.5%
Taylor expanded in x1 around 0 44.8%
Taylor expanded in x2 around 0 70.2%
Taylor expanded in x2 around inf 95.4%
if -9.4999999999999997e115 < x1 < -400 or 4.5e5 < x1 < 4.3999999999999999e153Initial program 99.4%
Taylor expanded in x1 around inf 99.3%
Taylor expanded in x1 around 0 93.6%
Taylor expanded in x1 around inf 87.4%
if -400 < x1 < 4.5e5Initial program 99.4%
Simplified89.8%
Taylor expanded in x1 around 0 88.5%
Taylor expanded in x2 around 0 98.4%
if 4.3999999999999999e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 70.7%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Final simplification95.9%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x1 -1.7e+34) (not (<= x1 2.95e+116)))
(- x1 (* x2 (+ 6.0 (/ (* x1 (- 2.0 (* x1 9.0))) x2))))
(+
x1
(+
(* x2 -6.0)
(+
(* x1 (- (* x1 9.0) 2.0))
(* x2 (+ (* 8.0 (* x1 x2)) (* x1 -12.0))))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.7e+34) || !(x1 <= 2.95e+116)) {
tmp = x1 - (x2 * (6.0 + ((x1 * (2.0 - (x1 * 9.0))) / x2)));
} else {
tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * -12.0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-1.7d+34)) .or. (.not. (x1 <= 2.95d+116))) then
tmp = x1 - (x2 * (6.0d0 + ((x1 * (2.0d0 - (x1 * 9.0d0))) / x2)))
else
tmp = x1 + ((x2 * (-6.0d0)) + ((x1 * ((x1 * 9.0d0) - 2.0d0)) + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * (-12.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.7e+34) || !(x1 <= 2.95e+116)) {
tmp = x1 - (x2 * (6.0 + ((x1 * (2.0 - (x1 * 9.0))) / x2)));
} else {
tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * -12.0)))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -1.7e+34) or not (x1 <= 2.95e+116): tmp = x1 - (x2 * (6.0 + ((x1 * (2.0 - (x1 * 9.0))) / x2))) else: tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * -12.0))))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -1.7e+34) || !(x1 <= 2.95e+116)) tmp = Float64(x1 - Float64(x2 * Float64(6.0 + Float64(Float64(x1 * Float64(2.0 - Float64(x1 * 9.0))) / x2)))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * -12.0)))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -1.7e+34) || ~((x1 <= 2.95e+116))) tmp = x1 - (x2 * (6.0 + ((x1 * (2.0 - (x1 * 9.0))) / x2))); else tmp = x1 + ((x2 * -6.0) + ((x1 * ((x1 * 9.0) - 2.0)) + (x2 * ((8.0 * (x1 * x2)) + (x1 * -12.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -1.7e+34], N[Not[LessEqual[x1, 2.95e+116]], $MachinePrecision]], N[(x1 - N[(x2 * N[(6.0 + N[(N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.7 \cdot 10^{+34} \lor \neg \left(x1 \leq 2.95 \cdot 10^{+116}\right):\\
\;\;\;\;x1 - x2 \cdot \left(6 + \frac{x1 \cdot \left(2 - x1 \cdot 9\right)}{x2}\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 \cdot \left(x1 \cdot 9 - 2\right) + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot -12\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.7e34 or 2.95e116 < x1 Initial program 24.2%
Simplified36.4%
Taylor expanded in x1 around 0 46.0%
Taylor expanded in x2 around 0 66.0%
Taylor expanded in x2 around inf 84.9%
if -1.7e34 < x1 < 2.95e116Initial program 99.4%
Simplified91.5%
Taylor expanded in x1 around 0 76.7%
Taylor expanded in x2 around inf 76.7%
Taylor expanded in x2 around 0 76.8%
associate-*r/76.8%
*-commutative76.8%
associate-*r/76.8%
Simplified76.8%
Taylor expanded in x2 around 0 84.9%
Final simplification84.9%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -7e+15) (not (<= x1 3.6e+114))) (- x1 (* x2 (+ 6.0 (/ (* x1 (- 2.0 (* x1 9.0))) x2)))) (- (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- 3.0 (* 2.0 x2)))) -1.0)))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -7e+15) || !(x1 <= 3.6e+114)) {
tmp = x1 - (x2 * (6.0 + ((x1 * (2.0 - (x1 * 9.0))) / x2)));
} else {
tmp = (x2 * -6.0) - (x1 * ((4.0 * (x2 * (3.0 - (2.0 * x2)))) - -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-7d+15)) .or. (.not. (x1 <= 3.6d+114))) then
tmp = x1 - (x2 * (6.0d0 + ((x1 * (2.0d0 - (x1 * 9.0d0))) / x2)))
else
tmp = (x2 * (-6.0d0)) - (x1 * ((4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2)))) - (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -7e+15) || !(x1 <= 3.6e+114)) {
tmp = x1 - (x2 * (6.0 + ((x1 * (2.0 - (x1 * 9.0))) / x2)));
} else {
tmp = (x2 * -6.0) - (x1 * ((4.0 * (x2 * (3.0 - (2.0 * x2)))) - -1.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -7e+15) or not (x1 <= 3.6e+114): tmp = x1 - (x2 * (6.0 + ((x1 * (2.0 - (x1 * 9.0))) / x2))) else: tmp = (x2 * -6.0) - (x1 * ((4.0 * (x2 * (3.0 - (2.0 * x2)))) - -1.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -7e+15) || !(x1 <= 3.6e+114)) tmp = Float64(x1 - Float64(x2 * Float64(6.0 + Float64(Float64(x1 * Float64(2.0 - Float64(x1 * 9.0))) / x2)))); else tmp = Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))) - -1.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -7e+15) || ~((x1 <= 3.6e+114))) tmp = x1 - (x2 * (6.0 + ((x1 * (2.0 - (x1 * 9.0))) / x2))); else tmp = (x2 * -6.0) - (x1 * ((4.0 * (x2 * (3.0 - (2.0 * x2)))) - -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -7e+15], N[Not[LessEqual[x1, 3.6e+114]], $MachinePrecision]], N[(x1 - N[(x2 * N[(6.0 + N[(N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -7 \cdot 10^{+15} \lor \neg \left(x1 \leq 3.6 \cdot 10^{+114}\right):\\
\;\;\;\;x1 - x2 \cdot \left(6 + \frac{x1 \cdot \left(2 - x1 \cdot 9\right)}{x2}\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - -1\right)\\
\end{array}
\end{array}
if x1 < -7e15 or 3.6000000000000001e114 < x1 Initial program 25.6%
Simplified37.5%
Taylor expanded in x1 around 0 45.3%
Taylor expanded in x2 around 0 64.9%
Taylor expanded in x2 around inf 83.5%
if -7e15 < x1 < 3.6000000000000001e114Initial program 99.4%
Simplified99.4%
Taylor expanded in x1 around 0 76.8%
Final simplification79.6%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -2.8e-14) (not (<= x1 6e-16))) (- x1 (* x1 (- 2.0 (* x1 9.0)))) (- (* x2 -6.0) x1)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.8e-14) || !(x1 <= 6e-16)) {
tmp = x1 - (x1 * (2.0 - (x1 * 9.0)));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-2.8d-14)) .or. (.not. (x1 <= 6d-16))) then
tmp = x1 - (x1 * (2.0d0 - (x1 * 9.0d0)))
else
tmp = (x2 * (-6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.8e-14) || !(x1 <= 6e-16)) {
tmp = x1 - (x1 * (2.0 - (x1 * 9.0)));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -2.8e-14) or not (x1 <= 6e-16): tmp = x1 - (x1 * (2.0 - (x1 * 9.0))) else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -2.8e-14) || !(x1 <= 6e-16)) tmp = Float64(x1 - Float64(x1 * Float64(2.0 - Float64(x1 * 9.0)))); else tmp = Float64(Float64(x2 * -6.0) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -2.8e-14) || ~((x1 <= 6e-16))) tmp = x1 - (x1 * (2.0 - (x1 * 9.0))); else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -2.8e-14], N[Not[LessEqual[x1, 6e-16]], $MachinePrecision]], N[(x1 - N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.8 \cdot 10^{-14} \lor \neg \left(x1 \leq 6 \cdot 10^{-16}\right):\\
\;\;\;\;x1 - x1 \cdot \left(2 - x1 \cdot 9\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x1 < -2.8000000000000001e-14 or 5.99999999999999987e-16 < x1 Initial program 41.9%
Simplified51.2%
Taylor expanded in x1 around 0 42.8%
Taylor expanded in x2 around 0 53.1%
Taylor expanded in x2 around 0 53.2%
if -2.8000000000000001e-14 < x1 < 5.99999999999999987e-16Initial program 99.5%
Simplified89.3%
Taylor expanded in x1 around 0 89.4%
Taylor expanded in x2 around 0 76.7%
Taylor expanded in x1 around 0 76.7%
*-commutative76.7%
mul-1-neg76.7%
unsub-neg76.7%
Simplified76.7%
Final simplification63.8%
(FPCore (x1 x2) :precision binary64 (- x1 (* x2 (+ 6.0 (/ (* x1 (- 2.0 (* x1 9.0))) x2)))))
double code(double x1, double x2) {
return x1 - (x2 * (6.0 + ((x1 * (2.0 - (x1 * 9.0))) / x2)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 - (x2 * (6.0d0 + ((x1 * (2.0d0 - (x1 * 9.0d0))) / x2)))
end function
public static double code(double x1, double x2) {
return x1 - (x2 * (6.0 + ((x1 * (2.0 - (x1 * 9.0))) / x2)));
}
def code(x1, x2): return x1 - (x2 * (6.0 + ((x1 * (2.0 - (x1 * 9.0))) / x2)))
function code(x1, x2) return Float64(x1 - Float64(x2 * Float64(6.0 + Float64(Float64(x1 * Float64(2.0 - Float64(x1 * 9.0))) / x2)))) end
function tmp = code(x1, x2) tmp = x1 - (x2 * (6.0 + ((x1 * (2.0 - (x1 * 9.0))) / x2))); end
code[x1_, x2_] := N[(x1 - N[(x2 * N[(6.0 + N[(N[(x1 * N[(2.0 - N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 - x2 \cdot \left(6 + \frac{x1 \cdot \left(2 - x1 \cdot 9\right)}{x2}\right)
\end{array}
Initial program 68.0%
Simplified68.5%
Taylor expanded in x1 around 0 63.9%
Taylor expanded in x2 around 0 63.8%
Taylor expanded in x2 around inf 71.7%
Final simplification71.7%
(FPCore (x1 x2) :precision binary64 (+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))))
double code(double x1, double x2) {
return (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end function
public static double code(double x1, double x2) {
return (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
def code(x1, x2): return (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)))
function code(x1, x2) return Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))) end
function tmp = code(x1, x2) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end
code[x1_, x2_] := N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)
\end{array}
Initial program 68.0%
Simplified68.5%
Taylor expanded in x1 around 0 63.9%
Taylor expanded in x2 around 0 63.8%
Taylor expanded in x1 around 0 63.8%
Final simplification63.8%
(FPCore (x1 x2) :precision binary64 (- (* x2 -6.0) x1))
double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x2 * (-6.0d0)) - x1
end function
public static double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
def code(x1, x2): return (x2 * -6.0) - x1
function code(x1, x2) return Float64(Float64(x2 * -6.0) - x1) end
function tmp = code(x1, x2) tmp = (x2 * -6.0) - x1; end
code[x1_, x2_] := N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6 - x1
\end{array}
Initial program 68.0%
Simplified68.5%
Taylor expanded in x1 around 0 63.9%
Taylor expanded in x2 around 0 63.8%
Taylor expanded in x1 around 0 36.9%
*-commutative36.9%
mul-1-neg36.9%
unsub-neg36.9%
Simplified36.9%
(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 68.0%
Simplified68.0%
Taylor expanded in x1 around 0 25.5%
*-commutative25.5%
Simplified25.5%
(FPCore (x1 x2) :precision binary64 9.0)
double code(double x1, double x2) {
return 9.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = 9.0d0
end function
public static double code(double x1, double x2) {
return 9.0;
}
def code(x1, x2): return 9.0
function code(x1, x2) return 9.0 end
function tmp = code(x1, x2) tmp = 9.0; end
code[x1_, x2_] := 9.0
\begin{array}{l}
\\
9
\end{array}
Initial program 68.0%
Taylor expanded in x1 around inf 34.5%
Taylor expanded in x1 around inf 50.1%
*-commutative50.1%
Simplified50.1%
Taylor expanded in x1 around 0 3.7%
herbie shell --seed 2024157
(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))))))