
(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 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (fma x1 (* x1 3.0) (* 2.0 x2)))
(t_1 (* 3.0 (* x1 x1)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- t_0 x1) (fma x1 x1 1.0)))
(t_4 (+ (* x1 x1) 1.0))
(t_5 (/ (- (+ t_2 (* 2.0 x2)) x1) t_4))
(t_6 (/ (- x1 t_0) (fma x1 x1 1.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_4
(+
(* (* t_5 (* x1 2.0)) (- t_5 3.0))
(* (* x1 x1) (- (* t_5 4.0) 6.0))))
(* t_2 t_5))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_4))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_1 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_3 4.0 -6.0)) (* (* x1 (* 2.0 t_6)) (- t_6 -3.0)))
(fma t_1 t_3 (pow x1 3.0))))))
(+ x1 (+ x1 (* 6.0 (pow x1 4.0)))))))
double code(double x1, double x2) {
double t_0 = fma(x1, (x1 * 3.0), (2.0 * x2));
double t_1 = 3.0 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = (t_0 - x1) / fma(x1, x1, 1.0);
double t_4 = (x1 * x1) + 1.0;
double t_5 = ((t_2 + (2.0 * x2)) - x1) / t_4;
double t_6 = (x1 - t_0) / fma(x1, x1, 1.0);
double tmp;
if ((x1 + ((x1 + (((t_4 * (((t_5 * (x1 * 2.0)) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_2 * t_5)) + (x1 * (x1 * x1)))) + (3.0 * (((t_2 - (2.0 * x2)) - x1) / t_4)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_3, 4.0, -6.0)), ((x1 * (2.0 * t_6)) * (t_6 - -3.0))), fma(t_1, t_3, pow(x1, 3.0)))));
} else {
tmp = x1 + (x1 + (6.0 * pow(x1, 4.0)));
}
return tmp;
}
function code(x1, x2) t_0 = fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) t_1 = Float64(3.0 * Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(t_0 - x1) / fma(x1, x1, 1.0)) t_4 = Float64(Float64(x1 * x1) + 1.0) t_5 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_4) t_6 = Float64(Float64(x1 - t_0) / fma(x1, x1, 1.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_4 * Float64(Float64(Float64(t_5 * Float64(x1 * 2.0)) * Float64(t_5 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)))) + Float64(t_2 * t_5)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_4)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_3, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_6)) * Float64(t_6 - -3.0))), fma(t_1, t_3, (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$0 - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 - t$95$0), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$4 * N[(N[(N[(t$95$5 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$5 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * t$95$5), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$1 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$3 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$6), $MachinePrecision]), $MachinePrecision] * N[(t$95$6 - -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right)\\
t_1 := 3 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{t_0 - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_4 := x1 \cdot x1 + 1\\
t_5 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_4}\\
t_6 := \frac{x1 - t_0}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_4 \cdot \left(\left(t_5 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_5 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_5 \cdot 4 - 6\right)\right) + t_2 \cdot t_5\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_4}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_1 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t_3, 4, -6\right), \left(x1 \cdot \left(2 \cdot t_6\right)\right) \cdot \left(t_6 - -3\right)\right), \mathsf{fma}\left(t_1, t_3, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 6 \cdot {x1}^{4}\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.3%
Simplified99.6%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 10.7%
*-commutative10.7%
Simplified10.7%
Taylor expanded in x1 around inf 98.6%
Final simplification99.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (/ (- (fma (* x1 3.0) x1 (* 2.0 x2)) x1) (fma x1 x1 1.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* t_3 (* x1 2.0)) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
t_0))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(+
(+
t_0
(fma
(fma (* (* x1 2.0) t_4) (+ -3.0 t_4) (* (* x1 x1) (fma 4.0 t_4 -6.0)))
(fma x1 x1 1.0)
(* t_1 t_4)))
(- x1 (* 3.0 (/ (- (+ x1 (* 2.0 x2)) t_1) (fma x1 x1 1.0))))))
(+ x1 (+ x1 (* 6.0 (pow x1 4.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = (fma((x1 * 3.0), x1, (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double tmp;
if ((x1 + ((x1 + (((t_2 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + ((t_0 + fma(fma(((x1 * 2.0) * t_4), (-3.0 + t_4), ((x1 * x1) * fma(4.0, t_4, -6.0))), fma(x1, x1, 1.0), (t_1 * t_4))) + (x1 - (3.0 * (((x1 + (2.0 * x2)) - t_1) / fma(x1, x1, 1.0)))));
} else {
tmp = x1 + (x1 + (6.0 * pow(x1, 4.0)));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(t_3 * Float64(x1 * 2.0)) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + t_0)) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + Float64(Float64(t_0 + fma(fma(Float64(Float64(x1 * 2.0) * t_4), Float64(-3.0 + t_4), Float64(Float64(x1 * x1) * fma(4.0, t_4, -6.0))), fma(x1, x1, 1.0), Float64(t_1 * t_4))) + Float64(x1 - Float64(3.0 * Float64(Float64(Float64(x1 + Float64(2.0 * x2)) - t_1) / fma(x1, x1, 1.0)))))); else tmp = Float64(x1 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(N[(t$95$0 + N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(-3.0 + t$95$4), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(4.0 * t$95$4 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x1 * x1 + 1.0), $MachinePrecision] + N[(t$95$1 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 - N[(3.0 * N[(N[(N[(x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
t_4 := \frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(\left(t_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + t_1 \cdot t_3\right) + t_0\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\right) \leq \infty:\\
\;\;\;\;x1 + \left(\left(t_0 + \mathsf{fma}\left(\mathsf{fma}\left(\left(x1 \cdot 2\right) \cdot t_4, -3 + t_4, \left(x1 \cdot x1\right) \cdot \mathsf{fma}\left(4, t_4, -6\right)\right), \mathsf{fma}\left(x1, x1, 1\right), t_1 \cdot t_4\right)\right) + \left(x1 - 3 \cdot \frac{\left(x1 + 2 \cdot x2\right) - t_1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 6 \cdot {x1}^{4}\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.3%
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 10.7%
*-commutative10.7%
Simplified10.7%
Taylor expanded in x1 around inf 98.6%
Final simplification99.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_0
(+
(* (* t_2 (* x1 2.0)) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_1 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))))
(if (<= t_3 INFINITY) t_3 (+ x1 (+ x1 (* 6.0 (pow x1 4.0)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + (x1 + (6.0 * pow(x1, 4.0)));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + (x1 + (6.0 * Math.pow(x1, 4.0)));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0 t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + (x1 + (6.0 * math.pow(x1, 4.0))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_0 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_1 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0; t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + (x1 + (6.0 * (x1 ^ 4.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$0 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$2), $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$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t_0 \cdot \left(\left(t_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_1 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0}\right)\\
\mathbf{if}\;t_3 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 6 \cdot {x1}^{4}\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.3%
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 10.7%
*-commutative10.7%
Simplified10.7%
Taylor expanded in x1 around inf 98.6%
Final simplification99.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ x1 (* 6.0 (pow x1 4.0)))))
(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 (/ (- t_2 x1) t_3))
(t_6 (* x1 (* x1 x1))))
(if (<= x1 -1.6e+62)
t_0
(if (<= x1 2.95e-8)
(-
x1
(-
(* 3.0 (/ (+ x1 (- (* 2.0 x2) t_1)) t_3))
(-
x1
(-
(+
(* t_1 t_4)
(*
t_3
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_4)))
(* (* (* x1 2.0) (- (* 2.0 x2) x1)) (+ 3.0 t_4)))))
t_6))))
(if (<= x1 4e+96)
(+
x1
(+
(+
x1
(+
(+
(*
t_3
(+
(* (* t_5 (* x1 2.0)) (- t_5 3.0))
(* (* x1 x1) (- (* t_5 4.0) 6.0))))
(* t_1 t_5))
t_6))
(* 3.0 (+ 3.0 (/ -1.0 x1)))))
t_0)))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 + (6.0 * pow(x1, 4.0)));
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 = (t_2 - x1) / t_3;
double t_6 = x1 * (x1 * x1);
double tmp;
if (x1 <= -1.6e+62) {
tmp = t_0;
} else if (x1 <= 2.95e-8) {
tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)) - (x1 - (((t_1 * t_4) + (t_3 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * ((2.0 * x2) - x1)) * (3.0 + t_4))))) - t_6)));
} else if (x1 <= 4e+96) {
tmp = x1 + ((x1 + (((t_3 * (((t_5 * (x1 * 2.0)) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_1 * t_5)) + t_6)) + (3.0 * (3.0 + (-1.0 / x1))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 + (x1 + (6.0d0 * (x1 ** 4.0d0)))
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 = (t_2 - x1) / t_3
t_6 = x1 * (x1 * x1)
if (x1 <= (-1.6d+62)) then
tmp = t_0
else if (x1 <= 2.95d-8) then
tmp = x1 - ((3.0d0 * ((x1 + ((2.0d0 * x2) - t_1)) / t_3)) - (x1 - (((t_1 * t_4) + (t_3 * (((x1 * x1) * (6.0d0 + (4.0d0 * t_4))) + (((x1 * 2.0d0) * ((2.0d0 * x2) - x1)) * (3.0d0 + t_4))))) - t_6)))
else if (x1 <= 4d+96) then
tmp = x1 + ((x1 + (((t_3 * (((t_5 * (x1 * 2.0d0)) * (t_5 - 3.0d0)) + ((x1 * x1) * ((t_5 * 4.0d0) - 6.0d0)))) + (t_1 * t_5)) + t_6)) + (3.0d0 * (3.0d0 + ((-1.0d0) / x1))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 + (6.0 * Math.pow(x1, 4.0)));
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 = (t_2 - x1) / t_3;
double t_6 = x1 * (x1 * x1);
double tmp;
if (x1 <= -1.6e+62) {
tmp = t_0;
} else if (x1 <= 2.95e-8) {
tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)) - (x1 - (((t_1 * t_4) + (t_3 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * ((2.0 * x2) - x1)) * (3.0 + t_4))))) - t_6)));
} else if (x1 <= 4e+96) {
tmp = x1 + ((x1 + (((t_3 * (((t_5 * (x1 * 2.0)) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_1 * t_5)) + t_6)) + (3.0 * (3.0 + (-1.0 / x1))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 + (6.0 * math.pow(x1, 4.0))) 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 = (t_2 - x1) / t_3 t_6 = x1 * (x1 * x1) tmp = 0 if x1 <= -1.6e+62: tmp = t_0 elif x1 <= 2.95e-8: tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)) - (x1 - (((t_1 * t_4) + (t_3 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * ((2.0 * x2) - x1)) * (3.0 + t_4))))) - t_6))) elif x1 <= 4e+96: tmp = x1 + ((x1 + (((t_3 * (((t_5 * (x1 * 2.0)) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_1 * t_5)) + t_6)) + (3.0 * (3.0 + (-1.0 / x1)))) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))) 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(Float64(t_2 - x1) / t_3) t_6 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -1.6e+62) tmp = t_0; elseif (x1 <= 2.95e-8) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(x1 + Float64(Float64(2.0 * x2) - t_1)) / t_3)) - Float64(x1 - Float64(Float64(Float64(t_1 * t_4) + Float64(t_3 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_4))) + Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)) * Float64(3.0 + t_4))))) - t_6)))); elseif (x1 <= 4e+96) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_3 * Float64(Float64(Float64(t_5 * Float64(x1 * 2.0)) * Float64(t_5 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)))) + Float64(t_1 * t_5)) + t_6)) + Float64(3.0 * Float64(3.0 + Float64(-1.0 / x1))))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 + (6.0 * (x1 ^ 4.0))); 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 = (t_2 - x1) / t_3; t_6 = x1 * (x1 * x1); tmp = 0.0; if (x1 <= -1.6e+62) tmp = t_0; elseif (x1 <= 2.95e-8) tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)) - (x1 - (((t_1 * t_4) + (t_3 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * ((2.0 * x2) - x1)) * (3.0 + t_4))))) - t_6))); elseif (x1 <= 4e+96) tmp = x1 + ((x1 + (((t_3 * (((t_5 * (x1 * 2.0)) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_1 * t_5)) + t_6)) + (3.0 * (3.0 + (-1.0 / x1)))); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $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[(N[(t$95$2 - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.6e+62], t$95$0, If[LessEqual[x1, 2.95e-8], N[(x1 - N[(N[(3.0 * N[(N[(x1 + N[(N[(2.0 * x2), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] - N[(x1 - N[(N[(N[(t$95$1 * t$95$4), $MachinePrecision] + N[(t$95$3 * 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] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4e+96], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$3 * N[(N[(N[(t$95$5 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$5 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$5), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 + 6 \cdot {x1}^{4}\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 := \frac{t_2 - x1}{t_3}\\
t_6 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+62}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 2.95 \cdot 10^{-8}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t_1\right)}{t_3} - \left(x1 - \left(\left(t_1 \cdot t_4 + t_3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_4\right) + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right) \cdot \left(3 + t_4\right)\right)\right) - t_6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{+96}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_3 \cdot \left(\left(t_5 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_5 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_5 \cdot 4 - 6\right)\right) + t_1 \cdot t_5\right) + t_6\right)\right) + 3 \cdot \left(3 + \frac{-1}{x1}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -1.59999999999999992e62 or 4.0000000000000002e96 < x1 Initial program 20.2%
Taylor expanded in x1 around inf 28.6%
*-commutative28.6%
Simplified28.6%
Taylor expanded in x1 around inf 100.0%
if -1.59999999999999992e62 < x1 < 2.9499999999999999e-8Initial program 98.6%
Taylor expanded in x1 around 0 97.5%
+-commutative97.5%
mul-1-neg97.5%
unsub-neg97.5%
Simplified97.5%
if 2.9499999999999999e-8 < x1 < 4.0000000000000002e96Initial program 99.2%
Taylor expanded in x1 around inf 98.5%
Final simplification98.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ x1 (* 6.0 (pow x1 4.0)))))
(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 (/ (- t_2 x1) t_3))
(t_6 (* x1 (* x1 x1))))
(if (<= x1 -4.8e+62)
t_0
(if (<= x1 2.95e-8)
(-
x1
(-
(* 3.0 (/ (+ x1 (- (* 2.0 x2) t_1)) t_3))
(-
x1
(-
(+
(* t_1 t_4)
(*
t_3
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_4)))
(* (* (* x1 2.0) (- (* 2.0 x2) x1)) (+ 3.0 t_4)))))
t_6))))
(if (<= x1 7e+96)
(+
x1
(+
(+
x1
(+
(+
(*
t_3
(+
(* (* t_5 (* x1 2.0)) (- t_5 3.0))
(* (* x1 x1) (- (* t_5 4.0) 6.0))))
(* t_1 t_5))
t_6))
9.0))
t_0)))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 + (6.0 * pow(x1, 4.0)));
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 = (t_2 - x1) / t_3;
double t_6 = x1 * (x1 * x1);
double tmp;
if (x1 <= -4.8e+62) {
tmp = t_0;
} else if (x1 <= 2.95e-8) {
tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)) - (x1 - (((t_1 * t_4) + (t_3 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * ((2.0 * x2) - x1)) * (3.0 + t_4))))) - t_6)));
} else if (x1 <= 7e+96) {
tmp = x1 + ((x1 + (((t_3 * (((t_5 * (x1 * 2.0)) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_1 * t_5)) + t_6)) + 9.0);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 + (x1 + (6.0d0 * (x1 ** 4.0d0)))
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 = (t_2 - x1) / t_3
t_6 = x1 * (x1 * x1)
if (x1 <= (-4.8d+62)) then
tmp = t_0
else if (x1 <= 2.95d-8) then
tmp = x1 - ((3.0d0 * ((x1 + ((2.0d0 * x2) - t_1)) / t_3)) - (x1 - (((t_1 * t_4) + (t_3 * (((x1 * x1) * (6.0d0 + (4.0d0 * t_4))) + (((x1 * 2.0d0) * ((2.0d0 * x2) - x1)) * (3.0d0 + t_4))))) - t_6)))
else if (x1 <= 7d+96) then
tmp = x1 + ((x1 + (((t_3 * (((t_5 * (x1 * 2.0d0)) * (t_5 - 3.0d0)) + ((x1 * x1) * ((t_5 * 4.0d0) - 6.0d0)))) + (t_1 * t_5)) + t_6)) + 9.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 + (6.0 * Math.pow(x1, 4.0)));
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 = (t_2 - x1) / t_3;
double t_6 = x1 * (x1 * x1);
double tmp;
if (x1 <= -4.8e+62) {
tmp = t_0;
} else if (x1 <= 2.95e-8) {
tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)) - (x1 - (((t_1 * t_4) + (t_3 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * ((2.0 * x2) - x1)) * (3.0 + t_4))))) - t_6)));
} else if (x1 <= 7e+96) {
tmp = x1 + ((x1 + (((t_3 * (((t_5 * (x1 * 2.0)) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_1 * t_5)) + t_6)) + 9.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 + (6.0 * math.pow(x1, 4.0))) 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 = (t_2 - x1) / t_3 t_6 = x1 * (x1 * x1) tmp = 0 if x1 <= -4.8e+62: tmp = t_0 elif x1 <= 2.95e-8: tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)) - (x1 - (((t_1 * t_4) + (t_3 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * ((2.0 * x2) - x1)) * (3.0 + t_4))))) - t_6))) elif x1 <= 7e+96: tmp = x1 + ((x1 + (((t_3 * (((t_5 * (x1 * 2.0)) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_1 * t_5)) + t_6)) + 9.0) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))) 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(Float64(t_2 - x1) / t_3) t_6 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -4.8e+62) tmp = t_0; elseif (x1 <= 2.95e-8) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(x1 + Float64(Float64(2.0 * x2) - t_1)) / t_3)) - Float64(x1 - Float64(Float64(Float64(t_1 * t_4) + Float64(t_3 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_4))) + Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)) * Float64(3.0 + t_4))))) - t_6)))); elseif (x1 <= 7e+96) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_3 * Float64(Float64(Float64(t_5 * Float64(x1 * 2.0)) * Float64(t_5 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)))) + Float64(t_1 * t_5)) + t_6)) + 9.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 + (6.0 * (x1 ^ 4.0))); 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 = (t_2 - x1) / t_3; t_6 = x1 * (x1 * x1); tmp = 0.0; if (x1 <= -4.8e+62) tmp = t_0; elseif (x1 <= 2.95e-8) tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)) - (x1 - (((t_1 * t_4) + (t_3 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * ((2.0 * x2) - x1)) * (3.0 + t_4))))) - t_6))); elseif (x1 <= 7e+96) tmp = x1 + ((x1 + (((t_3 * (((t_5 * (x1 * 2.0)) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_1 * t_5)) + t_6)) + 9.0); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $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[(N[(t$95$2 - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.8e+62], t$95$0, If[LessEqual[x1, 2.95e-8], N[(x1 - N[(N[(3.0 * N[(N[(x1 + N[(N[(2.0 * x2), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] - N[(x1 - N[(N[(N[(t$95$1 * t$95$4), $MachinePrecision] + N[(t$95$3 * 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] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 7e+96], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$3 * N[(N[(N[(t$95$5 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$5 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$5), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 + 6 \cdot {x1}^{4}\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 := \frac{t_2 - x1}{t_3}\\
t_6 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -4.8 \cdot 10^{+62}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 2.95 \cdot 10^{-8}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t_1\right)}{t_3} - \left(x1 - \left(\left(t_1 \cdot t_4 + t_3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_4\right) + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right) \cdot \left(3 + t_4\right)\right)\right) - t_6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 7 \cdot 10^{+96}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_3 \cdot \left(\left(t_5 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_5 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_5 \cdot 4 - 6\right)\right) + t_1 \cdot t_5\right) + t_6\right)\right) + 9\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -4.8e62 or 6.9999999999999998e96 < x1 Initial program 20.2%
Taylor expanded in x1 around inf 28.6%
*-commutative28.6%
Simplified28.6%
Taylor expanded in x1 around inf 100.0%
if -4.8e62 < x1 < 2.9499999999999999e-8Initial program 98.6%
Taylor expanded in x1 around 0 97.5%
+-commutative97.5%
mul-1-neg97.5%
unsub-neg97.5%
Simplified97.5%
if 2.9499999999999999e-8 < x1 < 6.9999999999999998e96Initial program 99.2%
Taylor expanded in x1 around inf 98.0%
Final simplification98.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (+ x1 (+ x1 (* 6.0 (pow x1 4.0)))))
(t_3 (* x1 (* x1 3.0)))
(t_4 (+ t_3 (* 2.0 x2)))
(t_5 (/ (- t_4 x1) t_1))
(t_6 (* t_3 t_5))
(t_7 (* (* x1 x1) (- (* t_5 4.0) 6.0))))
(if (<= x1 -49000000000000.0)
t_2
(if (<= x1 2.95e-8)
(+
x1
(+
(* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_1))
(+
x1
(+
t_0
(+
t_6
(*
t_1
(+
t_7
(* (* (* x1 2.0) (/ (- x1 t_4) t_1)) (- 3.0 (* 2.0 x2))))))))))
(if (<= x1 5e+96)
(+
x1
(+
(+
x1
(+ (+ (* t_1 (+ (* (* t_5 (* x1 2.0)) (- t_5 3.0)) t_7)) t_6) t_0))
9.0))
t_2)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 + (x1 + (6.0 * pow(x1, 4.0)));
double t_3 = x1 * (x1 * 3.0);
double t_4 = t_3 + (2.0 * x2);
double t_5 = (t_4 - x1) / t_1;
double t_6 = t_3 * t_5;
double t_7 = (x1 * x1) * ((t_5 * 4.0) - 6.0);
double tmp;
if (x1 <= -49000000000000.0) {
tmp = t_2;
} else if (x1 <= 2.95e-8) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_0 + (t_6 + (t_1 * (t_7 + (((x1 * 2.0) * ((x1 - t_4) / t_1)) * (3.0 - (2.0 * x2)))))))));
} else if (x1 <= 5e+96) {
tmp = x1 + ((x1 + (((t_1 * (((t_5 * (x1 * 2.0)) * (t_5 - 3.0)) + t_7)) + t_6) + t_0)) + 9.0);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 + (x1 + (6.0d0 * (x1 ** 4.0d0)))
t_3 = x1 * (x1 * 3.0d0)
t_4 = t_3 + (2.0d0 * x2)
t_5 = (t_4 - x1) / t_1
t_6 = t_3 * t_5
t_7 = (x1 * x1) * ((t_5 * 4.0d0) - 6.0d0)
if (x1 <= (-49000000000000.0d0)) then
tmp = t_2
else if (x1 <= 2.95d-8) then
tmp = x1 + ((3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + (t_0 + (t_6 + (t_1 * (t_7 + (((x1 * 2.0d0) * ((x1 - t_4) / t_1)) * (3.0d0 - (2.0d0 * x2)))))))))
else if (x1 <= 5d+96) then
tmp = x1 + ((x1 + (((t_1 * (((t_5 * (x1 * 2.0d0)) * (t_5 - 3.0d0)) + t_7)) + t_6) + t_0)) + 9.0d0)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 + (x1 + (6.0 * Math.pow(x1, 4.0)));
double t_3 = x1 * (x1 * 3.0);
double t_4 = t_3 + (2.0 * x2);
double t_5 = (t_4 - x1) / t_1;
double t_6 = t_3 * t_5;
double t_7 = (x1 * x1) * ((t_5 * 4.0) - 6.0);
double tmp;
if (x1 <= -49000000000000.0) {
tmp = t_2;
} else if (x1 <= 2.95e-8) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_0 + (t_6 + (t_1 * (t_7 + (((x1 * 2.0) * ((x1 - t_4) / t_1)) * (3.0 - (2.0 * x2)))))))));
} else if (x1 <= 5e+96) {
tmp = x1 + ((x1 + (((t_1 * (((t_5 * (x1 * 2.0)) * (t_5 - 3.0)) + t_7)) + t_6) + t_0)) + 9.0);
} else {
tmp = t_2;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = (x1 * x1) + 1.0 t_2 = x1 + (x1 + (6.0 * math.pow(x1, 4.0))) t_3 = x1 * (x1 * 3.0) t_4 = t_3 + (2.0 * x2) t_5 = (t_4 - x1) / t_1 t_6 = t_3 * t_5 t_7 = (x1 * x1) * ((t_5 * 4.0) - 6.0) tmp = 0 if x1 <= -49000000000000.0: tmp = t_2 elif x1 <= 2.95e-8: tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_0 + (t_6 + (t_1 * (t_7 + (((x1 * 2.0) * ((x1 - t_4) / t_1)) * (3.0 - (2.0 * x2))))))))) elif x1 <= 5e+96: tmp = x1 + ((x1 + (((t_1 * (((t_5 * (x1 * 2.0)) * (t_5 - 3.0)) + t_7)) + t_6) + t_0)) + 9.0) else: tmp = t_2 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))) 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_1) t_6 = Float64(t_3 * t_5) t_7 = Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)) tmp = 0.0 if (x1 <= -49000000000000.0) tmp = t_2; elseif (x1 <= 2.95e-8) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(t_0 + Float64(t_6 + Float64(t_1 * Float64(t_7 + Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(x1 - t_4) / t_1)) * Float64(3.0 - Float64(2.0 * x2)))))))))); elseif (x1 <= 5e+96) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(t_5 * Float64(x1 * 2.0)) * Float64(t_5 - 3.0)) + t_7)) + t_6) + t_0)) + 9.0)); else tmp = t_2; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = (x1 * x1) + 1.0; t_2 = x1 + (x1 + (6.0 * (x1 ^ 4.0))); t_3 = x1 * (x1 * 3.0); t_4 = t_3 + (2.0 * x2); t_5 = (t_4 - x1) / t_1; t_6 = t_3 * t_5; t_7 = (x1 * x1) * ((t_5 * 4.0) - 6.0); tmp = 0.0; if (x1 <= -49000000000000.0) tmp = t_2; elseif (x1 <= 2.95e-8) tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_0 + (t_6 + (t_1 * (t_7 + (((x1 * 2.0) * ((x1 - t_4) / t_1)) * (3.0 - (2.0 * x2))))))))); elseif (x1 <= 5e+96) tmp = x1 + ((x1 + (((t_1 * (((t_5 * (x1 * 2.0)) * (t_5 - 3.0)) + t_7)) + t_6) + t_0)) + 9.0); else tmp = t_2; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$4 - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$3 * t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -49000000000000.0], t$95$2, If[LessEqual[x1, 2.95e-8], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$0 + N[(t$95$6 + N[(t$95$1 * N[(t$95$7 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(x1 - t$95$4), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+96], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(t$95$5 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$5 - 3.0), $MachinePrecision]), $MachinePrecision] + t$95$7), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 + \left(x1 + 6 \cdot {x1}^{4}\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := t_3 + 2 \cdot x2\\
t_5 := \frac{t_4 - x1}{t_1}\\
t_6 := t_3 \cdot t_5\\
t_7 := \left(x1 \cdot x1\right) \cdot \left(t_5 \cdot 4 - 6\right)\\
\mathbf{if}\;x1 \leq -49000000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x1 \leq 2.95 \cdot 10^{-8}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(t_0 + \left(t_6 + t_1 \cdot \left(t_7 + \left(\left(x1 \cdot 2\right) \cdot \frac{x1 - t_4}{t_1}\right) \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+96}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(\left(t_5 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_5 - 3\right) + t_7\right) + t_6\right) + t_0\right)\right) + 9\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x1 < -4.9e13 or 5.0000000000000004e96 < x1 Initial program 29.3%
Taylor expanded in x1 around inf 35.6%
*-commutative35.6%
Simplified35.6%
Taylor expanded in x1 around inf 98.8%
if -4.9e13 < x1 < 2.9499999999999999e-8Initial program 98.6%
Taylor expanded in x1 around 0 98.1%
if 2.9499999999999999e-8 < x1 < 5.0000000000000004e96Initial program 99.2%
Taylor expanded in x1 around inf 98.0%
Final simplification98.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ x1 (* 6.0 (pow x1 4.0)))))
(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 (/ (- t_2 x1) t_3))
(t_6 (* x1 (* x1 x1))))
(if (<= x1 -155000000000.0)
t_0
(if (<= x1 2.95e-8)
(-
x1
(+
(* 3.0 (/ (+ x1 (- (* 2.0 x2) t_1)) t_3))
(-
(-
(+
(* t_1 t_4)
(*
t_3
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_4)))
(* (* (* x1 2.0) (- (* 2.0 x2) x1)) (- 3.0 (* 2.0 x2))))))
t_6)
x1)))
(if (<= x1 7e+96)
(+
x1
(+
(+
x1
(+
(+
(*
t_3
(+
(* (* t_5 (* x1 2.0)) (- t_5 3.0))
(* (* x1 x1) (- (* t_5 4.0) 6.0))))
(* t_1 t_5))
t_6))
9.0))
t_0)))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 + (6.0 * pow(x1, 4.0)));
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 = (t_2 - x1) / t_3;
double t_6 = x1 * (x1 * x1);
double tmp;
if (x1 <= -155000000000.0) {
tmp = t_0;
} else if (x1 <= 2.95e-8) {
tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)) + ((((t_1 * t_4) + (t_3 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * ((2.0 * x2) - x1)) * (3.0 - (2.0 * x2)))))) - t_6) - x1));
} else if (x1 <= 7e+96) {
tmp = x1 + ((x1 + (((t_3 * (((t_5 * (x1 * 2.0)) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_1 * t_5)) + t_6)) + 9.0);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 + (x1 + (6.0d0 * (x1 ** 4.0d0)))
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 = (t_2 - x1) / t_3
t_6 = x1 * (x1 * x1)
if (x1 <= (-155000000000.0d0)) then
tmp = t_0
else if (x1 <= 2.95d-8) then
tmp = x1 - ((3.0d0 * ((x1 + ((2.0d0 * x2) - t_1)) / t_3)) + ((((t_1 * t_4) + (t_3 * (((x1 * x1) * (6.0d0 + (4.0d0 * t_4))) + (((x1 * 2.0d0) * ((2.0d0 * x2) - x1)) * (3.0d0 - (2.0d0 * x2)))))) - t_6) - x1))
else if (x1 <= 7d+96) then
tmp = x1 + ((x1 + (((t_3 * (((t_5 * (x1 * 2.0d0)) * (t_5 - 3.0d0)) + ((x1 * x1) * ((t_5 * 4.0d0) - 6.0d0)))) + (t_1 * t_5)) + t_6)) + 9.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 + (6.0 * Math.pow(x1, 4.0)));
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 = (t_2 - x1) / t_3;
double t_6 = x1 * (x1 * x1);
double tmp;
if (x1 <= -155000000000.0) {
tmp = t_0;
} else if (x1 <= 2.95e-8) {
tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)) + ((((t_1 * t_4) + (t_3 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * ((2.0 * x2) - x1)) * (3.0 - (2.0 * x2)))))) - t_6) - x1));
} else if (x1 <= 7e+96) {
tmp = x1 + ((x1 + (((t_3 * (((t_5 * (x1 * 2.0)) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_1 * t_5)) + t_6)) + 9.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 + (6.0 * math.pow(x1, 4.0))) 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 = (t_2 - x1) / t_3 t_6 = x1 * (x1 * x1) tmp = 0 if x1 <= -155000000000.0: tmp = t_0 elif x1 <= 2.95e-8: tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)) + ((((t_1 * t_4) + (t_3 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * ((2.0 * x2) - x1)) * (3.0 - (2.0 * x2)))))) - t_6) - x1)) elif x1 <= 7e+96: tmp = x1 + ((x1 + (((t_3 * (((t_5 * (x1 * 2.0)) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_1 * t_5)) + t_6)) + 9.0) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))) 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(Float64(t_2 - x1) / t_3) t_6 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -155000000000.0) tmp = t_0; elseif (x1 <= 2.95e-8) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(x1 + Float64(Float64(2.0 * x2) - t_1)) / t_3)) + Float64(Float64(Float64(Float64(t_1 * t_4) + Float64(t_3 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_4))) + Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)) * Float64(3.0 - Float64(2.0 * x2)))))) - t_6) - x1))); elseif (x1 <= 7e+96) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_3 * Float64(Float64(Float64(t_5 * Float64(x1 * 2.0)) * Float64(t_5 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)))) + Float64(t_1 * t_5)) + t_6)) + 9.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 + (6.0 * (x1 ^ 4.0))); 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 = (t_2 - x1) / t_3; t_6 = x1 * (x1 * x1); tmp = 0.0; if (x1 <= -155000000000.0) tmp = t_0; elseif (x1 <= 2.95e-8) tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)) + ((((t_1 * t_4) + (t_3 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((x1 * 2.0) * ((2.0 * x2) - x1)) * (3.0 - (2.0 * x2)))))) - t_6) - x1)); elseif (x1 <= 7e+96) tmp = x1 + ((x1 + (((t_3 * (((t_5 * (x1 * 2.0)) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_1 * t_5)) + t_6)) + 9.0); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $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[(N[(t$95$2 - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -155000000000.0], t$95$0, If[LessEqual[x1, 2.95e-8], N[(x1 - N[(N[(3.0 * N[(N[(x1 + N[(N[(2.0 * x2), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(t$95$1 * t$95$4), $MachinePrecision] + N[(t$95$3 * 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] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$6), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 7e+96], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$3 * N[(N[(N[(t$95$5 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$5 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$5), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 + 6 \cdot {x1}^{4}\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 := \frac{t_2 - x1}{t_3}\\
t_6 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -155000000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 2.95 \cdot 10^{-8}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t_1\right)}{t_3} + \left(\left(\left(t_1 \cdot t_4 + t_3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_4\right) + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right) \cdot \left(3 - 2 \cdot x2\right)\right)\right) - t_6\right) - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 7 \cdot 10^{+96}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_3 \cdot \left(\left(t_5 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_5 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_5 \cdot 4 - 6\right)\right) + t_1 \cdot t_5\right) + t_6\right)\right) + 9\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -1.55e11 or 6.9999999999999998e96 < x1 Initial program 29.3%
Taylor expanded in x1 around inf 35.6%
*-commutative35.6%
Simplified35.6%
Taylor expanded in x1 around inf 98.8%
if -1.55e11 < x1 < 2.9499999999999999e-8Initial program 98.6%
Taylor expanded in x1 around 0 98.2%
+-commutative98.2%
mul-1-neg98.2%
unsub-neg98.2%
Simplified98.2%
Taylor expanded in x1 around 0 98.0%
if 2.9499999999999999e-8 < x1 < 6.9999999999999998e96Initial program 99.2%
Taylor expanded in x1 around inf 98.0%
Final simplification98.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ x1 (* 6.0 (pow x1 4.0)))))
(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 (* (* x1 x1) (+ 6.0 (* 4.0 t_4))))
(t_6 (* x1 (* x1 x1))))
(if (<= x1 -145000000000.0)
t_0
(if (<= x1 2.95e-8)
(-
x1
(+
(* 3.0 (/ (+ x1 (- (* 2.0 x2) t_1)) t_3))
(-
(-
(+
(* t_1 t_4)
(*
t_3
(+ t_5 (* (* (* x1 2.0) (- (* 2.0 x2) x1)) (- 3.0 (* 2.0 x2))))))
t_6)
x1)))
(if (<= x1 4e+96)
(+
x1
(+
(+
x1
(-
t_6
(-
(* t_3 (+ t_5 (* (* (/ (- t_2 x1) t_3) (* x1 2.0)) (+ 3.0 t_4))))
(* t_1 (* 2.0 x2)))))
(* 3.0 (/ 1.0 (/ -0.5 x2)))))
t_0)))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 + (6.0 * pow(x1, 4.0)));
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 = (x1 * x1) * (6.0 + (4.0 * t_4));
double t_6 = x1 * (x1 * x1);
double tmp;
if (x1 <= -145000000000.0) {
tmp = t_0;
} else if (x1 <= 2.95e-8) {
tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)) + ((((t_1 * t_4) + (t_3 * (t_5 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * (3.0 - (2.0 * x2)))))) - t_6) - x1));
} else if (x1 <= 4e+96) {
tmp = x1 + ((x1 + (t_6 - ((t_3 * (t_5 + ((((t_2 - x1) / t_3) * (x1 * 2.0)) * (3.0 + t_4)))) - (t_1 * (2.0 * x2))))) + (3.0 * (1.0 / (-0.5 / x2))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 + (x1 + (6.0d0 * (x1 ** 4.0d0)))
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 = (x1 * x1) * (6.0d0 + (4.0d0 * t_4))
t_6 = x1 * (x1 * x1)
if (x1 <= (-145000000000.0d0)) then
tmp = t_0
else if (x1 <= 2.95d-8) then
tmp = x1 - ((3.0d0 * ((x1 + ((2.0d0 * x2) - t_1)) / t_3)) + ((((t_1 * t_4) + (t_3 * (t_5 + (((x1 * 2.0d0) * ((2.0d0 * x2) - x1)) * (3.0d0 - (2.0d0 * x2)))))) - t_6) - x1))
else if (x1 <= 4d+96) then
tmp = x1 + ((x1 + (t_6 - ((t_3 * (t_5 + ((((t_2 - x1) / t_3) * (x1 * 2.0d0)) * (3.0d0 + t_4)))) - (t_1 * (2.0d0 * x2))))) + (3.0d0 * (1.0d0 / ((-0.5d0) / x2))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 + (6.0 * Math.pow(x1, 4.0)));
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 = (x1 * x1) * (6.0 + (4.0 * t_4));
double t_6 = x1 * (x1 * x1);
double tmp;
if (x1 <= -145000000000.0) {
tmp = t_0;
} else if (x1 <= 2.95e-8) {
tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)) + ((((t_1 * t_4) + (t_3 * (t_5 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * (3.0 - (2.0 * x2)))))) - t_6) - x1));
} else if (x1 <= 4e+96) {
tmp = x1 + ((x1 + (t_6 - ((t_3 * (t_5 + ((((t_2 - x1) / t_3) * (x1 * 2.0)) * (3.0 + t_4)))) - (t_1 * (2.0 * x2))))) + (3.0 * (1.0 / (-0.5 / x2))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 + (6.0 * math.pow(x1, 4.0))) 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 = (x1 * x1) * (6.0 + (4.0 * t_4)) t_6 = x1 * (x1 * x1) tmp = 0 if x1 <= -145000000000.0: tmp = t_0 elif x1 <= 2.95e-8: tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)) + ((((t_1 * t_4) + (t_3 * (t_5 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * (3.0 - (2.0 * x2)))))) - t_6) - x1)) elif x1 <= 4e+96: tmp = x1 + ((x1 + (t_6 - ((t_3 * (t_5 + ((((t_2 - x1) / t_3) * (x1 * 2.0)) * (3.0 + t_4)))) - (t_1 * (2.0 * x2))))) + (3.0 * (1.0 / (-0.5 / x2)))) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))) 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(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_4))) t_6 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -145000000000.0) tmp = t_0; elseif (x1 <= 2.95e-8) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(x1 + Float64(Float64(2.0 * x2) - t_1)) / t_3)) + Float64(Float64(Float64(Float64(t_1 * t_4) + Float64(t_3 * Float64(t_5 + Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)) * Float64(3.0 - Float64(2.0 * x2)))))) - t_6) - x1))); elseif (x1 <= 4e+96) tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_6 - Float64(Float64(t_3 * Float64(t_5 + Float64(Float64(Float64(Float64(t_2 - x1) / t_3) * Float64(x1 * 2.0)) * Float64(3.0 + t_4)))) - Float64(t_1 * Float64(2.0 * x2))))) + Float64(3.0 * Float64(1.0 / Float64(-0.5 / x2))))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 + (6.0 * (x1 ^ 4.0))); 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 = (x1 * x1) * (6.0 + (4.0 * t_4)); t_6 = x1 * (x1 * x1); tmp = 0.0; if (x1 <= -145000000000.0) tmp = t_0; elseif (x1 <= 2.95e-8) tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_1)) / t_3)) + ((((t_1 * t_4) + (t_3 * (t_5 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * (3.0 - (2.0 * x2)))))) - t_6) - x1)); elseif (x1 <= 4e+96) tmp = x1 + ((x1 + (t_6 - ((t_3 * (t_5 + ((((t_2 - x1) / t_3) * (x1 * 2.0)) * (3.0 + t_4)))) - (t_1 * (2.0 * x2))))) + (3.0 * (1.0 / (-0.5 / x2)))); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $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[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -145000000000.0], t$95$0, If[LessEqual[x1, 2.95e-8], N[(x1 - N[(N[(3.0 * N[(N[(x1 + N[(N[(2.0 * x2), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(t$95$1 * t$95$4), $MachinePrecision] + N[(t$95$3 * N[(t$95$5 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$6), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4e+96], N[(x1 + N[(N[(x1 + N[(t$95$6 - N[(N[(t$95$3 * N[(t$95$5 + N[(N[(N[(N[(t$95$2 - x1), $MachinePrecision] / t$95$3), $MachinePrecision] * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(1.0 / N[(-0.5 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 + 6 \cdot {x1}^{4}\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 := \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_4\right)\\
t_6 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -145000000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 2.95 \cdot 10^{-8}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t_1\right)}{t_3} + \left(\left(\left(t_1 \cdot t_4 + t_3 \cdot \left(t_5 + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right) \cdot \left(3 - 2 \cdot x2\right)\right)\right) - t_6\right) - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{+96}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_6 - \left(t_3 \cdot \left(t_5 + \left(\frac{t_2 - x1}{t_3} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(3 + t_4\right)\right) - t_1 \cdot \left(2 \cdot x2\right)\right)\right)\right) + 3 \cdot \frac{1}{\frac{-0.5}{x2}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -1.45e11 or 4.0000000000000002e96 < x1 Initial program 29.3%
Taylor expanded in x1 around inf 35.6%
*-commutative35.6%
Simplified35.6%
Taylor expanded in x1 around inf 98.8%
if -1.45e11 < x1 < 2.9499999999999999e-8Initial program 98.6%
Taylor expanded in x1 around 0 98.2%
+-commutative98.2%
mul-1-neg98.2%
unsub-neg98.2%
Simplified98.2%
Taylor expanded in x1 around 0 98.0%
if 2.9499999999999999e-8 < x1 < 4.0000000000000002e96Initial program 99.2%
fma-def99.2%
clear-num99.2%
associate--l-99.2%
*-commutative99.2%
*-commutative99.2%
inv-pow99.2%
associate-*r*99.2%
*-commutative99.2%
fma-neg99.2%
pow299.2%
fma-def99.2%
Applied egg-rr99.2%
unpow-199.2%
fma-udef99.2%
unsub-neg99.2%
Simplified99.2%
Taylor expanded in x1 around 0 95.7%
Taylor expanded in x1 around 0 88.5%
Final simplification97.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ t_0 (* 2.0 x2)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- x1 t_1) t_2))
(t_4 (* (* x1 x1) (+ 6.0 (* 4.0 t_3))))
(t_5 (* x1 (* x1 x1)))
(t_6
(+
x1
(+
(+
x1
(-
t_5
(-
(* t_2 (+ t_4 (* (* (/ (- t_1 x1) t_2) (* x1 2.0)) (+ 3.0 t_3))))
(* t_0 (* 2.0 x2)))))
(* 3.0 (/ 1.0 (/ -0.5 x2))))))
(t_7 (- 3.0 (* 2.0 x2))))
(if (<= x1 -5.6e+102)
(- (* x2 (- (* x1 -12.0) 6.0)) x1)
(if (<= x1 -0.064)
t_6
(if (<= x1 2.95e-8)
(-
x1
(+
(* 3.0 (/ (+ x1 (- (* 2.0 x2) t_0)) t_2))
(-
(-
(+
(* t_0 t_3)
(* t_2 (+ t_4 (* (* (* x1 2.0) (- (* 2.0 x2) x1)) t_7))))
t_5)
x1)))
(if (<= x1 1.35e+154)
t_6
(+ x1 (* x1 (- 1.0 (* 4.0 (* x2 t_7)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = t_0 + (2.0 * x2);
double t_2 = (x1 * x1) + 1.0;
double t_3 = (x1 - t_1) / t_2;
double t_4 = (x1 * x1) * (6.0 + (4.0 * t_3));
double t_5 = x1 * (x1 * x1);
double t_6 = x1 + ((x1 + (t_5 - ((t_2 * (t_4 + ((((t_1 - x1) / t_2) * (x1 * 2.0)) * (3.0 + t_3)))) - (t_0 * (2.0 * x2))))) + (3.0 * (1.0 / (-0.5 / x2))));
double t_7 = 3.0 - (2.0 * x2);
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1;
} else if (x1 <= -0.064) {
tmp = t_6;
} else if (x1 <= 2.95e-8) {
tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_2)) + ((((t_0 * t_3) + (t_2 * (t_4 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * t_7)))) - t_5) - x1));
} else if (x1 <= 1.35e+154) {
tmp = t_6;
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * t_7))));
}
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 = (x1 - t_1) / t_2
t_4 = (x1 * x1) * (6.0d0 + (4.0d0 * t_3))
t_5 = x1 * (x1 * x1)
t_6 = x1 + ((x1 + (t_5 - ((t_2 * (t_4 + ((((t_1 - x1) / t_2) * (x1 * 2.0d0)) * (3.0d0 + t_3)))) - (t_0 * (2.0d0 * x2))))) + (3.0d0 * (1.0d0 / ((-0.5d0) / x2))))
t_7 = 3.0d0 - (2.0d0 * x2)
if (x1 <= (-5.6d+102)) then
tmp = (x2 * ((x1 * (-12.0d0)) - 6.0d0)) - x1
else if (x1 <= (-0.064d0)) then
tmp = t_6
else if (x1 <= 2.95d-8) then
tmp = x1 - ((3.0d0 * ((x1 + ((2.0d0 * x2) - t_0)) / t_2)) + ((((t_0 * t_3) + (t_2 * (t_4 + (((x1 * 2.0d0) * ((2.0d0 * x2) - x1)) * t_7)))) - t_5) - x1))
else if (x1 <= 1.35d+154) then
tmp = t_6
else
tmp = x1 + (x1 * (1.0d0 - (4.0d0 * (x2 * t_7))))
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 = (x1 - t_1) / t_2;
double t_4 = (x1 * x1) * (6.0 + (4.0 * t_3));
double t_5 = x1 * (x1 * x1);
double t_6 = x1 + ((x1 + (t_5 - ((t_2 * (t_4 + ((((t_1 - x1) / t_2) * (x1 * 2.0)) * (3.0 + t_3)))) - (t_0 * (2.0 * x2))))) + (3.0 * (1.0 / (-0.5 / x2))));
double t_7 = 3.0 - (2.0 * x2);
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1;
} else if (x1 <= -0.064) {
tmp = t_6;
} else if (x1 <= 2.95e-8) {
tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_2)) + ((((t_0 * t_3) + (t_2 * (t_4 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * t_7)))) - t_5) - x1));
} else if (x1 <= 1.35e+154) {
tmp = t_6;
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * t_7))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = t_0 + (2.0 * x2) t_2 = (x1 * x1) + 1.0 t_3 = (x1 - t_1) / t_2 t_4 = (x1 * x1) * (6.0 + (4.0 * t_3)) t_5 = x1 * (x1 * x1) t_6 = x1 + ((x1 + (t_5 - ((t_2 * (t_4 + ((((t_1 - x1) / t_2) * (x1 * 2.0)) * (3.0 + t_3)))) - (t_0 * (2.0 * x2))))) + (3.0 * (1.0 / (-0.5 / x2)))) t_7 = 3.0 - (2.0 * x2) tmp = 0 if x1 <= -5.6e+102: tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1 elif x1 <= -0.064: tmp = t_6 elif x1 <= 2.95e-8: tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_2)) + ((((t_0 * t_3) + (t_2 * (t_4 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * t_7)))) - t_5) - x1)) elif x1 <= 1.35e+154: tmp = t_6 else: tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * t_7)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(t_0 + Float64(2.0 * x2)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(x1 - t_1) / t_2) t_4 = Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_3))) t_5 = Float64(x1 * Float64(x1 * x1)) t_6 = Float64(x1 + Float64(Float64(x1 + Float64(t_5 - Float64(Float64(t_2 * Float64(t_4 + Float64(Float64(Float64(Float64(t_1 - x1) / t_2) * Float64(x1 * 2.0)) * Float64(3.0 + t_3)))) - Float64(t_0 * Float64(2.0 * x2))))) + Float64(3.0 * Float64(1.0 / Float64(-0.5 / x2))))) t_7 = Float64(3.0 - Float64(2.0 * x2)) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) - x1); elseif (x1 <= -0.064) tmp = t_6; elseif (x1 <= 2.95e-8) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(x1 + Float64(Float64(2.0 * x2) - t_0)) / t_2)) + Float64(Float64(Float64(Float64(t_0 * t_3) + Float64(t_2 * Float64(t_4 + Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)) * t_7)))) - t_5) - x1))); elseif (x1 <= 1.35e+154) tmp = t_6; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 - Float64(4.0 * Float64(x2 * t_7))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = t_0 + (2.0 * x2); t_2 = (x1 * x1) + 1.0; t_3 = (x1 - t_1) / t_2; t_4 = (x1 * x1) * (6.0 + (4.0 * t_3)); t_5 = x1 * (x1 * x1); t_6 = x1 + ((x1 + (t_5 - ((t_2 * (t_4 + ((((t_1 - x1) / t_2) * (x1 * 2.0)) * (3.0 + t_3)))) - (t_0 * (2.0 * x2))))) + (3.0 * (1.0 / (-0.5 / x2)))); t_7 = 3.0 - (2.0 * x2); tmp = 0.0; if (x1 <= -5.6e+102) tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1; elseif (x1 <= -0.064) tmp = t_6; elseif (x1 <= 2.95e-8) tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_2)) + ((((t_0 * t_3) + (t_2 * (t_4 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * t_7)))) - t_5) - x1)); elseif (x1 <= 1.35e+154) tmp = t_6; else tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * t_7)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 - t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(N[(x1 + N[(t$95$5 - N[(N[(t$95$2 * N[(t$95$4 + N[(N[(N[(N[(t$95$1 - x1), $MachinePrecision] / t$95$2), $MachinePrecision] * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(1.0 / N[(-0.5 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, -0.064], t$95$6, If[LessEqual[x1, 2.95e-8], N[(x1 - N[(N[(3.0 * N[(N[(x1 + N[(N[(2.0 * x2), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(t$95$0 * t$95$3), $MachinePrecision] + N[(t$95$2 * N[(t$95$4 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] * t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$5), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$6, N[(x1 + N[(x1 * N[(1.0 - N[(4.0 * N[(x2 * t$95$7), $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{x1 - t_1}{t_2}\\
t_4 := \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_3\right)\\
t_5 := x1 \cdot \left(x1 \cdot x1\right)\\
t_6 := x1 + \left(\left(x1 + \left(t_5 - \left(t_2 \cdot \left(t_4 + \left(\frac{t_1 - x1}{t_2} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(3 + t_3\right)\right) - t_0 \cdot \left(2 \cdot x2\right)\right)\right)\right) + 3 \cdot \frac{1}{\frac{-0.5}{x2}}\right)\\
t_7 := 3 - 2 \cdot x2\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\
\mathbf{elif}\;x1 \leq -0.064:\\
\;\;\;\;t_6\\
\mathbf{elif}\;x1 \leq 2.95 \cdot 10^{-8}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t_0\right)}{t_2} + \left(\left(\left(t_0 \cdot t_3 + t_2 \cdot \left(t_4 + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right) \cdot t_7\right)\right) - t_5\right) - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_6\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot \left(x2 \cdot t_7\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 3.5%
fma-def3.5%
fma-neg3.5%
fma-neg3.5%
metadata-eval3.5%
metadata-eval3.5%
Simplified3.5%
Taylor expanded in x1 around 0 3.5%
Taylor expanded in x2 around 0 26.6%
if -5.60000000000000037e102 < x1 < -0.064000000000000001 or 2.9499999999999999e-8 < x1 < 1.35000000000000003e154Initial program 99.3%
fma-def99.3%
clear-num99.3%
associate--l-99.3%
*-commutative99.3%
*-commutative99.3%
inv-pow99.3%
associate-*r*99.3%
*-commutative99.3%
fma-neg99.3%
pow299.3%
fma-def99.3%
Applied egg-rr99.3%
unpow-199.3%
fma-udef99.3%
unsub-neg99.3%
Simplified99.3%
Taylor expanded in x1 around 0 97.5%
Taylor expanded in x1 around 0 91.6%
if -0.064000000000000001 < x1 < 2.9499999999999999e-8Initial program 98.6%
Taylor expanded in x1 around 0 98.6%
+-commutative98.6%
mul-1-neg98.6%
unsub-neg98.6%
Simplified98.6%
Taylor expanded in x1 around 0 98.6%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 58.6%
Final simplification81.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (- 3.0 (* 2.0 x2)))
(t_3 (* x2 t_2))
(t_4 (* x1 (* x1 3.0)))
(t_5 (+ t_4 (* 2.0 x2)))
(t_6 (/ (- x1 t_5) t_1))
(t_7 (* t_4 t_6))
(t_8 (* (* x1 x1) (+ 6.0 (* 4.0 t_6)))))
(if (<= x1 -5.6e+102)
(- (* x2 (- (* x1 -12.0) 6.0)) x1)
(if (<= x1 -3900.0)
(+
x1
(+
(* 3.0 (/ 1.0 (/ -0.5 x2)))
(+
x1
(-
t_0
(-
t_7
(*
(+ (* (* (/ (- t_5 x1) t_1) (* x1 2.0)) (/ 1.0 x1)) t_8)
(- -1.0 (* x1 x1))))))))
(if (<= x1 2.95e-8)
(-
x1
(+
(* 3.0 (/ (+ x1 (- (* 2.0 x2) t_4)) t_1))
(-
(-
(+ t_7 (* t_1 (+ t_8 (* (* (* x1 2.0) (- (* 2.0 x2) x1)) t_2))))
t_0)
x1)))
(if (<= x1 1.35e+154)
(+
x1
(-
(* 3.0 (/ (- (- t_4 (* 2.0 x2)) x1) t_1))
(- (- (+ t_7 (* t_1 (+ (* 4.0 (* x1 t_3)) t_8))) t_0) x1)))
(+ x1 (* x1 (- 1.0 (* 4.0 t_3))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 - (2.0 * x2);
double t_3 = x2 * t_2;
double t_4 = x1 * (x1 * 3.0);
double t_5 = t_4 + (2.0 * x2);
double t_6 = (x1 - t_5) / t_1;
double t_7 = t_4 * t_6;
double t_8 = (x1 * x1) * (6.0 + (4.0 * t_6));
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1;
} else if (x1 <= -3900.0) {
tmp = x1 + ((3.0 * (1.0 / (-0.5 / x2))) + (x1 + (t_0 - (t_7 - ((((((t_5 - x1) / t_1) * (x1 * 2.0)) * (1.0 / x1)) + t_8) * (-1.0 - (x1 * x1)))))));
} else if (x1 <= 2.95e-8) {
tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_4)) / t_1)) + (((t_7 + (t_1 * (t_8 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * t_2)))) - t_0) - x1));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_1)) - (((t_7 + (t_1 * ((4.0 * (x1 * t_3)) + t_8))) - t_0) - x1));
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * t_3)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: 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) + 1.0d0
t_2 = 3.0d0 - (2.0d0 * x2)
t_3 = x2 * t_2
t_4 = x1 * (x1 * 3.0d0)
t_5 = t_4 + (2.0d0 * x2)
t_6 = (x1 - t_5) / t_1
t_7 = t_4 * t_6
t_8 = (x1 * x1) * (6.0d0 + (4.0d0 * t_6))
if (x1 <= (-5.6d+102)) then
tmp = (x2 * ((x1 * (-12.0d0)) - 6.0d0)) - x1
else if (x1 <= (-3900.0d0)) then
tmp = x1 + ((3.0d0 * (1.0d0 / ((-0.5d0) / x2))) + (x1 + (t_0 - (t_7 - ((((((t_5 - x1) / t_1) * (x1 * 2.0d0)) * (1.0d0 / x1)) + t_8) * ((-1.0d0) - (x1 * x1)))))))
else if (x1 <= 2.95d-8) then
tmp = x1 - ((3.0d0 * ((x1 + ((2.0d0 * x2) - t_4)) / t_1)) + (((t_7 + (t_1 * (t_8 + (((x1 * 2.0d0) * ((2.0d0 * x2) - x1)) * t_2)))) - t_0) - x1))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * (((t_4 - (2.0d0 * x2)) - x1) / t_1)) - (((t_7 + (t_1 * ((4.0d0 * (x1 * t_3)) + t_8))) - t_0) - x1))
else
tmp = x1 + (x1 * (1.0d0 - (4.0d0 * t_3)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 - (2.0 * x2);
double t_3 = x2 * t_2;
double t_4 = x1 * (x1 * 3.0);
double t_5 = t_4 + (2.0 * x2);
double t_6 = (x1 - t_5) / t_1;
double t_7 = t_4 * t_6;
double t_8 = (x1 * x1) * (6.0 + (4.0 * t_6));
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1;
} else if (x1 <= -3900.0) {
tmp = x1 + ((3.0 * (1.0 / (-0.5 / x2))) + (x1 + (t_0 - (t_7 - ((((((t_5 - x1) / t_1) * (x1 * 2.0)) * (1.0 / x1)) + t_8) * (-1.0 - (x1 * x1)))))));
} else if (x1 <= 2.95e-8) {
tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_4)) / t_1)) + (((t_7 + (t_1 * (t_8 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * t_2)))) - t_0) - x1));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_1)) - (((t_7 + (t_1 * ((4.0 * (x1 * t_3)) + t_8))) - t_0) - x1));
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * t_3)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = (x1 * x1) + 1.0 t_2 = 3.0 - (2.0 * x2) t_3 = x2 * t_2 t_4 = x1 * (x1 * 3.0) t_5 = t_4 + (2.0 * x2) t_6 = (x1 - t_5) / t_1 t_7 = t_4 * t_6 t_8 = (x1 * x1) * (6.0 + (4.0 * t_6)) tmp = 0 if x1 <= -5.6e+102: tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1 elif x1 <= -3900.0: tmp = x1 + ((3.0 * (1.0 / (-0.5 / x2))) + (x1 + (t_0 - (t_7 - ((((((t_5 - x1) / t_1) * (x1 * 2.0)) * (1.0 / x1)) + t_8) * (-1.0 - (x1 * x1))))))) elif x1 <= 2.95e-8: tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_4)) / t_1)) + (((t_7 + (t_1 * (t_8 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * t_2)))) - t_0) - x1)) elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_1)) - (((t_7 + (t_1 * ((4.0 * (x1 * t_3)) + t_8))) - t_0) - x1)) else: tmp = x1 + (x1 * (1.0 - (4.0 * t_3))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(3.0 - Float64(2.0 * x2)) t_3 = Float64(x2 * t_2) t_4 = Float64(x1 * Float64(x1 * 3.0)) t_5 = Float64(t_4 + Float64(2.0 * x2)) t_6 = Float64(Float64(x1 - t_5) / t_1) t_7 = Float64(t_4 * t_6) t_8 = Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_6))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) - x1); elseif (x1 <= -3900.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(1.0 / Float64(-0.5 / x2))) + Float64(x1 + Float64(t_0 - Float64(t_7 - Float64(Float64(Float64(Float64(Float64(Float64(t_5 - x1) / t_1) * Float64(x1 * 2.0)) * Float64(1.0 / x1)) + t_8) * Float64(-1.0 - Float64(x1 * x1)))))))); elseif (x1 <= 2.95e-8) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(x1 + Float64(Float64(2.0 * x2) - t_4)) / t_1)) + Float64(Float64(Float64(t_7 + Float64(t_1 * Float64(t_8 + Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)) * t_2)))) - t_0) - x1))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_4 - Float64(2.0 * x2)) - x1) / t_1)) - Float64(Float64(Float64(t_7 + Float64(t_1 * Float64(Float64(4.0 * Float64(x1 * t_3)) + t_8))) - t_0) - x1))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 - Float64(4.0 * t_3)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = (x1 * x1) + 1.0; t_2 = 3.0 - (2.0 * x2); t_3 = x2 * t_2; t_4 = x1 * (x1 * 3.0); t_5 = t_4 + (2.0 * x2); t_6 = (x1 - t_5) / t_1; t_7 = t_4 * t_6; t_8 = (x1 * x1) * (6.0 + (4.0 * t_6)); tmp = 0.0; if (x1 <= -5.6e+102) tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1; elseif (x1 <= -3900.0) tmp = x1 + ((3.0 * (1.0 / (-0.5 / x2))) + (x1 + (t_0 - (t_7 - ((((((t_5 - x1) / t_1) * (x1 * 2.0)) * (1.0 / x1)) + t_8) * (-1.0 - (x1 * x1))))))); elseif (x1 <= 2.95e-8) tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_4)) / t_1)) + (((t_7 + (t_1 * (t_8 + (((x1 * 2.0) * ((2.0 * x2) - x1)) * t_2)))) - t_0) - x1)); elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_1)) - (((t_7 + (t_1 * ((4.0 * (x1 * t_3)) + t_8))) - t_0) - x1)); else tmp = x1 + (x1 * (1.0 - (4.0 * t_3))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x2 * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 - t$95$5), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$4 * t$95$6), $MachinePrecision]}, Block[{t$95$8 = N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, -3900.0], N[(x1 + N[(N[(3.0 * N[(1.0 / N[(-0.5 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$0 - N[(t$95$7 - N[(N[(N[(N[(N[(N[(t$95$5 - x1), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x1), $MachinePrecision]), $MachinePrecision] + t$95$8), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.95e-8], N[(x1 - N[(N[(3.0 * N[(N[(x1 + N[(N[(2.0 * x2), $MachinePrecision] - t$95$4), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t$95$7 + N[(t$95$1 * N[(t$95$8 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$4 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(t$95$7 + N[(t$95$1 * N[(N[(4.0 * N[(x1 * t$95$3), $MachinePrecision]), $MachinePrecision] + t$95$8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 - N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := 3 - 2 \cdot x2\\
t_3 := x2 \cdot t_2\\
t_4 := x1 \cdot \left(x1 \cdot 3\right)\\
t_5 := t_4 + 2 \cdot x2\\
t_6 := \frac{x1 - t_5}{t_1}\\
t_7 := t_4 \cdot t_6\\
t_8 := \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_6\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\
\mathbf{elif}\;x1 \leq -3900:\\
\;\;\;\;x1 + \left(3 \cdot \frac{1}{\frac{-0.5}{x2}} + \left(x1 + \left(t_0 - \left(t_7 - \left(\left(\frac{t_5 - x1}{t_1} \cdot \left(x1 \cdot 2\right)\right) \cdot \frac{1}{x1} + t_8\right) \cdot \left(-1 - x1 \cdot x1\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2.95 \cdot 10^{-8}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t_4\right)}{t_1} + \left(\left(\left(t_7 + t_1 \cdot \left(t_8 + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right) \cdot t_2\right)\right) - t_0\right) - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_4 - 2 \cdot x2\right) - x1}{t_1} - \left(\left(\left(t_7 + t_1 \cdot \left(4 \cdot \left(x1 \cdot t_3\right) + t_8\right)\right) - t_0\right) - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot t_3\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 3.5%
fma-def3.5%
fma-neg3.5%
fma-neg3.5%
metadata-eval3.5%
metadata-eval3.5%
Simplified3.5%
Taylor expanded in x1 around 0 3.5%
Taylor expanded in x2 around 0 26.6%
if -5.60000000000000037e102 < x1 < -3900Initial program 99.2%
fma-def99.2%
clear-num99.2%
associate--l-99.2%
*-commutative99.2%
*-commutative99.2%
inv-pow99.2%
associate-*r*99.2%
*-commutative99.2%
fma-neg99.2%
pow299.2%
fma-def99.2%
Applied egg-rr99.2%
unpow-199.2%
fma-udef99.2%
unsub-neg99.2%
Simplified99.2%
Taylor expanded in x1 around 0 98.9%
Taylor expanded in x1 around inf 93.3%
if -3900 < x1 < 2.9499999999999999e-8Initial program 98.6%
Taylor expanded in x1 around 0 98.6%
+-commutative98.6%
mul-1-neg98.6%
unsub-neg98.6%
Simplified98.6%
Taylor expanded in x1 around 0 98.6%
if 2.9499999999999999e-8 < x1 < 1.35000000000000003e154Initial program 99.4%
Taylor expanded in x1 around 0 72.0%
+-commutative72.0%
mul-1-neg72.0%
unsub-neg72.0%
Simplified72.0%
Taylor expanded in x1 around 0 72.2%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 58.6%
Final simplification78.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* x1 (* x1 x1)))
(t_2 (- (* x2 (- (* x1 -12.0) 6.0)) x1))
(t_3 (* x2 (- 3.0 (* 2.0 x2))))
(t_4 (+ (* x1 x1) 1.0))
(t_5 (/ (- x1 (+ t_0 (* 2.0 x2))) t_4))
(t_6 (* t_4 (+ (* 4.0 (* x1 t_3)) (* (* x1 x1) (+ 6.0 (* 4.0 t_5)))))))
(if (<= x1 -5.6e+102)
t_2
(if (<= x1 -1e-177)
(-
x1
(-
(* 3.0 (/ (+ x1 (- (* 2.0 x2) t_0)) t_4))
(- x1 (- (- t_6 (* t_0 (* 2.0 x2))) t_1))))
(if (<= x1 4.1e-199)
t_2
(if (<= x1 1.35e+154)
(+
x1
(-
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_4))
(- (- (+ (* t_0 t_5) t_6) t_1) x1)))
(+ x1 (* x1 (- 1.0 (* 4.0 t_3))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * (x1 * x1);
double t_2 = (x2 * ((x1 * -12.0) - 6.0)) - x1;
double t_3 = x2 * (3.0 - (2.0 * x2));
double t_4 = (x1 * x1) + 1.0;
double t_5 = (x1 - (t_0 + (2.0 * x2))) / t_4;
double t_6 = t_4 * ((4.0 * (x1 * t_3)) + ((x1 * x1) * (6.0 + (4.0 * t_5))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = t_2;
} else if (x1 <= -1e-177) {
tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_4)) - (x1 - ((t_6 - (t_0 * (2.0 * x2))) - t_1)));
} else if (x1 <= 4.1e-199) {
tmp = t_2;
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_4)) - ((((t_0 * t_5) + t_6) - t_1) - x1));
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * t_3)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = x1 * (x1 * x1)
t_2 = (x2 * ((x1 * (-12.0d0)) - 6.0d0)) - x1
t_3 = x2 * (3.0d0 - (2.0d0 * x2))
t_4 = (x1 * x1) + 1.0d0
t_5 = (x1 - (t_0 + (2.0d0 * x2))) / t_4
t_6 = t_4 * ((4.0d0 * (x1 * t_3)) + ((x1 * x1) * (6.0d0 + (4.0d0 * t_5))))
if (x1 <= (-5.6d+102)) then
tmp = t_2
else if (x1 <= (-1d-177)) then
tmp = x1 - ((3.0d0 * ((x1 + ((2.0d0 * x2) - t_0)) / t_4)) - (x1 - ((t_6 - (t_0 * (2.0d0 * x2))) - t_1)))
else if (x1 <= 4.1d-199) then
tmp = t_2
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_4)) - ((((t_0 * t_5) + t_6) - t_1) - x1))
else
tmp = x1 + (x1 * (1.0d0 - (4.0d0 * t_3)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * (x1 * x1);
double t_2 = (x2 * ((x1 * -12.0) - 6.0)) - x1;
double t_3 = x2 * (3.0 - (2.0 * x2));
double t_4 = (x1 * x1) + 1.0;
double t_5 = (x1 - (t_0 + (2.0 * x2))) / t_4;
double t_6 = t_4 * ((4.0 * (x1 * t_3)) + ((x1 * x1) * (6.0 + (4.0 * t_5))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = t_2;
} else if (x1 <= -1e-177) {
tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_4)) - (x1 - ((t_6 - (t_0 * (2.0 * x2))) - t_1)));
} else if (x1 <= 4.1e-199) {
tmp = t_2;
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_4)) - ((((t_0 * t_5) + t_6) - t_1) - x1));
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * t_3)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = x1 * (x1 * x1) t_2 = (x2 * ((x1 * -12.0) - 6.0)) - x1 t_3 = x2 * (3.0 - (2.0 * x2)) t_4 = (x1 * x1) + 1.0 t_5 = (x1 - (t_0 + (2.0 * x2))) / t_4 t_6 = t_4 * ((4.0 * (x1 * t_3)) + ((x1 * x1) * (6.0 + (4.0 * t_5)))) tmp = 0 if x1 <= -5.6e+102: tmp = t_2 elif x1 <= -1e-177: tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_4)) - (x1 - ((t_6 - (t_0 * (2.0 * x2))) - t_1))) elif x1 <= 4.1e-199: tmp = t_2 elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_4)) - ((((t_0 * t_5) + t_6) - t_1) - x1)) else: tmp = x1 + (x1 * (1.0 - (4.0 * t_3))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) - x1) t_3 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2))) t_4 = Float64(Float64(x1 * x1) + 1.0) t_5 = Float64(Float64(x1 - Float64(t_0 + Float64(2.0 * x2))) / t_4) t_6 = Float64(t_4 * Float64(Float64(4.0 * Float64(x1 * t_3)) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = t_2; elseif (x1 <= -1e-177) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(x1 + Float64(Float64(2.0 * x2) - t_0)) / t_4)) - Float64(x1 - Float64(Float64(t_6 - Float64(t_0 * Float64(2.0 * x2))) - t_1)))); elseif (x1 <= 4.1e-199) tmp = t_2; elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_4)) - Float64(Float64(Float64(Float64(t_0 * t_5) + t_6) - t_1) - x1))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 - Float64(4.0 * t_3)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = x1 * (x1 * x1); t_2 = (x2 * ((x1 * -12.0) - 6.0)) - x1; t_3 = x2 * (3.0 - (2.0 * x2)); t_4 = (x1 * x1) + 1.0; t_5 = (x1 - (t_0 + (2.0 * x2))) / t_4; t_6 = t_4 * ((4.0 * (x1 * t_3)) + ((x1 * x1) * (6.0 + (4.0 * t_5)))); tmp = 0.0; if (x1 <= -5.6e+102) tmp = t_2; elseif (x1 <= -1e-177) tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_4)) - (x1 - ((t_6 - (t_0 * (2.0 * x2))) - t_1))); elseif (x1 <= 4.1e-199) tmp = t_2; elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_4)) - ((((t_0 * t_5) + t_6) - t_1) - x1)); else tmp = x1 + (x1 * (1.0 - (4.0 * t_3))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 - N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$4 * N[(N[(4.0 * N[(x1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], t$95$2, If[LessEqual[x1, -1e-177], N[(x1 - N[(N[(3.0 * N[(N[(x1 + N[(N[(2.0 * x2), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision] - N[(x1 - N[(N[(t$95$6 - N[(t$95$0 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.1e-199], t$95$2, If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(t$95$0 * t$95$5), $MachinePrecision] + t$95$6), $MachinePrecision] - t$95$1), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 - N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\
t_3 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
t_4 := x1 \cdot x1 + 1\\
t_5 := \frac{x1 - \left(t_0 + 2 \cdot x2\right)}{t_4}\\
t_6 := t_4 \cdot \left(4 \cdot \left(x1 \cdot t_3\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_5\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x1 \leq -1 \cdot 10^{-177}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t_0\right)}{t_4} - \left(x1 - \left(\left(t_6 - t_0 \cdot \left(2 \cdot x2\right)\right) - t_1\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.1 \cdot 10^{-199}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_4} - \left(\left(\left(t_0 \cdot t_5 + t_6\right) - t_1\right) - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot t_3\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102 or -9.99999999999999952e-178 < x1 < 4.10000000000000022e-199Initial program 52.7%
Taylor expanded in x1 around 0 39.5%
Taylor expanded in x1 around 0 41.2%
fma-def41.2%
fma-neg41.2%
fma-neg41.2%
metadata-eval41.2%
metadata-eval41.2%
Simplified41.2%
Taylor expanded in x1 around 0 41.2%
Taylor expanded in x2 around 0 62.9%
if -5.60000000000000037e102 < x1 < -9.99999999999999952e-178Initial program 99.2%
Taylor expanded in x1 around 0 96.6%
+-commutative96.6%
mul-1-neg96.6%
unsub-neg96.6%
Simplified96.6%
Taylor expanded in x1 around 0 89.5%
Taylor expanded in x1 around 0 89.6%
if 4.10000000000000022e-199 < x1 < 1.35000000000000003e154Initial program 99.3%
Taylor expanded in x1 around 0 86.3%
+-commutative86.3%
mul-1-neg86.3%
unsub-neg86.3%
Simplified86.3%
Taylor expanded in x1 around 0 79.1%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 58.6%
Final simplification74.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (- (* x2 (- (* x1 -12.0) 6.0)) x1))
(t_2 (* x1 (* x1 x1)))
(t_3 (* x2 (- 3.0 (* 2.0 x2))))
(t_4 (* 4.0 t_3))
(t_5 (* 4.0 (* x1 t_3)))
(t_6 (* x1 (* x1 3.0)))
(t_7 (+ t_6 (* 2.0 x2)))
(t_8 (/ (- x1 t_7) t_0))
(t_9 (* (* x1 x1) (+ 6.0 (* 4.0 t_8)))))
(if (<= x1 -5.6e+102)
t_1
(if (<= x1 -4000.0)
(+
x1
(+
9.0
(+
x1
(+ t_2 (- (* t_6 (/ (- t_7 x1) t_0)) (* t_0 (- t_9 (* x1 2.0))))))))
(if (<= x1 -8e-178)
(- (* x2 -6.0) (* x1 (- t_4 -1.0)))
(if (<= x1 1e-198)
t_1
(if (<= x1 170.0)
(+ x1 (+ (* 3.0 (/ (- (- t_6 (* 2.0 x2)) x1) t_0)) (- x1 t_5)))
(if (<= x1 1.35e+154)
(+
x1
(- 9.0 (- (- (+ (* t_6 t_8) (* t_0 (+ t_5 t_9))) t_2) x1)))
(+ x1 (* x1 (- 1.0 t_4)))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = (x2 * ((x1 * -12.0) - 6.0)) - x1;
double t_2 = x1 * (x1 * x1);
double t_3 = x2 * (3.0 - (2.0 * x2));
double t_4 = 4.0 * t_3;
double t_5 = 4.0 * (x1 * t_3);
double t_6 = x1 * (x1 * 3.0);
double t_7 = t_6 + (2.0 * x2);
double t_8 = (x1 - t_7) / t_0;
double t_9 = (x1 * x1) * (6.0 + (4.0 * t_8));
double tmp;
if (x1 <= -5.6e+102) {
tmp = t_1;
} else if (x1 <= -4000.0) {
tmp = x1 + (9.0 + (x1 + (t_2 + ((t_6 * ((t_7 - x1) / t_0)) - (t_0 * (t_9 - (x1 * 2.0)))))));
} else if (x1 <= -8e-178) {
tmp = (x2 * -6.0) - (x1 * (t_4 - -1.0));
} else if (x1 <= 1e-198) {
tmp = t_1;
} else if (x1 <= 170.0) {
tmp = x1 + ((3.0 * (((t_6 - (2.0 * x2)) - x1) / t_0)) + (x1 - t_5));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (9.0 - ((((t_6 * t_8) + (t_0 * (t_5 + t_9))) - t_2) - x1));
} else {
tmp = x1 + (x1 * (1.0 - t_4));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: 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 = (x2 * ((x1 * (-12.0d0)) - 6.0d0)) - x1
t_2 = x1 * (x1 * x1)
t_3 = x2 * (3.0d0 - (2.0d0 * x2))
t_4 = 4.0d0 * t_3
t_5 = 4.0d0 * (x1 * t_3)
t_6 = x1 * (x1 * 3.0d0)
t_7 = t_6 + (2.0d0 * x2)
t_8 = (x1 - t_7) / t_0
t_9 = (x1 * x1) * (6.0d0 + (4.0d0 * t_8))
if (x1 <= (-5.6d+102)) then
tmp = t_1
else if (x1 <= (-4000.0d0)) then
tmp = x1 + (9.0d0 + (x1 + (t_2 + ((t_6 * ((t_7 - x1) / t_0)) - (t_0 * (t_9 - (x1 * 2.0d0)))))))
else if (x1 <= (-8d-178)) then
tmp = (x2 * (-6.0d0)) - (x1 * (t_4 - (-1.0d0)))
else if (x1 <= 1d-198) then
tmp = t_1
else if (x1 <= 170.0d0) then
tmp = x1 + ((3.0d0 * (((t_6 - (2.0d0 * x2)) - x1) / t_0)) + (x1 - t_5))
else if (x1 <= 1.35d+154) then
tmp = x1 + (9.0d0 - ((((t_6 * t_8) + (t_0 * (t_5 + t_9))) - t_2) - x1))
else
tmp = x1 + (x1 * (1.0d0 - t_4))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = (x2 * ((x1 * -12.0) - 6.0)) - x1;
double t_2 = x1 * (x1 * x1);
double t_3 = x2 * (3.0 - (2.0 * x2));
double t_4 = 4.0 * t_3;
double t_5 = 4.0 * (x1 * t_3);
double t_6 = x1 * (x1 * 3.0);
double t_7 = t_6 + (2.0 * x2);
double t_8 = (x1 - t_7) / t_0;
double t_9 = (x1 * x1) * (6.0 + (4.0 * t_8));
double tmp;
if (x1 <= -5.6e+102) {
tmp = t_1;
} else if (x1 <= -4000.0) {
tmp = x1 + (9.0 + (x1 + (t_2 + ((t_6 * ((t_7 - x1) / t_0)) - (t_0 * (t_9 - (x1 * 2.0)))))));
} else if (x1 <= -8e-178) {
tmp = (x2 * -6.0) - (x1 * (t_4 - -1.0));
} else if (x1 <= 1e-198) {
tmp = t_1;
} else if (x1 <= 170.0) {
tmp = x1 + ((3.0 * (((t_6 - (2.0 * x2)) - x1) / t_0)) + (x1 - t_5));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (9.0 - ((((t_6 * t_8) + (t_0 * (t_5 + t_9))) - t_2) - x1));
} else {
tmp = x1 + (x1 * (1.0 - t_4));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = (x2 * ((x1 * -12.0) - 6.0)) - x1 t_2 = x1 * (x1 * x1) t_3 = x2 * (3.0 - (2.0 * x2)) t_4 = 4.0 * t_3 t_5 = 4.0 * (x1 * t_3) t_6 = x1 * (x1 * 3.0) t_7 = t_6 + (2.0 * x2) t_8 = (x1 - t_7) / t_0 t_9 = (x1 * x1) * (6.0 + (4.0 * t_8)) tmp = 0 if x1 <= -5.6e+102: tmp = t_1 elif x1 <= -4000.0: tmp = x1 + (9.0 + (x1 + (t_2 + ((t_6 * ((t_7 - x1) / t_0)) - (t_0 * (t_9 - (x1 * 2.0))))))) elif x1 <= -8e-178: tmp = (x2 * -6.0) - (x1 * (t_4 - -1.0)) elif x1 <= 1e-198: tmp = t_1 elif x1 <= 170.0: tmp = x1 + ((3.0 * (((t_6 - (2.0 * x2)) - x1) / t_0)) + (x1 - t_5)) elif x1 <= 1.35e+154: tmp = x1 + (9.0 - ((((t_6 * t_8) + (t_0 * (t_5 + t_9))) - t_2) - x1)) else: tmp = x1 + (x1 * (1.0 - t_4)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) - x1) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2))) t_4 = Float64(4.0 * t_3) t_5 = Float64(4.0 * Float64(x1 * t_3)) t_6 = Float64(x1 * Float64(x1 * 3.0)) t_7 = Float64(t_6 + Float64(2.0 * x2)) t_8 = Float64(Float64(x1 - t_7) / t_0) t_9 = Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_8))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = t_1; elseif (x1 <= -4000.0) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_2 + Float64(Float64(t_6 * Float64(Float64(t_7 - x1) / t_0)) - Float64(t_0 * Float64(t_9 - Float64(x1 * 2.0)))))))); elseif (x1 <= -8e-178) tmp = Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(t_4 - -1.0))); elseif (x1 <= 1e-198) tmp = t_1; elseif (x1 <= 170.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_6 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 - t_5))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(9.0 - Float64(Float64(Float64(Float64(t_6 * t_8) + Float64(t_0 * Float64(t_5 + t_9))) - t_2) - x1))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 - t_4))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = (x2 * ((x1 * -12.0) - 6.0)) - x1; t_2 = x1 * (x1 * x1); t_3 = x2 * (3.0 - (2.0 * x2)); t_4 = 4.0 * t_3; t_5 = 4.0 * (x1 * t_3); t_6 = x1 * (x1 * 3.0); t_7 = t_6 + (2.0 * x2); t_8 = (x1 - t_7) / t_0; t_9 = (x1 * x1) * (6.0 + (4.0 * t_8)); tmp = 0.0; if (x1 <= -5.6e+102) tmp = t_1; elseif (x1 <= -4000.0) tmp = x1 + (9.0 + (x1 + (t_2 + ((t_6 * ((t_7 - x1) / t_0)) - (t_0 * (t_9 - (x1 * 2.0))))))); elseif (x1 <= -8e-178) tmp = (x2 * -6.0) - (x1 * (t_4 - -1.0)); elseif (x1 <= 1e-198) tmp = t_1; elseif (x1 <= 170.0) tmp = x1 + ((3.0 * (((t_6 - (2.0 * x2)) - x1) / t_0)) + (x1 - t_5)); elseif (x1 <= 1.35e+154) tmp = x1 + (9.0 - ((((t_6 * t_8) + (t_0 * (t_5 + t_9))) - t_2) - x1)); else tmp = x1 + (x1 * (1.0 - t_4)); 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[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(4.0 * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(4.0 * N[(x1 * t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$6 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(N[(x1 - t$95$7), $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, -5.6e+102], t$95$1, If[LessEqual[x1, -4000.0], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$2 + N[(N[(t$95$6 * N[(N[(t$95$7 - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * N[(t$95$9 - N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -8e-178], N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(t$95$4 - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e-198], t$95$1, If[LessEqual[x1, 170.0], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$6 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 - t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(9.0 - N[(N[(N[(N[(t$95$6 * t$95$8), $MachinePrecision] + N[(t$95$0 * N[(t$95$5 + t$95$9), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 - t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
t_4 := 4 \cdot t_3\\
t_5 := 4 \cdot \left(x1 \cdot t_3\right)\\
t_6 := x1 \cdot \left(x1 \cdot 3\right)\\
t_7 := t_6 + 2 \cdot x2\\
t_8 := \frac{x1 - t_7}{t_0}\\
t_9 := \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t_8\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq -4000:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_2 + \left(t_6 \cdot \frac{t_7 - x1}{t_0} - t_0 \cdot \left(t_9 - x1 \cdot 2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -8 \cdot 10^{-178}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(t_4 - -1\right)\\
\mathbf{elif}\;x1 \leq 10^{-198}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 170:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_6 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 - t_5\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(9 - \left(\left(\left(t_6 \cdot t_8 + t_0 \cdot \left(t_5 + t_9\right)\right) - t_2\right) - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 - t_4\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102 or -7.9999999999999996e-178 < x1 < 9.9999999999999991e-199Initial program 52.7%
Taylor expanded in x1 around 0 39.5%
Taylor expanded in x1 around 0 41.2%
fma-def41.2%
fma-neg41.2%
fma-neg41.2%
metadata-eval41.2%
metadata-eval41.2%
Simplified41.2%
Taylor expanded in x1 around 0 41.2%
Taylor expanded in x2 around 0 62.9%
if -5.60000000000000037e102 < x1 < -4e3Initial program 99.2%
Taylor expanded in x1 around 0 91.7%
+-commutative91.7%
mul-1-neg91.7%
unsub-neg91.7%
Simplified91.7%
Taylor expanded in x1 around inf 91.7%
Taylor expanded in x1 around inf 91.2%
*-commutative91.2%
Simplified91.2%
if -4e3 < x1 < -7.9999999999999996e-178Initial program 99.1%
Taylor expanded in x1 around 0 90.3%
Taylor expanded in x1 around 0 91.0%
fma-def91.1%
fma-neg91.1%
fma-neg91.1%
metadata-eval91.1%
metadata-eval91.1%
Simplified91.1%
Taylor expanded in x1 around 0 91.0%
if 9.9999999999999991e-199 < x1 < 170Initial program 99.3%
Taylor expanded in x1 around 0 84.6%
if 170 < x1 < 1.35000000000000003e154Initial program 99.4%
Taylor expanded in x1 around 0 73.0%
+-commutative73.0%
mul-1-neg73.0%
unsub-neg73.0%
Simplified73.0%
Taylor expanded in x1 around 0 73.3%
Taylor expanded in x1 around inf 73.3%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 58.6%
Final simplification74.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (- (* x2 (- (* x1 -12.0) 6.0)) x1))
(t_3 (* x2 (- 3.0 (* 2.0 x2))))
(t_4
(-
x1
(-
(* 3.0 (/ (+ x1 (- (* 2.0 x2) t_0)) t_1))
(-
x1
(-
(-
(*
t_1
(+
(* 4.0 (* x1 t_3))
(*
(* x1 x1)
(+ 6.0 (* 4.0 (/ (- x1 (+ t_0 (* 2.0 x2))) t_1))))))
(* t_0 (* 2.0 x2)))
(* x1 (* x1 x1))))))))
(if (<= x1 -5.6e+102)
t_2
(if (<= x1 -6.5e-179)
t_4
(if (<= x1 9e-199)
t_2
(if (<= x1 1.35e+154) t_4 (+ x1 (* x1 (- 1.0 (* 4.0 t_3))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (x2 * ((x1 * -12.0) - 6.0)) - x1;
double t_3 = x2 * (3.0 - (2.0 * x2));
double t_4 = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_1)) - (x1 - (((t_1 * ((4.0 * (x1 * t_3)) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - (t_0 + (2.0 * x2))) / t_1)))))) - (t_0 * (2.0 * x2))) - (x1 * (x1 * x1)))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = t_2;
} else if (x1 <= -6.5e-179) {
tmp = t_4;
} else if (x1 <= 9e-199) {
tmp = t_2;
} else if (x1 <= 1.35e+154) {
tmp = t_4;
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * t_3)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = (x2 * ((x1 * (-12.0d0)) - 6.0d0)) - x1
t_3 = x2 * (3.0d0 - (2.0d0 * x2))
t_4 = x1 - ((3.0d0 * ((x1 + ((2.0d0 * x2) - t_0)) / t_1)) - (x1 - (((t_1 * ((4.0d0 * (x1 * t_3)) + ((x1 * x1) * (6.0d0 + (4.0d0 * ((x1 - (t_0 + (2.0d0 * x2))) / t_1)))))) - (t_0 * (2.0d0 * x2))) - (x1 * (x1 * x1)))))
if (x1 <= (-5.6d+102)) then
tmp = t_2
else if (x1 <= (-6.5d-179)) then
tmp = t_4
else if (x1 <= 9d-199) then
tmp = t_2
else if (x1 <= 1.35d+154) then
tmp = t_4
else
tmp = x1 + (x1 * (1.0d0 - (4.0d0 * t_3)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (x2 * ((x1 * -12.0) - 6.0)) - x1;
double t_3 = x2 * (3.0 - (2.0 * x2));
double t_4 = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_1)) - (x1 - (((t_1 * ((4.0 * (x1 * t_3)) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - (t_0 + (2.0 * x2))) / t_1)))))) - (t_0 * (2.0 * x2))) - (x1 * (x1 * x1)))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = t_2;
} else if (x1 <= -6.5e-179) {
tmp = t_4;
} else if (x1 <= 9e-199) {
tmp = t_2;
} else if (x1 <= 1.35e+154) {
tmp = t_4;
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * t_3)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = (x2 * ((x1 * -12.0) - 6.0)) - x1 t_3 = x2 * (3.0 - (2.0 * x2)) t_4 = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_1)) - (x1 - (((t_1 * ((4.0 * (x1 * t_3)) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - (t_0 + (2.0 * x2))) / t_1)))))) - (t_0 * (2.0 * x2))) - (x1 * (x1 * x1))))) tmp = 0 if x1 <= -5.6e+102: tmp = t_2 elif x1 <= -6.5e-179: tmp = t_4 elif x1 <= 9e-199: tmp = t_2 elif x1 <= 1.35e+154: tmp = t_4 else: tmp = x1 + (x1 * (1.0 - (4.0 * t_3))) 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(x2 * Float64(Float64(x1 * -12.0) - 6.0)) - x1) t_3 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2))) t_4 = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(x1 + Float64(Float64(2.0 * x2) - t_0)) / t_1)) - Float64(x1 - Float64(Float64(Float64(t_1 * Float64(Float64(4.0 * Float64(x1 * t_3)) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(Float64(x1 - Float64(t_0 + Float64(2.0 * x2))) / t_1)))))) - Float64(t_0 * Float64(2.0 * x2))) - Float64(x1 * Float64(x1 * x1)))))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = t_2; elseif (x1 <= -6.5e-179) tmp = t_4; elseif (x1 <= 9e-199) tmp = t_2; elseif (x1 <= 1.35e+154) tmp = t_4; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 - Float64(4.0 * t_3)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = (x2 * ((x1 * -12.0) - 6.0)) - x1; t_3 = x2 * (3.0 - (2.0 * x2)); t_4 = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_0)) / t_1)) - (x1 - (((t_1 * ((4.0 * (x1 * t_3)) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - (t_0 + (2.0 * x2))) / t_1)))))) - (t_0 * (2.0 * x2))) - (x1 * (x1 * x1))))); tmp = 0.0; if (x1 <= -5.6e+102) tmp = t_2; elseif (x1 <= -6.5e-179) tmp = t_4; elseif (x1 <= 9e-199) tmp = t_2; elseif (x1 <= 1.35e+154) tmp = t_4; else tmp = x1 + (x1 * (1.0 - (4.0 * t_3))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 - N[(N[(3.0 * N[(N[(x1 + N[(N[(2.0 * x2), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x1 - N[(N[(N[(t$95$1 * N[(N[(4.0 * N[(x1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(N[(x1 - N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], t$95$2, If[LessEqual[x1, -6.5e-179], t$95$4, If[LessEqual[x1, 9e-199], t$95$2, If[LessEqual[x1, 1.35e+154], t$95$4, N[(x1 + N[(x1 * N[(1.0 - N[(4.0 * t$95$3), $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 := x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\
t_3 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
t_4 := x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t_0\right)}{t_1} - \left(x1 - \left(\left(t_1 \cdot \left(4 \cdot \left(x1 \cdot t_3\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - \left(t_0 + 2 \cdot x2\right)}{t_1}\right)\right) - t_0 \cdot \left(2 \cdot x2\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x1 \leq -6.5 \cdot 10^{-179}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x1 \leq 9 \cdot 10^{-199}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot t_3\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102 or -6.49999999999999996e-179 < x1 < 8.99999999999999995e-199Initial program 52.7%
Taylor expanded in x1 around 0 39.5%
Taylor expanded in x1 around 0 41.2%
fma-def41.2%
fma-neg41.2%
fma-neg41.2%
metadata-eval41.2%
metadata-eval41.2%
Simplified41.2%
Taylor expanded in x1 around 0 41.2%
Taylor expanded in x2 around 0 62.9%
if -5.60000000000000037e102 < x1 < -6.49999999999999996e-179 or 8.99999999999999995e-199 < x1 < 1.35000000000000003e154Initial program 99.3%
Taylor expanded in x1 around 0 90.8%
+-commutative90.8%
mul-1-neg90.8%
unsub-neg90.8%
Simplified90.8%
Taylor expanded in x1 around 0 83.6%
Taylor expanded in x1 around 0 83.0%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 58.6%
Final simplification73.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x2 (- 3.0 (* 2.0 x2))))
(t_2 (* 4.0 t_1))
(t_3 (- (* x2 (- (* x1 -12.0) 6.0)) x1))
(t_4 (* x1 (* x1 3.0)))
(t_5 (+ t_4 (* 2.0 x2)))
(t_6
(+
x1
(+
9.0
(+
x1
(+
(* x1 (* x1 x1))
(-
(* t_4 (/ (- t_5 x1) t_0))
(*
t_0
(-
(* (* x1 x1) (+ 6.0 (* 4.0 (/ (- x1 t_5) t_0))))
(* x1 2.0))))))))))
(if (<= x1 -5.6e+102)
t_3
(if (<= x1 -4000.0)
t_6
(if (<= x1 -1.8e-175)
(- (* x2 -6.0) (* x1 (- t_2 -1.0)))
(if (<= x1 7e-199)
t_3
(if (<= x1 3.8e+47)
(+
x1
(+
(* 3.0 (/ (- (- t_4 (* 2.0 x2)) x1) t_0))
(- x1 (* 4.0 (* x1 t_1)))))
(if (<= x1 1.35e+154) t_6 (+ x1 (* x1 (- 1.0 t_2)))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x2 * (3.0 - (2.0 * x2));
double t_2 = 4.0 * t_1;
double t_3 = (x2 * ((x1 * -12.0) - 6.0)) - x1;
double t_4 = x1 * (x1 * 3.0);
double t_5 = t_4 + (2.0 * x2);
double t_6 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_4 * ((t_5 - x1) / t_0)) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * ((x1 - t_5) / t_0)))) - (x1 * 2.0)))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = t_3;
} else if (x1 <= -4000.0) {
tmp = t_6;
} else if (x1 <= -1.8e-175) {
tmp = (x2 * -6.0) - (x1 * (t_2 - -1.0));
} else if (x1 <= 7e-199) {
tmp = t_3;
} else if (x1 <= 3.8e+47) {
tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_0)) + (x1 - (4.0 * (x1 * t_1))));
} else if (x1 <= 1.35e+154) {
tmp = t_6;
} else {
tmp = x1 + (x1 * (1.0 - t_2));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x2 * (3.0d0 - (2.0d0 * x2))
t_2 = 4.0d0 * t_1
t_3 = (x2 * ((x1 * (-12.0d0)) - 6.0d0)) - x1
t_4 = x1 * (x1 * 3.0d0)
t_5 = t_4 + (2.0d0 * x2)
t_6 = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) + ((t_4 * ((t_5 - x1) / t_0)) - (t_0 * (((x1 * x1) * (6.0d0 + (4.0d0 * ((x1 - t_5) / t_0)))) - (x1 * 2.0d0)))))))
if (x1 <= (-5.6d+102)) then
tmp = t_3
else if (x1 <= (-4000.0d0)) then
tmp = t_6
else if (x1 <= (-1.8d-175)) then
tmp = (x2 * (-6.0d0)) - (x1 * (t_2 - (-1.0d0)))
else if (x1 <= 7d-199) then
tmp = t_3
else if (x1 <= 3.8d+47) then
tmp = x1 + ((3.0d0 * (((t_4 - (2.0d0 * x2)) - x1) / t_0)) + (x1 - (4.0d0 * (x1 * t_1))))
else if (x1 <= 1.35d+154) then
tmp = t_6
else
tmp = x1 + (x1 * (1.0d0 - t_2))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x2 * (3.0 - (2.0 * x2));
double t_2 = 4.0 * t_1;
double t_3 = (x2 * ((x1 * -12.0) - 6.0)) - x1;
double t_4 = x1 * (x1 * 3.0);
double t_5 = t_4 + (2.0 * x2);
double t_6 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_4 * ((t_5 - x1) / t_0)) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * ((x1 - t_5) / t_0)))) - (x1 * 2.0)))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = t_3;
} else if (x1 <= -4000.0) {
tmp = t_6;
} else if (x1 <= -1.8e-175) {
tmp = (x2 * -6.0) - (x1 * (t_2 - -1.0));
} else if (x1 <= 7e-199) {
tmp = t_3;
} else if (x1 <= 3.8e+47) {
tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_0)) + (x1 - (4.0 * (x1 * t_1))));
} else if (x1 <= 1.35e+154) {
tmp = t_6;
} else {
tmp = x1 + (x1 * (1.0 - t_2));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x2 * (3.0 - (2.0 * x2)) t_2 = 4.0 * t_1 t_3 = (x2 * ((x1 * -12.0) - 6.0)) - x1 t_4 = x1 * (x1 * 3.0) t_5 = t_4 + (2.0 * x2) t_6 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_4 * ((t_5 - x1) / t_0)) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * ((x1 - t_5) / t_0)))) - (x1 * 2.0))))))) tmp = 0 if x1 <= -5.6e+102: tmp = t_3 elif x1 <= -4000.0: tmp = t_6 elif x1 <= -1.8e-175: tmp = (x2 * -6.0) - (x1 * (t_2 - -1.0)) elif x1 <= 7e-199: tmp = t_3 elif x1 <= 3.8e+47: tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_0)) + (x1 - (4.0 * (x1 * t_1)))) elif x1 <= 1.35e+154: tmp = t_6 else: tmp = x1 + (x1 * (1.0 - t_2)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x2 * Float64(3.0 - Float64(2.0 * x2))) t_2 = Float64(4.0 * t_1) t_3 = Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) - x1) t_4 = Float64(x1 * Float64(x1 * 3.0)) t_5 = Float64(t_4 + Float64(2.0 * x2)) t_6 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_4 * Float64(Float64(t_5 - x1) / t_0)) - Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(Float64(x1 - t_5) / t_0)))) - Float64(x1 * 2.0)))))))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = t_3; elseif (x1 <= -4000.0) tmp = t_6; elseif (x1 <= -1.8e-175) tmp = Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(t_2 - -1.0))); elseif (x1 <= 7e-199) tmp = t_3; elseif (x1 <= 3.8e+47) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_4 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 - Float64(4.0 * Float64(x1 * t_1))))); elseif (x1 <= 1.35e+154) tmp = t_6; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 - t_2))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x2 * (3.0 - (2.0 * x2)); t_2 = 4.0 * t_1; t_3 = (x2 * ((x1 * -12.0) - 6.0)) - x1; t_4 = x1 * (x1 * 3.0); t_5 = t_4 + (2.0 * x2); t_6 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_4 * ((t_5 - x1) / t_0)) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * ((x1 - t_5) / t_0)))) - (x1 * 2.0))))))); tmp = 0.0; if (x1 <= -5.6e+102) tmp = t_3; elseif (x1 <= -4000.0) tmp = t_6; elseif (x1 <= -1.8e-175) tmp = (x2 * -6.0) - (x1 * (t_2 - -1.0)); elseif (x1 <= 7e-199) tmp = t_3; elseif (x1 <= 3.8e+47) tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_0)) + (x1 - (4.0 * (x1 * t_1)))); elseif (x1 <= 1.35e+154) tmp = t_6; else tmp = x1 + (x1 * (1.0 - t_2)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(9.0 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$4 * N[(N[(t$95$5 - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(N[(x1 - t$95$5), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], t$95$3, If[LessEqual[x1, -4000.0], t$95$6, If[LessEqual[x1, -1.8e-175], N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(t$95$2 - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 7e-199], t$95$3, If[LessEqual[x1, 3.8e+47], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$4 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 - N[(4.0 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$6, N[(x1 + N[(x1 * N[(1.0 - t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
t_2 := 4 \cdot t_1\\
t_3 := x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\
t_4 := x1 \cdot \left(x1 \cdot 3\right)\\
t_5 := t_4 + 2 \cdot x2\\
t_6 := x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_4 \cdot \frac{t_5 - x1}{t_0} - t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - t_5}{t_0}\right) - x1 \cdot 2\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x1 \leq -4000:\\
\;\;\;\;t_6\\
\mathbf{elif}\;x1 \leq -1.8 \cdot 10^{-175}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(t_2 - -1\right)\\
\mathbf{elif}\;x1 \leq 7 \cdot 10^{-199}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x1 \leq 3.8 \cdot 10^{+47}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_4 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 - 4 \cdot \left(x1 \cdot t_1\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_6\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 - t_2\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102 or -1.8e-175 < x1 < 6.9999999999999998e-199Initial program 52.7%
Taylor expanded in x1 around 0 39.5%
Taylor expanded in x1 around 0 41.2%
fma-def41.2%
fma-neg41.2%
fma-neg41.2%
metadata-eval41.2%
metadata-eval41.2%
Simplified41.2%
Taylor expanded in x1 around 0 41.2%
Taylor expanded in x2 around 0 62.9%
if -5.60000000000000037e102 < x1 < -4e3 or 3.8000000000000003e47 < x1 < 1.35000000000000003e154Initial program 99.5%
Taylor expanded in x1 around 0 91.2%
+-commutative91.2%
mul-1-neg91.2%
unsub-neg91.2%
Simplified91.2%
Taylor expanded in x1 around inf 91.2%
Taylor expanded in x1 around inf 95.6%
*-commutative95.6%
Simplified95.6%
if -4e3 < x1 < -1.8e-175Initial program 99.1%
Taylor expanded in x1 around 0 90.3%
Taylor expanded in x1 around 0 91.0%
fma-def91.1%
fma-neg91.1%
fma-neg91.1%
metadata-eval91.1%
metadata-eval91.1%
Simplified91.1%
Taylor expanded in x1 around 0 91.0%
if 6.9999999999999998e-199 < x1 < 3.8000000000000003e47Initial program 99.2%
Taylor expanded in x1 around 0 71.0%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 58.6%
Final simplification74.3%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -6.3e+84) (and (not (<= x1 -6.2e-178)) (<= x1 1.15e-199))) (- (* x2 (- (* x1 -12.0) 6.0)) x1) (- (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- 3.0 (* 2.0 x2)))) -1.0)))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -6.3e+84) || (!(x1 <= -6.2e-178) && (x1 <= 1.15e-199))) {
tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1;
} else {
tmp = (x2 * -6.0) - (x1 * ((4.0 * (x2 * (3.0 - (2.0 * x2)))) - -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-6.3d+84)) .or. (.not. (x1 <= (-6.2d-178))) .and. (x1 <= 1.15d-199)) then
tmp = (x2 * ((x1 * (-12.0d0)) - 6.0d0)) - x1
else
tmp = (x2 * (-6.0d0)) - (x1 * ((4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2)))) - (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -6.3e+84) || (!(x1 <= -6.2e-178) && (x1 <= 1.15e-199))) {
tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1;
} else {
tmp = (x2 * -6.0) - (x1 * ((4.0 * (x2 * (3.0 - (2.0 * x2)))) - -1.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -6.3e+84) or (not (x1 <= -6.2e-178) and (x1 <= 1.15e-199)): tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1 else: tmp = (x2 * -6.0) - (x1 * ((4.0 * (x2 * (3.0 - (2.0 * x2)))) - -1.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -6.3e+84) || (!(x1 <= -6.2e-178) && (x1 <= 1.15e-199))) tmp = Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) - x1); else tmp = Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))) - -1.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -6.3e+84) || (~((x1 <= -6.2e-178)) && (x1 <= 1.15e-199))) tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1; else tmp = (x2 * -6.0) - (x1 * ((4.0 * (x2 * (3.0 - (2.0 * x2)))) - -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -6.3e+84], And[N[Not[LessEqual[x1, -6.2e-178]], $MachinePrecision], LessEqual[x1, 1.15e-199]]], N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -6.3 \cdot 10^{+84} \lor \neg \left(x1 \leq -6.2 \cdot 10^{-178}\right) \land x1 \leq 1.15 \cdot 10^{-199}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - -1\right)\\
\end{array}
\end{array}
if x1 < -6.30000000000000013e84 or -6.1999999999999999e-178 < x1 < 1.1500000000000001e-199Initial program 53.7%
Taylor expanded in x1 around 0 38.6%
Taylor expanded in x1 around 0 40.3%
fma-def40.4%
fma-neg40.4%
fma-neg40.4%
metadata-eval40.4%
metadata-eval40.4%
Simplified40.4%
Taylor expanded in x1 around 0 40.3%
Taylor expanded in x2 around 0 61.6%
if -6.30000000000000013e84 < x1 < -6.1999999999999999e-178 or 1.1500000000000001e-199 < x1 Initial program 83.2%
Taylor expanded in x1 around 0 50.4%
Taylor expanded in x1 around 0 59.5%
fma-def59.6%
fma-neg59.6%
fma-neg59.6%
metadata-eval59.6%
metadata-eval59.6%
Simplified59.6%
Taylor expanded in x1 around 0 59.5%
Final simplification60.3%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -2.8e+87) (and (not (<= x1 -1.45e-99)) (<= x1 1.02e-123))) (- (* x2 (- (* x1 -12.0) 6.0)) x1) (* x1 (+ -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.8e+87) || (!(x1 <= -1.45e-99) && (x1 <= 1.02e-123))) {
tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1;
} else {
tmp = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-2.8d+87)) .or. (.not. (x1 <= (-1.45d-99))) .and. (x1 <= 1.02d-123)) then
tmp = (x2 * ((x1 * (-12.0d0)) - 6.0d0)) - x1
else
tmp = x1 * ((-1.0d0) + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.8e+87) || (!(x1 <= -1.45e-99) && (x1 <= 1.02e-123))) {
tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1;
} else {
tmp = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -2.8e+87) or (not (x1 <= -1.45e-99) and (x1 <= 1.02e-123)): tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1 else: tmp = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -2.8e+87) || (!(x1 <= -1.45e-99) && (x1 <= 1.02e-123))) tmp = Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) - x1); else tmp = Float64(x1 * Float64(-1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -2.8e+87) || (~((x1 <= -1.45e-99)) && (x1 <= 1.02e-123))) tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1; else tmp = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -2.8e+87], And[N[Not[LessEqual[x1, -1.45e-99]], $MachinePrecision], LessEqual[x1, 1.02e-123]]], N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(x1 * N[(-1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.8 \cdot 10^{+87} \lor \neg \left(x1 \leq -1.45 \cdot 10^{-99}\right) \land x1 \leq 1.02 \cdot 10^{-123}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.80000000000000015e87 or -1.44999999999999993e-99 < x1 < 1.02e-123Initial program 66.9%
Taylor expanded in x1 around 0 53.1%
Taylor expanded in x1 around 0 54.5%
fma-def54.5%
fma-neg54.5%
fma-neg54.5%
metadata-eval54.5%
metadata-eval54.5%
Simplified54.5%
Taylor expanded in x1 around 0 54.5%
Taylor expanded in x2 around 0 67.4%
if -2.80000000000000015e87 < x1 < -1.44999999999999993e-99 or 1.02e-123 < x1 Initial program 78.8%
Taylor expanded in x1 around 0 39.8%
Taylor expanded in x1 around 0 51.3%
fma-def51.3%
fma-neg51.3%
fma-neg51.3%
metadata-eval51.3%
metadata-eval51.3%
Simplified51.3%
Taylor expanded in x1 around inf 45.3%
Final simplification56.1%
(FPCore (x1 x2) :precision binary64 (if (<= x2 -1.65e-169) (* x2 -6.0) (if (<= x2 5.8e-144) (- x1) (+ x1 (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -1.65e-169) {
tmp = x2 * -6.0;
} else if (x2 <= 5.8e-144) {
tmp = -x1;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x2 <= (-1.65d-169)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 5.8d-144) then
tmp = -x1
else
tmp = x1 + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= -1.65e-169) {
tmp = x2 * -6.0;
} else if (x2 <= 5.8e-144) {
tmp = -x1;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -1.65e-169: tmp = x2 * -6.0 elif x2 <= 5.8e-144: tmp = -x1 else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -1.65e-169) tmp = Float64(x2 * -6.0); elseif (x2 <= 5.8e-144) tmp = Float64(-x1); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= -1.65e-169) tmp = x2 * -6.0; elseif (x2 <= 5.8e-144) tmp = -x1; else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -1.65e-169], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 5.8e-144], (-x1), N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.65 \cdot 10^{-169}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 5.8 \cdot 10^{-144}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -1.65000000000000013e-169Initial program 76.0%
Taylor expanded in x1 around 0 45.8%
Taylor expanded in x1 around 0 35.8%
*-commutative35.8%
Simplified35.8%
Taylor expanded in x1 around 0 36.0%
if -1.65000000000000013e-169 < x2 < 5.8000000000000004e-144Initial program 77.6%
Taylor expanded in x1 around 0 50.5%
Taylor expanded in x1 around 0 51.8%
fma-def51.8%
fma-neg51.8%
fma-neg51.8%
metadata-eval51.8%
metadata-eval51.8%
Simplified51.8%
Taylor expanded in x2 around 0 47.6%
distribute-rgt1-in47.6%
metadata-eval47.6%
neg-mul-147.6%
Simplified47.6%
if 5.8000000000000004e-144 < x2 Initial program 67.4%
Taylor expanded in x1 around 0 44.3%
Taylor expanded in x1 around 0 32.7%
*-commutative32.7%
Simplified32.7%
Final simplification37.4%
(FPCore (x1 x2) :precision binary64 (- (* x2 (- (* x1 -12.0) 6.0)) x1))
double code(double x1, double x2) {
return (x2 * ((x1 * -12.0) - 6.0)) - x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x2 * ((x1 * (-12.0d0)) - 6.0d0)) - x1
end function
public static double code(double x1, double x2) {
return (x2 * ((x1 * -12.0) - 6.0)) - x1;
}
def code(x1, x2): return (x2 * ((x1 * -12.0) - 6.0)) - x1
function code(x1, x2) return Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) - x1) end
function tmp = code(x1, x2) tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1; end
code[x1_, x2_] := N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot \left(x1 \cdot -12 - 6\right) - x1
\end{array}
Initial program 73.0%
Taylor expanded in x1 around 0 46.3%
Taylor expanded in x1 around 0 52.9%
fma-def52.9%
fma-neg52.9%
fma-neg52.9%
metadata-eval52.9%
metadata-eval52.9%
Simplified52.9%
Taylor expanded in x1 around 0 52.9%
Taylor expanded in x2 around 0 45.2%
Final simplification45.2%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -4e-168) (not (<= x2 4.3e-131))) (* x2 -6.0) (- x1)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -4e-168) || !(x2 <= 4.3e-131)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-4d-168)) .or. (.not. (x2 <= 4.3d-131))) then
tmp = x2 * (-6.0d0)
else
tmp = -x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -4e-168) || !(x2 <= 4.3e-131)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -4e-168) or not (x2 <= 4.3e-131): tmp = x2 * -6.0 else: tmp = -x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -4e-168) || !(x2 <= 4.3e-131)) tmp = Float64(x2 * -6.0); else tmp = Float64(-x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -4e-168) || ~((x2 <= 4.3e-131))) tmp = x2 * -6.0; else tmp = -x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -4e-168], N[Not[LessEqual[x2, 4.3e-131]], $MachinePrecision]], N[(x2 * -6.0), $MachinePrecision], (-x1)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -4 \cdot 10^{-168} \lor \neg \left(x2 \leq 4.3 \cdot 10^{-131}\right):\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;-x1\\
\end{array}
\end{array}
if x2 < -4.0000000000000002e-168 or 4.30000000000000019e-131 < x2 Initial program 72.1%
Taylor expanded in x1 around 0 45.7%
Taylor expanded in x1 around 0 34.6%
*-commutative34.6%
Simplified34.6%
Taylor expanded in x1 around 0 34.4%
if -4.0000000000000002e-168 < x2 < 4.30000000000000019e-131Initial program 75.5%
Taylor expanded in x1 around 0 48.2%
Taylor expanded in x1 around 0 49.5%
fma-def49.5%
fma-neg49.5%
fma-neg49.5%
metadata-eval49.5%
metadata-eval49.5%
Simplified49.5%
Taylor expanded in x2 around 0 45.5%
distribute-rgt1-in45.5%
metadata-eval45.5%
neg-mul-145.5%
Simplified45.5%
Final simplification37.1%
(FPCore (x1 x2) :precision binary64 (- (* x2 -6.0) x1))
double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x2 * (-6.0d0)) - x1
end function
public static double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
def code(x1, x2): return (x2 * -6.0) - x1
function code(x1, x2) return Float64(Float64(x2 * -6.0) - x1) end
function tmp = code(x1, x2) tmp = (x2 * -6.0) - x1; end
code[x1_, x2_] := N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6 - x1
\end{array}
Initial program 73.0%
Taylor expanded in x1 around 0 46.3%
Taylor expanded in x1 around 0 52.9%
fma-def52.9%
fma-neg52.9%
fma-neg52.9%
metadata-eval52.9%
metadata-eval52.9%
Simplified52.9%
Taylor expanded in x1 around 0 52.9%
Taylor expanded in x2 around 0 39.7%
mul-1-neg39.7%
Simplified39.7%
Final simplification39.7%
(FPCore (x1 x2) :precision binary64 (- x1))
double code(double x1, double x2) {
return -x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = -x1
end function
public static double code(double x1, double x2) {
return -x1;
}
def code(x1, x2): return -x1
function code(x1, x2) return Float64(-x1) end
function tmp = code(x1, x2) tmp = -x1; end
code[x1_, x2_] := (-x1)
\begin{array}{l}
\\
-x1
\end{array}
Initial program 73.0%
Taylor expanded in x1 around 0 46.3%
Taylor expanded in x1 around 0 52.9%
fma-def52.9%
fma-neg52.9%
fma-neg52.9%
metadata-eval52.9%
metadata-eval52.9%
Simplified52.9%
Taylor expanded in x2 around 0 14.4%
distribute-rgt1-in14.4%
metadata-eval14.4%
neg-mul-114.4%
Simplified14.4%
Final simplification14.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 73.0%
Taylor expanded in x1 around 0 46.3%
Taylor expanded in x1 around 0 27.5%
*-commutative27.5%
Simplified27.5%
Taylor expanded in x1 around inf 3.3%
Final simplification3.3%
herbie shell --seed 2023315
(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))))))