
(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 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (fma x1 (* x1 3.0) (* 2.0 x2)))
(t_3 (/ (- t_2 x1) (fma x1 x1 1.0)))
(t_4 (/ (- x1 t_2) (fma x1 x1 1.0)))
(t_5 (+ t_0 (* 2.0 x2)))
(t_6 (/ (- t_5 x1) t_1))
(t_7 (* 3.0 (* x1 x1))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
(-
(* (- t_6 3.0) (* (* x1 2.0) (/ (- x1 t_5) t_1)))
(* (* x1 x1) (- (* t_6 4.0) 6.0)))
(- -1.0 (* x1 x1)))
(* t_0 t_6))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_7 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_3 4.0 -6.0)) (* (* x1 (* 2.0 t_4)) (- t_4 -3.0)))
(fma t_7 t_3 (pow x1 3.0))))))
(pow (pow (fma x2 -6.0 x1) 3.0) 0.3333333333333333))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = fma(x1, (x1 * 3.0), (2.0 * x2));
double t_3 = (t_2 - x1) / fma(x1, x1, 1.0);
double t_4 = (x1 - t_2) / fma(x1, x1, 1.0);
double t_5 = t_0 + (2.0 * x2);
double t_6 = (t_5 - x1) / t_1;
double t_7 = 3.0 * (x1 * x1);
double tmp;
if ((x1 + ((x1 + ((((((t_6 - 3.0) * ((x1 * 2.0) * ((x1 - t_5) / t_1))) - ((x1 * x1) * ((t_6 * 4.0) - 6.0))) * (-1.0 - (x1 * x1))) + (t_0 * t_6)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_7 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_3, 4.0, -6.0)), ((x1 * (2.0 * t_4)) * (t_4 - -3.0))), fma(t_7, t_3, pow(x1, 3.0)))));
} else {
tmp = pow(pow(fma(x2, -6.0, x1), 3.0), 0.3333333333333333);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) t_3 = Float64(Float64(t_2 - x1) / fma(x1, x1, 1.0)) t_4 = Float64(Float64(x1 - t_2) / fma(x1, x1, 1.0)) t_5 = Float64(t_0 + Float64(2.0 * x2)) t_6 = Float64(Float64(t_5 - x1) / t_1) t_7 = Float64(3.0 * Float64(x1 * x1)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(t_6 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(x1 - t_5) / t_1))) - Float64(Float64(x1 * x1) * Float64(Float64(t_6 * 4.0) - 6.0))) * Float64(-1.0 - Float64(x1 * x1))) + Float64(t_0 * t_6)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_7 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_3, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_4)) * Float64(t_4 - -3.0))), fma(t_7, t_3, (x1 ^ 3.0)))))); else tmp = (fma(x2, -6.0, x1) ^ 3.0) ^ 0.3333333333333333; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 - t$95$2), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(t$95$5 - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$7 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(t$95$6 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(x1 - t$95$5), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$6 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$6), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$7 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$3 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$4), $MachinePrecision]), $MachinePrecision] * N[(t$95$4 - -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$7 * t$95$3 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Power[N[(x2 * -6.0 + x1), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right)\\
t_3 := \frac{t_2 - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_4 := \frac{x1 - t_2}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_5 := t_0 + 2 \cdot x2\\
t_6 := \frac{t_5 - x1}{t_1}\\
t_7 := 3 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(\left(\left(t_6 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \frac{x1 - t_5}{t_1}\right) - \left(x1 \cdot x1\right) \cdot \left(t_6 \cdot 4 - 6\right)\right) \cdot \left(-1 - x1 \cdot x1\right) + t_0 \cdot t_6\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_7 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t_3, 4, -6\right), \left(x1 \cdot \left(2 \cdot t_4\right)\right) \cdot \left(t_4 - -3\right)\right), \mathsf{fma}\left(t_7, t_3, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(\mathsf{fma}\left(x2, -6, x1\right)\right)}^{3}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
Simplified99.6%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 3.0%
*-commutative3.0%
Simplified3.0%
add-cbrt-cube43.1%
pow1/3100.0%
pow3100.0%
+-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Final simplification99.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ t_0 (* 2.0 x2)))
(t_2 (/ (- (fma (* x1 3.0) x1 (* 2.0 x2)) x1) (fma x1 x1 1.0)))
(t_3 (* x1 (* x1 x1)))
(t_4 (+ (* x1 x1) 1.0))
(t_5 (/ (- t_1 x1) t_4)))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
(-
(* (- t_5 3.0) (* (* x1 2.0) (/ (- x1 t_1) t_4)))
(* (* x1 x1) (- (* t_5 4.0) 6.0)))
(- -1.0 (* x1 x1)))
(* t_0 t_5))
t_3))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_4))))
INFINITY)
(+
x1
(+
(+
t_3
(fma
(fma (* (* x1 2.0) t_2) (+ -3.0 t_2) (* (* x1 x1) (fma 4.0 t_2 -6.0)))
(fma x1 x1 1.0)
(* t_0 t_2)))
(- x1 (* 3.0 (/ (- (+ x1 (* 2.0 x2)) t_0) (fma x1 x1 1.0))))))
(pow (pow (fma x2 -6.0 x1) 3.0) 0.3333333333333333))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = t_0 + (2.0 * x2);
double t_2 = (fma((x1 * 3.0), x1, (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double t_3 = x1 * (x1 * x1);
double t_4 = (x1 * x1) + 1.0;
double t_5 = (t_1 - x1) / t_4;
double tmp;
if ((x1 + ((x1 + ((((((t_5 - 3.0) * ((x1 * 2.0) * ((x1 - t_1) / t_4))) - ((x1 * x1) * ((t_5 * 4.0) - 6.0))) * (-1.0 - (x1 * x1))) + (t_0 * t_5)) + t_3)) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_4)))) <= ((double) INFINITY)) {
tmp = x1 + ((t_3 + fma(fma(((x1 * 2.0) * t_2), (-3.0 + t_2), ((x1 * x1) * fma(4.0, t_2, -6.0))), fma(x1, x1, 1.0), (t_0 * t_2))) + (x1 - (3.0 * (((x1 + (2.0 * x2)) - t_0) / fma(x1, x1, 1.0)))));
} else {
tmp = pow(pow(fma(x2, -6.0, x1), 3.0), 0.3333333333333333);
}
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(fma(Float64(x1 * 3.0), x1, Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) t_3 = Float64(x1 * Float64(x1 * x1)) t_4 = Float64(Float64(x1 * x1) + 1.0) t_5 = Float64(Float64(t_1 - x1) / t_4) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(t_5 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(x1 - t_1) / t_4))) - Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0))) * Float64(-1.0 - Float64(x1 * x1))) + Float64(t_0 * t_5)) + t_3)) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_4)))) <= Inf) tmp = Float64(x1 + Float64(Float64(t_3 + fma(fma(Float64(Float64(x1 * 2.0) * t_2), Float64(-3.0 + t_2), Float64(Float64(x1 * x1) * fma(4.0, t_2, -6.0))), fma(x1, x1, 1.0), Float64(t_0 * t_2))) + Float64(x1 - Float64(3.0 * Float64(Float64(Float64(x1 + Float64(2.0 * x2)) - t_0) / fma(x1, x1, 1.0)))))); else tmp = (fma(x2, -6.0, x1) ^ 3.0) ^ 0.3333333333333333; end return 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[(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$3 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$1 - x1), $MachinePrecision] / t$95$4), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(t$95$5 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(x1 - t$95$1), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$5), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(N[(t$95$3 + N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(-3.0 + t$95$2), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(4.0 * t$95$2 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x1 * x1 + 1.0), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 - N[(3.0 * N[(N[(N[(x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Power[N[(x2 * -6.0 + x1), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $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 := \frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_3 := x1 \cdot \left(x1 \cdot x1\right)\\
t_4 := x1 \cdot x1 + 1\\
t_5 := \frac{t_1 - x1}{t_4}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(\left(\left(t_5 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \frac{x1 - t_1}{t_4}\right) - \left(x1 \cdot x1\right) \cdot \left(t_5 \cdot 4 - 6\right)\right) \cdot \left(-1 - x1 \cdot x1\right) + t_0 \cdot t_5\right) + t_3\right)\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_4}\right) \leq \infty:\\
\;\;\;\;x1 + \left(\left(t_3 + \mathsf{fma}\left(\mathsf{fma}\left(\left(x1 \cdot 2\right) \cdot t_2, -3 + t_2, \left(x1 \cdot x1\right) \cdot \mathsf{fma}\left(4, t_2, -6\right)\right), \mathsf{fma}\left(x1, x1, 1\right), t_0 \cdot t_2\right)\right) + \left(x1 - 3 \cdot \frac{\left(x1 + 2 \cdot x2\right) - t_0}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(\mathsf{fma}\left(x2, -6, x1\right)\right)}^{3}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
Simplified99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 3.0%
*-commutative3.0%
Simplified3.0%
add-cbrt-cube43.1%
pow1/3100.0%
pow3100.0%
+-commutative100.0%
fma-def100.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 (/ (- t_1 x1) t_2))
(t_4
(+
x1
(+
(+
x1
(+
(+
(*
(-
(* (- t_3 3.0) (* (* x1 2.0) (/ (- x1 t_1) t_2)))
(* (* x1 x1) (- (* t_3 4.0) 6.0)))
(- -1.0 (* x1 x1)))
(* t_0 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))))))
(if (<= t_4 INFINITY)
t_4
(pow (pow (fma x2 -6.0 x1) 3.0) 0.3333333333333333))))
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 = (t_1 - x1) / t_2;
double t_4 = x1 + ((x1 + ((((((t_3 - 3.0) * ((x1 * 2.0) * ((x1 - t_1) / t_2))) - ((x1 * x1) * ((t_3 * 4.0) - 6.0))) * (-1.0 - (x1 * x1))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_4 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = pow(pow(fma(x2, -6.0, x1), 3.0), 0.3333333333333333);
}
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(t_1 - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(t_3 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(x1 - t_1) / t_2))) - Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0))) * Float64(-1.0 - Float64(x1 * x1))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)))) tmp = 0.0 if (t_4 <= Inf) tmp = t_4; else tmp = (fma(x2, -6.0, x1) ^ 3.0) ^ 0.3333333333333333; end return 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[(t$95$1 - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(t$95$3 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(x1 - t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, Infinity], t$95$4, N[Power[N[Power[N[(x2 * -6.0 + x1), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $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{t_1 - x1}{t_2}\\
t_4 := x1 + \left(\left(x1 + \left(\left(\left(\left(t_3 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \frac{x1 - t_1}{t_2}\right) - \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) \cdot \left(-1 - x1 \cdot x1\right) + t_0 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_2}\right)\\
\mathbf{if}\;t_4 \leq \infty:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(\mathsf{fma}\left(x2, -6, x1\right)\right)}^{3}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 3.0%
*-commutative3.0%
Simplified3.0%
add-cbrt-cube43.1%
pow1/3100.0%
pow3100.0%
+-commutative100.0%
fma-def100.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 (/ (- t_1 x1) t_2))
(t_4
(+
x1
(+
(+
x1
(+
(+
(*
(-
(* (- t_3 3.0) (* (* x1 2.0) (/ (- x1 t_1) t_2)))
(* (* x1 x1) (- (* t_3 4.0) 6.0)))
(- -1.0 (* x1 x1)))
(* t_0 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))))))
(if (<= t_4 INFINITY)
t_4
(+
x1
(+
(-
(* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0))))
(* x1 (+ 2.0 (* 4.0 (* x2 (- 3.0 (* 2.0 x2)))))))
(* x2 -6.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 = (t_1 - x1) / t_2;
double t_4 = x1 + ((x1 + ((((((t_3 - 3.0) * ((x1 * 2.0) * ((x1 - t_1) / t_2))) - ((x1 * x1) * ((t_3 * 4.0) - 6.0))) * (-1.0 - (x1 * x1))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_4 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = x1 + (((3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2))))))) + (x2 * -6.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 = (t_1 - x1) / t_2;
double t_4 = x1 + ((x1 + ((((((t_3 - 3.0) * ((x1 * 2.0) * ((x1 - t_1) / t_2))) - ((x1 * x1) * ((t_3 * 4.0) - 6.0))) * (-1.0 - (x1 * x1))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = t_4;
} else {
tmp = x1 + (((3.0 * (Math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2))))))) + (x2 * -6.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 = (t_1 - x1) / t_2 t_4 = x1 + ((x1 + ((((((t_3 - 3.0) * ((x1 * 2.0) * ((x1 - t_1) / t_2))) - ((x1 * x1) * ((t_3 * 4.0) - 6.0))) * (-1.0 - (x1 * x1))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2))) tmp = 0 if t_4 <= math.inf: tmp = t_4 else: tmp = x1 + (((3.0 * (math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2))))))) + (x2 * -6.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(t_1 - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(t_3 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(x1 - t_1) / t_2))) - Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0))) * Float64(-1.0 - Float64(x1 * x1))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)))) tmp = 0.0 if (t_4 <= Inf) tmp = t_4; else tmp = Float64(x1 + Float64(Float64(Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0)))) - Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))))) + Float64(x2 * -6.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 = (t_1 - x1) / t_2; t_4 = x1 + ((x1 + ((((((t_3 - 3.0) * ((x1 * 2.0) * ((x1 - t_1) / t_2))) - ((x1 * x1) * ((t_3 * 4.0) - 6.0))) * (-1.0 - (x1 * x1))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2))); tmp = 0.0; if (t_4 <= Inf) tmp = t_4; else tmp = x1 + (((3.0 * ((x1 ^ 2.0) * (3.0 - (x2 * -2.0)))) - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2))))))) + (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(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[(t$95$1 - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(t$95$3 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(x1 - t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, Infinity], t$95$4, N[(x1 + N[(N[(N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $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{t_1 - x1}{t_2}\\
t_4 := x1 + \left(\left(x1 + \left(\left(\left(\left(t_3 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \frac{x1 - t_1}{t_2}\right) - \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) \cdot \left(-1 - x1 \cdot x1\right) + t_0 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_2}\right)\\
\mathbf{if}\;t_4 \leq \infty:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right) - x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right) + x2 \cdot -6\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 62.2%
Final simplification90.0%
(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 (/ (- t_1 x1) t_2))
(t_4
(+
x1
(+
(+
x1
(+
(+
(*
(-
(* (- t_3 3.0) (* (* x1 2.0) (/ (- x1 t_1) t_2)))
(* (* x1 x1) (- (* t_3 4.0) 6.0)))
(- -1.0 (* x1 x1)))
(* t_0 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))))))
(if (<= t_4 INFINITY)
t_4
(+ x1 (* x1 (- 1.0 (* 4.0 (* x2 (- 3.0 (* 2.0 x2))))))))))
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 = (t_1 - x1) / t_2;
double t_4 = x1 + ((x1 + ((((((t_3 - 3.0) * ((x1 * 2.0) * ((x1 - t_1) / t_2))) - ((x1 * x1) * ((t_3 * 4.0) - 6.0))) * (-1.0 - (x1 * x1))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_4 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (2.0 * x2))))));
}
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 = (t_1 - x1) / t_2;
double t_4 = x1 + ((x1 + ((((((t_3 - 3.0) * ((x1 * 2.0) * ((x1 - t_1) / t_2))) - ((x1 * x1) * ((t_3 * 4.0) - 6.0))) * (-1.0 - (x1 * x1))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = t_4;
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (2.0 * x2))))));
}
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 = (t_1 - x1) / t_2 t_4 = x1 + ((x1 + ((((((t_3 - 3.0) * ((x1 * 2.0) * ((x1 - t_1) / t_2))) - ((x1 * x1) * ((t_3 * 4.0) - 6.0))) * (-1.0 - (x1 * x1))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2))) tmp = 0 if t_4 <= math.inf: tmp = t_4 else: tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (2.0 * x2)))))) 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(t_1 - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(t_3 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(x1 - t_1) / t_2))) - Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0))) * Float64(-1.0 - Float64(x1 * x1))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)))) tmp = 0.0 if (t_4 <= Inf) tmp = t_4; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 - Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))))); 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 = (t_1 - x1) / t_2; t_4 = x1 + ((x1 + ((((((t_3 - 3.0) * ((x1 * 2.0) * ((x1 - t_1) / t_2))) - ((x1 * x1) * ((t_3 * 4.0) - 6.0))) * (-1.0 - (x1 * x1))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2))); tmp = 0.0; if (t_4 <= Inf) tmp = t_4; else tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (2.0 * x2)))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(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[(t$95$1 - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(t$95$3 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(x1 - t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, Infinity], t$95$4, N[(x1 + N[(x1 * N[(1.0 - N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := t_0 + 2 \cdot x2\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{t_1 - x1}{t_2}\\
t_4 := x1 + \left(\left(x1 + \left(\left(\left(\left(t_3 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \frac{x1 - t_1}{t_2}\right) - \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) \cdot \left(-1 - x1 \cdot x1\right) + t_0 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_2}\right)\\
\mathbf{if}\;t_4 \leq \infty:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 18.8%
Final simplification78.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ t_0 (* 2.0 x2)))
(t_2 (* x2 (- 3.0 (* 2.0 x2))))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_3)))
(t_5 (/ (- t_1 x1) t_3)))
(if (<= x1 -1.32e+154)
(+
x1
(+
(-
(* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0))))
(* x1 (+ 2.0 (* 4.0 t_2))))
(* x2 -6.0)))
(if (<= x1 -8.8e+49)
(+ x1 (+ t_4 (+ x1 (* 6.0 (pow x1 4.0)))))
(if (<= x1 1e+104)
(+
x1
(+
(+
x1
(+
(+
(*
(-
(* (- t_5 3.0) (* (* x1 2.0) (/ (- x1 t_1) t_3)))
(* (* x1 x1) (- (* t_5 4.0) 6.0)))
(- -1.0 (* x1 x1)))
(* t_0 t_5))
(* x1 (* x1 x1))))
t_4))
(+
x1
(+
(- x1 (* 4.0 (* x1 t_2)))
(*
3.0
(fma
x2
-2.0
(- (* (pow x1 2.0) (+ x1 (+ 3.0 (* 2.0 x2)))) x1))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = t_0 + (2.0 * x2);
double t_2 = x2 * (3.0 - (2.0 * x2));
double t_3 = (x1 * x1) + 1.0;
double t_4 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3);
double t_5 = (t_1 - x1) / t_3;
double tmp;
if (x1 <= -1.32e+154) {
tmp = x1 + (((3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) - (x1 * (2.0 + (4.0 * t_2)))) + (x2 * -6.0));
} else if (x1 <= -8.8e+49) {
tmp = x1 + (t_4 + (x1 + (6.0 * pow(x1, 4.0))));
} else if (x1 <= 1e+104) {
tmp = x1 + ((x1 + ((((((t_5 - 3.0) * ((x1 * 2.0) * ((x1 - t_1) / t_3))) - ((x1 * x1) * ((t_5 * 4.0) - 6.0))) * (-1.0 - (x1 * x1))) + (t_0 * t_5)) + (x1 * (x1 * x1)))) + t_4);
} else {
tmp = x1 + ((x1 - (4.0 * (x1 * t_2))) + (3.0 * fma(x2, -2.0, ((pow(x1, 2.0) * (x1 + (3.0 + (2.0 * x2)))) - x1))));
}
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(x2 * Float64(3.0 - Float64(2.0 * x2))) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_3)) t_5 = Float64(Float64(t_1 - x1) / t_3) tmp = 0.0 if (x1 <= -1.32e+154) tmp = Float64(x1 + Float64(Float64(Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0)))) - Float64(x1 * Float64(2.0 + Float64(4.0 * t_2)))) + Float64(x2 * -6.0))); elseif (x1 <= -8.8e+49) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0))))); elseif (x1 <= 1e+104) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(t_5 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(x1 - t_1) / t_3))) - Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0))) * Float64(-1.0 - Float64(x1 * x1))) + Float64(t_0 * t_5)) + Float64(x1 * Float64(x1 * x1)))) + t_4)); else tmp = Float64(x1 + Float64(Float64(x1 - Float64(4.0 * Float64(x1 * t_2))) + Float64(3.0 * fma(x2, -2.0, Float64(Float64((x1 ^ 2.0) * Float64(x1 + Float64(3.0 + Float64(2.0 * x2)))) - x1))))); end return 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[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$1 - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, If[LessEqual[x1, -1.32e+154], N[(x1 + N[(N[(N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(2.0 + N[(4.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -8.8e+49], N[(x1 + N[(t$95$4 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+104], N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(t$95$5 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(x1 - t$95$1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$5), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 - N[(4.0 * N[(x1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0 + N[(N[(N[Power[x1, 2.0], $MachinePrecision] * N[(x1 + N[(3.0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_3}\\
t_5 := \frac{t_1 - x1}{t_3}\\
\mathbf{if}\;x1 \leq -1.32 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right) - x1 \cdot \left(2 + 4 \cdot t_2\right)\right) + x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq -8.8 \cdot 10^{+49}:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+104}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(\left(t_5 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \frac{x1 - t_1}{t_3}\right) - \left(x1 \cdot x1\right) \cdot \left(t_5 \cdot 4 - 6\right)\right) \cdot \left(-1 - x1 \cdot x1\right) + t_0 \cdot t_5\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + t_4\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - 4 \cdot \left(x1 \cdot t_2\right)\right) + 3 \cdot \mathsf{fma}\left(x2, -2, {x1}^{2} \cdot \left(x1 + \left(3 + 2 \cdot x2\right)\right) - x1\right)\right)\\
\end{array}
\end{array}
if x1 < -1.31999999999999998e154Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 56.7%
if -1.31999999999999998e154 < x1 < -8.8000000000000003e49Initial program 59.4%
Taylor expanded in x1 around inf 99.7%
*-commutative99.7%
Simplified99.7%
if -8.8000000000000003e49 < x1 < 1e104Initial program 98.8%
if 1e104 < x1 Initial program 26.3%
Taylor expanded in x1 around 0 6.3%
Taylor expanded in x1 around 0 84.2%
*-commutative84.2%
fma-def84.2%
+-commutative84.2%
mul-1-neg84.2%
unsub-neg84.2%
+-commutative84.2%
unpow384.2%
unpow284.2%
distribute-lft-out97.4%
cancel-sign-sub-inv97.4%
metadata-eval97.4%
Simplified97.4%
Final simplification93.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0)))
(t_3 (+ t_1 (* 2.0 x2)))
(t_4 (/ (- t_3 x1) t_0)))
(if (<= x1 -8.8e+49)
(+ x1 (+ t_2 (+ x1 (* 6.0 (pow x1 4.0)))))
(if (<= x1 1.35e+154)
(+
x1
(+
(+
x1
(+
(+
(*
(-
(* (- t_4 3.0) (* (* x1 2.0) (/ (- x1 t_3) t_0)))
(* (* x1 x1) (- (* t_4 4.0) 6.0)))
(- -1.0 (* x1 x1)))
(* t_1 t_4))
(* x1 (* x1 x1))))
t_2))
(+ x1 (* x1 (- 1.0 (* 4.0 (* x2 (- 3.0 (* 2.0 x2)))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0);
double t_3 = t_1 + (2.0 * x2);
double t_4 = (t_3 - x1) / t_0;
double tmp;
if (x1 <= -8.8e+49) {
tmp = x1 + (t_2 + (x1 + (6.0 * pow(x1, 4.0))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + ((((((t_4 - 3.0) * ((x1 * 2.0) * ((x1 - t_3) / t_0))) - ((x1 * x1) * ((t_4 * 4.0) - 6.0))) * (-1.0 - (x1 * x1))) + (t_1 * t_4)) + (x1 * (x1 * x1)))) + t_2);
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (2.0 * x2))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)
t_3 = t_1 + (2.0d0 * x2)
t_4 = (t_3 - x1) / t_0
if (x1 <= (-8.8d+49)) then
tmp = x1 + (t_2 + (x1 + (6.0d0 * (x1 ** 4.0d0))))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((x1 + ((((((t_4 - 3.0d0) * ((x1 * 2.0d0) * ((x1 - t_3) / t_0))) - ((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0))) * ((-1.0d0) - (x1 * x1))) + (t_1 * t_4)) + (x1 * (x1 * x1)))) + t_2)
else
tmp = x1 + (x1 * (1.0d0 - (4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0);
double t_3 = t_1 + (2.0 * x2);
double t_4 = (t_3 - x1) / t_0;
double tmp;
if (x1 <= -8.8e+49) {
tmp = x1 + (t_2 + (x1 + (6.0 * Math.pow(x1, 4.0))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + ((((((t_4 - 3.0) * ((x1 * 2.0) * ((x1 - t_3) / t_0))) - ((x1 * x1) * ((t_4 * 4.0) - 6.0))) * (-1.0 - (x1 * x1))) + (t_1 * t_4)) + (x1 * (x1 * x1)))) + t_2);
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (2.0 * x2))))));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0) t_3 = t_1 + (2.0 * x2) t_4 = (t_3 - x1) / t_0 tmp = 0 if x1 <= -8.8e+49: tmp = x1 + (t_2 + (x1 + (6.0 * math.pow(x1, 4.0)))) elif x1 <= 1.35e+154: tmp = x1 + ((x1 + ((((((t_4 - 3.0) * ((x1 * 2.0) * ((x1 - t_3) / t_0))) - ((x1 * x1) * ((t_4 * 4.0) - 6.0))) * (-1.0 - (x1 * x1))) + (t_1 * t_4)) + (x1 * (x1 * x1)))) + t_2) else: tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (2.0 * x2)))))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)) t_3 = Float64(t_1 + Float64(2.0 * x2)) t_4 = Float64(Float64(t_3 - x1) / t_0) tmp = 0.0 if (x1 <= -8.8e+49) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(t_4 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(x1 - t_3) / t_0))) - Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0))) * Float64(-1.0 - Float64(x1 * x1))) + Float64(t_1 * t_4)) + Float64(x1 * Float64(x1 * x1)))) + t_2)); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 - Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0); t_3 = t_1 + (2.0 * x2); t_4 = (t_3 - x1) / t_0; tmp = 0.0; if (x1 <= -8.8e+49) tmp = x1 + (t_2 + (x1 + (6.0 * (x1 ^ 4.0)))); elseif (x1 <= 1.35e+154) tmp = x1 + ((x1 + ((((((t_4 - 3.0) * ((x1 * 2.0) * ((x1 - t_3) / t_0))) - ((x1 * x1) * ((t_4 * 4.0) - 6.0))) * (-1.0 - (x1 * x1))) + (t_1 * t_4)) + (x1 * (x1 * x1)))) + t_2); else tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (2.0 * x2)))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x1, -8.8e+49], N[(x1 + N[(t$95$2 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(t$95$4 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(x1 - t$95$3), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 - N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0}\\
t_3 := t_1 + 2 \cdot x2\\
t_4 := \frac{t_3 - x1}{t_0}\\
\mathbf{if}\;x1 \leq -8.8 \cdot 10^{+49}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(\left(t_4 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \frac{x1 - t_3}{t_0}\right) - \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\right) \cdot \left(-1 - x1 \cdot x1\right) + t_1 \cdot t_4\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -8.8000000000000003e49Initial program 19.8%
Taylor expanded in x1 around inf 33.2%
*-commutative33.2%
Simplified33.2%
if -8.8000000000000003e49 < x1 < 1.35000000000000003e154Initial program 98.9%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 39.9%
Final simplification80.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x2 (- 3.0 (* 2.0 x2))))
(t_2 (* x1 (* x1 3.0)))
(t_3 (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0)))
(t_4
(+
x1
(-
t_3
(-
(-
(-
(*
t_0
(+
(* (/ 1.0 x1) (* (* x1 2.0) (+ 3.0 (/ -1.0 x1))))
(*
(* x1 x1)
(+ 6.0 (* 4.0 (/ (- x1 (+ t_2 (* 2.0 x2))) t_0))))))
(* 3.0 t_2))
(* x1 (* x1 x1)))
x1)))))
(if (<= x1 -8e+19)
t_4
(if (<= x1 -1.6e-207)
(+ x1 (+ (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)) (* x2 -6.0)))
(if (<= x1 1.25e-244)
(- (* x2 -6.0) x1)
(if (<= x1 2100000000.0)
(+ x1 (+ t_3 (- x1 (* 4.0 (* x1 t_1)))))
(if (<= x1 1.35e+154) t_4 (+ x1 (* x1 (- 1.0 (* 4.0 t_1)))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x2 * (3.0 - (2.0 * x2));
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0);
double t_4 = x1 + (t_3 - ((((t_0 * (((1.0 / x1) * ((x1 * 2.0) * (3.0 + (-1.0 / x1)))) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - (t_2 + (2.0 * x2))) / t_0)))))) - (3.0 * t_2)) - (x1 * (x1 * x1))) - x1));
double tmp;
if (x1 <= -8e+19) {
tmp = t_4;
} else if (x1 <= -1.6e-207) {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
} else if (x1 <= 1.25e-244) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 2100000000.0) {
tmp = x1 + (t_3 + (x1 - (4.0 * (x1 * t_1))));
} else if (x1 <= 1.35e+154) {
tmp = t_4;
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * 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 = x2 * (3.0d0 - (2.0d0 * x2))
t_2 = x1 * (x1 * 3.0d0)
t_3 = 3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)
t_4 = x1 + (t_3 - ((((t_0 * (((1.0d0 / x1) * ((x1 * 2.0d0) * (3.0d0 + ((-1.0d0) / x1)))) + ((x1 * x1) * (6.0d0 + (4.0d0 * ((x1 - (t_2 + (2.0d0 * x2))) / t_0)))))) - (3.0d0 * t_2)) - (x1 * (x1 * x1))) - x1))
if (x1 <= (-8d+19)) then
tmp = t_4
else if (x1 <= (-1.6d-207)) then
tmp = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (x2 * (-6.0d0)))
else if (x1 <= 1.25d-244) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 2100000000.0d0) then
tmp = x1 + (t_3 + (x1 - (4.0d0 * (x1 * t_1))))
else if (x1 <= 1.35d+154) then
tmp = t_4
else
tmp = x1 + (x1 * (1.0d0 - (4.0d0 * 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 = x2 * (3.0 - (2.0 * x2));
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0);
double t_4 = x1 + (t_3 - ((((t_0 * (((1.0 / x1) * ((x1 * 2.0) * (3.0 + (-1.0 / x1)))) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - (t_2 + (2.0 * x2))) / t_0)))))) - (3.0 * t_2)) - (x1 * (x1 * x1))) - x1));
double tmp;
if (x1 <= -8e+19) {
tmp = t_4;
} else if (x1 <= -1.6e-207) {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
} else if (x1 <= 1.25e-244) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 2100000000.0) {
tmp = x1 + (t_3 + (x1 - (4.0 * (x1 * t_1))));
} else if (x1 <= 1.35e+154) {
tmp = t_4;
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * t_1)));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x2 * (3.0 - (2.0 * x2)) t_2 = x1 * (x1 * 3.0) t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0) t_4 = x1 + (t_3 - ((((t_0 * (((1.0 / x1) * ((x1 * 2.0) * (3.0 + (-1.0 / x1)))) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - (t_2 + (2.0 * x2))) / t_0)))))) - (3.0 * t_2)) - (x1 * (x1 * x1))) - x1)) tmp = 0 if x1 <= -8e+19: tmp = t_4 elif x1 <= -1.6e-207: tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)) elif x1 <= 1.25e-244: tmp = (x2 * -6.0) - x1 elif x1 <= 2100000000.0: tmp = x1 + (t_3 + (x1 - (4.0 * (x1 * t_1)))) elif x1 <= 1.35e+154: tmp = t_4 else: tmp = x1 + (x1 * (1.0 - (4.0 * t_1))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2))) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) t_4 = Float64(x1 + Float64(t_3 - Float64(Float64(Float64(Float64(t_0 * Float64(Float64(Float64(1.0 / x1) * Float64(Float64(x1 * 2.0) * Float64(3.0 + Float64(-1.0 / x1)))) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(Float64(x1 - Float64(t_2 + Float64(2.0 * x2))) / t_0)))))) - Float64(3.0 * t_2)) - Float64(x1 * Float64(x1 * x1))) - x1))) tmp = 0.0 if (x1 <= -8e+19) tmp = t_4; elseif (x1 <= -1.6e-207) tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(x2 * -6.0))); elseif (x1 <= 1.25e-244) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 2100000000.0) tmp = Float64(x1 + Float64(t_3 + Float64(x1 - Float64(4.0 * Float64(x1 * t_1))))); elseif (x1 <= 1.35e+154) tmp = t_4; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 - Float64(4.0 * t_1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x2 * (3.0 - (2.0 * x2)); t_2 = x1 * (x1 * 3.0); t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0); t_4 = x1 + (t_3 - ((((t_0 * (((1.0 / x1) * ((x1 * 2.0) * (3.0 + (-1.0 / x1)))) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - (t_2 + (2.0 * x2))) / t_0)))))) - (3.0 * t_2)) - (x1 * (x1 * x1))) - x1)); tmp = 0.0; if (x1 <= -8e+19) tmp = t_4; elseif (x1 <= -1.6e-207) tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)); elseif (x1 <= 1.25e-244) tmp = (x2 * -6.0) - x1; elseif (x1 <= 2100000000.0) tmp = x1 + (t_3 + (x1 - (4.0 * (x1 * t_1)))); elseif (x1 <= 1.35e+154) tmp = t_4; else tmp = x1 + (x1 * (1.0 - (4.0 * 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[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(t$95$3 - N[(N[(N[(N[(t$95$0 * N[(N[(N[(1.0 / x1), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(N[(x1 - N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * t$95$2), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -8e+19], t$95$4, If[LessEqual[x1, -1.6e-207], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.25e-244], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 2100000000.0], N[(x1 + N[(t$95$3 + N[(x1 - N[(4.0 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$4, N[(x1 + N[(x1 * N[(1.0 - N[(4.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := 3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0}\\
t_4 := x1 + \left(t_3 - \left(\left(\left(t_0 \cdot \left(\frac{1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 + \frac{-1}{x1}\right)\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - \left(t_2 + 2 \cdot x2\right)}{t_0}\right)\right) - 3 \cdot t_2\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\
\mathbf{if}\;x1 \leq -8 \cdot 10^{+19}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x1 \leq -1.6 \cdot 10^{-207}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 1.25 \cdot 10^{-244}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 2100000000:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 - 4 \cdot \left(x1 \cdot t_1\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot t_1\right)\\
\end{array}
\end{array}
if x1 < -8e19 or 2.1e9 < x1 < 1.35000000000000003e154Initial program 57.3%
Taylor expanded in x1 around inf 54.0%
Taylor expanded in x1 around inf 54.0%
Taylor expanded in x1 around inf 54.0%
if -8e19 < x1 < -1.6000000000000002e-207Initial program 99.6%
Taylor expanded in x1 around 0 87.5%
Taylor expanded in x1 around 0 87.9%
if -1.6000000000000002e-207 < x1 < 1.24999999999999999e-244Initial program 99.3%
Taylor expanded in x2 around inf 81.1%
associate-/l*81.1%
+-commutative81.1%
unpow281.1%
fma-udef81.1%
Simplified81.1%
Taylor expanded in x1 around 0 81.4%
Taylor expanded in x2 around 0 97.5%
+-commutative97.5%
*-commutative97.5%
associate-+l+97.6%
distribute-lft1-in97.6%
metadata-eval97.6%
neg-mul-197.6%
Simplified97.6%
if 1.24999999999999999e-244 < x1 < 2.1e9Initial program 97.6%
Taylor expanded in x1 around 0 84.2%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 39.9%
Final simplification71.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- 3.0 (* 2.0 x2))))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x1 (* x1 3.0)))
(t_3 (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_1)))
(t_4
(+
x1
(+
t_3
(+
x1
(+
(* x1 (* x1 x1))
(-
(* 3.0 t_2)
(*
t_1
(-
(*
(- (/ (- (+ t_2 (* 2.0 x2)) x1) t_1) 3.0)
(* (* x1 2.0) (- (/ 1.0 x1) 3.0)))
(* (* x1 x1) 6.0))))))))))
(if (<= x1 -3.6e+19)
t_4
(if (<= x1 -7.4e-208)
(+ x1 (+ (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)) (* x2 -6.0)))
(if (<= x1 1.6e-243)
(- (* x2 -6.0) x1)
(if (<= x1 25000000000.0)
(+ x1 (+ t_3 (- x1 (* 4.0 (* x1 t_0)))))
(if (<= x1 1.35e+154) t_4 (+ x1 (* x1 (- 1.0 (* 4.0 t_0)))))))))))
double code(double x1, double x2) {
double t_0 = x2 * (3.0 - (2.0 * x2));
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1);
double t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) - (t_1 * ((((((t_2 + (2.0 * x2)) - x1) / t_1) - 3.0) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))) - ((x1 * x1) * 6.0)))))));
double tmp;
if (x1 <= -3.6e+19) {
tmp = t_4;
} else if (x1 <= -7.4e-208) {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
} else if (x1 <= 1.6e-243) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 25000000000.0) {
tmp = x1 + (t_3 + (x1 - (4.0 * (x1 * t_0))));
} else if (x1 <= 1.35e+154) {
tmp = t_4;
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * t_0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x2 * (3.0d0 - (2.0d0 * x2))
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 * (x1 * 3.0d0)
t_3 = 3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_1)
t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_2) - (t_1 * ((((((t_2 + (2.0d0 * x2)) - x1) / t_1) - 3.0d0) * ((x1 * 2.0d0) * ((1.0d0 / x1) - 3.0d0))) - ((x1 * x1) * 6.0d0)))))))
if (x1 <= (-3.6d+19)) then
tmp = t_4
else if (x1 <= (-7.4d-208)) then
tmp = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (x2 * (-6.0d0)))
else if (x1 <= 1.6d-243) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 25000000000.0d0) then
tmp = x1 + (t_3 + (x1 - (4.0d0 * (x1 * t_0))))
else if (x1 <= 1.35d+154) then
tmp = t_4
else
tmp = x1 + (x1 * (1.0d0 - (4.0d0 * t_0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 * (3.0 - (2.0 * x2));
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1);
double t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) - (t_1 * ((((((t_2 + (2.0 * x2)) - x1) / t_1) - 3.0) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))) - ((x1 * x1) * 6.0)))))));
double tmp;
if (x1 <= -3.6e+19) {
tmp = t_4;
} else if (x1 <= -7.4e-208) {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
} else if (x1 <= 1.6e-243) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 25000000000.0) {
tmp = x1 + (t_3 + (x1 - (4.0 * (x1 * t_0))));
} else if (x1 <= 1.35e+154) {
tmp = t_4;
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * t_0)));
}
return tmp;
}
def code(x1, x2): t_0 = x2 * (3.0 - (2.0 * x2)) t_1 = (x1 * x1) + 1.0 t_2 = x1 * (x1 * 3.0) t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1) t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) - (t_1 * ((((((t_2 + (2.0 * x2)) - x1) / t_1) - 3.0) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))) - ((x1 * x1) * 6.0))))))) tmp = 0 if x1 <= -3.6e+19: tmp = t_4 elif x1 <= -7.4e-208: tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)) elif x1 <= 1.6e-243: tmp = (x2 * -6.0) - x1 elif x1 <= 25000000000.0: tmp = x1 + (t_3 + (x1 - (4.0 * (x1 * t_0)))) elif x1 <= 1.35e+154: tmp = t_4 else: tmp = x1 + (x1 * (1.0 - (4.0 * t_0))) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2))) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_1)) t_4 = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_2) - Float64(t_1 * Float64(Float64(Float64(Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_1) - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(1.0 / x1) - 3.0))) - Float64(Float64(x1 * x1) * 6.0)))))))) tmp = 0.0 if (x1 <= -3.6e+19) tmp = t_4; elseif (x1 <= -7.4e-208) tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(x2 * -6.0))); elseif (x1 <= 1.6e-243) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 25000000000.0) tmp = Float64(x1 + Float64(t_3 + Float64(x1 - Float64(4.0 * Float64(x1 * t_0))))); elseif (x1 <= 1.35e+154) tmp = t_4; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 - Float64(4.0 * t_0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * (3.0 - (2.0 * x2)); t_1 = (x1 * x1) + 1.0; t_2 = x1 * (x1 * 3.0); t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1); t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) - (t_1 * ((((((t_2 + (2.0 * x2)) - x1) / t_1) - 3.0) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))) - ((x1 * x1) * 6.0))))))); tmp = 0.0; if (x1 <= -3.6e+19) tmp = t_4; elseif (x1 <= -7.4e-208) tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)); elseif (x1 <= 1.6e-243) tmp = (x2 * -6.0) - x1; elseif (x1 <= 25000000000.0) tmp = x1 + (t_3 + (x1 - (4.0 * (x1 * t_0)))); elseif (x1 <= 1.35e+154) tmp = t_4; else tmp = x1 + (x1 * (1.0 - (4.0 * t_0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $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[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$2), $MachinePrecision] - N[(t$95$1 * N[(N[(N[(N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(1.0 / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.6e+19], t$95$4, If[LessEqual[x1, -7.4e-208], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.6e-243], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 25000000000.0], N[(x1 + N[(t$95$3 + N[(x1 - N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$4, N[(x1 + N[(x1 * N[(1.0 - N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := 3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_1}\\
t_4 := x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_2 - t_1 \cdot \left(\left(\frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right) - \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -3.6 \cdot 10^{+19}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x1 \leq -7.4 \cdot 10^{-208}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 1.6 \cdot 10^{-243}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 25000000000:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 - 4 \cdot \left(x1 \cdot t_0\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot t_0\right)\\
\end{array}
\end{array}
if x1 < -3.6e19 or 2.5e10 < x1 < 1.35000000000000003e154Initial program 57.3%
Taylor expanded in x1 around inf 54.0%
Taylor expanded in x1 around inf 54.0%
Taylor expanded in x1 around inf 47.5%
if -3.6e19 < x1 < -7.4000000000000004e-208Initial program 99.6%
Taylor expanded in x1 around 0 87.5%
Taylor expanded in x1 around 0 87.9%
if -7.4000000000000004e-208 < x1 < 1.5999999999999999e-243Initial program 99.3%
Taylor expanded in x2 around inf 81.1%
associate-/l*81.1%
+-commutative81.1%
unpow281.1%
fma-udef81.1%
Simplified81.1%
Taylor expanded in x1 around 0 81.4%
Taylor expanded in x2 around 0 97.5%
+-commutative97.5%
*-commutative97.5%
associate-+l+97.6%
distribute-lft1-in97.6%
metadata-eval97.6%
neg-mul-197.6%
Simplified97.6%
if 1.5999999999999999e-243 < x1 < 2.5e10Initial program 97.6%
Taylor expanded in x1 around 0 84.2%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 39.9%
Final simplification69.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 (/ (- t_1 x1) t_2)))
(if (<= x1 1.35e+154)
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
(-
(* (- t_3 3.0) (* (* x1 2.0) (/ (- x1 t_1) t_2)))
(* (* x1 x1) (- (* t_3 4.0) 6.0)))
(- -1.0 (* x1 x1)))
(* 3.0 t_0))))
(* 3.0 (- (* x2 -2.0) x1))))
(+ x1 (* x1 (- 1.0 (* 4.0 (* x2 (- 3.0 (* 2.0 x2))))))))))
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 = (t_1 - x1) / t_2;
double tmp;
if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + (((((t_3 - 3.0) * ((x1 * 2.0) * ((x1 - t_1) / t_2))) - ((x1 * x1) * ((t_3 * 4.0) - 6.0))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (2.0 * x2))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = t_0 + (2.0d0 * x2)
t_2 = (x1 * x1) + 1.0d0
t_3 = (t_1 - x1) / t_2
if (x1 <= 1.35d+154) then
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + (((((t_3 - 3.0d0) * ((x1 * 2.0d0) * ((x1 - t_1) / t_2))) - ((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0))) * ((-1.0d0) - (x1 * x1))) + (3.0d0 * t_0)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else
tmp = x1 + (x1 * (1.0d0 - (4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = t_0 + (2.0 * x2);
double t_2 = (x1 * x1) + 1.0;
double t_3 = (t_1 - x1) / t_2;
double tmp;
if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + (((((t_3 - 3.0) * ((x1 * 2.0) * ((x1 - t_1) / t_2))) - ((x1 * x1) * ((t_3 * 4.0) - 6.0))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (2.0 * x2))))));
}
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 = (t_1 - x1) / t_2 tmp = 0 if x1 <= 1.35e+154: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + (((((t_3 - 3.0) * ((x1 * 2.0) * ((x1 - t_1) / t_2))) - ((x1 * x1) * ((t_3 * 4.0) - 6.0))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (2.0 * x2)))))) 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(t_1 - x1) / t_2) tmp = 0.0 if (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(Float64(Float64(Float64(t_3 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(x1 - t_1) / t_2))) - Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0))) * Float64(-1.0 - Float64(x1 * x1))) + Float64(3.0 * t_0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 - Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))))); 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 = (t_1 - x1) / t_2; tmp = 0.0; if (x1 <= 1.35e+154) tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + (((((t_3 - 3.0) * ((x1 * 2.0) * ((x1 - t_1) / t_2))) - ((x1 * x1) * ((t_3 * 4.0) - 6.0))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (2.0 * x2)))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(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[(t$95$1 - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(t$95$3 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(x1 - t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 - N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := t_0 + 2 \cdot x2\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{t_1 - x1}{t_2}\\
\mathbf{if}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(\left(t_3 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \frac{x1 - t_1}{t_2}\right) - \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) \cdot \left(-1 - x1 \cdot x1\right) + 3 \cdot t_0\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\
\end{array}
\end{array}
if x1 < 1.35000000000000003e154Initial program 83.3%
Taylor expanded in x1 around inf 82.6%
Taylor expanded in x1 around 0 83.2%
mul-1-neg83.2%
unsub-neg83.2%
*-commutative83.2%
Simplified83.2%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 39.9%
Final simplification78.5%
(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))))
(if (<= x1 1.35e+154)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_1)
(*
(-
(* (- (/ (- t_2 x1) t_0) 3.0) (* (* x1 2.0) (/ (- x1 t_2) t_0)))
(* (* x1 x1) 6.0))
(- -1.0 (* x1 x1))))))))
(+ x1 (* x1 (- 1.0 (* 4.0 (* x2 (- 3.0 (* 2.0 x2))))))))))
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 tmp;
if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + ((((((t_2 - x1) / t_0) - 3.0) * ((x1 * 2.0) * ((x1 - t_2) / t_0))) - ((x1 * x1) * 6.0)) * (-1.0 - (x1 * x1)))))));
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (2.0 * x2))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = t_1 + (2.0d0 * x2)
if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_1) + ((((((t_2 - x1) / t_0) - 3.0d0) * ((x1 * 2.0d0) * ((x1 - t_2) / t_0))) - ((x1 * x1) * 6.0d0)) * ((-1.0d0) - (x1 * x1)))))))
else
tmp = x1 + (x1 * (1.0d0 - (4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2))))))
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 tmp;
if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + ((((((t_2 - x1) / t_0) - 3.0) * ((x1 * 2.0) * ((x1 - t_2) / t_0))) - ((x1 * x1) * 6.0)) * (-1.0 - (x1 * x1)))))));
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (2.0 * x2))))));
}
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) tmp = 0 if x1 <= 1.35e+154: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + ((((((t_2 - x1) / t_0) - 3.0) * ((x1 * 2.0) * ((x1 - t_2) / t_0))) - ((x1 * x1) * 6.0)) * (-1.0 - (x1 * x1))))))) else: tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (2.0 * x2)))))) 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)) tmp = 0.0 if (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_1) + Float64(Float64(Float64(Float64(Float64(Float64(t_2 - x1) / t_0) - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(x1 - t_2) / t_0))) - Float64(Float64(x1 * x1) * 6.0)) * Float64(-1.0 - Float64(x1 * x1)))))))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 - Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))))); 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); tmp = 0.0; if (x1 <= 1.35e+154) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + ((((((t_2 - x1) / t_0) - 3.0) * ((x1 * 2.0) * ((x1 - t_2) / t_0))) - ((x1 * x1) * 6.0)) * (-1.0 - (x1 * x1))))))); else tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (2.0 * x2)))))); 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]}, If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$1), $MachinePrecision] + N[(N[(N[(N[(N[(N[(t$95$2 - x1), $MachinePrecision] / t$95$0), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(x1 - t$95$2), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 - N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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\\
\mathbf{if}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_1 + \left(\left(\frac{t_2 - x1}{t_0} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \frac{x1 - t_2}{t_0}\right) - \left(x1 \cdot x1\right) \cdot 6\right) \cdot \left(-1 - x1 \cdot x1\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\
\end{array}
\end{array}
if x1 < 1.35000000000000003e154Initial program 83.3%
Taylor expanded in x1 around inf 82.6%
Taylor expanded in x1 around inf 79.9%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 39.9%
Final simplification75.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (- (* 2.0 x2) 3.0))
(t_2 (* x1 (* x1 3.0)))
(t_3 (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0)))
(t_4
(+
x1
(+
t_3
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_2)
(*
t_0
(+
(* (* x1 x1) 6.0)
(* t_1 (* (* x1 2.0) (+ 3.0 (/ -1.0 x1))))))))))))
(t_5 (* x2 (- 3.0 (* 2.0 x2)))))
(if (<= x1 -2.4e+36)
t_4
(if (<= x1 -3.8e-205)
(+ x1 (+ (* x1 (- (* 4.0 (* x2 t_1)) 2.0)) (* x2 -6.0)))
(if (<= x1 1.85e-244)
(- (* x2 -6.0) x1)
(if (<= x1 380000000.0)
(+ x1 (+ t_3 (- x1 (* 4.0 (* x1 t_5)))))
(if (<= x1 1.35e+154) t_4 (+ x1 (* x1 (- 1.0 (* 4.0 t_5)))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = (2.0 * x2) - 3.0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0);
double t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + (t_0 * (((x1 * x1) * 6.0) + (t_1 * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))))))));
double t_5 = x2 * (3.0 - (2.0 * x2));
double tmp;
if (x1 <= -2.4e+36) {
tmp = t_4;
} else if (x1 <= -3.8e-205) {
tmp = x1 + ((x1 * ((4.0 * (x2 * t_1)) - 2.0)) + (x2 * -6.0));
} else if (x1 <= 1.85e-244) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 380000000.0) {
tmp = x1 + (t_3 + (x1 - (4.0 * (x1 * t_5))));
} else if (x1 <= 1.35e+154) {
tmp = t_4;
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * t_5)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = (2.0d0 * x2) - 3.0d0
t_2 = x1 * (x1 * 3.0d0)
t_3 = 3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)
t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_2) + (t_0 * (((x1 * x1) * 6.0d0) + (t_1 * ((x1 * 2.0d0) * (3.0d0 + ((-1.0d0) / x1))))))))))
t_5 = x2 * (3.0d0 - (2.0d0 * x2))
if (x1 <= (-2.4d+36)) then
tmp = t_4
else if (x1 <= (-3.8d-205)) then
tmp = x1 + ((x1 * ((4.0d0 * (x2 * t_1)) - 2.0d0)) + (x2 * (-6.0d0)))
else if (x1 <= 1.85d-244) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 380000000.0d0) then
tmp = x1 + (t_3 + (x1 - (4.0d0 * (x1 * t_5))))
else if (x1 <= 1.35d+154) then
tmp = t_4
else
tmp = x1 + (x1 * (1.0d0 - (4.0d0 * t_5)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = (2.0 * x2) - 3.0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0);
double t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + (t_0 * (((x1 * x1) * 6.0) + (t_1 * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))))))));
double t_5 = x2 * (3.0 - (2.0 * x2));
double tmp;
if (x1 <= -2.4e+36) {
tmp = t_4;
} else if (x1 <= -3.8e-205) {
tmp = x1 + ((x1 * ((4.0 * (x2 * t_1)) - 2.0)) + (x2 * -6.0));
} else if (x1 <= 1.85e-244) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 380000000.0) {
tmp = x1 + (t_3 + (x1 - (4.0 * (x1 * t_5))));
} else if (x1 <= 1.35e+154) {
tmp = t_4;
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * t_5)));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = (2.0 * x2) - 3.0 t_2 = x1 * (x1 * 3.0) t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0) t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + (t_0 * (((x1 * x1) * 6.0) + (t_1 * ((x1 * 2.0) * (3.0 + (-1.0 / x1)))))))))) t_5 = x2 * (3.0 - (2.0 * x2)) tmp = 0 if x1 <= -2.4e+36: tmp = t_4 elif x1 <= -3.8e-205: tmp = x1 + ((x1 * ((4.0 * (x2 * t_1)) - 2.0)) + (x2 * -6.0)) elif x1 <= 1.85e-244: tmp = (x2 * -6.0) - x1 elif x1 <= 380000000.0: tmp = x1 + (t_3 + (x1 - (4.0 * (x1 * t_5)))) elif x1 <= 1.35e+154: tmp = t_4 else: tmp = x1 + (x1 * (1.0 - (4.0 * t_5))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(Float64(2.0 * x2) - 3.0) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) t_4 = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_2) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * 6.0) + Float64(t_1 * Float64(Float64(x1 * 2.0) * Float64(3.0 + Float64(-1.0 / x1))))))))))) t_5 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2))) tmp = 0.0 if (x1 <= -2.4e+36) tmp = t_4; elseif (x1 <= -3.8e-205) tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * t_1)) - 2.0)) + Float64(x2 * -6.0))); elseif (x1 <= 1.85e-244) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 380000000.0) tmp = Float64(x1 + Float64(t_3 + Float64(x1 - Float64(4.0 * Float64(x1 * t_5))))); elseif (x1 <= 1.35e+154) tmp = t_4; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 - Float64(4.0 * t_5)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = (2.0 * x2) - 3.0; t_2 = x1 * (x1 * 3.0); t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0); t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + (t_0 * (((x1 * x1) * 6.0) + (t_1 * ((x1 * 2.0) * (3.0 + (-1.0 / x1)))))))))); t_5 = x2 * (3.0 - (2.0 * x2)); tmp = 0.0; if (x1 <= -2.4e+36) tmp = t_4; elseif (x1 <= -3.8e-205) tmp = x1 + ((x1 * ((4.0 * (x2 * t_1)) - 2.0)) + (x2 * -6.0)); elseif (x1 <= 1.85e-244) tmp = (x2 * -6.0) - x1; elseif (x1 <= 380000000.0) tmp = x1 + (t_3 + (x1 - (4.0 * (x1 * t_5)))); elseif (x1 <= 1.35e+154) tmp = t_4; else tmp = x1 + (x1 * (1.0 - (4.0 * t_5))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$2), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + N[(t$95$1 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.4e+36], t$95$4, If[LessEqual[x1, -3.8e-205], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * t$95$1), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.85e-244], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 380000000.0], N[(x1 + N[(t$95$3 + N[(x1 - N[(4.0 * N[(x1 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$4, N[(x1 + N[(x1 * N[(1.0 - N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := 2 \cdot x2 - 3\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := 3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0}\\
t_4 := x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_2 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + t_1 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\right)\right)\\
t_5 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
\mathbf{if}\;x1 \leq -2.4 \cdot 10^{+36}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x1 \leq -3.8 \cdot 10^{-205}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot t_1\right) - 2\right) + x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 1.85 \cdot 10^{-244}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 380000000:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 - 4 \cdot \left(x1 \cdot t_5\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot t_5\right)\\
\end{array}
\end{array}
if x1 < -2.39999999999999992e36 or 3.8e8 < x1 < 1.35000000000000003e154Initial program 56.3%
Taylor expanded in x1 around inf 52.9%
Taylor expanded in x1 around inf 52.9%
Taylor expanded in x1 around 0 44.4%
Taylor expanded in x1 around inf 44.5%
if -2.39999999999999992e36 < x1 < -3.79999999999999992e-205Initial program 99.5%
Taylor expanded in x1 around 0 84.4%
Taylor expanded in x1 around 0 84.8%
if -3.79999999999999992e-205 < x1 < 1.8500000000000001e-244Initial program 99.3%
Taylor expanded in x2 around inf 81.1%
associate-/l*81.1%
+-commutative81.1%
unpow281.1%
fma-udef81.1%
Simplified81.1%
Taylor expanded in x1 around 0 81.4%
Taylor expanded in x2 around 0 97.5%
+-commutative97.5%
*-commutative97.5%
associate-+l+97.6%
distribute-lft1-in97.6%
metadata-eval97.6%
neg-mul-197.6%
Simplified97.6%
if 1.8500000000000001e-244 < x1 < 3.8e8Initial program 97.6%
Taylor expanded in x1 around 0 84.2%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 39.9%
Final simplification68.3%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.08e+25)
(+ x1 (- x1 (* x2 (- 6.0 (* x1 -12.0)))))
(if (or (<= x1 -5.8e-56) (not (<= x1 1.8e-59)))
(+ x1 (* x1 (- 1.0 (* 4.0 (* x2 (- 3.0 (* 2.0 x2)))))))
(- (* x2 -6.0) x1))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.08e+25) {
tmp = x1 + (x1 - (x2 * (6.0 - (x1 * -12.0))));
} else if ((x1 <= -5.8e-56) || !(x1 <= 1.8e-59)) {
tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (2.0 * x2))))));
} 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 <= (-1.08d+25)) then
tmp = x1 + (x1 - (x2 * (6.0d0 - (x1 * (-12.0d0)))))
else if ((x1 <= (-5.8d-56)) .or. (.not. (x1 <= 1.8d-59))) then
tmp = x1 + (x1 * (1.0d0 - (4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2))))))
else
tmp = (x2 * (-6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.08e+25) {
tmp = x1 + (x1 - (x2 * (6.0 - (x1 * -12.0))));
} else if ((x1 <= -5.8e-56) || !(x1 <= 1.8e-59)) {
tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (2.0 * x2))))));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.08e+25: tmp = x1 + (x1 - (x2 * (6.0 - (x1 * -12.0)))) elif (x1 <= -5.8e-56) or not (x1 <= 1.8e-59): tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (2.0 * x2)))))) else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.08e+25) tmp = Float64(x1 + Float64(x1 - Float64(x2 * Float64(6.0 - Float64(x1 * -12.0))))); elseif ((x1 <= -5.8e-56) || !(x1 <= 1.8e-59)) tmp = Float64(x1 + Float64(x1 * Float64(1.0 - Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))))); else tmp = Float64(Float64(x2 * -6.0) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.08e+25) tmp = x1 + (x1 - (x2 * (6.0 - (x1 * -12.0)))); elseif ((x1 <= -5.8e-56) || ~((x1 <= 1.8e-59))) tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (2.0 * x2)))))); else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.08e+25], N[(x1 + N[(x1 - N[(x2 * N[(6.0 - N[(x1 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -5.8e-56], N[Not[LessEqual[x1, 1.8e-59]], $MachinePrecision]], N[(x1 + N[(x1 * N[(1.0 - N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.08 \cdot 10^{+25}:\\
\;\;\;\;x1 + \left(x1 - x2 \cdot \left(6 - x1 \cdot -12\right)\right)\\
\mathbf{elif}\;x1 \leq -5.8 \cdot 10^{-56} \lor \neg \left(x1 \leq 1.8 \cdot 10^{-59}\right):\\
\;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x1 < -1.08e25Initial program 24.8%
Taylor expanded in x1 around 0 0.3%
add-cube-cbrt0.3%
pow30.3%
associate-*r*0.3%
fma-neg0.3%
metadata-eval0.3%
Applied egg-rr0.3%
Taylor expanded in x1 around 0 0.3%
*-commutative0.3%
Simplified0.3%
Taylor expanded in x2 around 0 9.4%
if -1.08e25 < x1 < -5.79999999999999982e-56 or 1.8e-59 < x1 Initial program 72.5%
Taylor expanded in x1 around 0 40.4%
Taylor expanded in x1 around inf 43.7%
if -5.79999999999999982e-56 < x1 < 1.8e-59Initial program 99.4%
Taylor expanded in x2 around inf 84.5%
associate-/l*84.6%
+-commutative84.6%
unpow284.6%
fma-udef84.6%
Simplified84.6%
Taylor expanded in x1 around 0 84.9%
Taylor expanded in x2 around 0 80.3%
+-commutative80.3%
*-commutative80.3%
associate-+l+80.4%
distribute-lft1-in80.4%
metadata-eval80.4%
neg-mul-180.4%
Simplified80.4%
Final simplification51.7%
(FPCore (x1 x2) :precision binary64 (+ x1 (+ (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)) (* x2 -6.0))))
double code(double x1, double x2) {
return x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (x2 * (-6.0d0)))
end function
public static double code(double x1, double x2) {
return x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
}
def code(x1, x2): return x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0))
function code(x1, x2) return Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(x2 * -6.0))) end
function tmp = code(x1, x2) tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)); end
code[x1_, x2_] := N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)
\end{array}
Initial program 74.2%
Taylor expanded in x1 around 0 50.3%
Taylor expanded in x1 around 0 54.3%
Final simplification54.3%
(FPCore (x1 x2) :precision binary64 (if (<= x1 1.9) (- (* x2 -6.0) x1) (+ x1 (- x1 (* x2 (- 6.0 (* x1 -12.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= 1.9) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = x1 + (x1 - (x2 * (6.0 - (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.9d0) then
tmp = (x2 * (-6.0d0)) - x1
else
tmp = x1 + (x1 - (x2 * (6.0d0 - (x1 * (-12.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 1.9) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = x1 + (x1 - (x2 * (6.0 - (x1 * -12.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 1.9: tmp = (x2 * -6.0) - x1 else: tmp = x1 + (x1 - (x2 * (6.0 - (x1 * -12.0)))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 1.9) tmp = Float64(Float64(x2 * -6.0) - x1); else tmp = Float64(x1 + Float64(x1 - Float64(x2 * Float64(6.0 - Float64(x1 * -12.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 1.9) tmp = (x2 * -6.0) - x1; else tmp = x1 + (x1 - (x2 * (6.0 - (x1 * -12.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 1.9], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], N[(x1 + N[(x1 - N[(x2 * N[(6.0 - N[(x1 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 1.9:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 - x2 \cdot \left(6 - x1 \cdot -12\right)\right)\\
\end{array}
\end{array}
if x1 < 1.8999999999999999Initial program 79.6%
Taylor expanded in x2 around inf 64.1%
associate-/l*64.1%
+-commutative64.1%
unpow264.1%
fma-udef64.1%
Simplified64.1%
Taylor expanded in x1 around 0 64.6%
Taylor expanded in x2 around 0 49.9%
+-commutative49.9%
*-commutative49.9%
associate-+l+50.0%
distribute-lft1-in50.0%
metadata-eval50.0%
neg-mul-150.0%
Simplified50.0%
if 1.8999999999999999 < x1 Initial program 59.7%
Taylor expanded in x1 around 0 14.0%
add-cube-cbrt14.0%
pow314.0%
associate-*r*14.0%
fma-neg14.0%
metadata-eval14.0%
Applied egg-rr14.0%
Taylor expanded in x1 around 0 30.0%
*-commutative30.0%
Simplified30.0%
Taylor expanded in x2 around 0 8.3%
Final simplification38.6%
(FPCore (x1 x2) :precision binary64 (if (<= x2 -5e-149) (* x2 -6.0) (if (<= x2 1.46e-92) (- x1) (+ x1 (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -5e-149) {
tmp = x2 * -6.0;
} else if (x2 <= 1.46e-92) {
tmp = -x1;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x2 <= (-5d-149)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 1.46d-92) then
tmp = -x1
else
tmp = x1 + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= -5e-149) {
tmp = x2 * -6.0;
} else if (x2 <= 1.46e-92) {
tmp = -x1;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -5e-149: tmp = x2 * -6.0 elif x2 <= 1.46e-92: tmp = -x1 else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -5e-149) tmp = Float64(x2 * -6.0); elseif (x2 <= 1.46e-92) tmp = Float64(-x1); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= -5e-149) tmp = x2 * -6.0; elseif (x2 <= 1.46e-92) tmp = -x1; else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -5e-149], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 1.46e-92], (-x1), N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -5 \cdot 10^{-149}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 1.46 \cdot 10^{-92}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -4.99999999999999968e-149Initial program 68.5%
Taylor expanded in x1 around 0 46.4%
Taylor expanded in x1 around 0 29.6%
*-commutative29.6%
Simplified29.6%
Taylor expanded in x1 around 0 29.9%
*-commutative29.9%
Simplified29.9%
if -4.99999999999999968e-149 < x2 < 1.45999999999999995e-92Initial program 76.3%
Taylor expanded in x2 around inf 51.0%
associate-/l*51.0%
+-commutative51.0%
unpow251.0%
fma-udef51.0%
Simplified51.0%
Taylor expanded in x1 around 0 50.9%
Taylor expanded in x2 around 0 36.0%
distribute-rgt1-in36.0%
metadata-eval36.0%
neg-mul-136.0%
Simplified36.0%
if 1.45999999999999995e-92 < x2 Initial program 79.0%
Taylor expanded in x1 around 0 54.3%
Taylor expanded in x1 around 0 28.1%
*-commutative28.1%
Simplified28.1%
Final simplification31.1%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -4.5e-149) (not (<= x2 1.46e-92))) (* x2 -6.0) (- x1)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -4.5e-149) || !(x2 <= 1.46e-92)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-4.5d-149)) .or. (.not. (x2 <= 1.46d-92))) then
tmp = x2 * (-6.0d0)
else
tmp = -x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -4.5e-149) || !(x2 <= 1.46e-92)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -4.5e-149) or not (x2 <= 1.46e-92): tmp = x2 * -6.0 else: tmp = -x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -4.5e-149) || !(x2 <= 1.46e-92)) tmp = Float64(x2 * -6.0); else tmp = Float64(-x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -4.5e-149) || ~((x2 <= 1.46e-92))) tmp = x2 * -6.0; else tmp = -x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -4.5e-149], N[Not[LessEqual[x2, 1.46e-92]], $MachinePrecision]], N[(x2 * -6.0), $MachinePrecision], (-x1)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -4.5 \cdot 10^{-149} \lor \neg \left(x2 \leq 1.46 \cdot 10^{-92}\right):\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;-x1\\
\end{array}
\end{array}
if x2 < -4.4999999999999998e-149 or 1.45999999999999995e-92 < x2 Initial program 73.3%
Taylor expanded in x1 around 0 50.0%
Taylor expanded in x1 around 0 28.9%
*-commutative28.9%
Simplified28.9%
Taylor expanded in x1 around 0 28.7%
*-commutative28.7%
Simplified28.7%
if -4.4999999999999998e-149 < x2 < 1.45999999999999995e-92Initial program 76.3%
Taylor expanded in x2 around inf 51.0%
associate-/l*51.0%
+-commutative51.0%
unpow251.0%
fma-udef51.0%
Simplified51.0%
Taylor expanded in x1 around 0 50.9%
Taylor expanded in x2 around 0 36.0%
distribute-rgt1-in36.0%
metadata-eval36.0%
neg-mul-136.0%
Simplified36.0%
Final simplification30.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 74.2%
Taylor expanded in x2 around inf 51.4%
associate-/l*50.7%
+-commutative50.7%
unpow250.7%
fma-udef50.7%
Simplified50.7%
Taylor expanded in x1 around 0 54.3%
Taylor expanded in x2 around 0 36.5%
+-commutative36.5%
*-commutative36.5%
associate-+l+36.5%
distribute-lft1-in36.5%
metadata-eval36.5%
neg-mul-136.5%
Simplified36.5%
Final simplification36.5%
(FPCore (x1 x2) :precision binary64 (- x1))
double code(double x1, double x2) {
return -x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = -x1
end function
public static double code(double x1, double x2) {
return -x1;
}
def code(x1, x2): return -x1
function code(x1, x2) return Float64(-x1) end
function tmp = code(x1, x2) tmp = -x1; end
code[x1_, x2_] := (-x1)
\begin{array}{l}
\\
-x1
\end{array}
Initial program 74.2%
Taylor expanded in x2 around inf 51.4%
associate-/l*50.7%
+-commutative50.7%
unpow250.7%
fma-udef50.7%
Simplified50.7%
Taylor expanded in x1 around 0 54.3%
Taylor expanded in x2 around 0 13.6%
distribute-rgt1-in13.6%
metadata-eval13.6%
neg-mul-113.6%
Simplified13.6%
Final simplification13.6%
(FPCore (x1 x2) :precision binary64 x1)
double code(double x1, double x2) {
return x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1
end function
public static double code(double x1, double x2) {
return x1;
}
def code(x1, x2): return x1
function code(x1, x2) return x1 end
function tmp = code(x1, x2) tmp = x1; end
code[x1_, x2_] := x1
\begin{array}{l}
\\
x1
\end{array}
Initial program 74.2%
Taylor expanded in x1 around 0 50.3%
Taylor expanded in x1 around 0 24.9%
*-commutative24.9%
Simplified24.9%
Taylor expanded in x1 around inf 3.2%
Final simplification3.2%
herbie shell --seed 2024020
(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))))))