
(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 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 3.0 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ t_1 (* 2.0 x2)))
(t_3 (fma x1 (* x1 3.0) (* 2.0 x2)))
(t_4 (/ (- t_3 x1) (fma x1 x1 1.0)))
(t_5 (+ (* x1 x1) 1.0))
(t_6 (/ (- t_2 x1) t_5))
(t_7 (/ (- x1 t_2) t_5))
(t_8 (/ (- x1 t_3) (fma x1 x1 1.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
(- -1.0 (* x1 x1))
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_7)))
(* (* (* x1 2.0) t_6) (+ 3.0 t_7))))
(* t_1 t_6))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_5))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_0 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_4 4.0 -6.0)) (* (* x1 (* 2.0 t_8)) (- t_8 -3.0)))
(fma t_0 t_4 (pow x1 3.0))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) (* 3.0 (+ 3.0 (/ -1.0 x1))))))))
double code(double x1, double x2) {
double t_0 = 3.0 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = t_1 + (2.0 * x2);
double t_3 = fma(x1, (x1 * 3.0), (2.0 * x2));
double t_4 = (t_3 - x1) / fma(x1, x1, 1.0);
double t_5 = (x1 * x1) + 1.0;
double t_6 = (t_2 - x1) / t_5;
double t_7 = (x1 - t_2) / t_5;
double t_8 = (x1 - t_3) / fma(x1, x1, 1.0);
double tmp;
if ((x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (((x1 * x1) * (6.0 + (4.0 * t_7))) + (((x1 * 2.0) * t_6) * (3.0 + t_7)))) + (t_1 * t_6)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_5)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_4, 4.0, -6.0)), ((x1 * (2.0 * t_8)) * (t_8 - -3.0))), fma(t_0, t_4, pow(x1, 3.0)))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + (3.0 * (3.0 + (-1.0 / x1))));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(3.0 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(t_1 + Float64(2.0 * x2)) t_3 = fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) t_4 = Float64(Float64(t_3 - x1) / fma(x1, x1, 1.0)) t_5 = Float64(Float64(x1 * x1) + 1.0) t_6 = Float64(Float64(t_2 - x1) / t_5) t_7 = Float64(Float64(x1 - t_2) / t_5) t_8 = Float64(Float64(x1 - t_3) / fma(x1, x1, 1.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(-1.0 - Float64(x1 * x1)) * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_7))) + Float64(Float64(Float64(x1 * 2.0) * t_6) * Float64(3.0 + t_7)))) + Float64(t_1 * t_6)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_5)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_4, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_8)) * Float64(t_8 - -3.0))), fma(t_0, t_4, (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + Float64(3.0 * Float64(3.0 + Float64(-1.0 / x1))))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$6 = N[(N[(t$95$2 - x1), $MachinePrecision] / t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 - t$95$2), $MachinePrecision] / t$95$5), $MachinePrecision]}, Block[{t$95$8 = N[(N[(x1 - t$95$3), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$6), $MachinePrecision] * N[(3.0 + t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$6), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$0 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$4 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$8), $MachinePrecision]), $MachinePrecision] * N[(t$95$8 - -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$4 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := t_1 + 2 \cdot x2\\
t_3 := \mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right)\\
t_4 := \frac{t_3 - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_5 := x1 \cdot x1 + 1\\
t_6 := \frac{t_2 - x1}{t_5}\\
t_7 := \frac{x1 - t_2}{t_5}\\
t_8 := \frac{x1 - t_3}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(\left(-1 - x1 \cdot x1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_7\right) + \left(\left(x1 \cdot 2\right) \cdot t_6\right) \cdot \left(3 + t_7\right)\right) + t_1 \cdot t_6\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_5}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_0 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t_4, 4, -6\right), \left(x1 \cdot \left(2 \cdot t_8\right)\right) \cdot \left(t_8 - -3\right)\right), \mathsf{fma}\left(t_0, t_4, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 3 \cdot \left(3 + \frac{-1}{x1}\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%
Simplified99.7%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (fma (* x1 3.0) x1 (* 2.0 x2)) x1) (fma x1 x1 1.0)))
(t_3 (+ t_0 (* 2.0 x2)))
(t_4 (/ (- x1 t_3) t_1))
(t_5 (/ (- t_3 x1) t_1))
(t_6 (* x1 (* x1 x1))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
(- -1.0 (* x1 x1))
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_4)))
(* (* (* x1 2.0) t_5) (+ 3.0 t_4))))
(* t_0 t_5))
t_6))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))
INFINITY)
(+
x1
(+
(+
t_6
(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 (/ (- t_0 (+ x1 (* 2.0 x2))) (fma x1 x1 1.0))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) (* 3.0 (+ 3.0 (/ -1.0 x1))))))))
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 * 3.0), x1, (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double t_3 = t_0 + (2.0 * x2);
double t_4 = (x1 - t_3) / t_1;
double t_5 = (t_3 - x1) / t_1;
double t_6 = x1 * (x1 * x1);
double tmp;
if ((x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * t_5) * (3.0 + t_4)))) + (t_0 * t_5)) + t_6)) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= ((double) INFINITY)) {
tmp = x1 + ((t_6 + 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 * ((t_0 - (x1 + (2.0 * x2))) / fma(x1, x1, 1.0)))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + (3.0 * (3.0 + (-1.0 / x1))));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) t_3 = Float64(t_0 + Float64(2.0 * x2)) t_4 = Float64(Float64(x1 - t_3) / t_1) t_5 = Float64(Float64(t_3 - x1) / t_1) t_6 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(-1.0 - Float64(x1 * x1)) * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_4))) + Float64(Float64(Float64(x1 * 2.0) * t_5) * Float64(3.0 + t_4)))) + Float64(t_0 * t_5)) + t_6)) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) <= Inf) tmp = Float64(x1 + Float64(Float64(t_6 + 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(t_0 - Float64(x1 + Float64(2.0 * x2))) / fma(x1, x1, 1.0)))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + Float64(3.0 * Float64(3.0 + Float64(-1.0 / 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[(N[(x1 * x1), $MachinePrecision] + 1.0), $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[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 - t$95$3), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$3 - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision] * N[(3.0 + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$5), $MachinePrecision]), $MachinePrecision] + t$95$6), $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[(N[(t$95$6 + 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[(t$95$0 - N[(x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_3 := t_0 + 2 \cdot x2\\
t_4 := \frac{x1 - t_3}{t_1}\\
t_5 := \frac{t_3 - x1}{t_1}\\
t_6 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(\left(-1 - x1 \cdot x1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_4\right) + \left(\left(x1 \cdot 2\right) \cdot t_5\right) \cdot \left(3 + t_4\right)\right) + t_0 \cdot t_5\right) + t_6\right)\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right) \leq \infty:\\
\;\;\;\;x1 + \left(\left(t_6 + \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{t_0 - \left(x1 + 2 \cdot x2\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 3 \cdot \left(3 + \frac{-1}{x1}\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%
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 inf 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ t_0 (* 2.0 x2)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- t_1 x1) t_2))
(t_4 (/ (- x1 t_1) t_2))
(t_5
(+
x1
(+
(+
x1
(+
(+
(*
(- -1.0 (* x1 x1))
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_4)))
(* (* (* x1 2.0) t_3) (+ 3.0 t_4))))
(* t_0 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))))))
(if (<= t_5 INFINITY)
t_5
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) (* 3.0 (+ 3.0 (/ -1.0 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 = (x1 * x1) + 1.0;
double t_3 = (t_1 - x1) / t_2;
double t_4 = (x1 - t_1) / t_2;
double t_5 = x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * t_3) * (3.0 + t_4)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_5 <= ((double) INFINITY)) {
tmp = t_5;
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + (3.0 * (3.0 + (-1.0 / x1))));
}
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 - t_1) / t_2;
double t_5 = x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * t_3) * (3.0 + t_4)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_5 <= Double.POSITIVE_INFINITY) {
tmp = t_5;
} else {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + (3.0 * (3.0 + (-1.0 / x1))));
}
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 - t_1) / t_2 t_5 = x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * t_3) * (3.0 + t_4)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2))) tmp = 0 if t_5 <= math.inf: tmp = t_5 else: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + (3.0 * (3.0 + (-1.0 / 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(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(t_1 - x1) / t_2) t_4 = Float64(Float64(x1 - t_1) / t_2) t_5 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(-1.0 - Float64(x1 * x1)) * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_4))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_4)))) + 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_5 <= Inf) tmp = t_5; else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + Float64(3.0 * Float64(3.0 + Float64(-1.0 / x1))))); 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 - t_1) / t_2; t_5 = x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * t_3) * (3.0 + t_4)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2))); tmp = 0.0; if (t_5 <= Inf) tmp = t_5; else tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + (3.0 * (3.0 + (-1.0 / x1)))); 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[(N[(x1 - t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(N[(x1 + N[(N[(N[(N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$4), $MachinePrecision]), $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$5, Infinity], t$95$5, N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(3.0 + N[(-1.0 / 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 := x1 \cdot x1 + 1\\
t_3 := \frac{t_1 - x1}{t_2}\\
t_4 := \frac{x1 - t_1}{t_2}\\
t_5 := x1 + \left(\left(x1 + \left(\left(\left(-1 - x1 \cdot x1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_4\right) + \left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(3 + t_4\right)\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_5 \leq \infty:\\
\;\;\;\;t_5\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 3 \cdot \left(3 + \frac{-1}{x1}\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 inf 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ t_1 (* 2.0 x2)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- x1 t_2) t_3))
(t_5 (* 3.0 (+ 3.0 (/ -1.0 x1))))
(t_6 (+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) t_5)))
(t_7 (/ (- t_2 x1) t_3))
(t_8 (* (* (* x1 2.0) t_7) (+ 3.0 t_4))))
(if (<= x1 -5.8e+102)
t_6
(if (<= x1 -0.9)
(+
x1
(+
(+
x1
(+
(+
(* (- -1.0 (* x1 x1)) (+ (* (* x1 x1) (+ 6.0 (* 4.0 t_4))) t_8))
(* t_1 t_7))
t_0))
t_5))
(if (<= x1 2.8e+54)
(+
x1
(-
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_3))
(- (- (+ (* t_1 t_4) (* t_3 (- t_8 (* (* x1 x1) 6.0)))) t_0) x1)))
t_6)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = t_1 + (2.0 * x2);
double t_3 = (x1 * x1) + 1.0;
double t_4 = (x1 - t_2) / t_3;
double t_5 = 3.0 * (3.0 + (-1.0 / x1));
double t_6 = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + t_5);
double t_7 = (t_2 - x1) / t_3;
double t_8 = ((x1 * 2.0) * t_7) * (3.0 + t_4);
double tmp;
if (x1 <= -5.8e+102) {
tmp = t_6;
} else if (x1 <= -0.9) {
tmp = x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (((x1 * x1) * (6.0 + (4.0 * t_4))) + t_8)) + (t_1 * t_7)) + t_0)) + t_5);
} else if (x1 <= 2.8e+54) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) - ((((t_1 * t_4) + (t_3 * (t_8 - ((x1 * x1) * 6.0)))) - t_0) - x1));
} else {
tmp = t_6;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = t_1 + (2.0d0 * x2)
t_3 = (x1 * x1) + 1.0d0
t_4 = (x1 - t_2) / t_3
t_5 = 3.0d0 * (3.0d0 + ((-1.0d0) / x1))
t_6 = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + t_5)
t_7 = (t_2 - x1) / t_3
t_8 = ((x1 * 2.0d0) * t_7) * (3.0d0 + t_4)
if (x1 <= (-5.8d+102)) then
tmp = t_6
else if (x1 <= (-0.9d0)) then
tmp = x1 + ((x1 + (((((-1.0d0) - (x1 * x1)) * (((x1 * x1) * (6.0d0 + (4.0d0 * t_4))) + t_8)) + (t_1 * t_7)) + t_0)) + t_5)
else if (x1 <= 2.8d+54) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_3)) - ((((t_1 * t_4) + (t_3 * (t_8 - ((x1 * x1) * 6.0d0)))) - t_0) - x1))
else
tmp = t_6
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = t_1 + (2.0 * x2);
double t_3 = (x1 * x1) + 1.0;
double t_4 = (x1 - t_2) / t_3;
double t_5 = 3.0 * (3.0 + (-1.0 / x1));
double t_6 = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + t_5);
double t_7 = (t_2 - x1) / t_3;
double t_8 = ((x1 * 2.0) * t_7) * (3.0 + t_4);
double tmp;
if (x1 <= -5.8e+102) {
tmp = t_6;
} else if (x1 <= -0.9) {
tmp = x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (((x1 * x1) * (6.0 + (4.0 * t_4))) + t_8)) + (t_1 * t_7)) + t_0)) + t_5);
} else if (x1 <= 2.8e+54) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) - ((((t_1 * t_4) + (t_3 * (t_8 - ((x1 * x1) * 6.0)))) - t_0) - x1));
} else {
tmp = t_6;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = t_1 + (2.0 * x2) t_3 = (x1 * x1) + 1.0 t_4 = (x1 - t_2) / t_3 t_5 = 3.0 * (3.0 + (-1.0 / x1)) t_6 = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + t_5) t_7 = (t_2 - x1) / t_3 t_8 = ((x1 * 2.0) * t_7) * (3.0 + t_4) tmp = 0 if x1 <= -5.8e+102: tmp = t_6 elif x1 <= -0.9: tmp = x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (((x1 * x1) * (6.0 + (4.0 * t_4))) + t_8)) + (t_1 * t_7)) + t_0)) + t_5) elif x1 <= 2.8e+54: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) - ((((t_1 * t_4) + (t_3 * (t_8 - ((x1 * x1) * 6.0)))) - t_0) - x1)) else: tmp = t_6 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(t_1 + Float64(2.0 * x2)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(x1 - t_2) / t_3) t_5 = Float64(3.0 * Float64(3.0 + Float64(-1.0 / x1))) t_6 = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + t_5)) t_7 = Float64(Float64(t_2 - x1) / t_3) t_8 = Float64(Float64(Float64(x1 * 2.0) * t_7) * Float64(3.0 + t_4)) tmp = 0.0 if (x1 <= -5.8e+102) tmp = t_6; elseif (x1 <= -0.9) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(-1.0 - Float64(x1 * x1)) * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_4))) + t_8)) + Float64(t_1 * t_7)) + t_0)) + t_5)); elseif (x1 <= 2.8e+54) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_3)) - Float64(Float64(Float64(Float64(t_1 * t_4) + Float64(t_3 * Float64(t_8 - Float64(Float64(x1 * x1) * 6.0)))) - t_0) - x1))); else tmp = t_6; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = t_1 + (2.0 * x2); t_3 = (x1 * x1) + 1.0; t_4 = (x1 - t_2) / t_3; t_5 = 3.0 * (3.0 + (-1.0 / x1)); t_6 = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + t_5); t_7 = (t_2 - x1) / t_3; t_8 = ((x1 * 2.0) * t_7) * (3.0 + t_4); tmp = 0.0; if (x1 <= -5.8e+102) tmp = t_6; elseif (x1 <= -0.9) tmp = x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (((x1 * x1) * (6.0 + (4.0 * t_4))) + t_8)) + (t_1 * t_7)) + t_0)) + t_5); elseif (x1 <= 2.8e+54) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) - ((((t_1 * t_4) + (t_3 * (t_8 - ((x1 * x1) * 6.0)))) - t_0) - x1)); else tmp = t_6; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 - t$95$2), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(N[(t$95$2 - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$8 = N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$7), $MachinePrecision] * N[(3.0 + t$95$4), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], t$95$6, If[LessEqual[x1, -0.9], N[(x1 + N[(N[(x1 + N[(N[(N[(N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$8), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$7), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.8e+54], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(t$95$1 * t$95$4), $MachinePrecision] + N[(t$95$3 * N[(t$95$8 - N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$6]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := t_1 + 2 \cdot x2\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{x1 - t_2}{t_3}\\
t_5 := 3 \cdot \left(3 + \frac{-1}{x1}\right)\\
t_6 := x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + t_5\right)\\
t_7 := \frac{t_2 - x1}{t_3}\\
t_8 := \left(\left(x1 \cdot 2\right) \cdot t_7\right) \cdot \left(3 + t_4\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;x1 \leq -0.9:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(-1 - x1 \cdot x1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_4\right) + t_8\right) + t_1 \cdot t_7\right) + t_0\right)\right) + t_5\right)\\
\mathbf{elif}\;x1 \leq 2.8 \cdot 10^{+54}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_3} - \left(\left(\left(t_1 \cdot t_4 + t_3 \cdot \left(t_8 - \left(x1 \cdot x1\right) \cdot 6\right)\right) - t_0\right) - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_6\\
\end{array}
\end{array}
if x1 < -5.8000000000000005e102 or 2.80000000000000015e54 < x1 Initial program 24.3%
Taylor expanded in x1 around inf 24.3%
Taylor expanded in x1 around inf 98.8%
*-commutative98.8%
Simplified98.8%
if -5.8000000000000005e102 < x1 < -0.900000000000000022Initial program 99.4%
Taylor expanded in x1 around inf 97.7%
if -0.900000000000000022 < x1 < 2.80000000000000015e54Initial program 99.4%
fma-def99.4%
fma-def99.4%
*-commutative99.4%
clear-num99.4%
inv-pow99.4%
*-commutative99.4%
fma-def99.4%
associate-*r*99.4%
fma-def99.4%
pow299.4%
Applied egg-rr99.4%
unpow-199.4%
Simplified99.4%
Taylor expanded in x1 around inf 97.3%
Final simplification97.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (+ t_0 (* 2.0 x2)))
(t_3 (/ (- t_2 x1) t_1))
(t_4 (* (* x1 2.0) t_3))
(t_5 (/ (- x1 t_2) t_1))
(t_6 (* (* x1 x1) (+ 6.0 (* 4.0 t_5))))
(t_7 (* x1 (* x1 x1)))
(t_8
(+
x1
(+
(+
x1
(+
(+ (* (- -1.0 (* x1 x1)) (+ t_6 (* t_4 (+ 3.0 t_5)))) (* t_0 t_3))
t_7))
9.0))))
(if (<= x1 -0.185)
t_8
(if (<= x1 0.055)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(-
x1
(-
(+
(* t_0 (- x1 (* 2.0 x2)))
(* t_1 (+ t_6 (* t_4 (- 3.0 (- (* 2.0 x2) x1))))))
t_7))))
(if (<= x1 1.6e+101)
t_8
(+
x1
(+ (- x1 (- (* 4.0 (* x1 (* x2 (- 3.0 (* 2.0 x2))))) t_7)) 9.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = t_0 + (2.0 * x2);
double t_3 = (t_2 - x1) / t_1;
double t_4 = (x1 * 2.0) * t_3;
double t_5 = (x1 - t_2) / t_1;
double t_6 = (x1 * x1) * (6.0 + (4.0 * t_5));
double t_7 = x1 * (x1 * x1);
double t_8 = x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (t_6 + (t_4 * (3.0 + t_5)))) + (t_0 * t_3)) + t_7)) + 9.0);
double tmp;
if (x1 <= -0.185) {
tmp = t_8;
} else if (x1 <= 0.055) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 - (((t_0 * (x1 - (2.0 * x2))) + (t_1 * (t_6 + (t_4 * (3.0 - ((2.0 * x2) - x1)))))) - t_7)));
} else if (x1 <= 1.6e+101) {
tmp = t_8;
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_7)) + 9.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = t_0 + (2.0d0 * x2)
t_3 = (t_2 - x1) / t_1
t_4 = (x1 * 2.0d0) * t_3
t_5 = (x1 - t_2) / t_1
t_6 = (x1 * x1) * (6.0d0 + (4.0d0 * t_5))
t_7 = x1 * (x1 * x1)
t_8 = x1 + ((x1 + (((((-1.0d0) - (x1 * x1)) * (t_6 + (t_4 * (3.0d0 + t_5)))) + (t_0 * t_3)) + t_7)) + 9.0d0)
if (x1 <= (-0.185d0)) then
tmp = t_8
else if (x1 <= 0.055d0) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 - (((t_0 * (x1 - (2.0d0 * x2))) + (t_1 * (t_6 + (t_4 * (3.0d0 - ((2.0d0 * x2) - x1)))))) - t_7)))
else if (x1 <= 1.6d+101) then
tmp = t_8
else
tmp = x1 + ((x1 - ((4.0d0 * (x1 * (x2 * (3.0d0 - (2.0d0 * x2))))) - t_7)) + 9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = t_0 + (2.0 * x2);
double t_3 = (t_2 - x1) / t_1;
double t_4 = (x1 * 2.0) * t_3;
double t_5 = (x1 - t_2) / t_1;
double t_6 = (x1 * x1) * (6.0 + (4.0 * t_5));
double t_7 = x1 * (x1 * x1);
double t_8 = x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (t_6 + (t_4 * (3.0 + t_5)))) + (t_0 * t_3)) + t_7)) + 9.0);
double tmp;
if (x1 <= -0.185) {
tmp = t_8;
} else if (x1 <= 0.055) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 - (((t_0 * (x1 - (2.0 * x2))) + (t_1 * (t_6 + (t_4 * (3.0 - ((2.0 * x2) - x1)))))) - t_7)));
} else if (x1 <= 1.6e+101) {
tmp = t_8;
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_7)) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = t_0 + (2.0 * x2) t_3 = (t_2 - x1) / t_1 t_4 = (x1 * 2.0) * t_3 t_5 = (x1 - t_2) / t_1 t_6 = (x1 * x1) * (6.0 + (4.0 * t_5)) t_7 = x1 * (x1 * x1) t_8 = x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (t_6 + (t_4 * (3.0 + t_5)))) + (t_0 * t_3)) + t_7)) + 9.0) tmp = 0 if x1 <= -0.185: tmp = t_8 elif x1 <= 0.055: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 - (((t_0 * (x1 - (2.0 * x2))) + (t_1 * (t_6 + (t_4 * (3.0 - ((2.0 * x2) - x1)))))) - t_7))) elif x1 <= 1.6e+101: tmp = t_8 else: tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_7)) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(t_0 + Float64(2.0 * x2)) t_3 = Float64(Float64(t_2 - x1) / t_1) t_4 = Float64(Float64(x1 * 2.0) * t_3) t_5 = Float64(Float64(x1 - t_2) / t_1) t_6 = Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) t_7 = Float64(x1 * Float64(x1 * x1)) t_8 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(-1.0 - Float64(x1 * x1)) * Float64(t_6 + Float64(t_4 * Float64(3.0 + t_5)))) + Float64(t_0 * t_3)) + t_7)) + 9.0)) tmp = 0.0 if (x1 <= -0.185) tmp = t_8; elseif (x1 <= 0.055) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 - Float64(Float64(Float64(t_0 * Float64(x1 - Float64(2.0 * x2))) + Float64(t_1 * Float64(t_6 + Float64(t_4 * Float64(3.0 - Float64(Float64(2.0 * x2) - x1)))))) - t_7)))); elseif (x1 <= 1.6e+101) tmp = t_8; else tmp = Float64(x1 + Float64(Float64(x1 - Float64(Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))) - t_7)) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = t_0 + (2.0 * x2); t_3 = (t_2 - x1) / t_1; t_4 = (x1 * 2.0) * t_3; t_5 = (x1 - t_2) / t_1; t_6 = (x1 * x1) * (6.0 + (4.0 * t_5)); t_7 = x1 * (x1 * x1); t_8 = x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (t_6 + (t_4 * (3.0 + t_5)))) + (t_0 * t_3)) + t_7)) + 9.0); tmp = 0.0; if (x1 <= -0.185) tmp = t_8; elseif (x1 <= 0.055) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 - (((t_0 * (x1 - (2.0 * x2))) + (t_1 * (t_6 + (t_4 * (3.0 - ((2.0 * x2) - x1)))))) - t_7))); elseif (x1 <= 1.6e+101) tmp = t_8; else tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_7)) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 - t$95$2), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(x1 + N[(N[(x1 + N[(N[(N[(N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * N[(t$95$6 + N[(t$95$4 * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + t$95$7), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -0.185], t$95$8, If[LessEqual[x1, 0.055], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 - N[(N[(N[(t$95$0 * N[(x1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(t$95$6 + N[(t$95$4 * N[(3.0 - N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.6e+101], t$95$8, N[(x1 + N[(N[(x1 - N[(N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$7), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := t_0 + 2 \cdot x2\\
t_3 := \frac{t_2 - x1}{t_1}\\
t_4 := \left(x1 \cdot 2\right) \cdot t_3\\
t_5 := \frac{x1 - t_2}{t_1}\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_5\right)\\
t_7 := x1 \cdot \left(x1 \cdot x1\right)\\
t_8 := x1 + \left(\left(x1 + \left(\left(\left(-1 - x1 \cdot x1\right) \cdot \left(t_6 + t_4 \cdot \left(3 + t_5\right)\right) + t_0 \cdot t_3\right) + t_7\right)\right) + 9\right)\\
\mathbf{if}\;x1 \leq -0.185:\\
\;\;\;\;t_8\\
\mathbf{elif}\;x1 \leq 0.055:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 - \left(\left(t_0 \cdot \left(x1 - 2 \cdot x2\right) + t_1 \cdot \left(t_6 + t_4 \cdot \left(3 - \left(2 \cdot x2 - x1\right)\right)\right)\right) - t_7\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.6 \cdot 10^{+101}:\\
\;\;\;\;t_8\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - t_7\right)\right) + 9\right)\\
\end{array}
\end{array}
if x1 < -0.185 or 0.0550000000000000003 < x1 < 1.60000000000000003e101Initial program 50.4%
Taylor expanded in x1 around inf 49.8%
if -0.185 < x1 < 0.0550000000000000003Initial program 99.3%
Taylor expanded in x1 around 0 99.0%
+-commutative99.0%
mul-1-neg99.0%
unsub-neg99.0%
Simplified99.0%
Taylor expanded in x1 around 0 99.0%
+-commutative99.0%
mul-1-neg99.0%
unsub-neg99.0%
Simplified99.0%
if 1.60000000000000003e101 < x1 Initial program 33.3%
Taylor expanded in x1 around 0 26.2%
+-commutative26.2%
mul-1-neg26.2%
unsub-neg26.2%
Simplified26.2%
Taylor expanded in x1 around inf 26.2%
Taylor expanded in x1 around 0 100.0%
Final simplification84.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (+ t_0 (* 2.0 x2)))
(t_3 (/ (- t_2 x1) t_1))
(t_4 (/ (- x1 t_2) t_1))
(t_5 (* (* (* x1 2.0) t_3) (+ 3.0 t_4)))
(t_6 (* x1 (* x1 x1))))
(if (<= x1 -0.88)
(+
x1
(+
(+
x1
(+
(+
(* (- -1.0 (* x1 x1)) (+ (* (* x1 x1) (+ 6.0 (* 4.0 t_4))) t_5))
(* t_0 t_3))
t_6))
(* 3.0 (+ 3.0 (/ -1.0 x1)))))
(if (<= x1 1.6e+101)
(+
x1
(-
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(- (- (+ (* t_0 t_4) (* t_1 (- t_5 (* (* x1 x1) 6.0)))) t_6) x1)))
(+
x1
(+ (- x1 (- (* 4.0 (* x1 (* x2 (- 3.0 (* 2.0 x2))))) t_6)) 9.0))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = t_0 + (2.0 * x2);
double t_3 = (t_2 - x1) / t_1;
double t_4 = (x1 - t_2) / t_1;
double t_5 = ((x1 * 2.0) * t_3) * (3.0 + t_4);
double t_6 = x1 * (x1 * x1);
double tmp;
if (x1 <= -0.88) {
tmp = x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (((x1 * x1) * (6.0 + (4.0 * t_4))) + t_5)) + (t_0 * t_3)) + t_6)) + (3.0 * (3.0 + (-1.0 / x1))));
} else if (x1 <= 1.6e+101) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) - ((((t_0 * t_4) + (t_1 * (t_5 - ((x1 * x1) * 6.0)))) - t_6) - x1));
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_6)) + 9.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = t_0 + (2.0d0 * x2)
t_3 = (t_2 - x1) / t_1
t_4 = (x1 - t_2) / t_1
t_5 = ((x1 * 2.0d0) * t_3) * (3.0d0 + t_4)
t_6 = x1 * (x1 * x1)
if (x1 <= (-0.88d0)) then
tmp = x1 + ((x1 + (((((-1.0d0) - (x1 * x1)) * (((x1 * x1) * (6.0d0 + (4.0d0 * t_4))) + t_5)) + (t_0 * t_3)) + t_6)) + (3.0d0 * (3.0d0 + ((-1.0d0) / x1))))
else if (x1 <= 1.6d+101) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) - ((((t_0 * t_4) + (t_1 * (t_5 - ((x1 * x1) * 6.0d0)))) - t_6) - x1))
else
tmp = x1 + ((x1 - ((4.0d0 * (x1 * (x2 * (3.0d0 - (2.0d0 * x2))))) - t_6)) + 9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = t_0 + (2.0 * x2);
double t_3 = (t_2 - x1) / t_1;
double t_4 = (x1 - t_2) / t_1;
double t_5 = ((x1 * 2.0) * t_3) * (3.0 + t_4);
double t_6 = x1 * (x1 * x1);
double tmp;
if (x1 <= -0.88) {
tmp = x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (((x1 * x1) * (6.0 + (4.0 * t_4))) + t_5)) + (t_0 * t_3)) + t_6)) + (3.0 * (3.0 + (-1.0 / x1))));
} else if (x1 <= 1.6e+101) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) - ((((t_0 * t_4) + (t_1 * (t_5 - ((x1 * x1) * 6.0)))) - t_6) - x1));
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_6)) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = t_0 + (2.0 * x2) t_3 = (t_2 - x1) / t_1 t_4 = (x1 - t_2) / t_1 t_5 = ((x1 * 2.0) * t_3) * (3.0 + t_4) t_6 = x1 * (x1 * x1) tmp = 0 if x1 <= -0.88: tmp = x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (((x1 * x1) * (6.0 + (4.0 * t_4))) + t_5)) + (t_0 * t_3)) + t_6)) + (3.0 * (3.0 + (-1.0 / x1)))) elif x1 <= 1.6e+101: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) - ((((t_0 * t_4) + (t_1 * (t_5 - ((x1 * x1) * 6.0)))) - t_6) - x1)) else: tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_6)) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(t_0 + Float64(2.0 * x2)) t_3 = Float64(Float64(t_2 - x1) / t_1) t_4 = Float64(Float64(x1 - t_2) / t_1) t_5 = Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_4)) t_6 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -0.88) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(-1.0 - Float64(x1 * x1)) * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_4))) + t_5)) + Float64(t_0 * t_3)) + t_6)) + Float64(3.0 * Float64(3.0 + Float64(-1.0 / x1))))); elseif (x1 <= 1.6e+101) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) - Float64(Float64(Float64(Float64(t_0 * t_4) + Float64(t_1 * Float64(t_5 - Float64(Float64(x1 * x1) * 6.0)))) - t_6) - x1))); else tmp = Float64(x1 + Float64(Float64(x1 - Float64(Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))) - t_6)) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = t_0 + (2.0 * x2); t_3 = (t_2 - x1) / t_1; t_4 = (x1 - t_2) / t_1; t_5 = ((x1 * 2.0) * t_3) * (3.0 + t_4); t_6 = x1 * (x1 * x1); tmp = 0.0; if (x1 <= -0.88) tmp = x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (((x1 * x1) * (6.0 + (4.0 * t_4))) + t_5)) + (t_0 * t_3)) + t_6)) + (3.0 * (3.0 + (-1.0 / x1)))); elseif (x1 <= 1.6e+101) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) - ((((t_0 * t_4) + (t_1 * (t_5 - ((x1 * x1) * 6.0)))) - t_6) - x1)); else tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_6)) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 - t$95$2), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$4), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -0.88], N[(x1 + N[(N[(x1 + N[(N[(N[(N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.6e+101], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(t$95$0 * t$95$4), $MachinePrecision] + N[(t$95$1 * N[(t$95$5 - N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$6), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 - N[(N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$6), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := t_0 + 2 \cdot x2\\
t_3 := \frac{t_2 - x1}{t_1}\\
t_4 := \frac{x1 - t_2}{t_1}\\
t_5 := \left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(3 + t_4\right)\\
t_6 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -0.88:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(-1 - x1 \cdot x1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_4\right) + t_5\right) + t_0 \cdot t_3\right) + t_6\right)\right) + 3 \cdot \left(3 + \frac{-1}{x1}\right)\right)\\
\mathbf{elif}\;x1 \leq 1.6 \cdot 10^{+101}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} - \left(\left(\left(t_0 \cdot t_4 + t_1 \cdot \left(t_5 - \left(x1 \cdot x1\right) \cdot 6\right)\right) - t_6\right) - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - t_6\right)\right) + 9\right)\\
\end{array}
\end{array}
if x1 < -0.880000000000000004Initial program 37.1%
Taylor expanded in x1 around inf 36.4%
if -0.880000000000000004 < x1 < 1.60000000000000003e101Initial program 99.3%
fma-def99.3%
fma-def99.3%
*-commutative99.3%
clear-num99.3%
inv-pow99.3%
*-commutative99.3%
fma-def99.3%
associate-*r*99.3%
fma-def99.3%
pow299.3%
Applied egg-rr99.3%
unpow-199.3%
Simplified99.3%
Taylor expanded in x1 around inf 96.7%
if 1.60000000000000003e101 < x1 Initial program 33.3%
Taylor expanded in x1 around 0 26.2%
+-commutative26.2%
mul-1-neg26.2%
unsub-neg26.2%
Simplified26.2%
Taylor expanded in x1 around inf 26.2%
Taylor expanded in x1 around 0 100.0%
Final simplification83.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (+ t_0 (* 2.0 x2)))
(t_3 (/ (- t_2 x1) t_1))
(t_4 (/ (- x1 t_2) t_1))
(t_5 (* (* (* x1 2.0) t_3) (+ 3.0 t_4)))
(t_6 (* x1 (* x1 x1))))
(if (<= x1 -0.72)
(+
x1
(+
(+
x1
(+
(+
(* (- -1.0 (* x1 x1)) (+ (* (* x1 x1) (+ 6.0 (* 4.0 t_4))) t_5))
(* t_0 t_3))
t_6))
9.0))
(if (<= x1 1.6e+101)
(+
x1
(-
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(- (- (+ (* t_0 t_4) (* t_1 (- t_5 (* (* x1 x1) 6.0)))) t_6) x1)))
(+
x1
(+ (- x1 (- (* 4.0 (* x1 (* x2 (- 3.0 (* 2.0 x2))))) t_6)) 9.0))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = t_0 + (2.0 * x2);
double t_3 = (t_2 - x1) / t_1;
double t_4 = (x1 - t_2) / t_1;
double t_5 = ((x1 * 2.0) * t_3) * (3.0 + t_4);
double t_6 = x1 * (x1 * x1);
double tmp;
if (x1 <= -0.72) {
tmp = x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (((x1 * x1) * (6.0 + (4.0 * t_4))) + t_5)) + (t_0 * t_3)) + t_6)) + 9.0);
} else if (x1 <= 1.6e+101) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) - ((((t_0 * t_4) + (t_1 * (t_5 - ((x1 * x1) * 6.0)))) - t_6) - x1));
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_6)) + 9.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = t_0 + (2.0d0 * x2)
t_3 = (t_2 - x1) / t_1
t_4 = (x1 - t_2) / t_1
t_5 = ((x1 * 2.0d0) * t_3) * (3.0d0 + t_4)
t_6 = x1 * (x1 * x1)
if (x1 <= (-0.72d0)) then
tmp = x1 + ((x1 + (((((-1.0d0) - (x1 * x1)) * (((x1 * x1) * (6.0d0 + (4.0d0 * t_4))) + t_5)) + (t_0 * t_3)) + t_6)) + 9.0d0)
else if (x1 <= 1.6d+101) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) - ((((t_0 * t_4) + (t_1 * (t_5 - ((x1 * x1) * 6.0d0)))) - t_6) - x1))
else
tmp = x1 + ((x1 - ((4.0d0 * (x1 * (x2 * (3.0d0 - (2.0d0 * x2))))) - t_6)) + 9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = t_0 + (2.0 * x2);
double t_3 = (t_2 - x1) / t_1;
double t_4 = (x1 - t_2) / t_1;
double t_5 = ((x1 * 2.0) * t_3) * (3.0 + t_4);
double t_6 = x1 * (x1 * x1);
double tmp;
if (x1 <= -0.72) {
tmp = x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (((x1 * x1) * (6.0 + (4.0 * t_4))) + t_5)) + (t_0 * t_3)) + t_6)) + 9.0);
} else if (x1 <= 1.6e+101) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) - ((((t_0 * t_4) + (t_1 * (t_5 - ((x1 * x1) * 6.0)))) - t_6) - x1));
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_6)) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = t_0 + (2.0 * x2) t_3 = (t_2 - x1) / t_1 t_4 = (x1 - t_2) / t_1 t_5 = ((x1 * 2.0) * t_3) * (3.0 + t_4) t_6 = x1 * (x1 * x1) tmp = 0 if x1 <= -0.72: tmp = x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (((x1 * x1) * (6.0 + (4.0 * t_4))) + t_5)) + (t_0 * t_3)) + t_6)) + 9.0) elif x1 <= 1.6e+101: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) - ((((t_0 * t_4) + (t_1 * (t_5 - ((x1 * x1) * 6.0)))) - t_6) - x1)) else: tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_6)) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(t_0 + Float64(2.0 * x2)) t_3 = Float64(Float64(t_2 - x1) / t_1) t_4 = Float64(Float64(x1 - t_2) / t_1) t_5 = Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_4)) t_6 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -0.72) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(-1.0 - Float64(x1 * x1)) * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_4))) + t_5)) + Float64(t_0 * t_3)) + t_6)) + 9.0)); elseif (x1 <= 1.6e+101) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) - Float64(Float64(Float64(Float64(t_0 * t_4) + Float64(t_1 * Float64(t_5 - Float64(Float64(x1 * x1) * 6.0)))) - t_6) - x1))); else tmp = Float64(x1 + Float64(Float64(x1 - Float64(Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))) - t_6)) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = t_0 + (2.0 * x2); t_3 = (t_2 - x1) / t_1; t_4 = (x1 - t_2) / t_1; t_5 = ((x1 * 2.0) * t_3) * (3.0 + t_4); t_6 = x1 * (x1 * x1); tmp = 0.0; if (x1 <= -0.72) tmp = x1 + ((x1 + ((((-1.0 - (x1 * x1)) * (((x1 * x1) * (6.0 + (4.0 * t_4))) + t_5)) + (t_0 * t_3)) + t_6)) + 9.0); elseif (x1 <= 1.6e+101) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) - ((((t_0 * t_4) + (t_1 * (t_5 - ((x1 * x1) * 6.0)))) - t_6) - x1)); else tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_6)) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 - t$95$2), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$4), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -0.72], N[(x1 + N[(N[(x1 + N[(N[(N[(N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.6e+101], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(t$95$0 * t$95$4), $MachinePrecision] + N[(t$95$1 * N[(t$95$5 - N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$6), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 - N[(N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$6), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := t_0 + 2 \cdot x2\\
t_3 := \frac{t_2 - x1}{t_1}\\
t_4 := \frac{x1 - t_2}{t_1}\\
t_5 := \left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(3 + t_4\right)\\
t_6 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -0.72:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(-1 - x1 \cdot x1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_4\right) + t_5\right) + t_0 \cdot t_3\right) + t_6\right)\right) + 9\right)\\
\mathbf{elif}\;x1 \leq 1.6 \cdot 10^{+101}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} - \left(\left(\left(t_0 \cdot t_4 + t_1 \cdot \left(t_5 - \left(x1 \cdot x1\right) \cdot 6\right)\right) - t_6\right) - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - t_6\right)\right) + 9\right)\\
\end{array}
\end{array}
if x1 < -0.71999999999999997Initial program 37.1%
Taylor expanded in x1 around inf 36.3%
if -0.71999999999999997 < x1 < 1.60000000000000003e101Initial program 99.3%
fma-def99.3%
fma-def99.3%
*-commutative99.3%
clear-num99.3%
inv-pow99.3%
*-commutative99.3%
fma-def99.3%
associate-*r*99.3%
fma-def99.3%
pow299.3%
Applied egg-rr99.3%
unpow-199.3%
Simplified99.3%
Taylor expanded in x1 around inf 96.7%
if 1.60000000000000003e101 < x1 Initial program 33.3%
Taylor expanded in x1 around 0 26.2%
+-commutative26.2%
mul-1-neg26.2%
unsub-neg26.2%
Simplified26.2%
Taylor expanded in x1 around inf 26.2%
Taylor expanded in x1 around 0 100.0%
Final simplification83.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (- (* 2.0 x2) x1))
(t_2 (* x1 (* x1 x1)))
(t_3 (* x1 (* x1 3.0)))
(t_4 (+ t_3 (* 2.0 x2)))
(t_5 (/ (- t_4 x1) t_0))
(t_6 (* (* x1 2.0) t_5))
(t_7 (* 3.0 (+ 3.0 (/ -1.0 x1))))
(t_8 (/ (- x1 t_4) t_0))
(t_9 (* (* x1 x1) (+ 6.0 (* 4.0 t_8)))))
(if (<= x1 -2600000.0)
(+
x1
(+
t_7
(+ x1 (+ t_2 (- (* t_3 t_5) (* t_0 (+ (* t_6 (/ 1.0 x1)) t_9)))))))
(if (<= x1 0.018)
(-
x1
(+
(* 3.0 (/ (- x1 (- t_3 (* 2.0 x2))) t_0))
(-
(-
(+
(* t_3 (- x1 (* 2.0 x2)))
(* t_0 (+ (* (* x1 x1) (- 6.0 (* 4.0 t_1))) (* t_6 (- 3.0 t_1)))))
t_2)
x1)))
(if (<= x1 1.6e+101)
(+
x1
(+
t_7
(+
x1
(+
t_2
(+
(* (- -1.0 (* x1 x1)) (+ t_9 (* t_6 (+ 3.0 t_8))))
(* t_3 (* 2.0 x2)))))))
(+
x1
(+ (- x1 (- (* 4.0 (* x1 (* x2 (- 3.0 (* 2.0 x2))))) t_2)) 9.0)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = (2.0 * x2) - x1;
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = t_3 + (2.0 * x2);
double t_5 = (t_4 - x1) / t_0;
double t_6 = (x1 * 2.0) * t_5;
double t_7 = 3.0 * (3.0 + (-1.0 / x1));
double t_8 = (x1 - t_4) / t_0;
double t_9 = (x1 * x1) * (6.0 + (4.0 * t_8));
double tmp;
if (x1 <= -2600000.0) {
tmp = x1 + (t_7 + (x1 + (t_2 + ((t_3 * t_5) - (t_0 * ((t_6 * (1.0 / x1)) + t_9))))));
} else if (x1 <= 0.018) {
tmp = x1 - ((3.0 * ((x1 - (t_3 - (2.0 * x2))) / t_0)) + ((((t_3 * (x1 - (2.0 * x2))) + (t_0 * (((x1 * x1) * (6.0 - (4.0 * t_1))) + (t_6 * (3.0 - t_1))))) - t_2) - x1));
} else if (x1 <= 1.6e+101) {
tmp = x1 + (t_7 + (x1 + (t_2 + (((-1.0 - (x1 * x1)) * (t_9 + (t_6 * (3.0 + t_8)))) + (t_3 * (2.0 * x2))))));
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_2)) + 9.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: t_9
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = (2.0d0 * x2) - x1
t_2 = x1 * (x1 * x1)
t_3 = x1 * (x1 * 3.0d0)
t_4 = t_3 + (2.0d0 * x2)
t_5 = (t_4 - x1) / t_0
t_6 = (x1 * 2.0d0) * t_5
t_7 = 3.0d0 * (3.0d0 + ((-1.0d0) / x1))
t_8 = (x1 - t_4) / t_0
t_9 = (x1 * x1) * (6.0d0 + (4.0d0 * t_8))
if (x1 <= (-2600000.0d0)) then
tmp = x1 + (t_7 + (x1 + (t_2 + ((t_3 * t_5) - (t_0 * ((t_6 * (1.0d0 / x1)) + t_9))))))
else if (x1 <= 0.018d0) then
tmp = x1 - ((3.0d0 * ((x1 - (t_3 - (2.0d0 * x2))) / t_0)) + ((((t_3 * (x1 - (2.0d0 * x2))) + (t_0 * (((x1 * x1) * (6.0d0 - (4.0d0 * t_1))) + (t_6 * (3.0d0 - t_1))))) - t_2) - x1))
else if (x1 <= 1.6d+101) then
tmp = x1 + (t_7 + (x1 + (t_2 + ((((-1.0d0) - (x1 * x1)) * (t_9 + (t_6 * (3.0d0 + t_8)))) + (t_3 * (2.0d0 * x2))))))
else
tmp = x1 + ((x1 - ((4.0d0 * (x1 * (x2 * (3.0d0 - (2.0d0 * x2))))) - t_2)) + 9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = (2.0 * x2) - x1;
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = t_3 + (2.0 * x2);
double t_5 = (t_4 - x1) / t_0;
double t_6 = (x1 * 2.0) * t_5;
double t_7 = 3.0 * (3.0 + (-1.0 / x1));
double t_8 = (x1 - t_4) / t_0;
double t_9 = (x1 * x1) * (6.0 + (4.0 * t_8));
double tmp;
if (x1 <= -2600000.0) {
tmp = x1 + (t_7 + (x1 + (t_2 + ((t_3 * t_5) - (t_0 * ((t_6 * (1.0 / x1)) + t_9))))));
} else if (x1 <= 0.018) {
tmp = x1 - ((3.0 * ((x1 - (t_3 - (2.0 * x2))) / t_0)) + ((((t_3 * (x1 - (2.0 * x2))) + (t_0 * (((x1 * x1) * (6.0 - (4.0 * t_1))) + (t_6 * (3.0 - t_1))))) - t_2) - x1));
} else if (x1 <= 1.6e+101) {
tmp = x1 + (t_7 + (x1 + (t_2 + (((-1.0 - (x1 * x1)) * (t_9 + (t_6 * (3.0 + t_8)))) + (t_3 * (2.0 * x2))))));
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_2)) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = (2.0 * x2) - x1 t_2 = x1 * (x1 * x1) t_3 = x1 * (x1 * 3.0) t_4 = t_3 + (2.0 * x2) t_5 = (t_4 - x1) / t_0 t_6 = (x1 * 2.0) * t_5 t_7 = 3.0 * (3.0 + (-1.0 / x1)) t_8 = (x1 - t_4) / t_0 t_9 = (x1 * x1) * (6.0 + (4.0 * t_8)) tmp = 0 if x1 <= -2600000.0: tmp = x1 + (t_7 + (x1 + (t_2 + ((t_3 * t_5) - (t_0 * ((t_6 * (1.0 / x1)) + t_9)))))) elif x1 <= 0.018: tmp = x1 - ((3.0 * ((x1 - (t_3 - (2.0 * x2))) / t_0)) + ((((t_3 * (x1 - (2.0 * x2))) + (t_0 * (((x1 * x1) * (6.0 - (4.0 * t_1))) + (t_6 * (3.0 - t_1))))) - t_2) - x1)) elif x1 <= 1.6e+101: tmp = x1 + (t_7 + (x1 + (t_2 + (((-1.0 - (x1 * x1)) * (t_9 + (t_6 * (3.0 + t_8)))) + (t_3 * (2.0 * x2)))))) else: tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_2)) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(Float64(2.0 * x2) - x1) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(t_3 + Float64(2.0 * x2)) t_5 = Float64(Float64(t_4 - x1) / t_0) t_6 = Float64(Float64(x1 * 2.0) * t_5) t_7 = Float64(3.0 * Float64(3.0 + Float64(-1.0 / x1))) t_8 = Float64(Float64(x1 - t_4) / t_0) t_9 = Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_8))) tmp = 0.0 if (x1 <= -2600000.0) tmp = Float64(x1 + Float64(t_7 + Float64(x1 + Float64(t_2 + Float64(Float64(t_3 * t_5) - Float64(t_0 * Float64(Float64(t_6 * Float64(1.0 / x1)) + t_9))))))); elseif (x1 <= 0.018) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(x1 - Float64(t_3 - Float64(2.0 * x2))) / t_0)) + Float64(Float64(Float64(Float64(t_3 * Float64(x1 - Float64(2.0 * x2))) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 - Float64(4.0 * t_1))) + Float64(t_6 * Float64(3.0 - t_1))))) - t_2) - x1))); elseif (x1 <= 1.6e+101) tmp = Float64(x1 + Float64(t_7 + Float64(x1 + Float64(t_2 + Float64(Float64(Float64(-1.0 - Float64(x1 * x1)) * Float64(t_9 + Float64(t_6 * Float64(3.0 + t_8)))) + Float64(t_3 * Float64(2.0 * x2))))))); else tmp = Float64(x1 + Float64(Float64(x1 - Float64(Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))) - t_2)) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = (2.0 * x2) - x1; t_2 = x1 * (x1 * x1); t_3 = x1 * (x1 * 3.0); t_4 = t_3 + (2.0 * x2); t_5 = (t_4 - x1) / t_0; t_6 = (x1 * 2.0) * t_5; t_7 = 3.0 * (3.0 + (-1.0 / x1)); t_8 = (x1 - t_4) / t_0; t_9 = (x1 * x1) * (6.0 + (4.0 * t_8)); tmp = 0.0; if (x1 <= -2600000.0) tmp = x1 + (t_7 + (x1 + (t_2 + ((t_3 * t_5) - (t_0 * ((t_6 * (1.0 / x1)) + t_9)))))); elseif (x1 <= 0.018) tmp = x1 - ((3.0 * ((x1 - (t_3 - (2.0 * x2))) / t_0)) + ((((t_3 * (x1 - (2.0 * x2))) + (t_0 * (((x1 * x1) * (6.0 - (4.0 * t_1))) + (t_6 * (3.0 - t_1))))) - t_2) - x1)); elseif (x1 <= 1.6e+101) tmp = x1 + (t_7 + (x1 + (t_2 + (((-1.0 - (x1 * x1)) * (t_9 + (t_6 * (3.0 + t_8)))) + (t_3 * (2.0 * x2)))))); else tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_2)) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$4 - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(3.0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(N[(x1 - t$95$4), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$9 = N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2600000.0], N[(x1 + N[(t$95$7 + N[(x1 + N[(t$95$2 + N[(N[(t$95$3 * t$95$5), $MachinePrecision] - N[(t$95$0 * N[(N[(t$95$6 * N[(1.0 / x1), $MachinePrecision]), $MachinePrecision] + t$95$9), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.018], N[(x1 - N[(N[(3.0 * N[(N[(x1 - N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(t$95$3 * N[(x1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(4.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$6 * N[(3.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.6e+101], N[(x1 + N[(t$95$7 + N[(x1 + N[(t$95$2 + N[(N[(N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * N[(t$95$9 + N[(t$95$6 * N[(3.0 + t$95$8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 - N[(N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := 2 \cdot x2 - x1\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := t_3 + 2 \cdot x2\\
t_5 := \frac{t_4 - x1}{t_0}\\
t_6 := \left(x1 \cdot 2\right) \cdot t_5\\
t_7 := 3 \cdot \left(3 + \frac{-1}{x1}\right)\\
t_8 := \frac{x1 - t_4}{t_0}\\
t_9 := \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_8\right)\\
\mathbf{if}\;x1 \leq -2600000:\\
\;\;\;\;x1 + \left(t_7 + \left(x1 + \left(t_2 + \left(t_3 \cdot t_5 - t_0 \cdot \left(t_6 \cdot \frac{1}{x1} + t_9\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 0.018:\\
\;\;\;\;x1 - \left(3 \cdot \frac{x1 - \left(t_3 - 2 \cdot x2\right)}{t_0} + \left(\left(\left(t_3 \cdot \left(x1 - 2 \cdot x2\right) + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 - 4 \cdot t_1\right) + t_6 \cdot \left(3 - t_1\right)\right)\right) - t_2\right) - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 1.6 \cdot 10^{+101}:\\
\;\;\;\;x1 + \left(t_7 + \left(x1 + \left(t_2 + \left(\left(-1 - x1 \cdot x1\right) \cdot \left(t_9 + t_6 \cdot \left(3 + t_8\right)\right) + t_3 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - t_2\right)\right) + 9\right)\\
\end{array}
\end{array}
if x1 < -2.6e6Initial program 33.8%
Taylor expanded in x1 around inf 33.8%
Taylor expanded in x1 around inf 30.7%
if -2.6e6 < x1 < 0.0179999999999999986Initial program 99.3%
Taylor expanded in x1 around 0 97.9%
+-commutative97.9%
mul-1-neg97.9%
unsub-neg97.9%
Simplified97.9%
Taylor expanded in x1 around 0 97.9%
+-commutative97.9%
mul-1-neg97.9%
unsub-neg97.9%
Simplified97.9%
Taylor expanded in x1 around 0 97.8%
+-commutative97.9%
mul-1-neg97.9%
unsub-neg97.9%
Simplified97.8%
if 0.0179999999999999986 < x1 < 1.60000000000000003e101Initial program 99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around 0 91.5%
if 1.60000000000000003e101 < x1 Initial program 33.3%
Taylor expanded in x1 around 0 26.2%
+-commutative26.2%
mul-1-neg26.2%
unsub-neg26.2%
Simplified26.2%
Taylor expanded in x1 around inf 26.2%
Taylor expanded in x1 around 0 100.0%
Final simplification83.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 x1)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (+ t_2 (* 2.0 x2)))
(t_4 (/ (- t_3 x1) t_0))
(t_5 (* (* x1 2.0) t_4))
(t_6 (* 3.0 (+ 3.0 (/ -1.0 x1))))
(t_7 (/ (- x1 t_3) t_0))
(t_8 (* (* x1 x1) (+ 6.0 (* 4.0 t_7)))))
(if (<= x1 -2600000.0)
(+
x1
(+
t_6
(+ x1 (+ t_1 (- (* t_2 t_4) (* t_0 (+ (* t_5 (/ 1.0 x1)) t_8)))))))
(if (<= x1 0.022)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
(-
x1
(-
(+
(* t_2 (- x1 (* 2.0 x2)))
(* t_0 (+ t_8 (* t_5 (- 3.0 (- (* 2.0 x2) x1))))))
t_1))))
(if (<= x1 1.6e+101)
(+
x1
(+
t_6
(+
x1
(+
t_1
(+
(* (- -1.0 (* x1 x1)) (+ t_8 (* t_5 (+ 3.0 t_7))))
(* t_2 (* 2.0 x2)))))))
(+
x1
(+ (- x1 (- (* 4.0 (* x1 (* x2 (- 3.0 (* 2.0 x2))))) t_1)) 9.0)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = t_2 + (2.0 * x2);
double t_4 = (t_3 - x1) / t_0;
double t_5 = (x1 * 2.0) * t_4;
double t_6 = 3.0 * (3.0 + (-1.0 / x1));
double t_7 = (x1 - t_3) / t_0;
double t_8 = (x1 * x1) * (6.0 + (4.0 * t_7));
double tmp;
if (x1 <= -2600000.0) {
tmp = x1 + (t_6 + (x1 + (t_1 + ((t_2 * t_4) - (t_0 * ((t_5 * (1.0 / x1)) + t_8))))));
} else if (x1 <= 0.022) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 - (((t_2 * (x1 - (2.0 * x2))) + (t_0 * (t_8 + (t_5 * (3.0 - ((2.0 * x2) - x1)))))) - t_1)));
} else if (x1 <= 1.6e+101) {
tmp = x1 + (t_6 + (x1 + (t_1 + (((-1.0 - (x1 * x1)) * (t_8 + (t_5 * (3.0 + t_7)))) + (t_2 * (2.0 * x2))))));
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_1)) + 9.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * x1)
t_2 = x1 * (x1 * 3.0d0)
t_3 = t_2 + (2.0d0 * x2)
t_4 = (t_3 - x1) / t_0
t_5 = (x1 * 2.0d0) * t_4
t_6 = 3.0d0 * (3.0d0 + ((-1.0d0) / x1))
t_7 = (x1 - t_3) / t_0
t_8 = (x1 * x1) * (6.0d0 + (4.0d0 * t_7))
if (x1 <= (-2600000.0d0)) then
tmp = x1 + (t_6 + (x1 + (t_1 + ((t_2 * t_4) - (t_0 * ((t_5 * (1.0d0 / x1)) + t_8))))))
else if (x1 <= 0.022d0) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 - (((t_2 * (x1 - (2.0d0 * x2))) + (t_0 * (t_8 + (t_5 * (3.0d0 - ((2.0d0 * x2) - x1)))))) - t_1)))
else if (x1 <= 1.6d+101) then
tmp = x1 + (t_6 + (x1 + (t_1 + ((((-1.0d0) - (x1 * x1)) * (t_8 + (t_5 * (3.0d0 + t_7)))) + (t_2 * (2.0d0 * x2))))))
else
tmp = x1 + ((x1 - ((4.0d0 * (x1 * (x2 * (3.0d0 - (2.0d0 * x2))))) - t_1)) + 9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = t_2 + (2.0 * x2);
double t_4 = (t_3 - x1) / t_0;
double t_5 = (x1 * 2.0) * t_4;
double t_6 = 3.0 * (3.0 + (-1.0 / x1));
double t_7 = (x1 - t_3) / t_0;
double t_8 = (x1 * x1) * (6.0 + (4.0 * t_7));
double tmp;
if (x1 <= -2600000.0) {
tmp = x1 + (t_6 + (x1 + (t_1 + ((t_2 * t_4) - (t_0 * ((t_5 * (1.0 / x1)) + t_8))))));
} else if (x1 <= 0.022) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 - (((t_2 * (x1 - (2.0 * x2))) + (t_0 * (t_8 + (t_5 * (3.0 - ((2.0 * x2) - x1)))))) - t_1)));
} else if (x1 <= 1.6e+101) {
tmp = x1 + (t_6 + (x1 + (t_1 + (((-1.0 - (x1 * x1)) * (t_8 + (t_5 * (3.0 + t_7)))) + (t_2 * (2.0 * x2))))));
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_1)) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * x1) t_2 = x1 * (x1 * 3.0) t_3 = t_2 + (2.0 * x2) t_4 = (t_3 - x1) / t_0 t_5 = (x1 * 2.0) * t_4 t_6 = 3.0 * (3.0 + (-1.0 / x1)) t_7 = (x1 - t_3) / t_0 t_8 = (x1 * x1) * (6.0 + (4.0 * t_7)) tmp = 0 if x1 <= -2600000.0: tmp = x1 + (t_6 + (x1 + (t_1 + ((t_2 * t_4) - (t_0 * ((t_5 * (1.0 / x1)) + t_8)))))) elif x1 <= 0.022: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 - (((t_2 * (x1 - (2.0 * x2))) + (t_0 * (t_8 + (t_5 * (3.0 - ((2.0 * x2) - x1)))))) - t_1))) elif x1 <= 1.6e+101: tmp = x1 + (t_6 + (x1 + (t_1 + (((-1.0 - (x1 * x1)) * (t_8 + (t_5 * (3.0 + t_7)))) + (t_2 * (2.0 * x2)))))) else: tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_1)) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(t_2 + Float64(2.0 * x2)) t_4 = Float64(Float64(t_3 - x1) / t_0) t_5 = Float64(Float64(x1 * 2.0) * t_4) t_6 = Float64(3.0 * Float64(3.0 + Float64(-1.0 / x1))) t_7 = Float64(Float64(x1 - t_3) / t_0) t_8 = Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_7))) tmp = 0.0 if (x1 <= -2600000.0) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(t_1 + Float64(Float64(t_2 * t_4) - Float64(t_0 * Float64(Float64(t_5 * Float64(1.0 / x1)) + t_8))))))); elseif (x1 <= 0.022) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 - Float64(Float64(Float64(t_2 * Float64(x1 - Float64(2.0 * x2))) + Float64(t_0 * Float64(t_8 + Float64(t_5 * Float64(3.0 - Float64(Float64(2.0 * x2) - x1)))))) - t_1)))); elseif (x1 <= 1.6e+101) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(t_1 + Float64(Float64(Float64(-1.0 - Float64(x1 * x1)) * Float64(t_8 + Float64(t_5 * Float64(3.0 + t_7)))) + Float64(t_2 * Float64(2.0 * x2))))))); else tmp = Float64(x1 + Float64(Float64(x1 - Float64(Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))) - t_1)) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * x1); t_2 = x1 * (x1 * 3.0); t_3 = t_2 + (2.0 * x2); t_4 = (t_3 - x1) / t_0; t_5 = (x1 * 2.0) * t_4; t_6 = 3.0 * (3.0 + (-1.0 / x1)); t_7 = (x1 - t_3) / t_0; t_8 = (x1 * x1) * (6.0 + (4.0 * t_7)); tmp = 0.0; if (x1 <= -2600000.0) tmp = x1 + (t_6 + (x1 + (t_1 + ((t_2 * t_4) - (t_0 * ((t_5 * (1.0 / x1)) + t_8)))))); elseif (x1 <= 0.022) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 - (((t_2 * (x1 - (2.0 * x2))) + (t_0 * (t_8 + (t_5 * (3.0 - ((2.0 * x2) - x1)))))) - t_1))); elseif (x1 <= 1.6e+101) tmp = x1 + (t_6 + (x1 + (t_1 + (((-1.0 - (x1 * x1)) * (t_8 + (t_5 * (3.0 + t_7)))) + (t_2 * (2.0 * x2)))))); else tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_1)) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(3.0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 - t$95$3), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$8 = N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2600000.0], N[(x1 + N[(t$95$6 + N[(x1 + N[(t$95$1 + N[(N[(t$95$2 * t$95$4), $MachinePrecision] - N[(t$95$0 * N[(N[(t$95$5 * N[(1.0 / x1), $MachinePrecision]), $MachinePrecision] + t$95$8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.022], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 - N[(N[(N[(t$95$2 * N[(x1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(t$95$8 + N[(t$95$5 * N[(3.0 - N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.6e+101], N[(x1 + N[(t$95$6 + N[(x1 + N[(t$95$1 + N[(N[(N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * N[(t$95$8 + N[(t$95$5 * N[(3.0 + t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 - N[(N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := t_2 + 2 \cdot x2\\
t_4 := \frac{t_3 - x1}{t_0}\\
t_5 := \left(x1 \cdot 2\right) \cdot t_4\\
t_6 := 3 \cdot \left(3 + \frac{-1}{x1}\right)\\
t_7 := \frac{x1 - t_3}{t_0}\\
t_8 := \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_7\right)\\
\mathbf{if}\;x1 \leq -2600000:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_1 + \left(t_2 \cdot t_4 - t_0 \cdot \left(t_5 \cdot \frac{1}{x1} + t_8\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 0.022:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 - \left(\left(t_2 \cdot \left(x1 - 2 \cdot x2\right) + t_0 \cdot \left(t_8 + t_5 \cdot \left(3 - \left(2 \cdot x2 - x1\right)\right)\right)\right) - t_1\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.6 \cdot 10^{+101}:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_1 + \left(\left(-1 - x1 \cdot x1\right) \cdot \left(t_8 + t_5 \cdot \left(3 + t_7\right)\right) + t_2 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - t_1\right)\right) + 9\right)\\
\end{array}
\end{array}
if x1 < -2.6e6Initial program 33.8%
Taylor expanded in x1 around inf 33.8%
Taylor expanded in x1 around inf 30.7%
if -2.6e6 < x1 < 0.021999999999999999Initial program 99.3%
Taylor expanded in x1 around 0 97.9%
+-commutative97.9%
mul-1-neg97.9%
unsub-neg97.9%
Simplified97.9%
Taylor expanded in x1 around 0 97.9%
+-commutative97.9%
mul-1-neg97.9%
unsub-neg97.9%
Simplified97.9%
if 0.021999999999999999 < x1 < 1.60000000000000003e101Initial program 99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around 0 91.5%
if 1.60000000000000003e101 < x1 Initial program 33.3%
Taylor expanded in x1 around 0 26.2%
+-commutative26.2%
mul-1-neg26.2%
unsub-neg26.2%
Simplified26.2%
Taylor expanded in x1 around inf 26.2%
Taylor expanded in x1 around 0 100.0%
Final simplification83.1%
(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 2.0) t_3))
(t_5 (- (* 2.0 x2) x1))
(t_6 (* x1 (* x1 x1)))
(t_7
(+
x1
(+
(* 3.0 (+ 3.0 (/ -1.0 x1)))
(+
x1
(+
t_6
(-
(* t_0 t_3)
(*
t_2
(+
(* t_4 (/ 1.0 x1))
(* (* x1 x1) (+ 6.0 (* 4.0 (/ (- x1 t_1) t_2)))))))))))))
(if (<= x1 -14000000.0)
t_7
(if (<= x1 4.2e+30)
(-
x1
(+
(* 3.0 (/ (- x1 (- t_0 (* 2.0 x2))) t_2))
(-
(-
(+
(* t_0 (- x1 (* 2.0 x2)))
(* t_2 (+ (* (* x1 x1) (- 6.0 (* 4.0 t_5))) (* t_4 (- 3.0 t_5)))))
t_6)
x1)))
(if (<= x1 1.6e+101)
t_7
(+
x1
(+ (- x1 (- (* 4.0 (* x1 (* x2 (- 3.0 (* 2.0 x2))))) t_6)) 9.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = t_0 + (2.0 * x2);
double t_2 = (x1 * x1) + 1.0;
double t_3 = (t_1 - x1) / t_2;
double t_4 = (x1 * 2.0) * t_3;
double t_5 = (2.0 * x2) - x1;
double t_6 = x1 * (x1 * x1);
double t_7 = x1 + ((3.0 * (3.0 + (-1.0 / x1))) + (x1 + (t_6 + ((t_0 * t_3) - (t_2 * ((t_4 * (1.0 / x1)) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_1) / t_2))))))))));
double tmp;
if (x1 <= -14000000.0) {
tmp = t_7;
} else if (x1 <= 4.2e+30) {
tmp = x1 - ((3.0 * ((x1 - (t_0 - (2.0 * x2))) / t_2)) + ((((t_0 * (x1 - (2.0 * x2))) + (t_2 * (((x1 * x1) * (6.0 - (4.0 * t_5))) + (t_4 * (3.0 - t_5))))) - t_6) - x1));
} else if (x1 <= 1.6e+101) {
tmp = t_7;
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_6)) + 9.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
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
t_4 = (x1 * 2.0d0) * t_3
t_5 = (2.0d0 * x2) - x1
t_6 = x1 * (x1 * x1)
t_7 = x1 + ((3.0d0 * (3.0d0 + ((-1.0d0) / x1))) + (x1 + (t_6 + ((t_0 * t_3) - (t_2 * ((t_4 * (1.0d0 / x1)) + ((x1 * x1) * (6.0d0 + (4.0d0 * ((x1 - t_1) / t_2))))))))))
if (x1 <= (-14000000.0d0)) then
tmp = t_7
else if (x1 <= 4.2d+30) then
tmp = x1 - ((3.0d0 * ((x1 - (t_0 - (2.0d0 * x2))) / t_2)) + ((((t_0 * (x1 - (2.0d0 * x2))) + (t_2 * (((x1 * x1) * (6.0d0 - (4.0d0 * t_5))) + (t_4 * (3.0d0 - t_5))))) - t_6) - x1))
else if (x1 <= 1.6d+101) then
tmp = t_7
else
tmp = x1 + ((x1 - ((4.0d0 * (x1 * (x2 * (3.0d0 - (2.0d0 * x2))))) - t_6)) + 9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = t_0 + (2.0 * x2);
double t_2 = (x1 * x1) + 1.0;
double t_3 = (t_1 - x1) / t_2;
double t_4 = (x1 * 2.0) * t_3;
double t_5 = (2.0 * x2) - x1;
double t_6 = x1 * (x1 * x1);
double t_7 = x1 + ((3.0 * (3.0 + (-1.0 / x1))) + (x1 + (t_6 + ((t_0 * t_3) - (t_2 * ((t_4 * (1.0 / x1)) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_1) / t_2))))))))));
double tmp;
if (x1 <= -14000000.0) {
tmp = t_7;
} else if (x1 <= 4.2e+30) {
tmp = x1 - ((3.0 * ((x1 - (t_0 - (2.0 * x2))) / t_2)) + ((((t_0 * (x1 - (2.0 * x2))) + (t_2 * (((x1 * x1) * (6.0 - (4.0 * t_5))) + (t_4 * (3.0 - t_5))))) - t_6) - x1));
} else if (x1 <= 1.6e+101) {
tmp = t_7;
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_6)) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = t_0 + (2.0 * x2) t_2 = (x1 * x1) + 1.0 t_3 = (t_1 - x1) / t_2 t_4 = (x1 * 2.0) * t_3 t_5 = (2.0 * x2) - x1 t_6 = x1 * (x1 * x1) t_7 = x1 + ((3.0 * (3.0 + (-1.0 / x1))) + (x1 + (t_6 + ((t_0 * t_3) - (t_2 * ((t_4 * (1.0 / x1)) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_1) / t_2)))))))))) tmp = 0 if x1 <= -14000000.0: tmp = t_7 elif x1 <= 4.2e+30: tmp = x1 - ((3.0 * ((x1 - (t_0 - (2.0 * x2))) / t_2)) + ((((t_0 * (x1 - (2.0 * x2))) + (t_2 * (((x1 * x1) * (6.0 - (4.0 * t_5))) + (t_4 * (3.0 - t_5))))) - t_6) - x1)) elif x1 <= 1.6e+101: tmp = t_7 else: tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_6)) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(t_0 + Float64(2.0 * x2)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(t_1 - x1) / t_2) t_4 = Float64(Float64(x1 * 2.0) * t_3) t_5 = Float64(Float64(2.0 * x2) - x1) t_6 = Float64(x1 * Float64(x1 * x1)) t_7 = Float64(x1 + Float64(Float64(3.0 * Float64(3.0 + Float64(-1.0 / x1))) + Float64(x1 + Float64(t_6 + Float64(Float64(t_0 * t_3) - Float64(t_2 * Float64(Float64(t_4 * Float64(1.0 / x1)) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(Float64(x1 - t_1) / t_2))))))))))) tmp = 0.0 if (x1 <= -14000000.0) tmp = t_7; elseif (x1 <= 4.2e+30) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(x1 - Float64(t_0 - Float64(2.0 * x2))) / t_2)) + Float64(Float64(Float64(Float64(t_0 * Float64(x1 - Float64(2.0 * x2))) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 - Float64(4.0 * t_5))) + Float64(t_4 * Float64(3.0 - t_5))))) - t_6) - x1))); elseif (x1 <= 1.6e+101) tmp = t_7; else tmp = Float64(x1 + Float64(Float64(x1 - Float64(Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))) - t_6)) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = t_0 + (2.0 * x2); t_2 = (x1 * x1) + 1.0; t_3 = (t_1 - x1) / t_2; t_4 = (x1 * 2.0) * t_3; t_5 = (2.0 * x2) - x1; t_6 = x1 * (x1 * x1); t_7 = x1 + ((3.0 * (3.0 + (-1.0 / x1))) + (x1 + (t_6 + ((t_0 * t_3) - (t_2 * ((t_4 * (1.0 / x1)) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_1) / t_2)))))))))); tmp = 0.0; if (x1 <= -14000000.0) tmp = t_7; elseif (x1 <= 4.2e+30) tmp = x1 - ((3.0 * ((x1 - (t_0 - (2.0 * x2))) / t_2)) + ((((t_0 * (x1 - (2.0 * x2))) + (t_2 * (((x1 * x1) * (6.0 - (4.0 * t_5))) + (t_4 * (3.0 - t_5))))) - t_6) - x1)); elseif (x1 <= 1.6e+101) tmp = t_7; else tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_6)) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(x1 + N[(N[(3.0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$6 + N[(N[(t$95$0 * t$95$3), $MachinePrecision] - N[(t$95$2 * N[(N[(t$95$4 * N[(1.0 / x1), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(N[(x1 - t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -14000000.0], t$95$7, If[LessEqual[x1, 4.2e+30], N[(x1 - N[(N[(3.0 * N[(N[(x1 - N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(t$95$0 * N[(x1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * N[(3.0 - t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$6), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.6e+101], t$95$7, N[(x1 + N[(N[(x1 - N[(N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$6), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := t_0 + 2 \cdot x2\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{t_1 - x1}{t_2}\\
t_4 := \left(x1 \cdot 2\right) \cdot t_3\\
t_5 := 2 \cdot x2 - x1\\
t_6 := x1 \cdot \left(x1 \cdot x1\right)\\
t_7 := x1 + \left(3 \cdot \left(3 + \frac{-1}{x1}\right) + \left(x1 + \left(t_6 + \left(t_0 \cdot t_3 - t_2 \cdot \left(t_4 \cdot \frac{1}{x1} + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - t_1}{t_2}\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -14000000:\\
\;\;\;\;t_7\\
\mathbf{elif}\;x1 \leq 4.2 \cdot 10^{+30}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{x1 - \left(t_0 - 2 \cdot x2\right)}{t_2} + \left(\left(\left(t_0 \cdot \left(x1 - 2 \cdot x2\right) + t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 - 4 \cdot t_5\right) + t_4 \cdot \left(3 - t_5\right)\right)\right) - t_6\right) - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 1.6 \cdot 10^{+101}:\\
\;\;\;\;t_7\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - t_6\right)\right) + 9\right)\\
\end{array}
\end{array}
if x1 < -1.4e7 or 4.2e30 < x1 < 1.60000000000000003e101Initial program 43.7%
Taylor expanded in x1 around inf 43.7%
Taylor expanded in x1 around inf 39.6%
if -1.4e7 < x1 < 4.2e30Initial program 99.3%
Taylor expanded in x1 around 0 96.9%
+-commutative96.9%
mul-1-neg96.9%
unsub-neg96.9%
Simplified96.9%
Taylor expanded in x1 around 0 96.9%
+-commutative96.9%
mul-1-neg96.9%
unsub-neg96.9%
Simplified96.9%
Taylor expanded in x1 around 0 96.8%
+-commutative96.9%
mul-1-neg96.9%
unsub-neg96.9%
Simplified96.8%
if 1.60000000000000003e101 < x1 Initial program 33.3%
Taylor expanded in x1 around 0 26.2%
+-commutative26.2%
mul-1-neg26.2%
unsub-neg26.2%
Simplified26.2%
Taylor expanded in x1 around inf 26.2%
Taylor expanded in x1 around 0 100.0%
Final simplification82.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 x1)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (+ t_2 (* 2.0 x2)))
(t_4 (/ (- t_3 x1) t_0))
(t_5 (* t_2 t_4))
(t_6 (* (* x1 x1) (+ 6.0 (* 4.0 (/ (- x1 t_3) t_0))))))
(if (<= x1 -11000000.0)
(+
x1
(+
(* 3.0 (+ 3.0 (/ -1.0 x1)))
(+
x1
(+ t_1 (- t_5 (* t_0 (+ (* (* (* x1 2.0) t_4) (/ 1.0 x1)) t_6)))))))
(if (<= x1 1.6e+101)
(-
x1
(-
(* 3.0 (/ (- x1 (- t_2 (* 2.0 x2))) t_0))
(+
x1
(+
t_1
(+
t_5
(*
t_0
(-
(* (- (- (* 2.0 x2) x1) 3.0) (* (* x1 2.0) (* 2.0 x2)))
t_6)))))))
(+
x1
(+ (- x1 (- (* 4.0 (* x1 (* x2 (- 3.0 (* 2.0 x2))))) t_1)) 9.0))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = t_2 + (2.0 * x2);
double t_4 = (t_3 - x1) / t_0;
double t_5 = t_2 * t_4;
double t_6 = (x1 * x1) * (6.0 + (4.0 * ((x1 - t_3) / t_0)));
double tmp;
if (x1 <= -11000000.0) {
tmp = x1 + ((3.0 * (3.0 + (-1.0 / x1))) + (x1 + (t_1 + (t_5 - (t_0 * ((((x1 * 2.0) * t_4) * (1.0 / x1)) + t_6))))));
} else if (x1 <= 1.6e+101) {
tmp = x1 - ((3.0 * ((x1 - (t_2 - (2.0 * x2))) / t_0)) - (x1 + (t_1 + (t_5 + (t_0 * (((((2.0 * x2) - x1) - 3.0) * ((x1 * 2.0) * (2.0 * x2))) - t_6))))));
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_1)) + 9.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * x1)
t_2 = x1 * (x1 * 3.0d0)
t_3 = t_2 + (2.0d0 * x2)
t_4 = (t_3 - x1) / t_0
t_5 = t_2 * t_4
t_6 = (x1 * x1) * (6.0d0 + (4.0d0 * ((x1 - t_3) / t_0)))
if (x1 <= (-11000000.0d0)) then
tmp = x1 + ((3.0d0 * (3.0d0 + ((-1.0d0) / x1))) + (x1 + (t_1 + (t_5 - (t_0 * ((((x1 * 2.0d0) * t_4) * (1.0d0 / x1)) + t_6))))))
else if (x1 <= 1.6d+101) then
tmp = x1 - ((3.0d0 * ((x1 - (t_2 - (2.0d0 * x2))) / t_0)) - (x1 + (t_1 + (t_5 + (t_0 * (((((2.0d0 * x2) - x1) - 3.0d0) * ((x1 * 2.0d0) * (2.0d0 * x2))) - t_6))))))
else
tmp = x1 + ((x1 - ((4.0d0 * (x1 * (x2 * (3.0d0 - (2.0d0 * x2))))) - t_1)) + 9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = t_2 + (2.0 * x2);
double t_4 = (t_3 - x1) / t_0;
double t_5 = t_2 * t_4;
double t_6 = (x1 * x1) * (6.0 + (4.0 * ((x1 - t_3) / t_0)));
double tmp;
if (x1 <= -11000000.0) {
tmp = x1 + ((3.0 * (3.0 + (-1.0 / x1))) + (x1 + (t_1 + (t_5 - (t_0 * ((((x1 * 2.0) * t_4) * (1.0 / x1)) + t_6))))));
} else if (x1 <= 1.6e+101) {
tmp = x1 - ((3.0 * ((x1 - (t_2 - (2.0 * x2))) / t_0)) - (x1 + (t_1 + (t_5 + (t_0 * (((((2.0 * x2) - x1) - 3.0) * ((x1 * 2.0) * (2.0 * x2))) - t_6))))));
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_1)) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * x1) t_2 = x1 * (x1 * 3.0) t_3 = t_2 + (2.0 * x2) t_4 = (t_3 - x1) / t_0 t_5 = t_2 * t_4 t_6 = (x1 * x1) * (6.0 + (4.0 * ((x1 - t_3) / t_0))) tmp = 0 if x1 <= -11000000.0: tmp = x1 + ((3.0 * (3.0 + (-1.0 / x1))) + (x1 + (t_1 + (t_5 - (t_0 * ((((x1 * 2.0) * t_4) * (1.0 / x1)) + t_6)))))) elif x1 <= 1.6e+101: tmp = x1 - ((3.0 * ((x1 - (t_2 - (2.0 * x2))) / t_0)) - (x1 + (t_1 + (t_5 + (t_0 * (((((2.0 * x2) - x1) - 3.0) * ((x1 * 2.0) * (2.0 * x2))) - t_6)))))) else: tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_1)) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(t_2 + Float64(2.0 * x2)) t_4 = Float64(Float64(t_3 - x1) / t_0) t_5 = Float64(t_2 * t_4) t_6 = Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(Float64(x1 - t_3) / t_0)))) tmp = 0.0 if (x1 <= -11000000.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(3.0 + Float64(-1.0 / x1))) + Float64(x1 + Float64(t_1 + Float64(t_5 - Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(1.0 / x1)) + t_6))))))); elseif (x1 <= 1.6e+101) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(x1 - Float64(t_2 - Float64(2.0 * x2))) / t_0)) - Float64(x1 + Float64(t_1 + Float64(t_5 + Float64(t_0 * Float64(Float64(Float64(Float64(Float64(2.0 * x2) - x1) - 3.0) * Float64(Float64(x1 * 2.0) * Float64(2.0 * x2))) - t_6))))))); else tmp = Float64(x1 + Float64(Float64(x1 - Float64(Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))) - t_1)) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * x1); t_2 = x1 * (x1 * 3.0); t_3 = t_2 + (2.0 * x2); t_4 = (t_3 - x1) / t_0; t_5 = t_2 * t_4; t_6 = (x1 * x1) * (6.0 + (4.0 * ((x1 - t_3) / t_0))); tmp = 0.0; if (x1 <= -11000000.0) tmp = x1 + ((3.0 * (3.0 + (-1.0 / x1))) + (x1 + (t_1 + (t_5 - (t_0 * ((((x1 * 2.0) * t_4) * (1.0 / x1)) + t_6)))))); elseif (x1 <= 1.6e+101) tmp = x1 - ((3.0 * ((x1 - (t_2 - (2.0 * x2))) / t_0)) - (x1 + (t_1 + (t_5 + (t_0 * (((((2.0 * x2) - x1) - 3.0) * ((x1 * 2.0) * (2.0 * x2))) - t_6)))))); else tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_1)) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(N[(x1 - t$95$3), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -11000000.0], N[(x1 + N[(N[(3.0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$1 + N[(t$95$5 - N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(1.0 / x1), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.6e+101], N[(x1 - N[(N[(3.0 * N[(N[(x1 - N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] - N[(x1 + N[(t$95$1 + N[(t$95$5 + N[(t$95$0 * N[(N[(N[(N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 - N[(N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := t_2 + 2 \cdot x2\\
t_4 := \frac{t_3 - x1}{t_0}\\
t_5 := t_2 \cdot t_4\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - t_3}{t_0}\right)\\
\mathbf{if}\;x1 \leq -11000000:\\
\;\;\;\;x1 + \left(3 \cdot \left(3 + \frac{-1}{x1}\right) + \left(x1 + \left(t_1 + \left(t_5 - t_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \frac{1}{x1} + t_6\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.6 \cdot 10^{+101}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{x1 - \left(t_2 - 2 \cdot x2\right)}{t_0} - \left(x1 + \left(t_1 + \left(t_5 + t_0 \cdot \left(\left(\left(2 \cdot x2 - x1\right) - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right) - t_6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - t_1\right)\right) + 9\right)\\
\end{array}
\end{array}
if x1 < -1.1e7Initial program 33.8%
Taylor expanded in x1 around inf 33.8%
Taylor expanded in x1 around inf 30.7%
if -1.1e7 < x1 < 1.60000000000000003e101Initial program 99.3%
Taylor expanded in x1 around 0 91.2%
+-commutative91.2%
mul-1-neg91.2%
unsub-neg91.2%
Simplified91.2%
Taylor expanded in x1 around 0 94.1%
if 1.60000000000000003e101 < x1 Initial program 33.3%
Taylor expanded in x1 around 0 26.2%
+-commutative26.2%
mul-1-neg26.2%
unsub-neg26.2%
Simplified26.2%
Taylor expanded in x1 around inf 26.2%
Taylor expanded in x1 around 0 100.0%
Final simplification81.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 4.0 (* x1 (* x2 (- 3.0 (* 2.0 x2))))))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x1 (* x1 x1)))
(t_3 (* x1 (* x1 3.0)))
(t_4 (+ t_3 (* 2.0 x2)))
(t_5
(+
x1
(+
9.0
(+
x1
(+
t_2
(+
(* t_3 (/ (- t_4 x1) t_1))
(*
t_1
(-
(* (- (- (* 2.0 x2) x1) 3.0) (* (* x1 2.0) (* 2.0 x2)))
(* (* x1 x1) (+ 6.0 (* 4.0 (/ (- x1 t_4) t_1))))))))))))
(t_6 (* 3.0 (/ (- x1 (- t_3 (* 2.0 x2))) t_1))))
(if (<= x1 -0.48)
t_5
(if (<= x1 -1e-245)
(- x1 (+ t_6 (- (- (+ (* t_3 (- x1 (* 2.0 x2))) (* t_1 t_0)) t_2) x1)))
(if (<= x1 1.75e-237)
(+ x1 (- (+ x1 (* 4.0 (* -3.0 (* x1 x2)))) t_6))
(if (<= x1 1.2e+31)
(- x1 (- t_6 (- x1 t_0)))
(if (<= x1 1.6e+101) t_5 (+ x1 (+ (- x1 (- t_0 t_2)) 9.0)))))))))
double code(double x1, double x2) {
double t_0 = 4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))));
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = t_3 + (2.0 * x2);
double t_5 = x1 + (9.0 + (x1 + (t_2 + ((t_3 * ((t_4 - x1) / t_1)) + (t_1 * (((((2.0 * x2) - x1) - 3.0) * ((x1 * 2.0) * (2.0 * x2))) - ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_4) / t_1))))))))));
double t_6 = 3.0 * ((x1 - (t_3 - (2.0 * x2))) / t_1);
double tmp;
if (x1 <= -0.48) {
tmp = t_5;
} else if (x1 <= -1e-245) {
tmp = x1 - (t_6 + ((((t_3 * (x1 - (2.0 * x2))) + (t_1 * t_0)) - t_2) - x1));
} else if (x1 <= 1.75e-237) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) - t_6);
} else if (x1 <= 1.2e+31) {
tmp = x1 - (t_6 - (x1 - t_0));
} else if (x1 <= 1.6e+101) {
tmp = t_5;
} else {
tmp = x1 + ((x1 - (t_0 - t_2)) + 9.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = 4.0d0 * (x1 * (x2 * (3.0d0 - (2.0d0 * x2))))
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 * (x1 * x1)
t_3 = x1 * (x1 * 3.0d0)
t_4 = t_3 + (2.0d0 * x2)
t_5 = x1 + (9.0d0 + (x1 + (t_2 + ((t_3 * ((t_4 - x1) / t_1)) + (t_1 * (((((2.0d0 * x2) - x1) - 3.0d0) * ((x1 * 2.0d0) * (2.0d0 * x2))) - ((x1 * x1) * (6.0d0 + (4.0d0 * ((x1 - t_4) / t_1))))))))))
t_6 = 3.0d0 * ((x1 - (t_3 - (2.0d0 * x2))) / t_1)
if (x1 <= (-0.48d0)) then
tmp = t_5
else if (x1 <= (-1d-245)) then
tmp = x1 - (t_6 + ((((t_3 * (x1 - (2.0d0 * x2))) + (t_1 * t_0)) - t_2) - x1))
else if (x1 <= 1.75d-237) then
tmp = x1 + ((x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))) - t_6)
else if (x1 <= 1.2d+31) then
tmp = x1 - (t_6 - (x1 - t_0))
else if (x1 <= 1.6d+101) then
tmp = t_5
else
tmp = x1 + ((x1 - (t_0 - t_2)) + 9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))));
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = t_3 + (2.0 * x2);
double t_5 = x1 + (9.0 + (x1 + (t_2 + ((t_3 * ((t_4 - x1) / t_1)) + (t_1 * (((((2.0 * x2) - x1) - 3.0) * ((x1 * 2.0) * (2.0 * x2))) - ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_4) / t_1))))))))));
double t_6 = 3.0 * ((x1 - (t_3 - (2.0 * x2))) / t_1);
double tmp;
if (x1 <= -0.48) {
tmp = t_5;
} else if (x1 <= -1e-245) {
tmp = x1 - (t_6 + ((((t_3 * (x1 - (2.0 * x2))) + (t_1 * t_0)) - t_2) - x1));
} else if (x1 <= 1.75e-237) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) - t_6);
} else if (x1 <= 1.2e+31) {
tmp = x1 - (t_6 - (x1 - t_0));
} else if (x1 <= 1.6e+101) {
tmp = t_5;
} else {
tmp = x1 + ((x1 - (t_0 - t_2)) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = 4.0 * (x1 * (x2 * (3.0 - (2.0 * x2)))) t_1 = (x1 * x1) + 1.0 t_2 = x1 * (x1 * x1) t_3 = x1 * (x1 * 3.0) t_4 = t_3 + (2.0 * x2) t_5 = x1 + (9.0 + (x1 + (t_2 + ((t_3 * ((t_4 - x1) / t_1)) + (t_1 * (((((2.0 * x2) - x1) - 3.0) * ((x1 * 2.0) * (2.0 * x2))) - ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_4) / t_1)))))))))) t_6 = 3.0 * ((x1 - (t_3 - (2.0 * x2))) / t_1) tmp = 0 if x1 <= -0.48: tmp = t_5 elif x1 <= -1e-245: tmp = x1 - (t_6 + ((((t_3 * (x1 - (2.0 * x2))) + (t_1 * t_0)) - t_2) - x1)) elif x1 <= 1.75e-237: tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) - t_6) elif x1 <= 1.2e+31: tmp = x1 - (t_6 - (x1 - t_0)) elif x1 <= 1.6e+101: tmp = t_5 else: tmp = x1 + ((x1 - (t_0 - t_2)) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(t_3 + Float64(2.0 * x2)) t_5 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_2 + Float64(Float64(t_3 * Float64(Float64(t_4 - x1) / t_1)) + Float64(t_1 * Float64(Float64(Float64(Float64(Float64(2.0 * x2) - x1) - 3.0) * Float64(Float64(x1 * 2.0) * Float64(2.0 * x2))) - Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(Float64(x1 - t_4) / t_1))))))))))) t_6 = Float64(3.0 * Float64(Float64(x1 - Float64(t_3 - Float64(2.0 * x2))) / t_1)) tmp = 0.0 if (x1 <= -0.48) tmp = t_5; elseif (x1 <= -1e-245) tmp = Float64(x1 - Float64(t_6 + Float64(Float64(Float64(Float64(t_3 * Float64(x1 - Float64(2.0 * x2))) + Float64(t_1 * t_0)) - t_2) - x1))); elseif (x1 <= 1.75e-237) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))) - t_6)); elseif (x1 <= 1.2e+31) tmp = Float64(x1 - Float64(t_6 - Float64(x1 - t_0))); elseif (x1 <= 1.6e+101) tmp = t_5; else tmp = Float64(x1 + Float64(Float64(x1 - Float64(t_0 - t_2)) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 4.0 * (x1 * (x2 * (3.0 - (2.0 * x2)))); t_1 = (x1 * x1) + 1.0; t_2 = x1 * (x1 * x1); t_3 = x1 * (x1 * 3.0); t_4 = t_3 + (2.0 * x2); t_5 = x1 + (9.0 + (x1 + (t_2 + ((t_3 * ((t_4 - x1) / t_1)) + (t_1 * (((((2.0 * x2) - x1) - 3.0) * ((x1 * 2.0) * (2.0 * x2))) - ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_4) / t_1)))))))))); t_6 = 3.0 * ((x1 - (t_3 - (2.0 * x2))) / t_1); tmp = 0.0; if (x1 <= -0.48) tmp = t_5; elseif (x1 <= -1e-245) tmp = x1 - (t_6 + ((((t_3 * (x1 - (2.0 * x2))) + (t_1 * t_0)) - t_2) - x1)); elseif (x1 <= 1.75e-237) tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) - t_6); elseif (x1 <= 1.2e+31) tmp = x1 - (t_6 - (x1 - t_0)); elseif (x1 <= 1.6e+101) tmp = t_5; else tmp = x1 + ((x1 - (t_0 - t_2)) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(9.0 + N[(x1 + N[(t$95$2 + N[(N[(t$95$3 * N[(N[(t$95$4 - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(N[(x1 - t$95$4), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(3.0 * N[(N[(x1 - N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -0.48], t$95$5, If[LessEqual[x1, -1e-245], N[(x1 - N[(t$95$6 + N[(N[(N[(N[(t$95$3 * N[(x1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$0), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.75e-237], N[(x1 + N[(N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$6), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.2e+31], N[(x1 - N[(t$95$6 - N[(x1 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.6e+101], t$95$5, N[(x1 + N[(N[(x1 - N[(t$95$0 - t$95$2), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := t_3 + 2 \cdot x2\\
t_5 := x1 + \left(9 + \left(x1 + \left(t_2 + \left(t_3 \cdot \frac{t_4 - x1}{t_1} + t_1 \cdot \left(\left(\left(2 \cdot x2 - x1\right) - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right) - \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - t_4}{t_1}\right)\right)\right)\right)\right)\right)\\
t_6 := 3 \cdot \frac{x1 - \left(t_3 - 2 \cdot x2\right)}{t_1}\\
\mathbf{if}\;x1 \leq -0.48:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x1 \leq -1 \cdot 10^{-245}:\\
\;\;\;\;x1 - \left(t_6 + \left(\left(\left(t_3 \cdot \left(x1 - 2 \cdot x2\right) + t_1 \cdot t_0\right) - t_2\right) - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 1.75 \cdot 10^{-237}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right) - t_6\right)\\
\mathbf{elif}\;x1 \leq 1.2 \cdot 10^{+31}:\\
\;\;\;\;x1 - \left(t_6 - \left(x1 - t_0\right)\right)\\
\mathbf{elif}\;x1 \leq 1.6 \cdot 10^{+101}:\\
\;\;\;\;t_5\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - \left(t_0 - t_2\right)\right) + 9\right)\\
\end{array}
\end{array}
if x1 < -0.47999999999999998 or 1.19999999999999991e31 < x1 < 1.60000000000000003e101Initial program 45.3%
Taylor expanded in x1 around 0 6.7%
+-commutative6.7%
mul-1-neg6.7%
unsub-neg6.7%
Simplified6.7%
Taylor expanded in x1 around inf 6.7%
Taylor expanded in x1 around 0 30.6%
if -0.47999999999999998 < x1 < -9.9999999999999993e-246Initial program 99.3%
Taylor expanded in x1 around 0 99.3%
+-commutative99.3%
mul-1-neg99.3%
unsub-neg99.3%
Simplified99.3%
Taylor expanded in x1 around 0 84.8%
Taylor expanded in x1 around 0 84.8%
+-commutative99.3%
mul-1-neg99.3%
unsub-neg99.3%
Simplified84.8%
if -9.9999999999999993e-246 < x1 < 1.74999999999999992e-237Initial program 99.6%
Taylor expanded in x1 around 0 71.9%
Taylor expanded in x2 around 0 94.7%
*-commutative94.7%
Simplified94.7%
if 1.74999999999999992e-237 < x1 < 1.19999999999999991e31Initial program 99.3%
Taylor expanded in x1 around 0 84.9%
if 1.60000000000000003e101 < x1 Initial program 33.3%
Taylor expanded in x1 around 0 26.2%
+-commutative26.2%
mul-1-neg26.2%
unsub-neg26.2%
Simplified26.2%
Taylor expanded in x1 around inf 26.2%
Taylor expanded in x1 around 0 100.0%
Final simplification74.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 x1)))
(t_2 (- (* 2.0 x2) x1))
(t_3 (* x1 (* x1 3.0)))
(t_4 (+ t_3 (* 2.0 x2)))
(t_5 (/ (- t_4 x1) t_0))
(t_6
(+
x1
(+
9.0
(+
x1
(+
t_1
(+
(* t_3 t_5)
(*
t_0
(-
(* (- t_2 3.0) (* (* x1 2.0) (* 2.0 x2)))
(* (* x1 x1) (+ 6.0 (* 4.0 (/ (- x1 t_4) t_0)))))))))))))
(if (<= x1 -1.55)
t_6
(if (<= x1 1.2e+31)
(-
x1
(+
(* 3.0 (/ (- x1 (- t_3 (* 2.0 x2))) t_0))
(-
(-
(+
(* t_3 (- x1 (* 2.0 x2)))
(*
t_0
(+
(* (* x1 x1) (- 6.0 (* 4.0 t_2)))
(* (* (* x1 2.0) t_5) (- 3.0 t_2)))))
t_1)
x1)))
(if (<= x1 1.6e+101)
t_6
(+
x1
(+ (- x1 (- (* 4.0 (* x1 (* x2 (- 3.0 (* 2.0 x2))))) t_1)) 9.0)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = (2.0 * x2) - x1;
double t_3 = x1 * (x1 * 3.0);
double t_4 = t_3 + (2.0 * x2);
double t_5 = (t_4 - x1) / t_0;
double t_6 = x1 + (9.0 + (x1 + (t_1 + ((t_3 * t_5) + (t_0 * (((t_2 - 3.0) * ((x1 * 2.0) * (2.0 * x2))) - ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_4) / t_0))))))))));
double tmp;
if (x1 <= -1.55) {
tmp = t_6;
} else if (x1 <= 1.2e+31) {
tmp = x1 - ((3.0 * ((x1 - (t_3 - (2.0 * x2))) / t_0)) + ((((t_3 * (x1 - (2.0 * x2))) + (t_0 * (((x1 * x1) * (6.0 - (4.0 * t_2))) + (((x1 * 2.0) * t_5) * (3.0 - t_2))))) - t_1) - x1));
} else if (x1 <= 1.6e+101) {
tmp = t_6;
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_1)) + 9.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * x1)
t_2 = (2.0d0 * x2) - x1
t_3 = x1 * (x1 * 3.0d0)
t_4 = t_3 + (2.0d0 * x2)
t_5 = (t_4 - x1) / t_0
t_6 = x1 + (9.0d0 + (x1 + (t_1 + ((t_3 * t_5) + (t_0 * (((t_2 - 3.0d0) * ((x1 * 2.0d0) * (2.0d0 * x2))) - ((x1 * x1) * (6.0d0 + (4.0d0 * ((x1 - t_4) / t_0))))))))))
if (x1 <= (-1.55d0)) then
tmp = t_6
else if (x1 <= 1.2d+31) then
tmp = x1 - ((3.0d0 * ((x1 - (t_3 - (2.0d0 * x2))) / t_0)) + ((((t_3 * (x1 - (2.0d0 * x2))) + (t_0 * (((x1 * x1) * (6.0d0 - (4.0d0 * t_2))) + (((x1 * 2.0d0) * t_5) * (3.0d0 - t_2))))) - t_1) - x1))
else if (x1 <= 1.6d+101) then
tmp = t_6
else
tmp = x1 + ((x1 - ((4.0d0 * (x1 * (x2 * (3.0d0 - (2.0d0 * x2))))) - t_1)) + 9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = (2.0 * x2) - x1;
double t_3 = x1 * (x1 * 3.0);
double t_4 = t_3 + (2.0 * x2);
double t_5 = (t_4 - x1) / t_0;
double t_6 = x1 + (9.0 + (x1 + (t_1 + ((t_3 * t_5) + (t_0 * (((t_2 - 3.0) * ((x1 * 2.0) * (2.0 * x2))) - ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_4) / t_0))))))))));
double tmp;
if (x1 <= -1.55) {
tmp = t_6;
} else if (x1 <= 1.2e+31) {
tmp = x1 - ((3.0 * ((x1 - (t_3 - (2.0 * x2))) / t_0)) + ((((t_3 * (x1 - (2.0 * x2))) + (t_0 * (((x1 * x1) * (6.0 - (4.0 * t_2))) + (((x1 * 2.0) * t_5) * (3.0 - t_2))))) - t_1) - x1));
} else if (x1 <= 1.6e+101) {
tmp = t_6;
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_1)) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * x1) t_2 = (2.0 * x2) - x1 t_3 = x1 * (x1 * 3.0) t_4 = t_3 + (2.0 * x2) t_5 = (t_4 - x1) / t_0 t_6 = x1 + (9.0 + (x1 + (t_1 + ((t_3 * t_5) + (t_0 * (((t_2 - 3.0) * ((x1 * 2.0) * (2.0 * x2))) - ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_4) / t_0)))))))))) tmp = 0 if x1 <= -1.55: tmp = t_6 elif x1 <= 1.2e+31: tmp = x1 - ((3.0 * ((x1 - (t_3 - (2.0 * x2))) / t_0)) + ((((t_3 * (x1 - (2.0 * x2))) + (t_0 * (((x1 * x1) * (6.0 - (4.0 * t_2))) + (((x1 * 2.0) * t_5) * (3.0 - t_2))))) - t_1) - x1)) elif x1 <= 1.6e+101: tmp = t_6 else: tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_1)) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(Float64(2.0 * x2) - x1) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(t_3 + Float64(2.0 * x2)) t_5 = Float64(Float64(t_4 - x1) / t_0) t_6 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_1 + Float64(Float64(t_3 * t_5) + Float64(t_0 * Float64(Float64(Float64(t_2 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(2.0 * x2))) - Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(Float64(x1 - t_4) / t_0))))))))))) tmp = 0.0 if (x1 <= -1.55) tmp = t_6; elseif (x1 <= 1.2e+31) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(x1 - Float64(t_3 - Float64(2.0 * x2))) / t_0)) + Float64(Float64(Float64(Float64(t_3 * Float64(x1 - Float64(2.0 * x2))) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 - Float64(4.0 * t_2))) + Float64(Float64(Float64(x1 * 2.0) * t_5) * Float64(3.0 - t_2))))) - t_1) - x1))); elseif (x1 <= 1.6e+101) tmp = t_6; else tmp = Float64(x1 + Float64(Float64(x1 - Float64(Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))) - t_1)) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * x1); t_2 = (2.0 * x2) - x1; t_3 = x1 * (x1 * 3.0); t_4 = t_3 + (2.0 * x2); t_5 = (t_4 - x1) / t_0; t_6 = x1 + (9.0 + (x1 + (t_1 + ((t_3 * t_5) + (t_0 * (((t_2 - 3.0) * ((x1 * 2.0) * (2.0 * x2))) - ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_4) / t_0)))))))))); tmp = 0.0; if (x1 <= -1.55) tmp = t_6; elseif (x1 <= 1.2e+31) tmp = x1 - ((3.0 * ((x1 - (t_3 - (2.0 * x2))) / t_0)) + ((((t_3 * (x1 - (2.0 * x2))) + (t_0 * (((x1 * x1) * (6.0 - (4.0 * t_2))) + (((x1 * 2.0) * t_5) * (3.0 - t_2))))) - t_1) - x1)); elseif (x1 <= 1.6e+101) tmp = t_6; else tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_1)) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$4 - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(9.0 + N[(x1 + N[(t$95$1 + N[(N[(t$95$3 * t$95$5), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(t$95$2 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(N[(x1 - t$95$4), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.55], t$95$6, If[LessEqual[x1, 1.2e+31], N[(x1 - N[(N[(3.0 * N[(N[(x1 - N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(t$95$3 * N[(x1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(4.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision] * N[(3.0 - t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.6e+101], t$95$6, N[(x1 + N[(N[(x1 - N[(N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := 2 \cdot x2 - x1\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := t_3 + 2 \cdot x2\\
t_5 := \frac{t_4 - x1}{t_0}\\
t_6 := x1 + \left(9 + \left(x1 + \left(t_1 + \left(t_3 \cdot t_5 + t_0 \cdot \left(\left(t_2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right) - \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - t_4}{t_0}\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -1.55:\\
\;\;\;\;t_6\\
\mathbf{elif}\;x1 \leq 1.2 \cdot 10^{+31}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{x1 - \left(t_3 - 2 \cdot x2\right)}{t_0} + \left(\left(\left(t_3 \cdot \left(x1 - 2 \cdot x2\right) + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 - 4 \cdot t_2\right) + \left(\left(x1 \cdot 2\right) \cdot t_5\right) \cdot \left(3 - t_2\right)\right)\right) - t_1\right) - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 1.6 \cdot 10^{+101}:\\
\;\;\;\;t_6\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - t_1\right)\right) + 9\right)\\
\end{array}
\end{array}
if x1 < -1.55000000000000004 or 1.19999999999999991e31 < x1 < 1.60000000000000003e101Initial program 45.3%
Taylor expanded in x1 around 0 6.7%
+-commutative6.7%
mul-1-neg6.7%
unsub-neg6.7%
Simplified6.7%
Taylor expanded in x1 around inf 6.7%
Taylor expanded in x1 around 0 30.6%
if -1.55000000000000004 < x1 < 1.19999999999999991e31Initial program 99.3%
Taylor expanded in x1 around 0 97.3%
+-commutative97.3%
mul-1-neg97.3%
unsub-neg97.3%
Simplified97.3%
Taylor expanded in x1 around 0 97.4%
+-commutative97.3%
mul-1-neg97.3%
unsub-neg97.3%
Simplified97.4%
Taylor expanded in x1 around 0 97.3%
+-commutative97.3%
mul-1-neg97.3%
unsub-neg97.3%
Simplified97.3%
if 1.60000000000000003e101 < x1 Initial program 33.3%
Taylor expanded in x1 around 0 26.2%
+-commutative26.2%
mul-1-neg26.2%
unsub-neg26.2%
Simplified26.2%
Taylor expanded in x1 around inf 26.2%
Taylor expanded in x1 around 0 100.0%
Final simplification80.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 x1)))
(t_2 (- (* 2.0 x2) x1))
(t_3 (* x1 (* x1 3.0)))
(t_4 (+ t_3 (* 2.0 x2)))
(t_5 (/ (- x1 t_4) t_0))
(t_6
(+
x1
(+
9.0
(+
x1
(+
t_1
(+
(* t_3 (/ (- t_4 x1) t_0))
(*
t_0
(-
(* (- t_2 3.0) (* (* x1 2.0) (* 2.0 x2)))
(* (* x1 x1) (+ 6.0 (* 4.0 t_5))))))))))))
(if (<= x1 -0.62)
t_6
(if (<= x1 1.2e+31)
(+
x1
(-
(* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_0))
(-
(-
(+
(* t_3 (- x1 (* 2.0 x2)))
(*
t_0
(-
(* (* x1 x1) (- 6.0 (* (* 2.0 x2) 4.0)))
(* (* (* x1 2.0) t_5) (- 3.0 t_2)))))
t_1)
x1)))
(if (<= x1 1.6e+101)
t_6
(+
x1
(+ (- x1 (- (* 4.0 (* x1 (* x2 (- 3.0 (* 2.0 x2))))) t_1)) 9.0)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = (2.0 * x2) - x1;
double t_3 = x1 * (x1 * 3.0);
double t_4 = t_3 + (2.0 * x2);
double t_5 = (x1 - t_4) / t_0;
double t_6 = x1 + (9.0 + (x1 + (t_1 + ((t_3 * ((t_4 - x1) / t_0)) + (t_0 * (((t_2 - 3.0) * ((x1 * 2.0) * (2.0 * x2))) - ((x1 * x1) * (6.0 + (4.0 * t_5)))))))));
double tmp;
if (x1 <= -0.62) {
tmp = t_6;
} else if (x1 <= 1.2e+31) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) - ((((t_3 * (x1 - (2.0 * x2))) + (t_0 * (((x1 * x1) * (6.0 - ((2.0 * x2) * 4.0))) - (((x1 * 2.0) * t_5) * (3.0 - t_2))))) - t_1) - x1));
} else if (x1 <= 1.6e+101) {
tmp = t_6;
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_1)) + 9.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * x1)
t_2 = (2.0d0 * x2) - x1
t_3 = x1 * (x1 * 3.0d0)
t_4 = t_3 + (2.0d0 * x2)
t_5 = (x1 - t_4) / t_0
t_6 = x1 + (9.0d0 + (x1 + (t_1 + ((t_3 * ((t_4 - x1) / t_0)) + (t_0 * (((t_2 - 3.0d0) * ((x1 * 2.0d0) * (2.0d0 * x2))) - ((x1 * x1) * (6.0d0 + (4.0d0 * t_5)))))))))
if (x1 <= (-0.62d0)) then
tmp = t_6
else if (x1 <= 1.2d+31) then
tmp = x1 + ((3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_0)) - ((((t_3 * (x1 - (2.0d0 * x2))) + (t_0 * (((x1 * x1) * (6.0d0 - ((2.0d0 * x2) * 4.0d0))) - (((x1 * 2.0d0) * t_5) * (3.0d0 - t_2))))) - t_1) - x1))
else if (x1 <= 1.6d+101) then
tmp = t_6
else
tmp = x1 + ((x1 - ((4.0d0 * (x1 * (x2 * (3.0d0 - (2.0d0 * x2))))) - t_1)) + 9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = (2.0 * x2) - x1;
double t_3 = x1 * (x1 * 3.0);
double t_4 = t_3 + (2.0 * x2);
double t_5 = (x1 - t_4) / t_0;
double t_6 = x1 + (9.0 + (x1 + (t_1 + ((t_3 * ((t_4 - x1) / t_0)) + (t_0 * (((t_2 - 3.0) * ((x1 * 2.0) * (2.0 * x2))) - ((x1 * x1) * (6.0 + (4.0 * t_5)))))))));
double tmp;
if (x1 <= -0.62) {
tmp = t_6;
} else if (x1 <= 1.2e+31) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) - ((((t_3 * (x1 - (2.0 * x2))) + (t_0 * (((x1 * x1) * (6.0 - ((2.0 * x2) * 4.0))) - (((x1 * 2.0) * t_5) * (3.0 - t_2))))) - t_1) - x1));
} else if (x1 <= 1.6e+101) {
tmp = t_6;
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_1)) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * x1) t_2 = (2.0 * x2) - x1 t_3 = x1 * (x1 * 3.0) t_4 = t_3 + (2.0 * x2) t_5 = (x1 - t_4) / t_0 t_6 = x1 + (9.0 + (x1 + (t_1 + ((t_3 * ((t_4 - x1) / t_0)) + (t_0 * (((t_2 - 3.0) * ((x1 * 2.0) * (2.0 * x2))) - ((x1 * x1) * (6.0 + (4.0 * t_5))))))))) tmp = 0 if x1 <= -0.62: tmp = t_6 elif x1 <= 1.2e+31: tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) - ((((t_3 * (x1 - (2.0 * x2))) + (t_0 * (((x1 * x1) * (6.0 - ((2.0 * x2) * 4.0))) - (((x1 * 2.0) * t_5) * (3.0 - t_2))))) - t_1) - x1)) elif x1 <= 1.6e+101: tmp = t_6 else: tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_1)) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(Float64(2.0 * x2) - x1) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(t_3 + Float64(2.0 * x2)) t_5 = Float64(Float64(x1 - t_4) / t_0) t_6 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_1 + Float64(Float64(t_3 * Float64(Float64(t_4 - x1) / t_0)) + Float64(t_0 * Float64(Float64(Float64(t_2 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(2.0 * x2))) - Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5)))))))))) tmp = 0.0 if (x1 <= -0.62) tmp = t_6; elseif (x1 <= 1.2e+31) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_0)) - Float64(Float64(Float64(Float64(t_3 * Float64(x1 - Float64(2.0 * x2))) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 - Float64(Float64(2.0 * x2) * 4.0))) - Float64(Float64(Float64(x1 * 2.0) * t_5) * Float64(3.0 - t_2))))) - t_1) - x1))); elseif (x1 <= 1.6e+101) tmp = t_6; else tmp = Float64(x1 + Float64(Float64(x1 - Float64(Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))) - t_1)) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * x1); t_2 = (2.0 * x2) - x1; t_3 = x1 * (x1 * 3.0); t_4 = t_3 + (2.0 * x2); t_5 = (x1 - t_4) / t_0; t_6 = x1 + (9.0 + (x1 + (t_1 + ((t_3 * ((t_4 - x1) / t_0)) + (t_0 * (((t_2 - 3.0) * ((x1 * 2.0) * (2.0 * x2))) - ((x1 * x1) * (6.0 + (4.0 * t_5))))))))); tmp = 0.0; if (x1 <= -0.62) tmp = t_6; elseif (x1 <= 1.2e+31) tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) - ((((t_3 * (x1 - (2.0 * x2))) + (t_0 * (((x1 * x1) * (6.0 - ((2.0 * x2) * 4.0))) - (((x1 * 2.0) * t_5) * (3.0 - t_2))))) - t_1) - x1)); elseif (x1 <= 1.6e+101) tmp = t_6; else tmp = x1 + ((x1 - ((4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))) - t_1)) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 - t$95$4), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(9.0 + N[(x1 + N[(t$95$1 + N[(N[(t$95$3 * N[(N[(t$95$4 - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(t$95$2 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -0.62], t$95$6, If[LessEqual[x1, 1.2e+31], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(t$95$3 * N[(x1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(N[(2.0 * x2), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision] * N[(3.0 - t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.6e+101], t$95$6, N[(x1 + N[(N[(x1 - N[(N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := 2 \cdot x2 - x1\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := t_3 + 2 \cdot x2\\
t_5 := \frac{x1 - t_4}{t_0}\\
t_6 := x1 + \left(9 + \left(x1 + \left(t_1 + \left(t_3 \cdot \frac{t_4 - x1}{t_0} + t_0 \cdot \left(\left(t_2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right) - \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_5\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -0.62:\\
\;\;\;\;t_6\\
\mathbf{elif}\;x1 \leq 1.2 \cdot 10^{+31}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_0} - \left(\left(\left(t_3 \cdot \left(x1 - 2 \cdot x2\right) + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 - \left(2 \cdot x2\right) \cdot 4\right) - \left(\left(x1 \cdot 2\right) \cdot t_5\right) \cdot \left(3 - t_2\right)\right)\right) - t_1\right) - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 1.6 \cdot 10^{+101}:\\
\;\;\;\;t_6\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - t_1\right)\right) + 9\right)\\
\end{array}
\end{array}
if x1 < -0.619999999999999996 or 1.19999999999999991e31 < x1 < 1.60000000000000003e101Initial program 45.3%
Taylor expanded in x1 around 0 6.7%
+-commutative6.7%
mul-1-neg6.7%
unsub-neg6.7%
Simplified6.7%
Taylor expanded in x1 around inf 6.7%
Taylor expanded in x1 around 0 30.6%
if -0.619999999999999996 < x1 < 1.19999999999999991e31Initial program 99.3%
Taylor expanded in x1 around 0 97.3%
+-commutative97.3%
mul-1-neg97.3%
unsub-neg97.3%
Simplified97.3%
Taylor expanded in x1 around 0 97.4%
+-commutative97.3%
mul-1-neg97.3%
unsub-neg97.3%
Simplified97.4%
Taylor expanded in x1 around 0 97.1%
if 1.60000000000000003e101 < x1 Initial program 33.3%
Taylor expanded in x1 around 0 26.2%
+-commutative26.2%
mul-1-neg26.2%
unsub-neg26.2%
Simplified26.2%
Taylor expanded in x1 around inf 26.2%
Taylor expanded in x1 around 0 100.0%
Final simplification79.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- 3.0 (* 2.0 x2))))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* 4.0 (* x1 t_0)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (* 3.0 (/ (- x1 (- t_1 (* 2.0 x2))) t_3)))
(t_5 (* x1 (* x1 x1))))
(if (<= x1 -1.6e-243)
(- x1 (- (* x1 (+ 2.0 (* 4.0 t_0))) (* x2 -6.0)))
(if (<= x1 1.3e-237)
(+ x1 (- (+ x1 (* 4.0 (* -3.0 (* x1 x2)))) t_4))
(if (<= x1 0.108)
(-
x1
(+ t_4 (- (- (+ (* t_1 (- x1 (* 2.0 x2))) (* t_3 t_2)) t_5) x1)))
(+ x1 (+ (- x1 (- t_2 t_5)) 9.0)))))))
double code(double x1, double x2) {
double t_0 = x2 * (3.0 - (2.0 * x2));
double t_1 = x1 * (x1 * 3.0);
double t_2 = 4.0 * (x1 * t_0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = 3.0 * ((x1 - (t_1 - (2.0 * x2))) / t_3);
double t_5 = x1 * (x1 * x1);
double tmp;
if (x1 <= -1.6e-243) {
tmp = x1 - ((x1 * (2.0 + (4.0 * t_0))) - (x2 * -6.0));
} else if (x1 <= 1.3e-237) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) - t_4);
} else if (x1 <= 0.108) {
tmp = x1 - (t_4 + ((((t_1 * (x1 - (2.0 * x2))) + (t_3 * t_2)) - t_5) - x1));
} else {
tmp = x1 + ((x1 - (t_2 - t_5)) + 9.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x2 * (3.0d0 - (2.0d0 * x2))
t_1 = x1 * (x1 * 3.0d0)
t_2 = 4.0d0 * (x1 * t_0)
t_3 = (x1 * x1) + 1.0d0
t_4 = 3.0d0 * ((x1 - (t_1 - (2.0d0 * x2))) / t_3)
t_5 = x1 * (x1 * x1)
if (x1 <= (-1.6d-243)) then
tmp = x1 - ((x1 * (2.0d0 + (4.0d0 * t_0))) - (x2 * (-6.0d0)))
else if (x1 <= 1.3d-237) then
tmp = x1 + ((x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))) - t_4)
else if (x1 <= 0.108d0) then
tmp = x1 - (t_4 + ((((t_1 * (x1 - (2.0d0 * x2))) + (t_3 * t_2)) - t_5) - x1))
else
tmp = x1 + ((x1 - (t_2 - t_5)) + 9.0d0)
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 * 3.0);
double t_2 = 4.0 * (x1 * t_0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = 3.0 * ((x1 - (t_1 - (2.0 * x2))) / t_3);
double t_5 = x1 * (x1 * x1);
double tmp;
if (x1 <= -1.6e-243) {
tmp = x1 - ((x1 * (2.0 + (4.0 * t_0))) - (x2 * -6.0));
} else if (x1 <= 1.3e-237) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) - t_4);
} else if (x1 <= 0.108) {
tmp = x1 - (t_4 + ((((t_1 * (x1 - (2.0 * x2))) + (t_3 * t_2)) - t_5) - x1));
} else {
tmp = x1 + ((x1 - (t_2 - t_5)) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = x2 * (3.0 - (2.0 * x2)) t_1 = x1 * (x1 * 3.0) t_2 = 4.0 * (x1 * t_0) t_3 = (x1 * x1) + 1.0 t_4 = 3.0 * ((x1 - (t_1 - (2.0 * x2))) / t_3) t_5 = x1 * (x1 * x1) tmp = 0 if x1 <= -1.6e-243: tmp = x1 - ((x1 * (2.0 + (4.0 * t_0))) - (x2 * -6.0)) elif x1 <= 1.3e-237: tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) - t_4) elif x1 <= 0.108: tmp = x1 - (t_4 + ((((t_1 * (x1 - (2.0 * x2))) + (t_3 * t_2)) - t_5) - x1)) else: tmp = x1 + ((x1 - (t_2 - t_5)) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2))) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(4.0 * Float64(x1 * t_0)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(3.0 * Float64(Float64(x1 - Float64(t_1 - Float64(2.0 * x2))) / t_3)) t_5 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -1.6e-243) tmp = Float64(x1 - Float64(Float64(x1 * Float64(2.0 + Float64(4.0 * t_0))) - Float64(x2 * -6.0))); elseif (x1 <= 1.3e-237) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))) - t_4)); elseif (x1 <= 0.108) tmp = Float64(x1 - Float64(t_4 + Float64(Float64(Float64(Float64(t_1 * Float64(x1 - Float64(2.0 * x2))) + Float64(t_3 * t_2)) - t_5) - x1))); else tmp = Float64(x1 + Float64(Float64(x1 - Float64(t_2 - t_5)) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * (3.0 - (2.0 * x2)); t_1 = x1 * (x1 * 3.0); t_2 = 4.0 * (x1 * t_0); t_3 = (x1 * x1) + 1.0; t_4 = 3.0 * ((x1 - (t_1 - (2.0 * x2))) / t_3); t_5 = x1 * (x1 * x1); tmp = 0.0; if (x1 <= -1.6e-243) tmp = x1 - ((x1 * (2.0 + (4.0 * t_0))) - (x2 * -6.0)); elseif (x1 <= 1.3e-237) tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) - t_4); elseif (x1 <= 0.108) tmp = x1 - (t_4 + ((((t_1 * (x1 - (2.0 * x2))) + (t_3 * t_2)) - t_5) - x1)); else tmp = x1 + ((x1 - (t_2 - t_5)) + 9.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[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(x1 - N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.6e-243], N[(x1 - N[(N[(x1 * N[(2.0 + N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.3e-237], N[(x1 + N[(N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.108], N[(x1 - N[(t$95$4 + N[(N[(N[(N[(t$95$1 * N[(x1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * t$95$2), $MachinePrecision]), $MachinePrecision] - t$95$5), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 - N[(t$95$2 - t$95$5), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := 4 \cdot \left(x1 \cdot t_0\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := 3 \cdot \frac{x1 - \left(t_1 - 2 \cdot x2\right)}{t_3}\\
t_5 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{-243}:\\
\;\;\;\;x1 - \left(x1 \cdot \left(2 + 4 \cdot t_0\right) - x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 1.3 \cdot 10^{-237}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right) - t_4\right)\\
\mathbf{elif}\;x1 \leq 0.108:\\
\;\;\;\;x1 - \left(t_4 + \left(\left(\left(t_1 \cdot \left(x1 - 2 \cdot x2\right) + t_3 \cdot t_2\right) - t_5\right) - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - \left(t_2 - t_5\right)\right) + 9\right)\\
\end{array}
\end{array}
if x1 < -1.5999999999999999e-243Initial program 66.5%
Taylor expanded in x1 around 0 42.2%
Taylor expanded in x1 around 0 43.6%
if -1.5999999999999999e-243 < x1 < 1.3000000000000001e-237Initial program 99.6%
Taylor expanded in x1 around 0 71.9%
Taylor expanded in x2 around 0 94.7%
*-commutative94.7%
Simplified94.7%
if 1.3000000000000001e-237 < x1 < 0.107999999999999999Initial program 99.2%
Taylor expanded in x1 around 0 98.5%
+-commutative98.5%
mul-1-neg98.5%
unsub-neg98.5%
Simplified98.5%
Taylor expanded in x1 around 0 87.6%
Taylor expanded in x1 around 0 87.6%
+-commutative98.5%
mul-1-neg98.5%
unsub-neg98.5%
Simplified87.6%
if 0.107999999999999999 < x1 Initial program 51.6%
Taylor expanded in x1 around 0 27.9%
+-commutative27.9%
mul-1-neg27.9%
unsub-neg27.9%
Simplified27.9%
Taylor expanded in x1 around inf 27.9%
Taylor expanded in x1 around 0 81.3%
Final simplification67.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(* 3.0 (/ (- x1 (- (* x1 (* x1 3.0)) (* 2.0 x2))) (+ (* x1 x1) 1.0))))
(t_1 (* x2 (- 3.0 (* 2.0 x2))))
(t_2 (* 4.0 (* x1 t_1))))
(if (<= x1 -1.6e-243)
(- x1 (- (* x1 (+ 2.0 (* 4.0 t_1))) (* x2 -6.0)))
(if (<= x1 1.5e-237)
(+ x1 (- (+ x1 (* 4.0 (* -3.0 (* x1 x2)))) t_0))
(if (<= x1 1.65)
(- x1 (- t_0 (- x1 t_2)))
(+ x1 (+ (- x1 (- t_2 (* x1 (* x1 x1)))) 9.0)))))))
double code(double x1, double x2) {
double t_0 = 3.0 * ((x1 - ((x1 * (x1 * 3.0)) - (2.0 * x2))) / ((x1 * x1) + 1.0));
double t_1 = x2 * (3.0 - (2.0 * x2));
double t_2 = 4.0 * (x1 * t_1);
double tmp;
if (x1 <= -1.6e-243) {
tmp = x1 - ((x1 * (2.0 + (4.0 * t_1))) - (x2 * -6.0));
} else if (x1 <= 1.5e-237) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) - t_0);
} else if (x1 <= 1.65) {
tmp = x1 - (t_0 - (x1 - t_2));
} else {
tmp = x1 + ((x1 - (t_2 - (x1 * (x1 * x1)))) + 9.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = 3.0d0 * ((x1 - ((x1 * (x1 * 3.0d0)) - (2.0d0 * x2))) / ((x1 * x1) + 1.0d0))
t_1 = x2 * (3.0d0 - (2.0d0 * x2))
t_2 = 4.0d0 * (x1 * t_1)
if (x1 <= (-1.6d-243)) then
tmp = x1 - ((x1 * (2.0d0 + (4.0d0 * t_1))) - (x2 * (-6.0d0)))
else if (x1 <= 1.5d-237) then
tmp = x1 + ((x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))) - t_0)
else if (x1 <= 1.65d0) then
tmp = x1 - (t_0 - (x1 - t_2))
else
tmp = x1 + ((x1 - (t_2 - (x1 * (x1 * x1)))) + 9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 3.0 * ((x1 - ((x1 * (x1 * 3.0)) - (2.0 * x2))) / ((x1 * x1) + 1.0));
double t_1 = x2 * (3.0 - (2.0 * x2));
double t_2 = 4.0 * (x1 * t_1);
double tmp;
if (x1 <= -1.6e-243) {
tmp = x1 - ((x1 * (2.0 + (4.0 * t_1))) - (x2 * -6.0));
} else if (x1 <= 1.5e-237) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) - t_0);
} else if (x1 <= 1.65) {
tmp = x1 - (t_0 - (x1 - t_2));
} else {
tmp = x1 + ((x1 - (t_2 - (x1 * (x1 * x1)))) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 * ((x1 - ((x1 * (x1 * 3.0)) - (2.0 * x2))) / ((x1 * x1) + 1.0)) t_1 = x2 * (3.0 - (2.0 * x2)) t_2 = 4.0 * (x1 * t_1) tmp = 0 if x1 <= -1.6e-243: tmp = x1 - ((x1 * (2.0 + (4.0 * t_1))) - (x2 * -6.0)) elif x1 <= 1.5e-237: tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) - t_0) elif x1 <= 1.65: tmp = x1 - (t_0 - (x1 - t_2)) else: tmp = x1 + ((x1 - (t_2 - (x1 * (x1 * x1)))) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(3.0 * Float64(Float64(x1 - Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2))) / Float64(Float64(x1 * x1) + 1.0))) t_1 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2))) t_2 = Float64(4.0 * Float64(x1 * t_1)) tmp = 0.0 if (x1 <= -1.6e-243) tmp = Float64(x1 - Float64(Float64(x1 * Float64(2.0 + Float64(4.0 * t_1))) - Float64(x2 * -6.0))); elseif (x1 <= 1.5e-237) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))) - t_0)); elseif (x1 <= 1.65) tmp = Float64(x1 - Float64(t_0 - Float64(x1 - t_2))); else tmp = Float64(x1 + Float64(Float64(x1 - Float64(t_2 - Float64(x1 * Float64(x1 * x1)))) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 * ((x1 - ((x1 * (x1 * 3.0)) - (2.0 * x2))) / ((x1 * x1) + 1.0)); t_1 = x2 * (3.0 - (2.0 * x2)); t_2 = 4.0 * (x1 * t_1); tmp = 0.0; if (x1 <= -1.6e-243) tmp = x1 - ((x1 * (2.0 + (4.0 * t_1))) - (x2 * -6.0)); elseif (x1 <= 1.5e-237) tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) - t_0); elseif (x1 <= 1.65) tmp = x1 - (t_0 - (x1 - t_2)); else tmp = x1 + ((x1 - (t_2 - (x1 * (x1 * x1)))) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(N[(x1 - N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.6e-243], N[(x1 - N[(N[(x1 * N[(2.0 + N[(4.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.5e-237], N[(x1 + N[(N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.65], N[(x1 - N[(t$95$0 - N[(x1 - t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 - N[(t$95$2 - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{x1 \cdot x1 + 1}\\
t_1 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
t_2 := 4 \cdot \left(x1 \cdot t_1\right)\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{-243}:\\
\;\;\;\;x1 - \left(x1 \cdot \left(2 + 4 \cdot t_1\right) - x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 1.5 \cdot 10^{-237}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right) - t_0\right)\\
\mathbf{elif}\;x1 \leq 1.65:\\
\;\;\;\;x1 - \left(t_0 - \left(x1 - t_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - \left(t_2 - x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 9\right)\\
\end{array}
\end{array}
if x1 < -1.5999999999999999e-243Initial program 66.5%
Taylor expanded in x1 around 0 42.2%
Taylor expanded in x1 around 0 43.6%
if -1.5999999999999999e-243 < x1 < 1.50000000000000012e-237Initial program 99.6%
Taylor expanded in x1 around 0 71.9%
Taylor expanded in x2 around 0 94.7%
*-commutative94.7%
Simplified94.7%
if 1.50000000000000012e-237 < x1 < 1.6499999999999999Initial program 99.2%
Taylor expanded in x1 around 0 86.5%
if 1.6499999999999999 < x1 Initial program 50.7%
Taylor expanded in x1 around 0 27.9%
+-commutative27.9%
mul-1-neg27.9%
unsub-neg27.9%
Simplified27.9%
Taylor expanded in x1 around inf 27.9%
Taylor expanded in x1 around 0 82.3%
Final simplification67.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- 3.0 (* 2.0 x2))))
(t_1 (- x1 (- (* x1 (+ 2.0 (* 4.0 t_0))) (* x2 -6.0)))))
(if (<= x1 -1.7e-243)
t_1
(if (<= x1 1.5e-237)
(+
x1
(-
(+ x1 (* 4.0 (* -3.0 (* x1 x2))))
(*
3.0
(/ (- x1 (- (* x1 (* x1 3.0)) (* 2.0 x2))) (+ (* x1 x1) 1.0)))))
(if (<= x1 1.4)
t_1
(+ x1 (+ (- x1 (- (* 4.0 (* x1 t_0)) (* x1 (* x1 x1)))) 9.0)))))))
double code(double x1, double x2) {
double t_0 = x2 * (3.0 - (2.0 * x2));
double t_1 = x1 - ((x1 * (2.0 + (4.0 * t_0))) - (x2 * -6.0));
double tmp;
if (x1 <= -1.7e-243) {
tmp = t_1;
} else if (x1 <= 1.5e-237) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) - (3.0 * ((x1 - ((x1 * (x1 * 3.0)) - (2.0 * x2))) / ((x1 * x1) + 1.0))));
} else if (x1 <= 1.4) {
tmp = t_1;
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * t_0)) - (x1 * (x1 * x1)))) + 9.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x2 * (3.0d0 - (2.0d0 * x2))
t_1 = x1 - ((x1 * (2.0d0 + (4.0d0 * t_0))) - (x2 * (-6.0d0)))
if (x1 <= (-1.7d-243)) then
tmp = t_1
else if (x1 <= 1.5d-237) then
tmp = x1 + ((x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))) - (3.0d0 * ((x1 - ((x1 * (x1 * 3.0d0)) - (2.0d0 * x2))) / ((x1 * x1) + 1.0d0))))
else if (x1 <= 1.4d0) then
tmp = t_1
else
tmp = x1 + ((x1 - ((4.0d0 * (x1 * t_0)) - (x1 * (x1 * x1)))) + 9.0d0)
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 * (2.0 + (4.0 * t_0))) - (x2 * -6.0));
double tmp;
if (x1 <= -1.7e-243) {
tmp = t_1;
} else if (x1 <= 1.5e-237) {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) - (3.0 * ((x1 - ((x1 * (x1 * 3.0)) - (2.0 * x2))) / ((x1 * x1) + 1.0))));
} else if (x1 <= 1.4) {
tmp = t_1;
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * t_0)) - (x1 * (x1 * x1)))) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = x2 * (3.0 - (2.0 * x2)) t_1 = x1 - ((x1 * (2.0 + (4.0 * t_0))) - (x2 * -6.0)) tmp = 0 if x1 <= -1.7e-243: tmp = t_1 elif x1 <= 1.5e-237: tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) - (3.0 * ((x1 - ((x1 * (x1 * 3.0)) - (2.0 * x2))) / ((x1 * x1) + 1.0)))) elif x1 <= 1.4: tmp = t_1 else: tmp = x1 + ((x1 - ((4.0 * (x1 * t_0)) - (x1 * (x1 * x1)))) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2))) t_1 = Float64(x1 - Float64(Float64(x1 * Float64(2.0 + Float64(4.0 * t_0))) - Float64(x2 * -6.0))) tmp = 0.0 if (x1 <= -1.7e-243) tmp = t_1; elseif (x1 <= 1.5e-237) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))) - Float64(3.0 * Float64(Float64(x1 - Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2))) / Float64(Float64(x1 * x1) + 1.0))))); elseif (x1 <= 1.4) tmp = t_1; else tmp = Float64(x1 + Float64(Float64(x1 - Float64(Float64(4.0 * Float64(x1 * t_0)) - Float64(x1 * Float64(x1 * x1)))) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * (3.0 - (2.0 * x2)); t_1 = x1 - ((x1 * (2.0 + (4.0 * t_0))) - (x2 * -6.0)); tmp = 0.0; if (x1 <= -1.7e-243) tmp = t_1; elseif (x1 <= 1.5e-237) tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) - (3.0 * ((x1 - ((x1 * (x1 * 3.0)) - (2.0 * x2))) / ((x1 * x1) + 1.0)))); elseif (x1 <= 1.4) tmp = t_1; else tmp = x1 + ((x1 - ((4.0 * (x1 * t_0)) - (x1 * (x1 * x1)))) + 9.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[(x1 - N[(N[(x1 * N[(2.0 + N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.7e-243], t$95$1, If[LessEqual[x1, 1.5e-237], N[(x1 + N[(N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * N[(N[(x1 - N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.4], t$95$1, N[(x1 + N[(N[(x1 - N[(N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
t_1 := x1 - \left(x1 \cdot \left(2 + 4 \cdot t_0\right) - x2 \cdot -6\right)\\
\mathbf{if}\;x1 \leq -1.7 \cdot 10^{-243}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 1.5 \cdot 10^{-237}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right) - 3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right)\\
\mathbf{elif}\;x1 \leq 1.4:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - \left(4 \cdot \left(x1 \cdot t_0\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 9\right)\\
\end{array}
\end{array}
if x1 < -1.69999999999999998e-243 or 1.50000000000000012e-237 < x1 < 1.3999999999999999Initial program 77.3%
Taylor expanded in x1 around 0 56.8%
Taylor expanded in x1 around 0 57.7%
if -1.69999999999999998e-243 < x1 < 1.50000000000000012e-237Initial program 99.6%
Taylor expanded in x1 around 0 71.9%
Taylor expanded in x2 around 0 94.7%
*-commutative94.7%
Simplified94.7%
if 1.3999999999999999 < x1 Initial program 50.7%
Taylor expanded in x1 around 0 27.9%
+-commutative27.9%
mul-1-neg27.9%
unsub-neg27.9%
Simplified27.9%
Taylor expanded in x1 around inf 27.9%
Taylor expanded in x1 around 0 82.3%
Final simplification67.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- 3.0 (* 2.0 x2))))
(t_1 (- x1 (- (* x1 (+ 2.0 (* 4.0 t_0))) (* x2 -6.0)))))
(if (<= x1 -3.1e-245)
t_1
(if (<= x1 2.7e-238)
(* x2 -6.0)
(if (<= x1 1.4)
t_1
(+ x1 (+ (- x1 (- (* 4.0 (* x1 t_0)) (* x1 (* x1 x1)))) 9.0)))))))
double code(double x1, double x2) {
double t_0 = x2 * (3.0 - (2.0 * x2));
double t_1 = x1 - ((x1 * (2.0 + (4.0 * t_0))) - (x2 * -6.0));
double tmp;
if (x1 <= -3.1e-245) {
tmp = t_1;
} else if (x1 <= 2.7e-238) {
tmp = x2 * -6.0;
} else if (x1 <= 1.4) {
tmp = t_1;
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * t_0)) - (x1 * (x1 * x1)))) + 9.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x2 * (3.0d0 - (2.0d0 * x2))
t_1 = x1 - ((x1 * (2.0d0 + (4.0d0 * t_0))) - (x2 * (-6.0d0)))
if (x1 <= (-3.1d-245)) then
tmp = t_1
else if (x1 <= 2.7d-238) then
tmp = x2 * (-6.0d0)
else if (x1 <= 1.4d0) then
tmp = t_1
else
tmp = x1 + ((x1 - ((4.0d0 * (x1 * t_0)) - (x1 * (x1 * x1)))) + 9.0d0)
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 * (2.0 + (4.0 * t_0))) - (x2 * -6.0));
double tmp;
if (x1 <= -3.1e-245) {
tmp = t_1;
} else if (x1 <= 2.7e-238) {
tmp = x2 * -6.0;
} else if (x1 <= 1.4) {
tmp = t_1;
} else {
tmp = x1 + ((x1 - ((4.0 * (x1 * t_0)) - (x1 * (x1 * x1)))) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = x2 * (3.0 - (2.0 * x2)) t_1 = x1 - ((x1 * (2.0 + (4.0 * t_0))) - (x2 * -6.0)) tmp = 0 if x1 <= -3.1e-245: tmp = t_1 elif x1 <= 2.7e-238: tmp = x2 * -6.0 elif x1 <= 1.4: tmp = t_1 else: tmp = x1 + ((x1 - ((4.0 * (x1 * t_0)) - (x1 * (x1 * x1)))) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2))) t_1 = Float64(x1 - Float64(Float64(x1 * Float64(2.0 + Float64(4.0 * t_0))) - Float64(x2 * -6.0))) tmp = 0.0 if (x1 <= -3.1e-245) tmp = t_1; elseif (x1 <= 2.7e-238) tmp = Float64(x2 * -6.0); elseif (x1 <= 1.4) tmp = t_1; else tmp = Float64(x1 + Float64(Float64(x1 - Float64(Float64(4.0 * Float64(x1 * t_0)) - Float64(x1 * Float64(x1 * x1)))) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * (3.0 - (2.0 * x2)); t_1 = x1 - ((x1 * (2.0 + (4.0 * t_0))) - (x2 * -6.0)); tmp = 0.0; if (x1 <= -3.1e-245) tmp = t_1; elseif (x1 <= 2.7e-238) tmp = x2 * -6.0; elseif (x1 <= 1.4) tmp = t_1; else tmp = x1 + ((x1 - ((4.0 * (x1 * t_0)) - (x1 * (x1 * x1)))) + 9.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[(x1 - N[(N[(x1 * N[(2.0 + N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.1e-245], t$95$1, If[LessEqual[x1, 2.7e-238], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x1, 1.4], t$95$1, N[(x1 + N[(N[(x1 - N[(N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
t_1 := x1 - \left(x1 \cdot \left(2 + 4 \cdot t_0\right) - x2 \cdot -6\right)\\
\mathbf{if}\;x1 \leq -3.1 \cdot 10^{-245}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 2.7 \cdot 10^{-238}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 1.4:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - \left(4 \cdot \left(x1 \cdot t_0\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 9\right)\\
\end{array}
\end{array}
if x1 < -3.10000000000000003e-245 or 2.69999999999999991e-238 < x1 < 1.3999999999999999Initial program 77.3%
Taylor expanded in x1 around 0 56.8%
Taylor expanded in x1 around 0 57.7%
if -3.10000000000000003e-245 < x1 < 2.69999999999999991e-238Initial program 99.6%
Taylor expanded in x1 around 0 71.9%
Taylor expanded in x1 around 0 91.9%
*-commutative91.9%
Simplified91.9%
Taylor expanded in x1 around 0 92.0%
*-commutative92.0%
Simplified92.0%
if 1.3999999999999999 < x1 Initial program 50.7%
Taylor expanded in x1 around 0 27.9%
+-commutative27.9%
mul-1-neg27.9%
unsub-neg27.9%
Simplified27.9%
Taylor expanded in x1 around inf 27.9%
Taylor expanded in x1 around 0 82.3%
Final simplification67.4%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -3.05e-117) (not (<= x1 2.95e-64))) (+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -3.05e-117) || !(x1 <= 2.95e-64)) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-3.05d-117)) .or. (.not. (x1 <= 2.95d-64))) then
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -3.05e-117) || !(x1 <= 2.95e-64)) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -3.05e-117) or not (x1 <= 2.95e-64): tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -3.05e-117) || !(x1 <= 2.95e-64)) tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -3.05e-117) || ~((x1 <= 2.95e-64))) tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -3.05e-117], N[Not[LessEqual[x1, 2.95e-64]], $MachinePrecision]], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.05 \cdot 10^{-117} \lor \neg \left(x1 \leq 2.95 \cdot 10^{-64}\right):\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -3.05000000000000001e-117 or 2.94999999999999997e-64 < x1 Initial program 58.0%
Taylor expanded in x1 around 0 31.3%
Taylor expanded in x1 around inf 28.2%
if -3.05000000000000001e-117 < x1 < 2.94999999999999997e-64Initial program 99.4%
Taylor expanded in x1 around 0 80.2%
Taylor expanded in x1 around 0 61.6%
*-commutative61.6%
Simplified61.6%
Taylor expanded in x1 around 0 61.9%
*-commutative61.9%
Simplified61.9%
Final simplification41.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))
(if (<= x1 -3.05e-117)
(+ x1 (+ 9.0 t_0))
(if (<= x1 1.8e-64) (* x2 -6.0) (+ x1 t_0)))))
double code(double x1, double x2) {
double t_0 = x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
double tmp;
if (x1 <= -3.05e-117) {
tmp = x1 + (9.0 + t_0);
} else if (x1 <= 1.8e-64) {
tmp = x2 * -6.0;
} else {
tmp = x1 + 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) :: tmp
t_0 = x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
if (x1 <= (-3.05d-117)) then
tmp = x1 + (9.0d0 + t_0)
else if (x1 <= 1.8d-64) then
tmp = x2 * (-6.0d0)
else
tmp = x1 + t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
double tmp;
if (x1 <= -3.05e-117) {
tmp = x1 + (9.0 + t_0);
} else if (x1 <= 1.8e-64) {
tmp = x2 * -6.0;
} else {
tmp = x1 + t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) tmp = 0 if x1 <= -3.05e-117: tmp = x1 + (9.0 + t_0) elif x1 <= 1.8e-64: tmp = x2 * -6.0 else: tmp = x1 + t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) tmp = 0.0 if (x1 <= -3.05e-117) tmp = Float64(x1 + Float64(9.0 + t_0)); elseif (x1 <= 1.8e-64) tmp = Float64(x2 * -6.0); else tmp = Float64(x1 + t_0); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); tmp = 0.0; if (x1 <= -3.05e-117) tmp = x1 + (9.0 + t_0); elseif (x1 <= 1.8e-64) tmp = x2 * -6.0; else tmp = x1 + t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.05e-117], N[(x1 + N[(9.0 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.8e-64], N[(x2 * -6.0), $MachinePrecision], N[(x1 + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{if}\;x1 \leq -3.05 \cdot 10^{-117}:\\
\;\;\;\;x1 + \left(9 + t_0\right)\\
\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{-64}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x1 + t_0\\
\end{array}
\end{array}
if x1 < -3.05000000000000001e-117Initial program 57.1%
Taylor expanded in x1 around 0 31.2%
Taylor expanded in x1 around inf 15.9%
if -3.05000000000000001e-117 < x1 < 1.7999999999999999e-64Initial program 99.4%
Taylor expanded in x1 around 0 80.2%
Taylor expanded in x1 around 0 61.6%
*-commutative61.6%
Simplified61.6%
Taylor expanded in x1 around 0 61.9%
*-commutative61.9%
Simplified61.9%
if 1.7999999999999999e-64 < x1 Initial program 59.1%
Taylor expanded in x1 around 0 31.3%
Taylor expanded in x1 around inf 45.0%
Final simplification41.7%
(FPCore (x1 x2) :precision binary64 (- x1 (- (* x1 (+ 2.0 (* 4.0 (* x2 (- 3.0 (* 2.0 x2)))))) (* x2 -6.0))))
double code(double x1, double x2) {
return x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 - ((x1 * (2.0d0 + (4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2)))))) - (x2 * (-6.0d0)))
end function
public static double code(double x1, double x2) {
return x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0));
}
def code(x1, x2): return x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0))
function code(x1, x2) return Float64(x1 - Float64(Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))))) - Float64(x2 * -6.0))) end
function tmp = code(x1, x2) tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0)); end
code[x1_, x2_] := N[(x1 - N[(N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 - \left(x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x2 \cdot -6\right)
\end{array}
Initial program 74.2%
Taylor expanded in x1 around 0 50.4%
Taylor expanded in x1 around 0 55.8%
Final simplification55.8%
(FPCore (x1 x2) :precision binary64 (+ x1 (* x2 -6.0)))
double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + (x2 * (-6.0d0))
end function
public static double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
def code(x1, x2): return x1 + (x2 * -6.0)
function code(x1, x2) return Float64(x1 + Float64(x2 * -6.0)) end
function tmp = code(x1, x2) tmp = x1 + (x2 * -6.0); end
code[x1_, x2_] := N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + x2 \cdot -6
\end{array}
Initial program 74.2%
Taylor expanded in x1 around 0 50.4%
Taylor expanded in x1 around 0 27.7%
*-commutative27.7%
Simplified27.7%
Final simplification27.7%
(FPCore (x1 x2) :precision binary64 (* x2 -6.0))
double code(double x1, double x2) {
return x2 * -6.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * (-6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * -6.0;
}
def code(x1, x2): return x2 * -6.0
function code(x1, x2) return Float64(x2 * -6.0) end
function tmp = code(x1, x2) tmp = x2 * -6.0; end
code[x1_, x2_] := N[(x2 * -6.0), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6
\end{array}
Initial program 74.2%
Taylor expanded in x1 around 0 50.4%
Taylor expanded in x1 around 0 27.7%
*-commutative27.7%
Simplified27.7%
Taylor expanded in x1 around 0 27.4%
*-commutative27.4%
Simplified27.4%
Final simplification27.4%
(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.4%
Taylor expanded in x1 around 0 27.7%
*-commutative27.7%
Simplified27.7%
Taylor expanded in x1 around inf 3.1%
Final simplification3.1%
herbie shell --seed 2024018
(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))))))