
(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 23 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) (fma 2.0 x2 (- x1))))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2)))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_1 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(fma
x1
(* x1 (/ t_0 (/ (fma x1 x1 1.0) 3.0)))
(*
(fma x1 x1 1.0)
(+
x1
(+
(* x1 (* x1 -6.0))
(*
(/ t_0 (fma x1 x1 1.0))
(+
(* x1 (+ -6.0 (/ t_0 (/ (fma x1 x1 1.0) 2.0))))
(* (* x1 x1) 4.0)))))))))
(- (* 6.0 (pow x1 4.0)) x1))))
double code(double x1, double x2) {
double t_0 = fma(x1, (x1 * 3.0), fma(2.0, x2, -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 tmp;
if ((x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), fma(x1, (x1 * (t_0 / (fma(x1, x1, 1.0) / 3.0))), (fma(x1, x1, 1.0) * (x1 + ((x1 * (x1 * -6.0)) + ((t_0 / fma(x1, x1, 1.0)) * ((x1 * (-6.0 + (t_0 / (fma(x1, x1, 1.0) / 2.0)))) + ((x1 * x1) * 4.0))))))));
} else {
tmp = (6.0 * pow(x1, 4.0)) - x1;
}
return tmp;
}
function code(x1, x2) t_0 = fma(x1, Float64(x1 * 3.0), fma(2.0, x2, Float64(-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) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), fma(x1, Float64(x1 * Float64(t_0 / Float64(fma(x1, x1, 1.0) / 3.0))), Float64(fma(x1, x1, 1.0) * Float64(x1 + Float64(Float64(x1 * Float64(x1 * -6.0)) + Float64(Float64(t_0 / fma(x1, x1, 1.0)) * Float64(Float64(x1 * Float64(-6.0 + Float64(t_0 / Float64(fma(x1, x1, 1.0) / 2.0)))) + Float64(Float64(x1 * x1) * 4.0))))))))); else tmp = Float64(Float64(6.0 * (x1 ^ 4.0)) - x1); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2 + (-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]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $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] + 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$2), $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[(x1 * N[(t$95$0 / N[(N[(x1 * x1 + 1.0), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(N[(x1 * N[(x1 * -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(x1 * N[(-6.0 + N[(t$95$0 / N[(N[(x1 * x1 + 1.0), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1, x1 \cdot 3, \mathsf{fma}\left(2, x2, -x1\right)\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}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\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) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\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)}, \mathsf{fma}\left(x1, x1 \cdot \frac{t_0}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{3}}, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \left(x1 \cdot \left(x1 \cdot -6\right) + \frac{t_0}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(x1 \cdot \left(-6 + \frac{t_0}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{2}}\right) + \left(x1 \cdot x1\right) \cdot 4\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot {x1}^{4} - x1\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
+-commutative99.4%
Simplified99.7%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 98.5%
Taylor expanded in x1 around inf 98.5%
+-commutative98.5%
neg-mul-198.5%
unsub-neg98.5%
Simplified98.5%
Final simplification99.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* (* (* x1 2.0) t_3) (- t_3 3.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+ (* t_2 (+ t_4 (* (* 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
(+
(+
x1
(+
t_0
(+
(*
t_2
(+
t_4
(*
(* x1 x1)
(- (* 4.0 (/ (- (+ (* 2.0 x2) (* 3.0 (* x1 x1))) x1) t_2)) 6.0))))
(* (* x1 x1) 9.0))))
(* 3.0 (- (* x2 -2.0) x1))))
(- (* 6.0 (pow x1 4.0)) x1))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = ((x1 * 2.0) * t_3) * (t_3 - 3.0);
double tmp;
if ((x1 + ((x1 + (((t_2 * (t_4 + ((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 + ((x1 + (t_0 + ((t_2 * (t_4 + ((x1 * x1) * ((4.0 * ((((2.0 * x2) + (3.0 * (x1 * x1))) - x1) / t_2)) - 6.0)))) + ((x1 * x1) * 9.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = (6.0 * pow(x1, 4.0)) - x1;
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = ((x1 * 2.0) * t_3) * (t_3 - 3.0);
double tmp;
if ((x1 + ((x1 + (((t_2 * (t_4 + ((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.POSITIVE_INFINITY) {
tmp = x1 + ((x1 + (t_0 + ((t_2 * (t_4 + ((x1 * x1) * ((4.0 * ((((2.0 * x2) + (3.0 * (x1 * x1))) - x1) / t_2)) - 6.0)))) + ((x1 * x1) * 9.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = (6.0 * Math.pow(x1, 4.0)) - x1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2 t_4 = ((x1 * 2.0) * t_3) * (t_3 - 3.0) tmp = 0 if (x1 + ((x1 + (((t_2 * (t_4 + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= math.inf: tmp = x1 + ((x1 + (t_0 + ((t_2 * (t_4 + ((x1 * x1) * ((4.0 * ((((2.0 * x2) + (3.0 * (x1 * x1))) - x1) / t_2)) - 6.0)))) + ((x1 * x1) * 9.0)))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = (6.0 * math.pow(x1, 4.0)) - x1 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(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(t_4 + 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(x1 + Float64(t_0 + Float64(Float64(t_2 * Float64(t_4 + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(Float64(Float64(2.0 * x2) + Float64(3.0 * Float64(x1 * x1))) - x1) / t_2)) - 6.0)))) + Float64(Float64(x1 * x1) * 9.0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(Float64(6.0 * (x1 ^ 4.0)) - x1); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2; t_4 = ((x1 * 2.0) * t_3) * (t_3 - 3.0); tmp = 0.0; if ((x1 + ((x1 + (((t_2 * (t_4 + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = x1 + ((x1 + (t_0 + ((t_2 * (t_4 + ((x1 * x1) * ((4.0 * ((((2.0 * x2) + (3.0 * (x1 * x1))) - x1) / t_2)) - 6.0)))) + ((x1 * x1) * 9.0)))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = (6.0 * (x1 ^ 4.0)) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(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[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(t$95$4 + 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[(x1 + N[(t$95$0 + N[(N[(t$95$2 * N[(t$95$4 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(N[(2.0 * x2), $MachinePrecision] + N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
t_4 := \left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(t_3 - 3\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(t_4 + \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(x1 + \left(t_0 + \left(t_2 \cdot \left(t_4 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(2 \cdot x2 + 3 \cdot \left(x1 \cdot x1\right)\right) - x1}{t_2} - 6\right)\right) + \left(x1 \cdot x1\right) \cdot 9\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot {x1}^{4} - x1\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
Taylor expanded in x1 around 0 98.6%
Taylor expanded in x1 around 0 98.6%
unpow298.6%
Simplified98.6%
Taylor expanded in x1 around inf 99.4%
*-commutative33.3%
unpow233.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 0 0.0%
Taylor expanded in x1 around inf 98.5%
Taylor expanded in x1 around inf 98.5%
+-commutative98.5%
neg-mul-198.5%
unsub-neg98.5%
Simplified98.5%
Final simplification99.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (- (* x1 (* x1 9.0)) x1))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* (* x1 x1) 9.0)
(*
t_2
(+
(* (* x1 x1) (- (* t_3 4.0) 6.0))
(*
(* (* x1 2.0) t_3)
(+
(* 2.0 (/ x2 (* x1 x1)))
(- (/ -1.0 x1) (/ 3.0 (* x1 x1))))))))))))))
(if (<= x1 -1.8e+108)
t_1
(if (<= x1 -0.7)
t_4
(if (<= x1 0.33)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))
(+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
(if (<= x1 2e+153) t_4 t_1))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * (x1 * 9.0)) - x1;
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + (((x1 * x1) * 9.0) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (((x1 * 2.0) * t_3) * ((2.0 * (x2 / (x1 * x1))) + ((-1.0 / x1) - (3.0 / (x1 * x1)))))))))));
double tmp;
if (x1 <= -1.8e+108) {
tmp = t_1;
} else if (x1 <= -0.7) {
tmp = t_4;
} else if (x1 <= 0.33) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 2e+153) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * (x1 * 9.0d0)) - x1
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_0 + (2.0d0 * x2)) - x1) / t_2
t_4 = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + ((x1 * (x1 * x1)) + (((x1 * x1) * 9.0d0) + (t_2 * (((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * t_3) * ((2.0d0 * (x2 / (x1 * x1))) + (((-1.0d0) / x1) - (3.0d0 / (x1 * x1)))))))))))
if (x1 <= (-1.8d+108)) then
tmp = t_1
else if (x1 <= (-0.7d0)) then
tmp = t_4
else if (x1 <= 0.33d0) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
else if (x1 <= 2d+153) then
tmp = t_4
else
tmp = t_1
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 * 9.0)) - x1;
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + (((x1 * x1) * 9.0) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (((x1 * 2.0) * t_3) * ((2.0 * (x2 / (x1 * x1))) + ((-1.0 / x1) - (3.0 / (x1 * x1)))))))))));
double tmp;
if (x1 <= -1.8e+108) {
tmp = t_1;
} else if (x1 <= -0.7) {
tmp = t_4;
} else if (x1 <= 0.33) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 2e+153) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * (x1 * 9.0)) - x1 t_2 = (x1 * x1) + 1.0 t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2 t_4 = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + (((x1 * x1) * 9.0) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (((x1 * 2.0) * t_3) * ((2.0 * (x2 / (x1 * x1))) + ((-1.0 / x1) - (3.0 / (x1 * x1))))))))))) tmp = 0 if x1 <= -1.8e+108: tmp = t_1 elif x1 <= -0.7: tmp = t_4 elif x1 <= 0.33: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) elif x1 <= 2e+153: tmp = t_4 else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * Float64(x1 * 9.0)) - x1) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(Float64(x1 * x1) * 9.0) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(Float64(2.0 * Float64(x2 / Float64(x1 * x1))) + Float64(Float64(-1.0 / x1) - Float64(3.0 / Float64(x1 * x1)))))))))))) tmp = 0.0 if (x1 <= -1.8e+108) tmp = t_1; elseif (x1 <= -0.7) tmp = t_4; elseif (x1 <= 0.33) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); elseif (x1 <= 2e+153) tmp = t_4; else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * (x1 * 9.0)) - x1; t_2 = (x1 * x1) + 1.0; t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2; t_4 = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + (((x1 * x1) * 9.0) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (((x1 * 2.0) * t_3) * ((2.0 * (x2 / (x1 * x1))) + ((-1.0 / x1) - (3.0 / (x1 * x1))))))))))); tmp = 0.0; if (x1 <= -1.8e+108) tmp = t_1; elseif (x1 <= -0.7) tmp = t_4; elseif (x1 <= 0.33) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); elseif (x1 <= 2e+153) tmp = t_4; else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(N[(2.0 * N[(x2 / N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / x1), $MachinePrecision] - N[(3.0 / N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.8e+108], t$95$1, If[LessEqual[x1, -0.7], t$95$4, If[LessEqual[x1, 0.33], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+153], t$95$4, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot \left(x1 \cdot 9\right) - x1\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_2}\\
t_4 := x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(\left(x1 \cdot x1\right) \cdot 9 + t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(2 \cdot \frac{x2}{x1 \cdot x1} + \left(\frac{-1}{x1} - \frac{3}{x1 \cdot x1}\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -1.8 \cdot 10^{+108}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq -0.7:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x1 \leq 0.33:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+153}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x1 < -1.8e108 or 2e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.1%
fma-def0.1%
*-commutative0.1%
unpow20.1%
associate-*r*0.1%
+-rgt-identity0.1%
+-commutative0.1%
unpow20.1%
fma-udef0.1%
+-rgt-identity0.1%
*-commutative0.1%
*-commutative0.1%
associate-*r*0.1%
Simplified0.1%
Taylor expanded in x1 around 0 85.0%
+-commutative85.0%
neg-mul-185.0%
unsub-neg85.0%
*-commutative85.0%
unpow285.0%
associate-*l*85.0%
Simplified85.0%
if -1.8e108 < x1 < -0.69999999999999996 or 0.330000000000000016 < x1 < 2e153Initial program 97.6%
Taylor expanded in x1 around 0 94.6%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
associate-*r/93.3%
metadata-eval93.3%
unpow293.3%
Simplified93.3%
Taylor expanded in x1 around inf 93.1%
*-commutative93.1%
unpow293.1%
Simplified93.1%
if -0.69999999999999996 < x1 < 0.330000000000000016Initial program 99.3%
Taylor expanded in x1 around 0 99.3%
Final simplification94.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (- (* x1 (* x1 9.0)) x1))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0))
(t_4
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_2 t_3)
(*
t_0
(+
(* (* x1 x1) 6.0)
(*
(* (* x1 2.0) t_3)
(+
(* 2.0 (/ x2 (* x1 x1)))
(- (/ -1.0 x1) (/ 3.0 (* x1 x1))))))))))))))
(if (<= x1 -5e+106)
t_1
(if (<= x1 -0.72)
t_4
(if (<= x1 0.36)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
(+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
(if (<= x1 2e+153) t_4 t_1))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = (x1 * (x1 * 9.0)) - x1;
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * 6.0) + (((x1 * 2.0) * t_3) * ((2.0 * (x2 / (x1 * x1))) + ((-1.0 / x1) - (3.0 / (x1 * x1)))))))))));
double tmp;
if (x1 <= -5e+106) {
tmp = t_1;
} else if (x1 <= -0.72) {
tmp = t_4;
} else if (x1 <= 0.36) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 2e+153) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = (x1 * (x1 * 9.0d0)) - x1
t_2 = x1 * (x1 * 3.0d0)
t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
t_4 = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * 6.0d0) + (((x1 * 2.0d0) * t_3) * ((2.0d0 * (x2 / (x1 * x1))) + (((-1.0d0) / x1) - (3.0d0 / (x1 * x1)))))))))))
if (x1 <= (-5d+106)) then
tmp = t_1
else if (x1 <= (-0.72d0)) then
tmp = t_4
else if (x1 <= 0.36d0) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
else if (x1 <= 2d+153) then
tmp = t_4
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = (x1 * (x1 * 9.0)) - x1;
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * 6.0) + (((x1 * 2.0) * t_3) * ((2.0 * (x2 / (x1 * x1))) + ((-1.0 / x1) - (3.0 / (x1 * x1)))))))))));
double tmp;
if (x1 <= -5e+106) {
tmp = t_1;
} else if (x1 <= -0.72) {
tmp = t_4;
} else if (x1 <= 0.36) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 2e+153) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = (x1 * (x1 * 9.0)) - x1 t_2 = x1 * (x1 * 3.0) t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0 t_4 = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * 6.0) + (((x1 * 2.0) * t_3) * ((2.0 * (x2 / (x1 * x1))) + ((-1.0 / x1) - (3.0 / (x1 * x1))))))))))) tmp = 0 if x1 <= -5e+106: tmp = t_1 elif x1 <= -0.72: tmp = t_4 elif x1 <= 0.36: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) elif x1 <= 2e+153: tmp = t_4 else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(Float64(x1 * Float64(x1 * 9.0)) - x1) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) t_4 = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * t_3) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * 6.0) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(Float64(2.0 * Float64(x2 / Float64(x1 * x1))) + Float64(Float64(-1.0 / x1) - Float64(3.0 / Float64(x1 * x1)))))))))))) tmp = 0.0 if (x1 <= -5e+106) tmp = t_1; elseif (x1 <= -0.72) tmp = t_4; elseif (x1 <= 0.36) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); elseif (x1 <= 2e+153) tmp = t_4; else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = (x1 * (x1 * 9.0)) - x1; t_2 = x1 * (x1 * 3.0); t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0; t_4 = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * 6.0) + (((x1 * 2.0) * t_3) * ((2.0 * (x2 / (x1 * x1))) + ((-1.0 / x1) - (3.0 / (x1 * x1))))))))))); tmp = 0.0; if (x1 <= -5e+106) tmp = t_1; elseif (x1 <= -0.72) tmp = t_4; elseif (x1 <= 0.36) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); elseif (x1 <= 2e+153) tmp = t_4; else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * t$95$3), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(N[(2.0 * N[(x2 / N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / x1), $MachinePrecision] - N[(3.0 / N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+106], t$95$1, If[LessEqual[x1, -0.72], t$95$4, If[LessEqual[x1, 0.36], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+153], t$95$4, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 9\right) - x1\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_0}\\
t_4 := x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_2 \cdot t_3 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + \left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(2 \cdot \frac{x2}{x1 \cdot x1} + \left(\frac{-1}{x1} - \frac{3}{x1 \cdot x1}\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+106}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq -0.72:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x1 \leq 0.36:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+153}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x1 < -4.9999999999999998e106 or 2e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.1%
fma-def0.1%
*-commutative0.1%
unpow20.1%
associate-*r*0.1%
+-rgt-identity0.1%
+-commutative0.1%
unpow20.1%
fma-udef0.1%
+-rgt-identity0.1%
*-commutative0.1%
*-commutative0.1%
associate-*r*0.1%
Simplified0.1%
Taylor expanded in x1 around 0 85.0%
+-commutative85.0%
neg-mul-185.0%
unsub-neg85.0%
*-commutative85.0%
unpow285.0%
associate-*l*85.0%
Simplified85.0%
if -4.9999999999999998e106 < x1 < -0.71999999999999997 or 0.35999999999999999 < x1 < 2e153Initial program 97.6%
Taylor expanded in x1 around 0 94.6%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
associate-*r/93.3%
metadata-eval93.3%
unpow293.3%
Simplified93.3%
Taylor expanded in x1 around inf 87.0%
*-commutative66.8%
unpow266.8%
Simplified87.0%
if -0.71999999999999997 < x1 < 0.35999999999999999Initial program 99.3%
Taylor expanded in x1 around 0 99.3%
Final simplification93.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (/ (- (+ (* x1 (* x1 3.0)) (* 2.0 x2)) x1) t_0)))
(if (or (<= x1 -3.6e+108) (not (<= x1 2e+153)))
(- (* x1 (* x1 9.0)) x1)
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_0
(+
(* (* (* x1 2.0) t_1) (- t_1 3.0))
(*
(* x1 x1)
(- (* 4.0 (/ (- (+ (* 2.0 x2) (* 3.0 (* x1 x1))) x1) t_0)) 6.0))))
(* (* x1 x1) 9.0))))
(* 3.0 (- (* x2 -2.0) x1)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_0;
double tmp;
if ((x1 <= -3.6e+108) || !(x1 <= 2e+153)) {
tmp = (x1 * (x1 * 9.0)) - x1;
} else {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * ((((x1 * 2.0) * t_1) * (t_1 - 3.0)) + ((x1 * x1) * ((4.0 * ((((2.0 * x2) + (3.0 * (x1 * x1))) - x1) / t_0)) - 6.0)))) + ((x1 * x1) * 9.0)))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = (((x1 * (x1 * 3.0d0)) + (2.0d0 * x2)) - x1) / t_0
if ((x1 <= (-3.6d+108)) .or. (.not. (x1 <= 2d+153))) then
tmp = (x1 * (x1 * 9.0d0)) - x1
else
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * ((((x1 * 2.0d0) * t_1) * (t_1 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * ((((2.0d0 * x2) + (3.0d0 * (x1 * x1))) - x1) / t_0)) - 6.0d0)))) + ((x1 * x1) * 9.0d0)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_0;
double tmp;
if ((x1 <= -3.6e+108) || !(x1 <= 2e+153)) {
tmp = (x1 * (x1 * 9.0)) - x1;
} else {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * ((((x1 * 2.0) * t_1) * (t_1 - 3.0)) + ((x1 * x1) * ((4.0 * ((((2.0 * x2) + (3.0 * (x1 * x1))) - x1) / t_0)) - 6.0)))) + ((x1 * x1) * 9.0)))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_0 tmp = 0 if (x1 <= -3.6e+108) or not (x1 <= 2e+153): tmp = (x1 * (x1 * 9.0)) - x1 else: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * ((((x1 * 2.0) * t_1) * (t_1 - 3.0)) + ((x1 * x1) * ((4.0 * ((((2.0 * x2) + (3.0 * (x1 * x1))) - x1) / t_0)) - 6.0)))) + ((x1 * x1) * 9.0)))) + (3.0 * ((x2 * -2.0) - x1))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) + Float64(2.0 * x2)) - x1) / t_0) tmp = 0.0 if ((x1 <= -3.6e+108) || !(x1 <= 2e+153)) tmp = Float64(Float64(x1 * Float64(x1 * 9.0)) - x1); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_1) * Float64(t_1 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(Float64(Float64(2.0 * x2) + Float64(3.0 * Float64(x1 * x1))) - x1) / t_0)) - 6.0)))) + Float64(Float64(x1 * x1) * 9.0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_0; tmp = 0.0; if ((x1 <= -3.6e+108) || ~((x1 <= 2e+153))) tmp = (x1 * (x1 * 9.0)) - x1; else tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * ((((x1 * 2.0) * t_1) * (t_1 - 3.0)) + ((x1 * x1) * ((4.0 * ((((2.0 * x2) + (3.0 * (x1 * x1))) - x1) / t_0)) - 6.0)))) + ((x1 * x1) * 9.0)))) + (3.0 * ((x2 * -2.0) - x1))); 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[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[Or[LessEqual[x1, -3.6e+108], N[Not[LessEqual[x1, 2e+153]], $MachinePrecision]], N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(t$95$1 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(N[(2.0 * x2), $MachinePrecision] + N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{t_0}\\
\mathbf{if}\;x1 \leq -3.6 \cdot 10^{+108} \lor \neg \left(x1 \leq 2 \cdot 10^{+153}\right):\\
\;\;\;\;x1 \cdot \left(x1 \cdot 9\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_1\right) \cdot \left(t_1 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(2 \cdot x2 + 3 \cdot \left(x1 \cdot x1\right)\right) - x1}{t_0} - 6\right)\right) + \left(x1 \cdot x1\right) \cdot 9\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\end{array}
\end{array}
if x1 < -3.6e108 or 2e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.1%
fma-def0.1%
*-commutative0.1%
unpow20.1%
associate-*r*0.1%
+-rgt-identity0.1%
+-commutative0.1%
unpow20.1%
fma-udef0.1%
+-rgt-identity0.1%
*-commutative0.1%
*-commutative0.1%
associate-*r*0.1%
Simplified0.1%
Taylor expanded in x1 around 0 85.0%
+-commutative85.0%
neg-mul-185.0%
unsub-neg85.0%
*-commutative85.0%
unpow285.0%
associate-*l*85.0%
Simplified85.0%
if -3.6e108 < x1 < 2e153Initial program 98.9%
Taylor expanded in x1 around 0 98.0%
Taylor expanded in x1 around 0 98.1%
unpow298.1%
Simplified98.1%
Taylor expanded in x1 around inf 98.9%
*-commutative33.1%
unpow233.1%
Simplified98.9%
Final simplification95.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0)))
(if (or (<= x1 -1.28e+107) (not (<= x1 2e+153)))
(- (* x1 (* x1 9.0)) x1)
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_1 t_2)
(*
t_0
(+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0)))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double tmp;
if ((x1 <= -1.28e+107) || !(x1 <= 2e+153)) {
tmp = (x1 * (x1 * 9.0)) - x1;
} else {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = ((t_1 + (2.0d0 * x2)) - x1) / t_0
if ((x1 <= (-1.28d+107)) .or. (.not. (x1 <= 2d+153))) then
tmp = (x1 * (x1 * 9.0d0)) - x1
else
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double tmp;
if ((x1 <= -1.28e+107) || !(x1 <= 2e+153)) {
tmp = (x1 * (x1 * 9.0)) - x1;
} else {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0 tmp = 0 if (x1 <= -1.28e+107) or not (x1 <= 2e+153): tmp = (x1 * (x1 * 9.0)) - x1 else: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) tmp = 0.0 if ((x1 <= -1.28e+107) || !(x1 <= 2e+153)) tmp = Float64(Float64(x1 * Float64(x1 * 9.0)) - x1); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * t_2) + Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0; tmp = 0.0; if ((x1 <= -1.28e+107) || ~((x1 <= 2e+153))) tmp = (x1 * (x1 * 9.0)) - x1; else tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[Or[LessEqual[x1, -1.28e+107], N[Not[LessEqual[x1, 2e+153]], $MachinePrecision]], N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * t$95$2), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0}\\
\mathbf{if}\;x1 \leq -1.28 \cdot 10^{+107} \lor \neg \left(x1 \leq 2 \cdot 10^{+153}\right):\\
\;\;\;\;x1 \cdot \left(x1 \cdot 9\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot t_2 + t_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.2799999999999999e107 or 2e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.1%
fma-def0.1%
*-commutative0.1%
unpow20.1%
associate-*r*0.1%
+-rgt-identity0.1%
+-commutative0.1%
unpow20.1%
fma-udef0.1%
+-rgt-identity0.1%
*-commutative0.1%
*-commutative0.1%
associate-*r*0.1%
Simplified0.1%
Taylor expanded in x1 around 0 85.0%
+-commutative85.0%
neg-mul-185.0%
unsub-neg85.0%
*-commutative85.0%
unpow285.0%
associate-*l*85.0%
Simplified85.0%
if -1.2799999999999999e107 < x1 < 2e153Initial program 98.9%
Taylor expanded in x1 around 0 98.0%
Taylor expanded in x1 around inf 96.4%
*-commutative57.7%
unpow257.7%
Simplified96.4%
Final simplification93.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (- (* x1 (* x1 9.0)) x1))
(t_2 (* x1 (* x1 3.0)))
(t_3 (- (* 2.0 x2) 3.0))
(t_4 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0))
(t_5
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_2 t_4)
(*
t_0
(+
(* (* x1 x1) (- (* t_4 4.0) 6.0))
(* 4.0 (/ (* x2 t_3) x1)))))))))))
(if (<= x1 -7.1e+108)
t_1
(if (<= x1 -0.9)
t_5
(if (<= x1 1.45e-18)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
(+ x1 (* 4.0 (* x2 (* x1 t_3))))))
(if (<= x1 2e+153) t_5 t_1))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = (x1 * (x1 * 9.0)) - x1;
double t_2 = x1 * (x1 * 3.0);
double t_3 = (2.0 * x2) - 3.0;
double t_4 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_5 = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_4) + (t_0 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (4.0 * ((x2 * t_3) / x1))))))));
double tmp;
if (x1 <= -7.1e+108) {
tmp = t_1;
} else if (x1 <= -0.9) {
tmp = t_5;
} else if (x1 <= 1.45e-18) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * t_3)))));
} else if (x1 <= 2e+153) {
tmp = t_5;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = (x1 * (x1 * 9.0d0)) - x1
t_2 = x1 * (x1 * 3.0d0)
t_3 = (2.0d0 * x2) - 3.0d0
t_4 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
t_5 = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_4) + (t_0 * (((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)) + (4.0d0 * ((x2 * t_3) / x1))))))))
if (x1 <= (-7.1d+108)) then
tmp = t_1
else if (x1 <= (-0.9d0)) then
tmp = t_5
else if (x1 <= 1.45d-18) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (x2 * (x1 * t_3)))))
else if (x1 <= 2d+153) then
tmp = t_5
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = (x1 * (x1 * 9.0)) - x1;
double t_2 = x1 * (x1 * 3.0);
double t_3 = (2.0 * x2) - 3.0;
double t_4 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_5 = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_4) + (t_0 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (4.0 * ((x2 * t_3) / x1))))))));
double tmp;
if (x1 <= -7.1e+108) {
tmp = t_1;
} else if (x1 <= -0.9) {
tmp = t_5;
} else if (x1 <= 1.45e-18) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * t_3)))));
} else if (x1 <= 2e+153) {
tmp = t_5;
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = (x1 * (x1 * 9.0)) - x1 t_2 = x1 * (x1 * 3.0) t_3 = (2.0 * x2) - 3.0 t_4 = ((t_2 + (2.0 * x2)) - x1) / t_0 t_5 = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_4) + (t_0 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (4.0 * ((x2 * t_3) / x1)))))))) tmp = 0 if x1 <= -7.1e+108: tmp = t_1 elif x1 <= -0.9: tmp = t_5 elif x1 <= 1.45e-18: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * t_3))))) elif x1 <= 2e+153: tmp = t_5 else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(Float64(x1 * Float64(x1 * 9.0)) - x1) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(2.0 * x2) - 3.0) t_4 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) t_5 = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * t_4) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) + Float64(4.0 * Float64(Float64(x2 * t_3) / x1))))))))) tmp = 0.0 if (x1 <= -7.1e+108) tmp = t_1; elseif (x1 <= -0.9) tmp = t_5; elseif (x1 <= 1.45e-18) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * t_3)))))); elseif (x1 <= 2e+153) tmp = t_5; else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = (x1 * (x1 * 9.0)) - x1; t_2 = x1 * (x1 * 3.0); t_3 = (2.0 * x2) - 3.0; t_4 = ((t_2 + (2.0 * x2)) - x1) / t_0; t_5 = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_4) + (t_0 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (4.0 * ((x2 * t_3) / x1)))))))); tmp = 0.0; if (x1 <= -7.1e+108) tmp = t_1; elseif (x1 <= -0.9) tmp = t_5; elseif (x1 <= 1.45e-18) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * t_3))))); elseif (x1 <= 2e+153) tmp = t_5; else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * t$95$4), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(N[(x2 * t$95$3), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -7.1e+108], t$95$1, If[LessEqual[x1, -0.9], t$95$5, If[LessEqual[x1, 1.45e-18], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+153], t$95$5, t$95$1]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 9\right) - x1\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := 2 \cdot x2 - 3\\
t_4 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_0}\\
t_5 := x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_2 \cdot t_4 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right) + 4 \cdot \frac{x2 \cdot t_3}{x1}\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -7.1 \cdot 10^{+108}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq -0.9:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x1 \leq 1.45 \cdot 10^{-18}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot t_3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+153}:\\
\;\;\;\;t_5\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x1 < -7.1000000000000003e108 or 2e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.1%
fma-def0.1%
*-commutative0.1%
unpow20.1%
associate-*r*0.1%
+-rgt-identity0.1%
+-commutative0.1%
unpow20.1%
fma-udef0.1%
+-rgt-identity0.1%
*-commutative0.1%
*-commutative0.1%
associate-*r*0.1%
Simplified0.1%
Taylor expanded in x1 around 0 85.0%
+-commutative85.0%
neg-mul-185.0%
unsub-neg85.0%
*-commutative85.0%
unpow285.0%
associate-*l*85.0%
Simplified85.0%
if -7.1000000000000003e108 < x1 < -0.900000000000000022 or 1.45e-18 < x1 < 2e153Initial program 97.7%
Taylor expanded in x1 around 0 94.7%
Taylor expanded in x1 around inf 91.5%
unpow291.5%
associate-*r/91.5%
metadata-eval91.5%
unpow291.5%
Simplified91.5%
Taylor expanded in x1 around 0 83.6%
if -0.900000000000000022 < x1 < 1.45e-18Initial program 99.3%
Taylor expanded in x1 around 0 99.3%
Final simplification92.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (- (* x1 (* x1 9.0)) x1))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_3)
(* t_2 (+ (* (* x1 x1) 6.0) (* (* (* x1 2.0) t_3) -3.0))))))
(* 3.0 (* x2 -2.0))))))
(if (<= x1 -5.6e+102)
t_1
(if (<= x1 -2.05e+55)
t_4
(if (<= x1 1.9e+51)
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
(if (<= x1 2e+153) t_4 t_1))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * (x1 * 9.0)) - x1;
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * t_3) + (t_2 * (((x1 * x1) * 6.0) + (((x1 * 2.0) * t_3) * -3.0)))))) + (3.0 * (x2 * -2.0)));
double tmp;
if (x1 <= -5.6e+102) {
tmp = t_1;
} else if (x1 <= -2.05e+55) {
tmp = t_4;
} else if (x1 <= 1.9e+51) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 2e+153) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * (x1 * 9.0d0)) - x1
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_0 + (2.0d0 * x2)) - x1) / t_2
t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * t_3) + (t_2 * (((x1 * x1) * 6.0d0) + (((x1 * 2.0d0) * t_3) * (-3.0d0))))))) + (3.0d0 * (x2 * (-2.0d0))))
if (x1 <= (-5.6d+102)) then
tmp = t_1
else if (x1 <= (-2.05d+55)) then
tmp = t_4
else if (x1 <= 1.9d+51) then
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
else if (x1 <= 2d+153) then
tmp = t_4
else
tmp = t_1
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 * 9.0)) - x1;
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * t_3) + (t_2 * (((x1 * x1) * 6.0) + (((x1 * 2.0) * t_3) * -3.0)))))) + (3.0 * (x2 * -2.0)));
double tmp;
if (x1 <= -5.6e+102) {
tmp = t_1;
} else if (x1 <= -2.05e+55) {
tmp = t_4;
} else if (x1 <= 1.9e+51) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 2e+153) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * (x1 * 9.0)) - x1 t_2 = (x1 * x1) + 1.0 t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2 t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * t_3) + (t_2 * (((x1 * x1) * 6.0) + (((x1 * 2.0) * t_3) * -3.0)))))) + (3.0 * (x2 * -2.0))) tmp = 0 if x1 <= -5.6e+102: tmp = t_1 elif x1 <= -2.05e+55: tmp = t_4 elif x1 <= 1.9e+51: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) elif x1 <= 2e+153: tmp = t_4 else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * Float64(x1 * 9.0)) - x1) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_3) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * 6.0) + Float64(Float64(Float64(x1 * 2.0) * t_3) * -3.0)))))) + Float64(3.0 * Float64(x2 * -2.0)))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = t_1; elseif (x1 <= -2.05e+55) tmp = t_4; elseif (x1 <= 1.9e+51) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); elseif (x1 <= 2e+153) tmp = t_4; else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * (x1 * 9.0)) - x1; t_2 = (x1 * x1) + 1.0; t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2; t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * t_3) + (t_2 * (((x1 * x1) * 6.0) + (((x1 * 2.0) * t_3) * -3.0)))))) + (3.0 * (x2 * -2.0))); tmp = 0.0; if (x1 <= -5.6e+102) tmp = t_1; elseif (x1 <= -2.05e+55) tmp = t_4; elseif (x1 <= 1.9e+51) tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); elseif (x1 <= 2e+153) tmp = t_4; else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$3), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], t$95$1, If[LessEqual[x1, -2.05e+55], t$95$4, If[LessEqual[x1, 1.9e+51], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+153], t$95$4, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot \left(x1 \cdot 9\right) - x1\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_2}\\
t_4 := x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot t_3 + t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + \left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot -3\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq -2.05 \cdot 10^{+55}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x1 \leq 1.9 \cdot 10^{+51}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+153}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102 or 2e153 < x1 Initial program 1.5%
Taylor expanded in x1 around 0 1.5%
Taylor expanded in x2 around 0 0.1%
fma-def0.1%
*-commutative0.1%
unpow20.1%
associate-*r*0.1%
+-rgt-identity0.1%
+-commutative0.1%
unpow20.1%
fma-udef0.1%
+-rgt-identity0.1%
*-commutative0.1%
*-commutative0.1%
associate-*r*0.1%
Simplified0.1%
Taylor expanded in x1 around 0 83.7%
+-commutative83.7%
neg-mul-183.7%
unsub-neg83.7%
*-commutative83.7%
unpow283.7%
associate-*l*83.7%
Simplified83.7%
if -5.60000000000000037e102 < x1 < -2.04999999999999991e55 or 1.8999999999999999e51 < x1 < 2e153Initial program 96.4%
Taylor expanded in x2 around 0 92.9%
+-commutative92.9%
associate--r+92.9%
associate-*r/92.9%
div-sub92.9%
*-commutative92.9%
unpow292.9%
associate-*r*92.9%
fma-neg92.9%
+-commutative92.9%
unpow292.9%
fma-udef92.9%
Simplified92.9%
Taylor expanded in x1 around 0 92.9%
Taylor expanded in x1 around 0 92.9%
*-commutative23.3%
Simplified92.9%
Taylor expanded in x1 around inf 89.3%
*-commutative89.3%
unpow289.3%
Simplified89.3%
if -2.04999999999999991e55 < x1 < 1.8999999999999999e51Initial program 99.3%
Taylor expanded in x1 around 0 92.9%
Taylor expanded in x1 around 0 92.9%
Final simplification90.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (- (* x1 (* x1 9.0)) x1))
(t_2 (* x1 (* x1 3.0)))
(t_3 (* 3.0 (- (* x2 -2.0) x1)))
(t_4 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0))
(t_5
(+
x1
(+
t_3
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_2 t_4)
(* t_0 (+ (* (* x1 x1) (- (* t_4 4.0) 6.0)) -6.0)))))))))
(if (<= x1 -3.5e+106)
t_1
(if (<= x1 -1.05e+32)
t_5
(if (<= x1 6000000.0)
(+ x1 (+ t_3 (+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
(if (<= x1 2e+153) t_5 t_1))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = (x1 * (x1 * 9.0)) - x1;
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * ((x2 * -2.0) - x1);
double t_4 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_5 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_4) + (t_0 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + -6.0))))));
double tmp;
if (x1 <= -3.5e+106) {
tmp = t_1;
} else if (x1 <= -1.05e+32) {
tmp = t_5;
} else if (x1 <= 6000000.0) {
tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 2e+153) {
tmp = t_5;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = (x1 * (x1 * 9.0d0)) - x1
t_2 = x1 * (x1 * 3.0d0)
t_3 = 3.0d0 * ((x2 * (-2.0d0)) - x1)
t_4 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
t_5 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_4) + (t_0 * (((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)) + (-6.0d0)))))))
if (x1 <= (-3.5d+106)) then
tmp = t_1
else if (x1 <= (-1.05d+32)) then
tmp = t_5
else if (x1 <= 6000000.0d0) then
tmp = x1 + (t_3 + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
else if (x1 <= 2d+153) then
tmp = t_5
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = (x1 * (x1 * 9.0)) - x1;
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * ((x2 * -2.0) - x1);
double t_4 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_5 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_4) + (t_0 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + -6.0))))));
double tmp;
if (x1 <= -3.5e+106) {
tmp = t_1;
} else if (x1 <= -1.05e+32) {
tmp = t_5;
} else if (x1 <= 6000000.0) {
tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 2e+153) {
tmp = t_5;
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = (x1 * (x1 * 9.0)) - x1 t_2 = x1 * (x1 * 3.0) t_3 = 3.0 * ((x2 * -2.0) - x1) t_4 = ((t_2 + (2.0 * x2)) - x1) / t_0 t_5 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_4) + (t_0 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + -6.0)))))) tmp = 0 if x1 <= -3.5e+106: tmp = t_1 elif x1 <= -1.05e+32: tmp = t_5 elif x1 <= 6000000.0: tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) elif x1 <= 2e+153: tmp = t_5 else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(Float64(x1 * Float64(x1 * 9.0)) - x1) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) t_4 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) t_5 = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * t_4) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) + -6.0))))))) tmp = 0.0 if (x1 <= -3.5e+106) tmp = t_1; elseif (x1 <= -1.05e+32) tmp = t_5; elseif (x1 <= 6000000.0) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); elseif (x1 <= 2e+153) tmp = t_5; else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = (x1 * (x1 * 9.0)) - x1; t_2 = x1 * (x1 * 3.0); t_3 = 3.0 * ((x2 * -2.0) - x1); t_4 = ((t_2 + (2.0 * x2)) - x1) / t_0; t_5 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_4) + (t_0 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + -6.0)))))); tmp = 0.0; if (x1 <= -3.5e+106) tmp = t_1; elseif (x1 <= -1.05e+32) tmp = t_5; elseif (x1 <= 6000000.0) tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); elseif (x1 <= 2e+153) tmp = t_5; else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * t$95$4), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.5e+106], t$95$1, If[LessEqual[x1, -1.05e+32], t$95$5, If[LessEqual[x1, 6000000.0], N[(x1 + N[(t$95$3 + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+153], t$95$5, t$95$1]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 9\right) - x1\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
t_4 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_0}\\
t_5 := x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_2 \cdot t_4 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right) + -6\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -3.5 \cdot 10^{+106}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq -1.05 \cdot 10^{+32}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x1 \leq 6000000:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+153}:\\
\;\;\;\;t_5\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x1 < -3.49999999999999981e106 or 2e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.1%
fma-def0.1%
*-commutative0.1%
unpow20.1%
associate-*r*0.1%
+-rgt-identity0.1%
+-commutative0.1%
unpow20.1%
fma-udef0.1%
+-rgt-identity0.1%
*-commutative0.1%
*-commutative0.1%
associate-*r*0.1%
Simplified0.1%
Taylor expanded in x1 around 0 85.0%
+-commutative85.0%
neg-mul-185.0%
unsub-neg85.0%
*-commutative85.0%
unpow285.0%
associate-*l*85.0%
Simplified85.0%
if -3.49999999999999981e106 < x1 < -1.05e32 or 6e6 < x1 < 2e153Initial program 97.4%
Taylor expanded in x1 around 0 97.4%
Taylor expanded in x1 around inf 97.4%
unpow297.4%
associate-*r/97.4%
metadata-eval97.4%
unpow297.4%
Simplified97.4%
Taylor expanded in x1 around inf 85.6%
if -1.05e32 < x1 < 6e6Initial program 99.3%
Taylor expanded in x1 around 0 96.8%
Taylor expanded in x1 around 0 96.9%
Final simplification91.8%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x1 -3e+107) (not (<= x1 2.3e+148)))
(- (* x1 (* x1 9.0)) x1)
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -3e+107) || !(x1 <= 2.3e+148)) {
tmp = (x1 * (x1 * 9.0)) - x1;
} else {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-3d+107)) .or. (.not. (x1 <= 2.3d+148))) then
tmp = (x1 * (x1 * 9.0d0)) - x1
else
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -3e+107) || !(x1 <= 2.3e+148)) {
tmp = (x1 * (x1 * 9.0)) - x1;
} else {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -3e+107) or not (x1 <= 2.3e+148): tmp = (x1 * (x1 * 9.0)) - x1 else: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -3e+107) || !(x1 <= 2.3e+148)) tmp = Float64(Float64(x1 * Float64(x1 * 9.0)) - x1); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -3e+107) || ~((x1 <= 2.3e+148))) tmp = (x1 * (x1 * 9.0)) - x1; else tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -3e+107], N[Not[LessEqual[x1, 2.3e+148]], $MachinePrecision]], N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3 \cdot 10^{+107} \lor \neg \left(x1 \leq 2.3 \cdot 10^{+148}\right):\\
\;\;\;\;x1 \cdot \left(x1 \cdot 9\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -3.00000000000000023e107 or 2.3000000000000001e148 < x1 Initial program 2.9%
Taylor expanded in x1 around 0 0.2%
Taylor expanded in x2 around 0 0.2%
fma-def0.2%
*-commutative0.2%
unpow20.2%
associate-*r*0.2%
+-rgt-identity0.2%
+-commutative0.2%
unpow20.2%
fma-udef0.2%
+-rgt-identity0.2%
*-commutative0.2%
*-commutative0.2%
associate-*r*0.2%
Simplified0.2%
Taylor expanded in x1 around 0 82.8%
+-commutative82.8%
neg-mul-182.8%
unsub-neg82.8%
*-commutative82.8%
unpow282.8%
associate-*l*82.8%
Simplified82.8%
if -3.00000000000000023e107 < x1 < 2.3000000000000001e148Initial program 98.9%
Taylor expanded in x1 around 0 83.1%
Final simplification83.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* x1 (* x1 9.0)) x1))
(t_1
(+
x1
(+ (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)) (* x2 -6.0)))))
(if (<= x1 -3.2e+107)
t_0
(if (<= x1 -1.86e-202)
t_1
(if (<= x1 -5e-309)
(- (* x2 -6.0) x1)
(if (<= x1 2.3e+148) t_1 t_0))))))
double code(double x1, double x2) {
double t_0 = (x1 * (x1 * 9.0)) - x1;
double t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
double tmp;
if (x1 <= -3.2e+107) {
tmp = t_0;
} else if (x1 <= -1.86e-202) {
tmp = t_1;
} else if (x1 <= -5e-309) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 2.3e+148) {
tmp = t_1;
} 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) :: tmp
t_0 = (x1 * (x1 * 9.0d0)) - x1
t_1 = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (x2 * (-6.0d0)))
if (x1 <= (-3.2d+107)) then
tmp = t_0
else if (x1 <= (-1.86d-202)) then
tmp = t_1
else if (x1 <= (-5d-309)) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 2.3d+148) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * (x1 * 9.0)) - x1;
double t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
double tmp;
if (x1 <= -3.2e+107) {
tmp = t_0;
} else if (x1 <= -1.86e-202) {
tmp = t_1;
} else if (x1 <= -5e-309) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 2.3e+148) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * (x1 * 9.0)) - x1 t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)) tmp = 0 if x1 <= -3.2e+107: tmp = t_0 elif x1 <= -1.86e-202: tmp = t_1 elif x1 <= -5e-309: tmp = (x2 * -6.0) - x1 elif x1 <= 2.3e+148: tmp = t_1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * Float64(x1 * 9.0)) - x1) t_1 = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(x2 * -6.0))) tmp = 0.0 if (x1 <= -3.2e+107) tmp = t_0; elseif (x1 <= -1.86e-202) tmp = t_1; elseif (x1 <= -5e-309) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 2.3e+148) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * (x1 * 9.0)) - x1; t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)); tmp = 0.0; if (x1 <= -3.2e+107) tmp = t_0; elseif (x1 <= -1.86e-202) tmp = t_1; elseif (x1 <= -5e-309) tmp = (x2 * -6.0) - x1; elseif (x1 <= 2.3e+148) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.2e+107], t$95$0, If[LessEqual[x1, -1.86e-202], t$95$1, If[LessEqual[x1, -5e-309], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 2.3e+148], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 9\right) - x1\\
t_1 := x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\
\mathbf{if}\;x1 \leq -3.2 \cdot 10^{+107}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -1.86 \cdot 10^{-202}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq -5 \cdot 10^{-309}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+148}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -3.20000000000000029e107 or 2.3000000000000001e148 < x1 Initial program 2.9%
Taylor expanded in x1 around 0 0.2%
Taylor expanded in x2 around 0 0.2%
fma-def0.2%
*-commutative0.2%
unpow20.2%
associate-*r*0.2%
+-rgt-identity0.2%
+-commutative0.2%
unpow20.2%
fma-udef0.2%
+-rgt-identity0.2%
*-commutative0.2%
*-commutative0.2%
associate-*r*0.2%
Simplified0.2%
Taylor expanded in x1 around 0 82.8%
+-commutative82.8%
neg-mul-182.8%
unsub-neg82.8%
*-commutative82.8%
unpow282.8%
associate-*l*82.8%
Simplified82.8%
if -3.20000000000000029e107 < x1 < -1.85999999999999998e-202 or -4.9999999999999995e-309 < x1 < 2.3000000000000001e148Initial program 98.7%
Taylor expanded in x1 around 0 80.5%
Taylor expanded in x1 around 0 75.6%
if -1.85999999999999998e-202 < x1 < -4.9999999999999995e-309Initial program 99.7%
Taylor expanded in x1 around 0 99.7%
Taylor expanded in x1 around inf 96.2%
Taylor expanded in x1 around 0 96.3%
+-commutative96.3%
fma-def96.2%
neg-mul-196.2%
fma-neg96.3%
Simplified96.3%
Final simplification79.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* 2.0 x2) 3.0))
(t_1 (- (* x1 (* x1 9.0)) x1))
(t_2 (+ x1 (+ (* x1 (- (* 4.0 (* x2 t_0)) 2.0)) (* x2 -6.0)))))
(if (<= x1 -2.6e+107)
t_1
(if (<= x1 -4.2e-208)
t_2
(if (<= x1 3e-159)
(+ x1 (+ (+ x1 (* 4.0 (* x2 (* x1 t_0)))) (* 3.0 (* x2 -2.0))))
(if (<= x1 2.3e+148) t_2 t_1))))))
double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = (x1 * (x1 * 9.0)) - x1;
double t_2 = x1 + ((x1 * ((4.0 * (x2 * t_0)) - 2.0)) + (x2 * -6.0));
double tmp;
if (x1 <= -2.6e+107) {
tmp = t_1;
} else if (x1 <= -4.2e-208) {
tmp = t_2;
} else if (x1 <= 3e-159) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * t_0)))) + (3.0 * (x2 * -2.0)));
} else if (x1 <= 2.3e+148) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (2.0d0 * x2) - 3.0d0
t_1 = (x1 * (x1 * 9.0d0)) - x1
t_2 = x1 + ((x1 * ((4.0d0 * (x2 * t_0)) - 2.0d0)) + (x2 * (-6.0d0)))
if (x1 <= (-2.6d+107)) then
tmp = t_1
else if (x1 <= (-4.2d-208)) then
tmp = t_2
else if (x1 <= 3d-159) then
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * t_0)))) + (3.0d0 * (x2 * (-2.0d0))))
else if (x1 <= 2.3d+148) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = (x1 * (x1 * 9.0)) - x1;
double t_2 = x1 + ((x1 * ((4.0 * (x2 * t_0)) - 2.0)) + (x2 * -6.0));
double tmp;
if (x1 <= -2.6e+107) {
tmp = t_1;
} else if (x1 <= -4.2e-208) {
tmp = t_2;
} else if (x1 <= 3e-159) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * t_0)))) + (3.0 * (x2 * -2.0)));
} else if (x1 <= 2.3e+148) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = (2.0 * x2) - 3.0 t_1 = (x1 * (x1 * 9.0)) - x1 t_2 = x1 + ((x1 * ((4.0 * (x2 * t_0)) - 2.0)) + (x2 * -6.0)) tmp = 0 if x1 <= -2.6e+107: tmp = t_1 elif x1 <= -4.2e-208: tmp = t_2 elif x1 <= 3e-159: tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * t_0)))) + (3.0 * (x2 * -2.0))) elif x1 <= 2.3e+148: tmp = t_2 else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(Float64(2.0 * x2) - 3.0) t_1 = Float64(Float64(x1 * Float64(x1 * 9.0)) - x1) t_2 = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * t_0)) - 2.0)) + Float64(x2 * -6.0))) tmp = 0.0 if (x1 <= -2.6e+107) tmp = t_1; elseif (x1 <= -4.2e-208) tmp = t_2; elseif (x1 <= 3e-159) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * t_0)))) + Float64(3.0 * Float64(x2 * -2.0)))); elseif (x1 <= 2.3e+148) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (2.0 * x2) - 3.0; t_1 = (x1 * (x1 * 9.0)) - x1; t_2 = x1 + ((x1 * ((4.0 * (x2 * t_0)) - 2.0)) + (x2 * -6.0)); tmp = 0.0; if (x1 <= -2.6e+107) tmp = t_1; elseif (x1 <= -4.2e-208) tmp = t_2; elseif (x1 <= 3e-159) tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * t_0)))) + (3.0 * (x2 * -2.0))); elseif (x1 <= 2.3e+148) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * t$95$0), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.6e+107], t$95$1, If[LessEqual[x1, -4.2e-208], t$95$2, If[LessEqual[x1, 3e-159], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.3e+148], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot x2 - 3\\
t_1 := x1 \cdot \left(x1 \cdot 9\right) - x1\\
t_2 := x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot t_0\right) - 2\right) + x2 \cdot -6\right)\\
\mathbf{if}\;x1 \leq -2.6 \cdot 10^{+107}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq -4.2 \cdot 10^{-208}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x1 \leq 3 \cdot 10^{-159}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot t_0\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+148}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x1 < -2.6000000000000001e107 or 2.3000000000000001e148 < x1 Initial program 2.9%
Taylor expanded in x1 around 0 0.2%
Taylor expanded in x2 around 0 0.2%
fma-def0.2%
*-commutative0.2%
unpow20.2%
associate-*r*0.2%
+-rgt-identity0.2%
+-commutative0.2%
unpow20.2%
fma-udef0.2%
+-rgt-identity0.2%
*-commutative0.2%
*-commutative0.2%
associate-*r*0.2%
Simplified0.2%
Taylor expanded in x1 around 0 82.8%
+-commutative82.8%
neg-mul-182.8%
unsub-neg82.8%
*-commutative82.8%
unpow282.8%
associate-*l*82.8%
Simplified82.8%
if -2.6000000000000001e107 < x1 < -4.20000000000000024e-208 or 3.00000000000000009e-159 < x1 < 2.3000000000000001e148Initial program 98.5%
Taylor expanded in x1 around 0 75.5%
Taylor expanded in x1 around 0 72.9%
if -4.20000000000000024e-208 < x1 < 3.00000000000000009e-159Initial program 99.6%
Taylor expanded in x1 around 0 99.6%
Taylor expanded in x1 around 0 92.8%
*-commutative92.8%
Simplified92.8%
Final simplification80.2%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x1 -3.9e+108) (not (<= x1 2.3e+148)))
(- (* x1 (* x1 9.0)) x1)
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -3.9e+108) || !(x1 <= 2.3e+148)) {
tmp = (x1 * (x1 * 9.0)) - x1;
} else {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * ((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 <= (-3.9d+108)) .or. (.not. (x1 <= 2.3d+148))) then
tmp = (x1 * (x1 * 9.0d0)) - x1
else
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -3.9e+108) || !(x1 <= 2.3e+148)) {
tmp = (x1 * (x1 * 9.0)) - x1;
} else {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -3.9e+108) or not (x1 <= 2.3e+148): tmp = (x1 * (x1 * 9.0)) - x1 else: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -3.9e+108) || !(x1 <= 2.3e+148)) tmp = Float64(Float64(x1 * Float64(x1 * 9.0)) - x1); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -3.9e+108) || ~((x1 <= 2.3e+148))) tmp = (x1 * (x1 * 9.0)) - x1; else tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -3.9e+108], N[Not[LessEqual[x1, 2.3e+148]], $MachinePrecision]], N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.9 \cdot 10^{+108} \lor \neg \left(x1 \leq 2.3 \cdot 10^{+148}\right):\\
\;\;\;\;x1 \cdot \left(x1 \cdot 9\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -3.89999999999999985e108 or 2.3000000000000001e148 < x1 Initial program 2.9%
Taylor expanded in x1 around 0 0.2%
Taylor expanded in x2 around 0 0.2%
fma-def0.2%
*-commutative0.2%
unpow20.2%
associate-*r*0.2%
+-rgt-identity0.2%
+-commutative0.2%
unpow20.2%
fma-udef0.2%
+-rgt-identity0.2%
*-commutative0.2%
*-commutative0.2%
associate-*r*0.2%
Simplified0.2%
Taylor expanded in x1 around 0 82.8%
+-commutative82.8%
neg-mul-182.8%
unsub-neg82.8%
*-commutative82.8%
unpow282.8%
associate-*l*82.8%
Simplified82.8%
if -3.89999999999999985e108 < x1 < 2.3000000000000001e148Initial program 98.9%
Taylor expanded in x1 around 0 83.1%
Taylor expanded in x1 around 0 83.1%
Final simplification83.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* x1 (* x1 9.0)) x1)))
(if (<= x1 -1.06e+108)
t_0
(if (<= x1 -1.85e-37)
(+ x1 (* (* x2 x2) (* x1 8.0)))
(if (<= x1 0.7)
(- (* x2 -6.0) x1)
(if (<= x1 2.3e+148)
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))
t_0))))))
double code(double x1, double x2) {
double t_0 = (x1 * (x1 * 9.0)) - x1;
double tmp;
if (x1 <= -1.06e+108) {
tmp = t_0;
} else if (x1 <= -1.85e-37) {
tmp = x1 + ((x2 * x2) * (x1 * 8.0));
} else if (x1 <= 0.7) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 2.3e+148) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.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) :: tmp
t_0 = (x1 * (x1 * 9.0d0)) - x1
if (x1 <= (-1.06d+108)) then
tmp = t_0
else if (x1 <= (-1.85d-37)) then
tmp = x1 + ((x2 * x2) * (x1 * 8.0d0))
else if (x1 <= 0.7d0) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 2.3d+148) then
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * (x1 * 9.0)) - x1;
double tmp;
if (x1 <= -1.06e+108) {
tmp = t_0;
} else if (x1 <= -1.85e-37) {
tmp = x1 + ((x2 * x2) * (x1 * 8.0));
} else if (x1 <= 0.7) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 2.3e+148) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * (x1 * 9.0)) - x1 tmp = 0 if x1 <= -1.06e+108: tmp = t_0 elif x1 <= -1.85e-37: tmp = x1 + ((x2 * x2) * (x1 * 8.0)) elif x1 <= 0.7: tmp = (x2 * -6.0) - x1 elif x1 <= 2.3e+148: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * Float64(x1 * 9.0)) - x1) tmp = 0.0 if (x1 <= -1.06e+108) tmp = t_0; elseif (x1 <= -1.85e-37) tmp = Float64(x1 + Float64(Float64(x2 * x2) * Float64(x1 * 8.0))); elseif (x1 <= 0.7) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 2.3e+148) tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * (x1 * 9.0)) - x1; tmp = 0.0; if (x1 <= -1.06e+108) tmp = t_0; elseif (x1 <= -1.85e-37) tmp = x1 + ((x2 * x2) * (x1 * 8.0)); elseif (x1 <= 0.7) tmp = (x2 * -6.0) - x1; elseif (x1 <= 2.3e+148) tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, If[LessEqual[x1, -1.06e+108], t$95$0, If[LessEqual[x1, -1.85e-37], N[(x1 + N[(N[(x2 * x2), $MachinePrecision] * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.7], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 2.3e+148], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 9\right) - x1\\
\mathbf{if}\;x1 \leq -1.06 \cdot 10^{+108}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -1.85 \cdot 10^{-37}:\\
\;\;\;\;x1 + \left(x2 \cdot x2\right) \cdot \left(x1 \cdot 8\right)\\
\mathbf{elif}\;x1 \leq 0.7:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+148}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -1.06e108 or 2.3000000000000001e148 < x1 Initial program 2.9%
Taylor expanded in x1 around 0 0.2%
Taylor expanded in x2 around 0 0.2%
fma-def0.2%
*-commutative0.2%
unpow20.2%
associate-*r*0.2%
+-rgt-identity0.2%
+-commutative0.2%
unpow20.2%
fma-udef0.2%
+-rgt-identity0.2%
*-commutative0.2%
*-commutative0.2%
associate-*r*0.2%
Simplified0.2%
Taylor expanded in x1 around 0 82.8%
+-commutative82.8%
neg-mul-182.8%
unsub-neg82.8%
*-commutative82.8%
unpow282.8%
associate-*l*82.8%
Simplified82.8%
if -1.06e108 < x1 < -1.85e-37Initial program 99.5%
Taylor expanded in x1 around 0 60.1%
Taylor expanded in x2 around inf 49.4%
*-commutative49.4%
associate-*l*49.4%
unpow249.4%
Simplified49.4%
if -1.85e-37 < x1 < 0.69999999999999996Initial program 99.3%
Taylor expanded in x1 around 0 98.7%
Taylor expanded in x1 around inf 81.4%
Taylor expanded in x1 around 0 82.0%
+-commutative82.0%
fma-def82.1%
neg-mul-182.1%
fma-neg82.0%
Simplified82.0%
if 0.69999999999999996 < x1 < 2.3000000000000001e148Initial program 95.8%
Taylor expanded in x1 around 0 32.0%
Taylor expanded in x1 around inf 32.0%
Final simplification73.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* x1 (* x1 9.0)) x1)))
(if (<= x1 -4e+107)
t_0
(if (<= x1 -2.1e-37)
(- (+ x1 (+ 9.0 (* (* x2 x2) (* x1 8.0)))) (/ 3.0 x1))
(if (<= x1 0.7)
(- (* x2 -6.0) x1)
(if (<= x1 2.3e+148)
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))
t_0))))))
double code(double x1, double x2) {
double t_0 = (x1 * (x1 * 9.0)) - x1;
double tmp;
if (x1 <= -4e+107) {
tmp = t_0;
} else if (x1 <= -2.1e-37) {
tmp = (x1 + (9.0 + ((x2 * x2) * (x1 * 8.0)))) - (3.0 / x1);
} else if (x1 <= 0.7) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 2.3e+148) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.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) :: tmp
t_0 = (x1 * (x1 * 9.0d0)) - x1
if (x1 <= (-4d+107)) then
tmp = t_0
else if (x1 <= (-2.1d-37)) then
tmp = (x1 + (9.0d0 + ((x2 * x2) * (x1 * 8.0d0)))) - (3.0d0 / x1)
else if (x1 <= 0.7d0) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 2.3d+148) then
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * (x1 * 9.0)) - x1;
double tmp;
if (x1 <= -4e+107) {
tmp = t_0;
} else if (x1 <= -2.1e-37) {
tmp = (x1 + (9.0 + ((x2 * x2) * (x1 * 8.0)))) - (3.0 / x1);
} else if (x1 <= 0.7) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 2.3e+148) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * (x1 * 9.0)) - x1 tmp = 0 if x1 <= -4e+107: tmp = t_0 elif x1 <= -2.1e-37: tmp = (x1 + (9.0 + ((x2 * x2) * (x1 * 8.0)))) - (3.0 / x1) elif x1 <= 0.7: tmp = (x2 * -6.0) - x1 elif x1 <= 2.3e+148: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * Float64(x1 * 9.0)) - x1) tmp = 0.0 if (x1 <= -4e+107) tmp = t_0; elseif (x1 <= -2.1e-37) tmp = Float64(Float64(x1 + Float64(9.0 + Float64(Float64(x2 * x2) * Float64(x1 * 8.0)))) - Float64(3.0 / x1)); elseif (x1 <= 0.7) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 2.3e+148) tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * (x1 * 9.0)) - x1; tmp = 0.0; if (x1 <= -4e+107) tmp = t_0; elseif (x1 <= -2.1e-37) tmp = (x1 + (9.0 + ((x2 * x2) * (x1 * 8.0)))) - (3.0 / x1); elseif (x1 <= 0.7) tmp = (x2 * -6.0) - x1; elseif (x1 <= 2.3e+148) tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, If[LessEqual[x1, -4e+107], t$95$0, If[LessEqual[x1, -2.1e-37], N[(N[(x1 + N[(9.0 + N[(N[(x2 * x2), $MachinePrecision] * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 / x1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.7], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 2.3e+148], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 9\right) - x1\\
\mathbf{if}\;x1 \leq -4 \cdot 10^{+107}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -2.1 \cdot 10^{-37}:\\
\;\;\;\;\left(x1 + \left(9 + \left(x2 \cdot x2\right) \cdot \left(x1 \cdot 8\right)\right)\right) - \frac{3}{x1}\\
\mathbf{elif}\;x1 \leq 0.7:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+148}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -3.9999999999999999e107 or 2.3000000000000001e148 < x1 Initial program 2.9%
Taylor expanded in x1 around 0 0.2%
Taylor expanded in x2 around 0 0.2%
fma-def0.2%
*-commutative0.2%
unpow20.2%
associate-*r*0.2%
+-rgt-identity0.2%
+-commutative0.2%
unpow20.2%
fma-udef0.2%
+-rgt-identity0.2%
*-commutative0.2%
*-commutative0.2%
associate-*r*0.2%
Simplified0.2%
Taylor expanded in x1 around 0 82.8%
+-commutative82.8%
neg-mul-182.8%
unsub-neg82.8%
*-commutative82.8%
unpow282.8%
associate-*l*82.8%
Simplified82.8%
if -3.9999999999999999e107 < x1 < -2.1000000000000001e-37Initial program 99.5%
Taylor expanded in x1 around 0 60.1%
Taylor expanded in x1 around inf 50.4%
Taylor expanded in x2 around inf 50.4%
*-commutative50.4%
associate-*l*50.4%
unpow250.4%
Simplified50.4%
associate-+r-50.4%
+-commutative50.4%
un-div-inv50.4%
Applied egg-rr50.4%
if -2.1000000000000001e-37 < x1 < 0.69999999999999996Initial program 99.3%
Taylor expanded in x1 around 0 98.7%
Taylor expanded in x1 around inf 81.4%
Taylor expanded in x1 around 0 82.0%
+-commutative82.0%
fma-def82.1%
neg-mul-182.1%
fma-neg82.0%
Simplified82.0%
if 0.69999999999999996 < x1 < 2.3000000000000001e148Initial program 95.8%
Taylor expanded in x1 around 0 32.0%
Taylor expanded in x1 around inf 32.0%
Final simplification73.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* x1 (* x1 9.0)) x1))
(t_1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))
(if (<= x1 -8.4e+108)
t_0
(if (<= x1 -1.85e-37)
(+ x1 (+ 9.0 t_1))
(if (<= x1 0.7)
(- (* x2 -6.0) x1)
(if (<= x1 2.3e+148) (+ x1 t_1) t_0))))))
double code(double x1, double x2) {
double t_0 = (x1 * (x1 * 9.0)) - x1;
double t_1 = x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
double tmp;
if (x1 <= -8.4e+108) {
tmp = t_0;
} else if (x1 <= -1.85e-37) {
tmp = x1 + (9.0 + t_1);
} else if (x1 <= 0.7) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 2.3e+148) {
tmp = x1 + t_1;
} 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) :: tmp
t_0 = (x1 * (x1 * 9.0d0)) - x1
t_1 = x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
if (x1 <= (-8.4d+108)) then
tmp = t_0
else if (x1 <= (-1.85d-37)) then
tmp = x1 + (9.0d0 + t_1)
else if (x1 <= 0.7d0) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 2.3d+148) then
tmp = x1 + t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * (x1 * 9.0)) - x1;
double t_1 = x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
double tmp;
if (x1 <= -8.4e+108) {
tmp = t_0;
} else if (x1 <= -1.85e-37) {
tmp = x1 + (9.0 + t_1);
} else if (x1 <= 0.7) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 2.3e+148) {
tmp = x1 + t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * (x1 * 9.0)) - x1 t_1 = x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) tmp = 0 if x1 <= -8.4e+108: tmp = t_0 elif x1 <= -1.85e-37: tmp = x1 + (9.0 + t_1) elif x1 <= 0.7: tmp = (x2 * -6.0) - x1 elif x1 <= 2.3e+148: tmp = x1 + t_1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * Float64(x1 * 9.0)) - x1) t_1 = Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) tmp = 0.0 if (x1 <= -8.4e+108) tmp = t_0; elseif (x1 <= -1.85e-37) tmp = Float64(x1 + Float64(9.0 + t_1)); elseif (x1 <= 0.7) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 2.3e+148) tmp = Float64(x1 + t_1); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * (x1 * 9.0)) - x1; t_1 = x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); tmp = 0.0; if (x1 <= -8.4e+108) tmp = t_0; elseif (x1 <= -1.85e-37) tmp = x1 + (9.0 + t_1); elseif (x1 <= 0.7) tmp = (x2 * -6.0) - x1; elseif (x1 <= 2.3e+148) tmp = x1 + t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -8.4e+108], t$95$0, If[LessEqual[x1, -1.85e-37], N[(x1 + N[(9.0 + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.7], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 2.3e+148], N[(x1 + t$95$1), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 9\right) - x1\\
t_1 := x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{if}\;x1 \leq -8.4 \cdot 10^{+108}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -1.85 \cdot 10^{-37}:\\
\;\;\;\;x1 + \left(9 + t_1\right)\\
\mathbf{elif}\;x1 \leq 0.7:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+148}:\\
\;\;\;\;x1 + t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -8.40000000000000039e108 or 2.3000000000000001e148 < x1 Initial program 2.9%
Taylor expanded in x1 around 0 0.2%
Taylor expanded in x2 around 0 0.2%
fma-def0.2%
*-commutative0.2%
unpow20.2%
associate-*r*0.2%
+-rgt-identity0.2%
+-commutative0.2%
unpow20.2%
fma-udef0.2%
+-rgt-identity0.2%
*-commutative0.2%
*-commutative0.2%
associate-*r*0.2%
Simplified0.2%
Taylor expanded in x1 around 0 82.8%
+-commutative82.8%
neg-mul-182.8%
unsub-neg82.8%
*-commutative82.8%
unpow282.8%
associate-*l*82.8%
Simplified82.8%
if -8.40000000000000039e108 < x1 < -1.85e-37Initial program 99.5%
Taylor expanded in x1 around 0 60.1%
Taylor expanded in x1 around inf 50.5%
if -1.85e-37 < x1 < 0.69999999999999996Initial program 99.3%
Taylor expanded in x1 around 0 98.7%
Taylor expanded in x1 around inf 81.4%
Taylor expanded in x1 around 0 82.0%
+-commutative82.0%
fma-def82.1%
neg-mul-182.1%
fma-neg82.0%
Simplified82.0%
if 0.69999999999999996 < x1 < 2.3000000000000001e148Initial program 95.8%
Taylor expanded in x1 around 0 32.0%
Taylor expanded in x1 around inf 32.0%
Final simplification73.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* x1 (* x1 9.0)) x1)) (t_1 (+ x1 (* (* x2 x2) (* x1 8.0)))))
(if (<= x1 -7.1e+108)
t_0
(if (<= x1 -2.6e-37)
t_1
(if (<= x1 0.7) (- (* x2 -6.0) x1) (if (<= x1 2.3e+148) t_1 t_0))))))
double code(double x1, double x2) {
double t_0 = (x1 * (x1 * 9.0)) - x1;
double t_1 = x1 + ((x2 * x2) * (x1 * 8.0));
double tmp;
if (x1 <= -7.1e+108) {
tmp = t_0;
} else if (x1 <= -2.6e-37) {
tmp = t_1;
} else if (x1 <= 0.7) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 2.3e+148) {
tmp = t_1;
} 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) :: tmp
t_0 = (x1 * (x1 * 9.0d0)) - x1
t_1 = x1 + ((x2 * x2) * (x1 * 8.0d0))
if (x1 <= (-7.1d+108)) then
tmp = t_0
else if (x1 <= (-2.6d-37)) then
tmp = t_1
else if (x1 <= 0.7d0) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 2.3d+148) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * (x1 * 9.0)) - x1;
double t_1 = x1 + ((x2 * x2) * (x1 * 8.0));
double tmp;
if (x1 <= -7.1e+108) {
tmp = t_0;
} else if (x1 <= -2.6e-37) {
tmp = t_1;
} else if (x1 <= 0.7) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 2.3e+148) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * (x1 * 9.0)) - x1 t_1 = x1 + ((x2 * x2) * (x1 * 8.0)) tmp = 0 if x1 <= -7.1e+108: tmp = t_0 elif x1 <= -2.6e-37: tmp = t_1 elif x1 <= 0.7: tmp = (x2 * -6.0) - x1 elif x1 <= 2.3e+148: tmp = t_1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * Float64(x1 * 9.0)) - x1) t_1 = Float64(x1 + Float64(Float64(x2 * x2) * Float64(x1 * 8.0))) tmp = 0.0 if (x1 <= -7.1e+108) tmp = t_0; elseif (x1 <= -2.6e-37) tmp = t_1; elseif (x1 <= 0.7) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 2.3e+148) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * (x1 * 9.0)) - x1; t_1 = x1 + ((x2 * x2) * (x1 * 8.0)); tmp = 0.0; if (x1 <= -7.1e+108) tmp = t_0; elseif (x1 <= -2.6e-37) tmp = t_1; elseif (x1 <= 0.7) tmp = (x2 * -6.0) - x1; elseif (x1 <= 2.3e+148) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x2 * x2), $MachinePrecision] * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -7.1e+108], t$95$0, If[LessEqual[x1, -2.6e-37], t$95$1, If[LessEqual[x1, 0.7], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 2.3e+148], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 9\right) - x1\\
t_1 := x1 + \left(x2 \cdot x2\right) \cdot \left(x1 \cdot 8\right)\\
\mathbf{if}\;x1 \leq -7.1 \cdot 10^{+108}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -2.6 \cdot 10^{-37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 0.7:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+148}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -7.1000000000000003e108 or 2.3000000000000001e148 < x1 Initial program 2.9%
Taylor expanded in x1 around 0 0.2%
Taylor expanded in x2 around 0 0.2%
fma-def0.2%
*-commutative0.2%
unpow20.2%
associate-*r*0.2%
+-rgt-identity0.2%
+-commutative0.2%
unpow20.2%
fma-udef0.2%
+-rgt-identity0.2%
*-commutative0.2%
*-commutative0.2%
associate-*r*0.2%
Simplified0.2%
Taylor expanded in x1 around 0 82.8%
+-commutative82.8%
neg-mul-182.8%
unsub-neg82.8%
*-commutative82.8%
unpow282.8%
associate-*l*82.8%
Simplified82.8%
if -7.1000000000000003e108 < x1 < -2.5999999999999998e-37 or 0.69999999999999996 < x1 < 2.3000000000000001e148Initial program 97.9%
Taylor expanded in x1 around 0 47.8%
Taylor expanded in x2 around inf 41.7%
*-commutative41.7%
associate-*l*41.7%
unpow241.7%
Simplified41.7%
if -2.5999999999999998e-37 < x1 < 0.69999999999999996Initial program 99.3%
Taylor expanded in x1 around 0 98.7%
Taylor expanded in x1 around inf 81.4%
Taylor expanded in x1 around 0 82.0%
+-commutative82.0%
fma-def82.1%
neg-mul-182.1%
fma-neg82.0%
Simplified82.0%
Final simplification73.3%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -2.4e-31) (not (<= x1 3.4))) (- (* x1 (* x1 9.0)) x1) (- (* x2 -6.0) x1)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.4e-31) || !(x1 <= 3.4)) {
tmp = (x1 * (x1 * 9.0)) - x1;
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-2.4d-31)) .or. (.not. (x1 <= 3.4d0))) then
tmp = (x1 * (x1 * 9.0d0)) - x1
else
tmp = (x2 * (-6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.4e-31) || !(x1 <= 3.4)) {
tmp = (x1 * (x1 * 9.0)) - x1;
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -2.4e-31) or not (x1 <= 3.4): tmp = (x1 * (x1 * 9.0)) - x1 else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -2.4e-31) || !(x1 <= 3.4)) tmp = Float64(Float64(x1 * Float64(x1 * 9.0)) - x1); else tmp = Float64(Float64(x2 * -6.0) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -2.4e-31) || ~((x1 <= 3.4))) tmp = (x1 * (x1 * 9.0)) - x1; else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -2.4e-31], N[Not[LessEqual[x1, 3.4]], $MachinePrecision]], N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.4 \cdot 10^{-31} \lor \neg \left(x1 \leq 3.4\right):\\
\;\;\;\;x1 \cdot \left(x1 \cdot 9\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x1 < -2.4e-31 or 3.39999999999999991 < x1 Initial program 44.1%
Taylor expanded in x1 around 0 19.8%
Taylor expanded in x2 around 0 3.9%
fma-def3.9%
*-commutative3.9%
unpow23.9%
associate-*r*3.9%
+-rgt-identity3.9%
+-commutative3.9%
unpow23.9%
fma-udef3.9%
+-rgt-identity3.9%
*-commutative3.9%
*-commutative3.9%
associate-*r*3.9%
Simplified3.9%
Taylor expanded in x1 around 0 51.2%
+-commutative51.2%
neg-mul-151.2%
unsub-neg51.2%
*-commutative51.2%
unpow251.2%
associate-*l*51.2%
Simplified51.2%
if -2.4e-31 < x1 < 3.39999999999999991Initial program 99.3%
Taylor expanded in x1 around 0 98.7%
Taylor expanded in x1 around inf 79.3%
Taylor expanded in x1 around 0 79.8%
+-commutative79.8%
fma-def79.9%
neg-mul-179.9%
fma-neg79.8%
Simplified79.8%
Final simplification66.2%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -1.1e-97) (not (<= x2 1.65e-195))) (+ x1 (* x2 -6.0)) (+ x1 (* x1 -2.0))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.1e-97) || !(x2 <= 1.65e-195)) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = x1 + (x1 * -2.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-1.1d-97)) .or. (.not. (x2 <= 1.65d-195))) then
tmp = x1 + (x2 * (-6.0d0))
else
tmp = x1 + (x1 * (-2.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.1e-97) || !(x2 <= 1.65e-195)) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = x1 + (x1 * -2.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -1.1e-97) or not (x2 <= 1.65e-195): tmp = x1 + (x2 * -6.0) else: tmp = x1 + (x1 * -2.0) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -1.1e-97) || !(x2 <= 1.65e-195)) tmp = Float64(x1 + Float64(x2 * -6.0)); else tmp = Float64(x1 + Float64(x1 * -2.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -1.1e-97) || ~((x2 <= 1.65e-195))) tmp = x1 + (x2 * -6.0); else tmp = x1 + (x1 * -2.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -1.1e-97], N[Not[LessEqual[x2, 1.65e-195]], $MachinePrecision]], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.1 \cdot 10^{-97} \lor \neg \left(x2 \leq 1.65 \cdot 10^{-195}\right):\\
\;\;\;\;x1 + x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot -2\\
\end{array}
\end{array}
if x2 < -1.0999999999999999e-97 or 1.65e-195 < x2 Initial program 72.6%
Taylor expanded in x1 around 0 62.2%
Taylor expanded in x1 around 0 36.8%
*-commutative36.8%
Simplified36.8%
if -1.0999999999999999e-97 < x2 < 1.65e-195Initial program 74.0%
Taylor expanded in x1 around 0 56.9%
Taylor expanded in x2 around 0 41.9%
fma-def42.6%
*-commutative42.6%
unpow242.6%
associate-*r*42.6%
+-rgt-identity42.6%
+-commutative42.6%
unpow242.6%
fma-udef42.6%
+-rgt-identity42.6%
*-commutative42.6%
*-commutative42.6%
associate-*r*42.6%
Simplified42.6%
Taylor expanded in x1 around 0 43.4%
*-commutative43.4%
Simplified43.4%
Final simplification38.7%
(FPCore (x1 x2) :precision binary64 (+ x1 (* x1 -2.0)))
double code(double x1, double x2) {
return x1 + (x1 * -2.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + (x1 * (-2.0d0))
end function
public static double code(double x1, double x2) {
return x1 + (x1 * -2.0);
}
def code(x1, x2): return x1 + (x1 * -2.0)
function code(x1, x2) return Float64(x1 + Float64(x1 * -2.0)) end
function tmp = code(x1, x2) tmp = x1 + (x1 * -2.0); end
code[x1_, x2_] := N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + x1 \cdot -2
\end{array}
Initial program 73.0%
Taylor expanded in x1 around 0 60.7%
Taylor expanded in x2 around 0 14.3%
fma-def14.6%
*-commutative14.6%
unpow214.6%
associate-*r*14.6%
+-rgt-identity14.6%
+-commutative14.6%
unpow214.6%
fma-udef14.6%
+-rgt-identity14.6%
*-commutative14.6%
*-commutative14.6%
associate-*r*14.6%
Simplified14.6%
Taylor expanded in x1 around 0 15.1%
*-commutative15.1%
Simplified15.1%
Final simplification15.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 72.4%
Taylor expanded in x1 around inf 81.1%
Taylor expanded in x1 around 0 44.2%
+-commutative44.2%
fma-def44.2%
neg-mul-144.2%
fma-neg44.2%
Simplified44.2%
Final simplification44.2%
(FPCore (x1 x2) :precision binary64 (* x1 2.0))
double code(double x1, double x2) {
return x1 * 2.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 * 2.0d0
end function
public static double code(double x1, double x2) {
return x1 * 2.0;
}
def code(x1, x2): return x1 * 2.0
function code(x1, x2) return Float64(x1 * 2.0) end
function tmp = code(x1, x2) tmp = x1 * 2.0; end
code[x1_, x2_] := N[(x1 * 2.0), $MachinePrecision]
\begin{array}{l}
\\
x1 \cdot 2
\end{array}
Initial program 73.0%
Taylor expanded in x1 around 0 60.7%
Taylor expanded in x2 around 0 14.3%
fma-def14.6%
*-commutative14.6%
unpow214.6%
associate-*r*14.6%
+-rgt-identity14.6%
+-commutative14.6%
unpow214.6%
fma-udef14.6%
+-rgt-identity14.6%
*-commutative14.6%
*-commutative14.6%
associate-*r*14.6%
Simplified14.6%
Taylor expanded in x1 around inf 3.4%
*-commutative3.4%
Simplified3.4%
Final simplification3.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 60.7%
Taylor expanded in x1 around 0 31.0%
*-commutative31.0%
Simplified31.0%
Taylor expanded in x1 around inf 3.4%
Final simplification3.4%
herbie shell --seed 2023171
(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))))))