
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (/ (- (fma x1 (* x1 3.0) (* x2 2.0)) x1) (fma x1 x1 1.0)))
(t_1 (* 3.0 (* x1 x1)))
(t_2 (/ (- t_1 (fma x2 -2.0 x1)) (fma x1 x1 1.0)))
(t_3 (/ (- t_1 (fma 2.0 x2 x1)) (fma x1 x1 1.0)))
(t_4 (/ (- (fma x2 -2.0 x1) t_1) (fma x1 x1 1.0))))
(if (<= x1 -7.6e+153)
(+
6.0
(+
(* x1 -17.0)
(+ (* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0)))) (* -6.0 x2))))
(if (<= x1 -2e-22)
(+
x1
(fma
3.0
t_3
(+
(* t_1 t_2)
(*
(fma x1 x1 1.0)
(+
x1
(*
x1
(+ (* 2.0 (* t_4 (- t_4 -3.0))) (* x1 (fma t_2 4.0 -6.0)))))))))
(if (<= x1 1e+104)
(+
x1
(fma
3.0
t_3
(+
x1
(fma
(fma x1 x1 1.0)
(fma
x1
(* x1 (fma t_0 4.0 -6.0))
(* (* x1 (* 2.0 t_0)) (+ -3.0 t_0)))
(fma t_1 t_0 (pow x1 3.0))))))
(+
x1
(+
(- x1 (* 4.0 (* x1 (* x2 (- 3.0 (* x2 2.0))))))
(*
3.0
(fma
x2
-2.0
(- (* (pow x1 2.0) (+ x1 (+ 3.0 (* x2 2.0)))) x1))))))))))
double code(double x1, double x2) {
double t_0 = (fma(x1, (x1 * 3.0), (x2 * 2.0)) - x1) / fma(x1, x1, 1.0);
double t_1 = 3.0 * (x1 * x1);
double t_2 = (t_1 - fma(x2, -2.0, x1)) / fma(x1, x1, 1.0);
double t_3 = (t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0);
double t_4 = (fma(x2, -2.0, x1) - t_1) / fma(x1, x1, 1.0);
double tmp;
if (x1 <= -7.6e+153) {
tmp = 6.0 + ((x1 * -17.0) + ((3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (-6.0 * x2)));
} else if (x1 <= -2e-22) {
tmp = x1 + fma(3.0, t_3, ((t_1 * t_2) + (fma(x1, x1, 1.0) * (x1 + (x1 * ((2.0 * (t_4 * (t_4 - -3.0))) + (x1 * fma(t_2, 4.0, -6.0))))))));
} else if (x1 <= 1e+104) {
tmp = x1 + fma(3.0, t_3, (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_0, 4.0, -6.0)), ((x1 * (2.0 * t_0)) * (-3.0 + t_0))), fma(t_1, t_0, pow(x1, 3.0)))));
} else {
tmp = x1 + ((x1 - (4.0 * (x1 * (x2 * (3.0 - (x2 * 2.0)))))) + (3.0 * fma(x2, -2.0, ((pow(x1, 2.0) * (x1 + (3.0 + (x2 * 2.0)))) - x1))));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(fma(x1, Float64(x1 * 3.0), Float64(x2 * 2.0)) - x1) / fma(x1, x1, 1.0)) t_1 = Float64(3.0 * Float64(x1 * x1)) t_2 = Float64(Float64(t_1 - fma(x2, -2.0, x1)) / fma(x1, x1, 1.0)) t_3 = Float64(Float64(t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)) t_4 = Float64(Float64(fma(x2, -2.0, x1) - t_1) / fma(x1, x1, 1.0)) tmp = 0.0 if (x1 <= -7.6e+153) tmp = Float64(6.0 + Float64(Float64(x1 * -17.0) + Float64(Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0)))) + Float64(-6.0 * x2)))); elseif (x1 <= -2e-22) tmp = Float64(x1 + fma(3.0, t_3, Float64(Float64(t_1 * t_2) + Float64(fma(x1, x1, 1.0) * Float64(x1 + Float64(x1 * Float64(Float64(2.0 * Float64(t_4 * Float64(t_4 - -3.0))) + Float64(x1 * fma(t_2, 4.0, -6.0))))))))); elseif (x1 <= 1e+104) tmp = Float64(x1 + fma(3.0, t_3, Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_0, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_0)) * Float64(-3.0 + t_0))), fma(t_1, t_0, (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64(Float64(x1 - Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(x2 * 2.0)))))) + Float64(3.0 * fma(x2, -2.0, Float64(Float64((x1 ^ 2.0) * Float64(x1 + Float64(3.0 + Float64(x2 * 2.0)))) - x1))))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 - N[(x2 * -2.0 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x2 * -2.0 + x1), $MachinePrecision] - t$95$1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -7.6e+153], N[(6.0 + N[(N[(x1 * -17.0), $MachinePrecision] + N[(N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-6.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2e-22], N[(x1 + N[(3.0 * t$95$3 + N[(N[(t$95$1 * t$95$2), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(x1 * N[(N[(2.0 * N[(t$95$4 * N[(t$95$4 - -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(t$95$2 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+104], N[(x1 + N[(3.0 * t$95$3 + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$0 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(-3.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$0 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 - N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0 + N[(N[(N[Power[x1, 2.0], $MachinePrecision] * N[(x1 + N[(3.0 + N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, x2 \cdot 2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := 3 \cdot \left(x1 \cdot x1\right)\\
t_2 := \frac{t\_1 - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_3 := \frac{t\_1 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_4 := \frac{\mathsf{fma}\left(x2, -2, x1\right) - t\_1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 \leq -7.6 \cdot 10^{+153}:\\
\;\;\;\;6 + \left(x1 \cdot -17 + \left(3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right) + -6 \cdot x2\right)\right)\\
\mathbf{elif}\;x1 \leq -2 \cdot 10^{-22}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, t\_3, t\_1 \cdot t\_2 + \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + x1 \cdot \left(2 \cdot \left(t\_4 \cdot \left(t\_4 - -3\right)\right) + x1 \cdot \mathsf{fma}\left(t\_2, 4, -6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+104}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, t\_3, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_0, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_0\right)\right) \cdot \left(-3 + t\_0\right)\right), \mathsf{fma}\left(t\_1, t\_0, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - x2 \cdot 2\right)\right)\right)\right) + 3 \cdot \mathsf{fma}\left(x2, -2, {x1}^{2} \cdot \left(x1 + \left(3 + x2 \cdot 2\right)\right) - x1\right)\right)\\
\end{array}
\end{array}
if x1 < -7.59999999999999933e153Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 69.6%
if -7.59999999999999933e153 < x1 < -2.0000000000000001e-22Initial program 62.3%
Simplified99.6%
if -2.0000000000000001e-22 < x1 < 1e104Initial program 98.7%
Simplified99.0%
if 1e104 < x1 Initial program 24.5%
Taylor expanded in x1 around 0 1.3%
Taylor expanded in x1 around 0 71.4%
*-commutative71.4%
fma-def73.5%
+-commutative73.5%
mul-1-neg73.5%
unsub-neg73.5%
+-commutative73.5%
unpow373.5%
unpow273.5%
distribute-lft-out95.9%
cancel-sign-sub-inv95.9%
metadata-eval95.9%
Simplified95.9%
Final simplification95.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x2 2.0) t_0))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- x1 t_1) t_2))
(t_4 (* 3.0 (* x1 x1)))
(t_5 (/ (- t_4 (fma x2 -2.0 x1)) (fma x1 x1 1.0)))
(t_6 (/ (- (fma x2 -2.0 x1) t_4) (fma x1 x1 1.0))))
(if (<= x1 -7.6e+153)
(+
6.0
(+
(* x1 -17.0)
(+ (* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0)))) (* -6.0 x2))))
(if (<= x1 -1.15e-175)
(+
x1
(fma
3.0
(/ (- t_4 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
(* t_4 t_5)
(*
(fma x1 x1 1.0)
(+
x1
(*
x1
(+ (* 2.0 (* t_6 (- t_6 -3.0))) (* x1 (fma t_5 4.0 -6.0)))))))))
(if (<= x1 2e+105)
(+
x1
(+
(+
x1
(+
(+
(*
(+
(* (* (* x1 2.0) (/ (- t_1 x1) t_2)) (+ 3.0 t_3))
(* (* x1 x1) (+ 6.0 (* 4.0 t_3))))
(- -1.0 (* x1 x1)))
(* 3.0 t_0))
(* x1 (* x1 x1))))
(* 3.0 (- (* x2 -2.0) x1))))
(+
x1
(+
(- x1 (* 4.0 (* x1 (* x2 (- 3.0 (* x2 2.0))))))
(*
3.0
(fma
x2
-2.0
(- (* (pow x1 2.0) (+ x1 (+ 3.0 (* x2 2.0)))) x1))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x2 * 2.0) + t_0;
double t_2 = (x1 * x1) + 1.0;
double t_3 = (x1 - t_1) / t_2;
double t_4 = 3.0 * (x1 * x1);
double t_5 = (t_4 - fma(x2, -2.0, x1)) / fma(x1, x1, 1.0);
double t_6 = (fma(x2, -2.0, x1) - t_4) / fma(x1, x1, 1.0);
double tmp;
if (x1 <= -7.6e+153) {
tmp = 6.0 + ((x1 * -17.0) + ((3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (-6.0 * x2)));
} else if (x1 <= -1.15e-175) {
tmp = x1 + fma(3.0, ((t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), ((t_4 * t_5) + (fma(x1, x1, 1.0) * (x1 + (x1 * ((2.0 * (t_6 * (t_6 - -3.0))) + (x1 * fma(t_5, 4.0, -6.0))))))));
} else if (x1 <= 2e+105) {
tmp = x1 + ((x1 + (((((((x1 * 2.0) * ((t_1 - x1) / t_2)) * (3.0 + t_3)) + ((x1 * x1) * (6.0 + (4.0 * t_3)))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + ((x1 - (4.0 * (x1 * (x2 * (3.0 - (x2 * 2.0)))))) + (3.0 * fma(x2, -2.0, ((pow(x1, 2.0) * (x1 + (3.0 + (x2 * 2.0)))) - x1))));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x2 * 2.0) + t_0) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(x1 - t_1) / t_2) t_4 = Float64(3.0 * Float64(x1 * x1)) t_5 = Float64(Float64(t_4 - fma(x2, -2.0, x1)) / fma(x1, x1, 1.0)) t_6 = Float64(Float64(fma(x2, -2.0, x1) - t_4) / fma(x1, x1, 1.0)) tmp = 0.0 if (x1 <= -7.6e+153) tmp = Float64(6.0 + Float64(Float64(x1 * -17.0) + Float64(Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0)))) + Float64(-6.0 * x2)))); elseif (x1 <= -1.15e-175) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(Float64(t_4 * t_5) + Float64(fma(x1, x1, 1.0) * Float64(x1 + Float64(x1 * Float64(Float64(2.0 * Float64(t_6 * Float64(t_6 - -3.0))) + Float64(x1 * fma(t_5, 4.0, -6.0))))))))); elseif (x1 <= 2e+105) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(t_1 - x1) / t_2)) * Float64(3.0 + t_3)) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_3)))) * Float64(-1.0 - Float64(x1 * x1))) + Float64(3.0 * t_0)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(x1 + Float64(Float64(x1 - Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(x2 * 2.0)))))) + Float64(3.0 * fma(x2, -2.0, Float64(Float64((x1 ^ 2.0) * Float64(x1 + Float64(3.0 + Float64(x2 * 2.0)))) - x1))))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 - t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$4 - N[(x2 * -2.0 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(x2 * -2.0 + x1), $MachinePrecision] - t$95$4), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -7.6e+153], N[(6.0 + N[(N[(x1 * -17.0), $MachinePrecision] + N[(N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-6.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.15e-175], N[(x1 + N[(3.0 * N[(N[(t$95$4 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$4 * t$95$5), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(x1 * N[(N[(2.0 * N[(t$95$6 * N[(t$95$6 - -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(t$95$5 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+105], N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(t$95$1 - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 - N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0 + N[(N[(N[Power[x1, 2.0], $MachinePrecision] * N[(x1 + N[(3.0 + N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x2 \cdot 2 + t\_0\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{x1 - t\_1}{t\_2}\\
t_4 := 3 \cdot \left(x1 \cdot x1\right)\\
t_5 := \frac{t\_4 - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_6 := \frac{\mathsf{fma}\left(x2, -2, x1\right) - t\_4}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 \leq -7.6 \cdot 10^{+153}:\\
\;\;\;\;6 + \left(x1 \cdot -17 + \left(3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right) + -6 \cdot x2\right)\right)\\
\mathbf{elif}\;x1 \leq -1.15 \cdot 10^{-175}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_4 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, t\_4 \cdot t\_5 + \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + x1 \cdot \left(2 \cdot \left(t\_6 \cdot \left(t\_6 - -3\right)\right) + x1 \cdot \mathsf{fma}\left(t\_5, 4, -6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+105}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(\left(\left(x1 \cdot 2\right) \cdot \frac{t\_1 - x1}{t\_2}\right) \cdot \left(3 + t\_3\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_3\right)\right) \cdot \left(-1 - x1 \cdot x1\right) + 3 \cdot t\_0\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - x2 \cdot 2\right)\right)\right)\right) + 3 \cdot \mathsf{fma}\left(x2, -2, {x1}^{2} \cdot \left(x1 + \left(3 + x2 \cdot 2\right)\right) - x1\right)\right)\\
\end{array}
\end{array}
if x1 < -7.59999999999999933e153Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 69.6%
if -7.59999999999999933e153 < x1 < -1.15e-175Initial program 79.9%
Simplified99.8%
if -1.15e-175 < x1 < 1.9999999999999999e105Initial program 98.5%
Taylor expanded in x1 around inf 96.7%
Taylor expanded in x1 around 0 98.5%
mul-1-neg98.5%
unsub-neg98.5%
*-commutative98.5%
Simplified98.5%
if 1.9999999999999999e105 < x1 Initial program 24.5%
Taylor expanded in x1 around 0 1.3%
Taylor expanded in x1 around 0 71.4%
*-commutative71.4%
fma-def73.5%
+-commutative73.5%
mul-1-neg73.5%
unsub-neg73.5%
+-commutative73.5%
unpow373.5%
unpow273.5%
distribute-lft-out95.9%
cancel-sign-sub-inv95.9%
metadata-eval95.9%
Simplified95.9%
Final simplification95.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x2 2.0) t_1))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- t_2 x1) t_3))
(t_5 (/ (- x1 t_2) t_3))
(t_6
(*
(+
(* (* (* x1 2.0) t_4) (+ 3.0 t_5))
(* (* x1 x1) (+ 6.0 (* 4.0 t_5))))
(- -1.0 (* x1 x1)))))
(if (<=
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* x2 2.0)) x1) t_3))
(+ x1 (+ t_0 (+ t_6 (* t_1 t_4))))))
INFINITY)
(+ x1 (+ (+ x1 (+ (+ t_6 (* 3.0 t_1)) t_0)) (* 3.0 (- (* x2 -2.0) x1))))
(+
6.0
(+
(* x1 -17.0)
(+ (* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0)))) (* -6.0 x2)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x2 * 2.0) + t_1;
double t_3 = (x1 * x1) + 1.0;
double t_4 = (t_2 - x1) / t_3;
double t_5 = (x1 - t_2) / t_3;
double t_6 = ((((x1 * 2.0) * t_4) * (3.0 + t_5)) + ((x1 * x1) * (6.0 + (4.0 * t_5)))) * (-1.0 - (x1 * x1));
double tmp;
if ((x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_3)) + (x1 + (t_0 + (t_6 + (t_1 * t_4)))))) <= ((double) INFINITY)) {
tmp = x1 + ((x1 + ((t_6 + (3.0 * t_1)) + t_0)) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = 6.0 + ((x1 * -17.0) + ((3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (-6.0 * x2)));
}
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 = (x2 * 2.0) + t_1;
double t_3 = (x1 * x1) + 1.0;
double t_4 = (t_2 - x1) / t_3;
double t_5 = (x1 - t_2) / t_3;
double t_6 = ((((x1 * 2.0) * t_4) * (3.0 + t_5)) + ((x1 * x1) * (6.0 + (4.0 * t_5)))) * (-1.0 - (x1 * x1));
double tmp;
if ((x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_3)) + (x1 + (t_0 + (t_6 + (t_1 * t_4)))))) <= Double.POSITIVE_INFINITY) {
tmp = x1 + ((x1 + ((t_6 + (3.0 * t_1)) + t_0)) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = 6.0 + ((x1 * -17.0) + ((3.0 * (Math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (-6.0 * x2)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = (x2 * 2.0) + t_1 t_3 = (x1 * x1) + 1.0 t_4 = (t_2 - x1) / t_3 t_5 = (x1 - t_2) / t_3 t_6 = ((((x1 * 2.0) * t_4) * (3.0 + t_5)) + ((x1 * x1) * (6.0 + (4.0 * t_5)))) * (-1.0 - (x1 * x1)) tmp = 0 if (x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_3)) + (x1 + (t_0 + (t_6 + (t_1 * t_4)))))) <= math.inf: tmp = x1 + ((x1 + ((t_6 + (3.0 * t_1)) + t_0)) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = 6.0 + ((x1 * -17.0) + ((3.0 * (math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (-6.0 * x2))) 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(x2 * 2.0) + t_1) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(t_2 - x1) / t_3) t_5 = Float64(Float64(x1 - t_2) / t_3) t_6 = Float64(Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(3.0 + t_5)) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5)))) * Float64(-1.0 - Float64(x1 * x1))) tmp = 0.0 if (Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(x2 * 2.0)) - x1) / t_3)) + Float64(x1 + Float64(t_0 + Float64(t_6 + Float64(t_1 * t_4)))))) <= Inf) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(t_6 + Float64(3.0 * t_1)) + t_0)) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(6.0 + Float64(Float64(x1 * -17.0) + Float64(Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0)))) + Float64(-6.0 * x2)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = (x2 * 2.0) + t_1; t_3 = (x1 * x1) + 1.0; t_4 = (t_2 - x1) / t_3; t_5 = (x1 - t_2) / t_3; t_6 = ((((x1 * 2.0) * t_4) * (3.0 + t_5)) + ((x1 * x1) * (6.0 + (4.0 * t_5)))) * (-1.0 - (x1 * x1)); tmp = 0.0; if ((x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_3)) + (x1 + (t_0 + (t_6 + (t_1 * t_4)))))) <= Inf) tmp = x1 + ((x1 + ((t_6 + (3.0 * t_1)) + t_0)) + (3.0 * ((x2 * -2.0) - x1))); else tmp = 6.0 + ((x1 * -17.0) + ((3.0 * ((x1 ^ 2.0) * (3.0 - (x2 * -2.0)))) + (-6.0 * x2))); 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[(x2 * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$2 - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 - t$95$2), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$0 + N[(t$95$6 + N[(t$95$1 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(N[(x1 + N[(N[(t$95$6 + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 + N[(N[(x1 * -17.0), $MachinePrecision] + N[(N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-6.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x2 \cdot 2 + t\_1\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{t\_2 - x1}{t\_3}\\
t_5 := \frac{x1 - t\_2}{t\_3}\\
t_6 := \left(\left(\left(x1 \cdot 2\right) \cdot t\_4\right) \cdot \left(3 + t\_5\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right)\right) \cdot \left(-1 - x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(3 \cdot \frac{\left(t\_1 - x2 \cdot 2\right) - x1}{t\_3} + \left(x1 + \left(t\_0 + \left(t\_6 + t\_1 \cdot t\_4\right)\right)\right)\right) \leq \infty:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t\_6 + 3 \cdot t\_1\right) + t\_0\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;6 + \left(x1 \cdot -17 + \left(3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right) + -6 \cdot x2\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.5%
Taylor expanded in x1 around inf 98.2%
Taylor expanded in x1 around 0 99.5%
mul-1-neg99.5%
unsub-neg99.5%
*-commutative99.5%
Simplified99.5%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 1.8%
Taylor expanded in x2 around 0 0.9%
*-commutative0.9%
Simplified0.9%
Taylor expanded in x1 around 0 60.6%
Final simplification87.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (+ (* x2 2.0) t_0))
(t_3 (/ (- x1 t_2) t_1)))
(if (<= x1 -1.35e+154)
(+
6.0
(+
(* x1 -17.0)
(+ (* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0)))) (* -6.0 x2))))
(if (<= x1 -1e+108)
(+
x1
(+
(+ x1 (* 6.0 (pow x1 4.0)))
(* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_1))))
(if (<= x1 3e+106)
(+
x1
(+
(+
x1
(+
(+
(*
(+
(* (* (* x1 2.0) (/ (- t_2 x1) t_1)) (+ 3.0 t_3))
(* (* x1 x1) (+ 6.0 (* 4.0 t_3))))
(- -1.0 (* x1 x1)))
(* 3.0 t_0))
(* x1 (* x1 x1))))
(* 3.0 (- (* x2 -2.0) x1))))
(+
x1
(+
(- x1 (* 4.0 (* x1 (* x2 (- 3.0 (* x2 2.0))))))
(*
3.0
(fma
x2
-2.0
(- (* (pow x1 2.0) (+ x1 (+ 3.0 (* x2 2.0)))) x1))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (x2 * 2.0) + t_0;
double t_3 = (x1 - t_2) / t_1;
double tmp;
if (x1 <= -1.35e+154) {
tmp = 6.0 + ((x1 * -17.0) + ((3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (-6.0 * x2)));
} else if (x1 <= -1e+108) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + (3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)));
} else if (x1 <= 3e+106) {
tmp = x1 + ((x1 + (((((((x1 * 2.0) * ((t_2 - x1) / t_1)) * (3.0 + t_3)) + ((x1 * x1) * (6.0 + (4.0 * t_3)))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + ((x1 - (4.0 * (x1 * (x2 * (3.0 - (x2 * 2.0)))))) + (3.0 * fma(x2, -2.0, ((pow(x1, 2.0) * (x1 + (3.0 + (x2 * 2.0)))) - x1))));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(x2 * 2.0) + t_0) t_3 = Float64(Float64(x1 - t_2) / t_1) tmp = 0.0 if (x1 <= -1.35e+154) tmp = Float64(6.0 + Float64(Float64(x1 * -17.0) + Float64(Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0)))) + Float64(-6.0 * x2)))); elseif (x1 <= -1e+108) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(x2 * 2.0)) - x1) / t_1)))); elseif (x1 <= 3e+106) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(t_2 - x1) / t_1)) * Float64(3.0 + t_3)) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_3)))) * Float64(-1.0 - Float64(x1 * x1))) + Float64(3.0 * t_0)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(x1 + Float64(Float64(x1 - Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(x2 * 2.0)))))) + Float64(3.0 * fma(x2, -2.0, Float64(Float64((x1 ^ 2.0) * Float64(x1 + Float64(3.0 + Float64(x2 * 2.0)))) - x1))))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 - t$95$2), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -1.35e+154], N[(6.0 + N[(N[(x1 * -17.0), $MachinePrecision] + N[(N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-6.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1e+108], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3e+106], N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(t$95$2 - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 - N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0 + N[(N[(N[Power[x1, 2.0], $MachinePrecision] * N[(x1 + N[(3.0 + N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x2 \cdot 2 + t\_0\\
t_3 := \frac{x1 - t\_2}{t\_1}\\
\mathbf{if}\;x1 \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;6 + \left(x1 \cdot -17 + \left(3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right) + -6 \cdot x2\right)\right)\\
\mathbf{elif}\;x1 \leq -1 \cdot 10^{+108}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 3 \cdot \frac{\left(t\_0 - x2 \cdot 2\right) - x1}{t\_1}\right)\\
\mathbf{elif}\;x1 \leq 3 \cdot 10^{+106}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(\left(\left(x1 \cdot 2\right) \cdot \frac{t\_2 - x1}{t\_1}\right) \cdot \left(3 + t\_3\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_3\right)\right) \cdot \left(-1 - x1 \cdot x1\right) + 3 \cdot t\_0\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - x2 \cdot 2\right)\right)\right)\right) + 3 \cdot \mathsf{fma}\left(x2, -2, {x1}^{2} \cdot \left(x1 + \left(3 + x2 \cdot 2\right)\right) - x1\right)\right)\\
\end{array}
\end{array}
if x1 < -1.35000000000000003e154Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 69.6%
if -1.35000000000000003e154 < x1 < -1e108Initial program 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
if -1e108 < x1 < 3.0000000000000001e106Initial program 98.8%
Taylor expanded in x1 around inf 97.5%
Taylor expanded in x1 around 0 98.9%
mul-1-neg98.9%
unsub-neg98.9%
*-commutative98.9%
Simplified98.9%
if 3.0000000000000001e106 < x1 Initial program 24.5%
Taylor expanded in x1 around 0 1.3%
Taylor expanded in x1 around 0 71.4%
*-commutative71.4%
fma-def73.5%
+-commutative73.5%
mul-1-neg73.5%
unsub-neg73.5%
+-commutative73.5%
unpow373.5%
unpow273.5%
distribute-lft-out95.9%
cancel-sign-sub-inv95.9%
metadata-eval95.9%
Simplified95.9%
Final simplification95.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0)))))
(t_3 (+ (* x2 2.0) t_0))
(t_4 (/ (- x1 t_3) t_1))
(t_5 (* 4.0 (* x2 (- 3.0 (* x2 2.0)))))
(t_6 (* x1 (- -1.0 t_5))))
(if (<= x1 -1.35e+154)
(+ 6.0 (+ (* x1 -17.0) (+ t_2 (* -6.0 x2))))
(if (<= x1 -5.5e+102)
(+
x1
(+
(+ x1 (* 6.0 (pow x1 4.0)))
(* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_1))))
(if (<= x1 1.35e+154)
(+
x1
(+
(+
x1
(+
(+
(*
(+
(* (* (* x1 2.0) (/ (- t_3 x1) t_1)) (+ 3.0 t_4))
(* (* x1 x1) (+ 6.0 (* 4.0 t_4))))
(- -1.0 (* x1 x1)))
(* 3.0 t_0))
(* x1 (* x1 x1))))
(* 3.0 (- (* x2 -2.0) x1))))
(if (<= x1 1.6e+181)
t_6
(if (<= x1 4.8e+203)
(/ (- (pow x1 2.0) (pow (* -6.0 x2) 2.0)) (- x1 (* -6.0 x2)))
(if (<= x1 3.9e+233)
t_6
(+ x1 (+ (* -6.0 x2) (- t_2 (* x1 (+ 2.0 t_5)))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0)));
double t_3 = (x2 * 2.0) + t_0;
double t_4 = (x1 - t_3) / t_1;
double t_5 = 4.0 * (x2 * (3.0 - (x2 * 2.0)));
double t_6 = x1 * (-1.0 - t_5);
double tmp;
if (x1 <= -1.35e+154) {
tmp = 6.0 + ((x1 * -17.0) + (t_2 + (-6.0 * x2)));
} else if (x1 <= -5.5e+102) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + (3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (((((((x1 * 2.0) * ((t_3 - x1) / t_1)) * (3.0 + t_4)) + ((x1 * x1) * (6.0 + (4.0 * t_4)))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= 1.6e+181) {
tmp = t_6;
} else if (x1 <= 4.8e+203) {
tmp = (pow(x1, 2.0) - pow((-6.0 * x2), 2.0)) / (x1 - (-6.0 * x2));
} else if (x1 <= 3.9e+233) {
tmp = t_6;
} else {
tmp = x1 + ((-6.0 * x2) + (t_2 - (x1 * (2.0 + t_5))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = 3.0d0 * ((x1 ** 2.0d0) * (3.0d0 - (x2 * (-2.0d0))))
t_3 = (x2 * 2.0d0) + t_0
t_4 = (x1 - t_3) / t_1
t_5 = 4.0d0 * (x2 * (3.0d0 - (x2 * 2.0d0)))
t_6 = x1 * ((-1.0d0) - t_5)
if (x1 <= (-1.35d+154)) then
tmp = 6.0d0 + ((x1 * (-17.0d0)) + (t_2 + ((-6.0d0) * x2)))
else if (x1 <= (-5.5d+102)) then
tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + (3.0d0 * (((t_0 - (x2 * 2.0d0)) - x1) / t_1)))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((x1 + (((((((x1 * 2.0d0) * ((t_3 - x1) / t_1)) * (3.0d0 + t_4)) + ((x1 * x1) * (6.0d0 + (4.0d0 * t_4)))) * ((-1.0d0) - (x1 * x1))) + (3.0d0 * t_0)) + (x1 * (x1 * x1)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else if (x1 <= 1.6d+181) then
tmp = t_6
else if (x1 <= 4.8d+203) then
tmp = ((x1 ** 2.0d0) - (((-6.0d0) * x2) ** 2.0d0)) / (x1 - ((-6.0d0) * x2))
else if (x1 <= 3.9d+233) then
tmp = t_6
else
tmp = x1 + (((-6.0d0) * x2) + (t_2 - (x1 * (2.0d0 + t_5))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 * (Math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)));
double t_3 = (x2 * 2.0) + t_0;
double t_4 = (x1 - t_3) / t_1;
double t_5 = 4.0 * (x2 * (3.0 - (x2 * 2.0)));
double t_6 = x1 * (-1.0 - t_5);
double tmp;
if (x1 <= -1.35e+154) {
tmp = 6.0 + ((x1 * -17.0) + (t_2 + (-6.0 * x2)));
} else if (x1 <= -5.5e+102) {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + (3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (((((((x1 * 2.0) * ((t_3 - x1) / t_1)) * (3.0 + t_4)) + ((x1 * x1) * (6.0 + (4.0 * t_4)))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= 1.6e+181) {
tmp = t_6;
} else if (x1 <= 4.8e+203) {
tmp = (Math.pow(x1, 2.0) - Math.pow((-6.0 * x2), 2.0)) / (x1 - (-6.0 * x2));
} else if (x1 <= 3.9e+233) {
tmp = t_6;
} else {
tmp = x1 + ((-6.0 * x2) + (t_2 - (x1 * (2.0 + t_5))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = 3.0 * (math.pow(x1, 2.0) * (3.0 - (x2 * -2.0))) t_3 = (x2 * 2.0) + t_0 t_4 = (x1 - t_3) / t_1 t_5 = 4.0 * (x2 * (3.0 - (x2 * 2.0))) t_6 = x1 * (-1.0 - t_5) tmp = 0 if x1 <= -1.35e+154: tmp = 6.0 + ((x1 * -17.0) + (t_2 + (-6.0 * x2))) elif x1 <= -5.5e+102: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + (3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1))) elif x1 <= 1.35e+154: tmp = x1 + ((x1 + (((((((x1 * 2.0) * ((t_3 - x1) / t_1)) * (3.0 + t_4)) + ((x1 * x1) * (6.0 + (4.0 * t_4)))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1))) elif x1 <= 1.6e+181: tmp = t_6 elif x1 <= 4.8e+203: tmp = (math.pow(x1, 2.0) - math.pow((-6.0 * x2), 2.0)) / (x1 - (-6.0 * x2)) elif x1 <= 3.9e+233: tmp = t_6 else: tmp = x1 + ((-6.0 * x2) + (t_2 - (x1 * (2.0 + t_5)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0)))) t_3 = Float64(Float64(x2 * 2.0) + t_0) t_4 = Float64(Float64(x1 - t_3) / t_1) t_5 = Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(x2 * 2.0)))) t_6 = Float64(x1 * Float64(-1.0 - t_5)) tmp = 0.0 if (x1 <= -1.35e+154) tmp = Float64(6.0 + Float64(Float64(x1 * -17.0) + Float64(t_2 + Float64(-6.0 * x2)))); elseif (x1 <= -5.5e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(x2 * 2.0)) - x1) / t_1)))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(t_3 - x1) / t_1)) * Float64(3.0 + t_4)) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_4)))) * Float64(-1.0 - Float64(x1 * x1))) + Float64(3.0 * t_0)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); elseif (x1 <= 1.6e+181) tmp = t_6; elseif (x1 <= 4.8e+203) tmp = Float64(Float64((x1 ^ 2.0) - (Float64(-6.0 * x2) ^ 2.0)) / Float64(x1 - Float64(-6.0 * x2))); elseif (x1 <= 3.9e+233) tmp = t_6; else tmp = Float64(x1 + Float64(Float64(-6.0 * x2) + Float64(t_2 - Float64(x1 * Float64(2.0 + t_5))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = 3.0 * ((x1 ^ 2.0) * (3.0 - (x2 * -2.0))); t_3 = (x2 * 2.0) + t_0; t_4 = (x1 - t_3) / t_1; t_5 = 4.0 * (x2 * (3.0 - (x2 * 2.0))); t_6 = x1 * (-1.0 - t_5); tmp = 0.0; if (x1 <= -1.35e+154) tmp = 6.0 + ((x1 * -17.0) + (t_2 + (-6.0 * x2))); elseif (x1 <= -5.5e+102) tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + (3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1))); elseif (x1 <= 1.35e+154) tmp = x1 + ((x1 + (((((((x1 * 2.0) * ((t_3 - x1) / t_1)) * (3.0 + t_4)) + ((x1 * x1) * (6.0 + (4.0 * t_4)))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1))); elseif (x1 <= 1.6e+181) tmp = t_6; elseif (x1 <= 4.8e+203) tmp = ((x1 ^ 2.0) - ((-6.0 * x2) ^ 2.0)) / (x1 - (-6.0 * x2)); elseif (x1 <= 3.9e+233) tmp = t_6; else tmp = x1 + ((-6.0 * x2) + (t_2 - (x1 * (2.0 + t_5)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 - t$95$3), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(4.0 * N[(x2 * N[(3.0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(-1.0 - t$95$5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.35e+154], N[(6.0 + N[(N[(x1 * -17.0), $MachinePrecision] + N[(t$95$2 + N[(-6.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5.5e+102], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(t$95$3 - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$4), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.6e+181], t$95$6, If[LessEqual[x1, 4.8e+203], N[(N[(N[Power[x1, 2.0], $MachinePrecision] - N[Power[N[(-6.0 * x2), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(-6.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.9e+233], t$95$6, N[(x1 + N[(N[(-6.0 * x2), $MachinePrecision] + N[(t$95$2 - N[(x1 * N[(2.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := 3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right)\\
t_3 := x2 \cdot 2 + t\_0\\
t_4 := \frac{x1 - t\_3}{t\_1}\\
t_5 := 4 \cdot \left(x2 \cdot \left(3 - x2 \cdot 2\right)\right)\\
t_6 := x1 \cdot \left(-1 - t\_5\right)\\
\mathbf{if}\;x1 \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;6 + \left(x1 \cdot -17 + \left(t\_2 + -6 \cdot x2\right)\right)\\
\mathbf{elif}\;x1 \leq -5.5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 3 \cdot \frac{\left(t\_0 - x2 \cdot 2\right) - x1}{t\_1}\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(\left(\left(x1 \cdot 2\right) \cdot \frac{t\_3 - x1}{t\_1}\right) \cdot \left(3 + t\_4\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_4\right)\right) \cdot \left(-1 - x1 \cdot x1\right) + 3 \cdot t\_0\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 1.6 \cdot 10^{+181}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;x1 \leq 4.8 \cdot 10^{+203}:\\
\;\;\;\;\frac{{x1}^{2} - {\left(-6 \cdot x2\right)}^{2}}{x1 - -6 \cdot x2}\\
\mathbf{elif}\;x1 \leq 3.9 \cdot 10^{+233}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(-6 \cdot x2 + \left(t\_2 - x1 \cdot \left(2 + t\_5\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.35000000000000003e154Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 69.6%
if -1.35000000000000003e154 < x1 < -5.49999999999999981e102Initial program 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
if -5.49999999999999981e102 < x1 < 1.35000000000000003e154Initial program 98.9%
Taylor expanded in x1 around inf 97.6%
Taylor expanded in x1 around 0 98.9%
mul-1-neg98.9%
unsub-neg98.9%
*-commutative98.9%
Simplified98.9%
if 1.35000000000000003e154 < x1 < 1.6e181 or 4.8000000000000002e203 < x1 < 3.8999999999999999e233Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 92.3%
fma-def100.0%
fma-neg100.0%
fma-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x1 around inf 100.0%
if 1.6e181 < x1 < 4.8000000000000002e203Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 5.4%
*-commutative5.4%
Simplified5.4%
flip-+100.0%
pow2100.0%
pow2100.0%
Applied egg-rr100.0%
if 3.8999999999999999e233 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 88.2%
Final simplification95.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (+ (* x2 2.0) t_0))
(t_3 (* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0)))))
(t_4 (/ (- x1 t_2) t_1))
(t_5 (* 4.0 (* x2 (- 3.0 (* x2 2.0))))))
(if (<= x1 -1.35e+154)
(+ 6.0 (+ (* x1 -17.0) (+ t_3 (* -6.0 x2))))
(if (<= x1 -5.5e+102)
(+
x1
(+
(+ x1 (* 6.0 (pow x1 4.0)))
(* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_1))))
(if (<= x1 1.35e+154)
(+
x1
(+
(+
x1
(+
(+
(*
(+
(* (* (* x1 2.0) (/ (- t_2 x1) t_1)) (+ 3.0 t_4))
(* (* x1 x1) (+ 6.0 (* 4.0 t_4))))
(- -1.0 (* x1 x1)))
(* 3.0 t_0))
(* x1 (* x1 x1))))
(* 3.0 (- (* x2 -2.0) x1))))
(if (<= x1 1.95e+188)
(* x1 (- -1.0 t_5))
(+ x1 (+ (* -6.0 x2) (- t_3 (* x1 (+ 2.0 t_5)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (x2 * 2.0) + t_0;
double t_3 = 3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0)));
double t_4 = (x1 - t_2) / t_1;
double t_5 = 4.0 * (x2 * (3.0 - (x2 * 2.0)));
double tmp;
if (x1 <= -1.35e+154) {
tmp = 6.0 + ((x1 * -17.0) + (t_3 + (-6.0 * x2)));
} else if (x1 <= -5.5e+102) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + (3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (((((((x1 * 2.0) * ((t_2 - x1) / t_1)) * (3.0 + t_4)) + ((x1 * x1) * (6.0 + (4.0 * t_4)))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= 1.95e+188) {
tmp = x1 * (-1.0 - t_5);
} else {
tmp = x1 + ((-6.0 * x2) + (t_3 - (x1 * (2.0 + t_5))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = (x2 * 2.0d0) + t_0
t_3 = 3.0d0 * ((x1 ** 2.0d0) * (3.0d0 - (x2 * (-2.0d0))))
t_4 = (x1 - t_2) / t_1
t_5 = 4.0d0 * (x2 * (3.0d0 - (x2 * 2.0d0)))
if (x1 <= (-1.35d+154)) then
tmp = 6.0d0 + ((x1 * (-17.0d0)) + (t_3 + ((-6.0d0) * x2)))
else if (x1 <= (-5.5d+102)) then
tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + (3.0d0 * (((t_0 - (x2 * 2.0d0)) - x1) / t_1)))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((x1 + (((((((x1 * 2.0d0) * ((t_2 - x1) / t_1)) * (3.0d0 + t_4)) + ((x1 * x1) * (6.0d0 + (4.0d0 * t_4)))) * ((-1.0d0) - (x1 * x1))) + (3.0d0 * t_0)) + (x1 * (x1 * x1)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else if (x1 <= 1.95d+188) then
tmp = x1 * ((-1.0d0) - t_5)
else
tmp = x1 + (((-6.0d0) * x2) + (t_3 - (x1 * (2.0d0 + t_5))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (x2 * 2.0) + t_0;
double t_3 = 3.0 * (Math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)));
double t_4 = (x1 - t_2) / t_1;
double t_5 = 4.0 * (x2 * (3.0 - (x2 * 2.0)));
double tmp;
if (x1 <= -1.35e+154) {
tmp = 6.0 + ((x1 * -17.0) + (t_3 + (-6.0 * x2)));
} else if (x1 <= -5.5e+102) {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + (3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (((((((x1 * 2.0) * ((t_2 - x1) / t_1)) * (3.0 + t_4)) + ((x1 * x1) * (6.0 + (4.0 * t_4)))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= 1.95e+188) {
tmp = x1 * (-1.0 - t_5);
} else {
tmp = x1 + ((-6.0 * x2) + (t_3 - (x1 * (2.0 + t_5))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = (x2 * 2.0) + t_0 t_3 = 3.0 * (math.pow(x1, 2.0) * (3.0 - (x2 * -2.0))) t_4 = (x1 - t_2) / t_1 t_5 = 4.0 * (x2 * (3.0 - (x2 * 2.0))) tmp = 0 if x1 <= -1.35e+154: tmp = 6.0 + ((x1 * -17.0) + (t_3 + (-6.0 * x2))) elif x1 <= -5.5e+102: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + (3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1))) elif x1 <= 1.35e+154: tmp = x1 + ((x1 + (((((((x1 * 2.0) * ((t_2 - x1) / t_1)) * (3.0 + t_4)) + ((x1 * x1) * (6.0 + (4.0 * t_4)))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1))) elif x1 <= 1.95e+188: tmp = x1 * (-1.0 - t_5) else: tmp = x1 + ((-6.0 * x2) + (t_3 - (x1 * (2.0 + t_5)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(x2 * 2.0) + t_0) t_3 = Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0)))) t_4 = Float64(Float64(x1 - t_2) / t_1) t_5 = Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(x2 * 2.0)))) tmp = 0.0 if (x1 <= -1.35e+154) tmp = Float64(6.0 + Float64(Float64(x1 * -17.0) + Float64(t_3 + Float64(-6.0 * x2)))); elseif (x1 <= -5.5e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(x2 * 2.0)) - x1) / t_1)))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(t_2 - x1) / t_1)) * Float64(3.0 + t_4)) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_4)))) * Float64(-1.0 - Float64(x1 * x1))) + Float64(3.0 * t_0)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); elseif (x1 <= 1.95e+188) tmp = Float64(x1 * Float64(-1.0 - t_5)); else tmp = Float64(x1 + Float64(Float64(-6.0 * x2) + Float64(t_3 - Float64(x1 * Float64(2.0 + t_5))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = (x2 * 2.0) + t_0; t_3 = 3.0 * ((x1 ^ 2.0) * (3.0 - (x2 * -2.0))); t_4 = (x1 - t_2) / t_1; t_5 = 4.0 * (x2 * (3.0 - (x2 * 2.0))); tmp = 0.0; if (x1 <= -1.35e+154) tmp = 6.0 + ((x1 * -17.0) + (t_3 + (-6.0 * x2))); elseif (x1 <= -5.5e+102) tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + (3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1))); elseif (x1 <= 1.35e+154) tmp = x1 + ((x1 + (((((((x1 * 2.0) * ((t_2 - x1) / t_1)) * (3.0 + t_4)) + ((x1 * x1) * (6.0 + (4.0 * t_4)))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1))); elseif (x1 <= 1.95e+188) tmp = x1 * (-1.0 - t_5); else tmp = x1 + ((-6.0 * x2) + (t_3 - (x1 * (2.0 + t_5)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 - t$95$2), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(4.0 * N[(x2 * N[(3.0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.35e+154], N[(6.0 + N[(N[(x1 * -17.0), $MachinePrecision] + N[(t$95$3 + N[(-6.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5.5e+102], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(t$95$2 - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$4), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.95e+188], N[(x1 * N[(-1.0 - t$95$5), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(-6.0 * x2), $MachinePrecision] + N[(t$95$3 - N[(x1 * N[(2.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x2 \cdot 2 + t\_0\\
t_3 := 3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right)\\
t_4 := \frac{x1 - t\_2}{t\_1}\\
t_5 := 4 \cdot \left(x2 \cdot \left(3 - x2 \cdot 2\right)\right)\\
\mathbf{if}\;x1 \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;6 + \left(x1 \cdot -17 + \left(t\_3 + -6 \cdot x2\right)\right)\\
\mathbf{elif}\;x1 \leq -5.5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 3 \cdot \frac{\left(t\_0 - x2 \cdot 2\right) - x1}{t\_1}\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(\left(\left(x1 \cdot 2\right) \cdot \frac{t\_2 - x1}{t\_1}\right) \cdot \left(3 + t\_4\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_4\right)\right) \cdot \left(-1 - x1 \cdot x1\right) + 3 \cdot t\_0\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 1.95 \cdot 10^{+188}:\\
\;\;\;\;x1 \cdot \left(-1 - t\_5\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(-6 \cdot x2 + \left(t\_3 - x1 \cdot \left(2 + t\_5\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.35000000000000003e154Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 69.6%
if -1.35000000000000003e154 < x1 < -5.49999999999999981e102Initial program 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
if -5.49999999999999981e102 < x1 < 1.35000000000000003e154Initial program 98.9%
Taylor expanded in x1 around inf 97.6%
Taylor expanded in x1 around 0 98.9%
mul-1-neg98.9%
unsub-neg98.9%
*-commutative98.9%
Simplified98.9%
if 1.35000000000000003e154 < x1 < 1.95e188Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 75.7%
fma-def88.2%
fma-neg88.2%
fma-neg88.2%
metadata-eval88.2%
metadata-eval88.2%
Simplified88.2%
Taylor expanded in x1 around inf 88.2%
if 1.95e188 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 79.3%
Final simplification93.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1
(+
6.0
(+
(* x1 -17.0)
(+ (* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0)))) (* -6.0 x2)))))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (+ (* x2 2.0) t_0))
(t_4 (/ (- x1 t_3) t_2)))
(if (<= x1 -1.35e+154)
t_1
(if (<= x1 -1e+108)
(+
x1
(+
(+ x1 (* 6.0 (pow x1 4.0)))
(* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_2))))
(if (<= x1 1.35e+154)
(+
x1
(+
(+
x1
(+
(+
(*
(+
(* (* (* x1 2.0) (/ (- t_3 x1) t_2)) (+ 3.0 t_4))
(* (* x1 x1) (+ 6.0 (* 4.0 t_4))))
(- -1.0 (* x1 x1)))
(* 3.0 t_0))
(* x1 (* x1 x1))))
(* 3.0 (- (* x2 -2.0) x1))))
(if (<= x1 1.32e+188)
(* x1 (- -1.0 (* 4.0 (* x2 (- 3.0 (* x2 2.0))))))
t_1))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = 6.0 + ((x1 * -17.0) + ((3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (-6.0 * x2)));
double t_2 = (x1 * x1) + 1.0;
double t_3 = (x2 * 2.0) + t_0;
double t_4 = (x1 - t_3) / t_2;
double tmp;
if (x1 <= -1.35e+154) {
tmp = t_1;
} else if (x1 <= -1e+108) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + (3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_2)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (((((((x1 * 2.0) * ((t_3 - x1) / t_2)) * (3.0 + t_4)) + ((x1 * x1) * (6.0 + (4.0 * t_4)))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= 1.32e+188) {
tmp = x1 * (-1.0 - (4.0 * (x2 * (3.0 - (x2 * 2.0)))));
} 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 = 6.0d0 + ((x1 * (-17.0d0)) + ((3.0d0 * ((x1 ** 2.0d0) * (3.0d0 - (x2 * (-2.0d0))))) + ((-6.0d0) * x2)))
t_2 = (x1 * x1) + 1.0d0
t_3 = (x2 * 2.0d0) + t_0
t_4 = (x1 - t_3) / t_2
if (x1 <= (-1.35d+154)) then
tmp = t_1
else if (x1 <= (-1d+108)) then
tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + (3.0d0 * (((t_0 - (x2 * 2.0d0)) - x1) / t_2)))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((x1 + (((((((x1 * 2.0d0) * ((t_3 - x1) / t_2)) * (3.0d0 + t_4)) + ((x1 * x1) * (6.0d0 + (4.0d0 * t_4)))) * ((-1.0d0) - (x1 * x1))) + (3.0d0 * t_0)) + (x1 * (x1 * x1)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else if (x1 <= 1.32d+188) then
tmp = x1 * ((-1.0d0) - (4.0d0 * (x2 * (3.0d0 - (x2 * 2.0d0)))))
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 = 6.0 + ((x1 * -17.0) + ((3.0 * (Math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (-6.0 * x2)));
double t_2 = (x1 * x1) + 1.0;
double t_3 = (x2 * 2.0) + t_0;
double t_4 = (x1 - t_3) / t_2;
double tmp;
if (x1 <= -1.35e+154) {
tmp = t_1;
} else if (x1 <= -1e+108) {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + (3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_2)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (((((((x1 * 2.0) * ((t_3 - x1) / t_2)) * (3.0 + t_4)) + ((x1 * x1) * (6.0 + (4.0 * t_4)))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= 1.32e+188) {
tmp = x1 * (-1.0 - (4.0 * (x2 * (3.0 - (x2 * 2.0)))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = 6.0 + ((x1 * -17.0) + ((3.0 * (math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (-6.0 * x2))) t_2 = (x1 * x1) + 1.0 t_3 = (x2 * 2.0) + t_0 t_4 = (x1 - t_3) / t_2 tmp = 0 if x1 <= -1.35e+154: tmp = t_1 elif x1 <= -1e+108: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + (3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_2))) elif x1 <= 1.35e+154: tmp = x1 + ((x1 + (((((((x1 * 2.0) * ((t_3 - x1) / t_2)) * (3.0 + t_4)) + ((x1 * x1) * (6.0 + (4.0 * t_4)))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1))) elif x1 <= 1.32e+188: tmp = x1 * (-1.0 - (4.0 * (x2 * (3.0 - (x2 * 2.0))))) else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(6.0 + Float64(Float64(x1 * -17.0) + Float64(Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0)))) + Float64(-6.0 * x2)))) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(x2 * 2.0) + t_0) t_4 = Float64(Float64(x1 - t_3) / t_2) tmp = 0.0 if (x1 <= -1.35e+154) tmp = t_1; elseif (x1 <= -1e+108) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(x2 * 2.0)) - x1) / t_2)))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(t_3 - x1) / t_2)) * Float64(3.0 + t_4)) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_4)))) * Float64(-1.0 - Float64(x1 * x1))) + Float64(3.0 * t_0)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); elseif (x1 <= 1.32e+188) tmp = Float64(x1 * Float64(-1.0 - Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(x2 * 2.0)))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = 6.0 + ((x1 * -17.0) + ((3.0 * ((x1 ^ 2.0) * (3.0 - (x2 * -2.0)))) + (-6.0 * x2))); t_2 = (x1 * x1) + 1.0; t_3 = (x2 * 2.0) + t_0; t_4 = (x1 - t_3) / t_2; tmp = 0.0; if (x1 <= -1.35e+154) tmp = t_1; elseif (x1 <= -1e+108) tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + (3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_2))); elseif (x1 <= 1.35e+154) tmp = x1 + ((x1 + (((((((x1 * 2.0) * ((t_3 - x1) / t_2)) * (3.0 + t_4)) + ((x1 * x1) * (6.0 + (4.0 * t_4)))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1))); elseif (x1 <= 1.32e+188) tmp = x1 * (-1.0 - (4.0 * (x2 * (3.0 - (x2 * 2.0))))); 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[(6.0 + N[(N[(x1 * -17.0), $MachinePrecision] + N[(N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-6.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 - t$95$3), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[x1, -1.35e+154], t$95$1, If[LessEqual[x1, -1e+108], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(t$95$3 - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$4), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.32e+188], N[(x1 * N[(-1.0 - N[(4.0 * N[(x2 * N[(3.0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := 6 + \left(x1 \cdot -17 + \left(3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right) + -6 \cdot x2\right)\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := x2 \cdot 2 + t\_0\\
t_4 := \frac{x1 - t\_3}{t\_2}\\
\mathbf{if}\;x1 \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -1 \cdot 10^{+108}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 3 \cdot \frac{\left(t\_0 - x2 \cdot 2\right) - x1}{t\_2}\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(\left(\left(x1 \cdot 2\right) \cdot \frac{t\_3 - x1}{t\_2}\right) \cdot \left(3 + t\_4\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_4\right)\right) \cdot \left(-1 - x1 \cdot x1\right) + 3 \cdot t\_0\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 1.32 \cdot 10^{+188}:\\
\;\;\;\;x1 \cdot \left(-1 - 4 \cdot \left(x2 \cdot \left(3 - x2 \cdot 2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -1.35000000000000003e154 or 1.3200000000000001e188 < x1 Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 73.1%
if -1.35000000000000003e154 < x1 < -1e108Initial program 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
if -1e108 < x1 < 1.35000000000000003e154Initial program 98.9%
Taylor expanded in x1 around inf 97.6%
Taylor expanded in x1 around 0 98.9%
mul-1-neg98.9%
unsub-neg98.9%
*-commutative98.9%
Simplified98.9%
if 1.35000000000000003e154 < x1 < 1.3200000000000001e188Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 75.7%
fma-def88.2%
fma-neg88.2%
fma-neg88.2%
metadata-eval88.2%
metadata-eval88.2%
Simplified88.2%
Taylor expanded in x1 around inf 88.2%
Final simplification93.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (- (* x1 -2.0) (* x2 (- 6.0 (* x1 -12.0))))))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* x2 (- 3.0 (* x2 2.0))))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (* 3.0 (/ (- (- t_1 (* x2 2.0)) x1) t_3)))
(t_5
(+
x1
(+
t_4
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_1)
(*
t_3
(+
(* (* x1 x1) (- (* 4.0 (/ (- (+ (* x2 2.0) t_1) x1) t_3)) 6.0))
(* (/ 1.0 x1) (* (* x1 2.0) (- (/ 1.0 x1) 3.0)))))))))))
(t_6 (+ x1 (+ (- x1 (* 4.0 (* x1 t_2))) t_4))))
(if (<= x1 -5.6e+102)
t_0
(if (<= x1 -125.0)
t_5
(if (<= x1 -3.25e-196)
t_6
(if (<= x1 4e-176)
t_0
(if (<= x1 2.4e+45)
t_6
(if (<= x1 1.35e+154)
t_5
(+ x1 (* x1 (- 1.0 (* 4.0 t_2))))))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0))));
double t_1 = x1 * (x1 * 3.0);
double t_2 = x2 * (3.0 - (x2 * 2.0));
double t_3 = (x1 * x1) + 1.0;
double t_4 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_3);
double t_5 = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_3 * (((x1 * x1) * ((4.0 * ((((x2 * 2.0) + t_1) - x1) / t_3)) - 6.0)) + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0)))))))));
double t_6 = x1 + ((x1 - (4.0 * (x1 * t_2))) + t_4);
double tmp;
if (x1 <= -5.6e+102) {
tmp = t_0;
} else if (x1 <= -125.0) {
tmp = t_5;
} else if (x1 <= -3.25e-196) {
tmp = t_6;
} else if (x1 <= 4e-176) {
tmp = t_0;
} else if (x1 <= 2.4e+45) {
tmp = t_6;
} else if (x1 <= 1.35e+154) {
tmp = t_5;
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * t_2)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 + ((x1 * (-2.0d0)) - (x2 * (6.0d0 - (x1 * (-12.0d0)))))
t_1 = x1 * (x1 * 3.0d0)
t_2 = x2 * (3.0d0 - (x2 * 2.0d0))
t_3 = (x1 * x1) + 1.0d0
t_4 = 3.0d0 * (((t_1 - (x2 * 2.0d0)) - x1) / t_3)
t_5 = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_1) + (t_3 * (((x1 * x1) * ((4.0d0 * ((((x2 * 2.0d0) + t_1) - x1) / t_3)) - 6.0d0)) + ((1.0d0 / x1) * ((x1 * 2.0d0) * ((1.0d0 / x1) - 3.0d0)))))))))
t_6 = x1 + ((x1 - (4.0d0 * (x1 * t_2))) + t_4)
if (x1 <= (-5.6d+102)) then
tmp = t_0
else if (x1 <= (-125.0d0)) then
tmp = t_5
else if (x1 <= (-3.25d-196)) then
tmp = t_6
else if (x1 <= 4d-176) then
tmp = t_0
else if (x1 <= 2.4d+45) then
tmp = t_6
else if (x1 <= 1.35d+154) then
tmp = t_5
else
tmp = x1 + (x1 * (1.0d0 - (4.0d0 * t_2)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0))));
double t_1 = x1 * (x1 * 3.0);
double t_2 = x2 * (3.0 - (x2 * 2.0));
double t_3 = (x1 * x1) + 1.0;
double t_4 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_3);
double t_5 = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_3 * (((x1 * x1) * ((4.0 * ((((x2 * 2.0) + t_1) - x1) / t_3)) - 6.0)) + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0)))))))));
double t_6 = x1 + ((x1 - (4.0 * (x1 * t_2))) + t_4);
double tmp;
if (x1 <= -5.6e+102) {
tmp = t_0;
} else if (x1 <= -125.0) {
tmp = t_5;
} else if (x1 <= -3.25e-196) {
tmp = t_6;
} else if (x1 <= 4e-176) {
tmp = t_0;
} else if (x1 <= 2.4e+45) {
tmp = t_6;
} else if (x1 <= 1.35e+154) {
tmp = t_5;
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * t_2)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0)))) t_1 = x1 * (x1 * 3.0) t_2 = x2 * (3.0 - (x2 * 2.0)) t_3 = (x1 * x1) + 1.0 t_4 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_3) t_5 = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_3 * (((x1 * x1) * ((4.0 * ((((x2 * 2.0) + t_1) - x1) / t_3)) - 6.0)) + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))))))) t_6 = x1 + ((x1 - (4.0 * (x1 * t_2))) + t_4) tmp = 0 if x1 <= -5.6e+102: tmp = t_0 elif x1 <= -125.0: tmp = t_5 elif x1 <= -3.25e-196: tmp = t_6 elif x1 <= 4e-176: tmp = t_0 elif x1 <= 2.4e+45: tmp = t_6 elif x1 <= 1.35e+154: tmp = t_5 else: tmp = x1 + (x1 * (1.0 - (4.0 * t_2))) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x1 * -2.0) - Float64(x2 * Float64(6.0 - Float64(x1 * -12.0))))) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(x2 * Float64(3.0 - Float64(x2 * 2.0))) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(x2 * 2.0)) - x1) / t_3)) t_5 = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_1) + Float64(t_3 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(Float64(Float64(x2 * 2.0) + t_1) - x1) / t_3)) - 6.0)) + Float64(Float64(1.0 / x1) * Float64(Float64(x1 * 2.0) * Float64(Float64(1.0 / x1) - 3.0)))))))))) t_6 = Float64(x1 + Float64(Float64(x1 - Float64(4.0 * Float64(x1 * t_2))) + t_4)) tmp = 0.0 if (x1 <= -5.6e+102) tmp = t_0; elseif (x1 <= -125.0) tmp = t_5; elseif (x1 <= -3.25e-196) tmp = t_6; elseif (x1 <= 4e-176) tmp = t_0; elseif (x1 <= 2.4e+45) tmp = t_6; elseif (x1 <= 1.35e+154) tmp = t_5; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 - Float64(4.0 * t_2)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0)))); t_1 = x1 * (x1 * 3.0); t_2 = x2 * (3.0 - (x2 * 2.0)); t_3 = (x1 * x1) + 1.0; t_4 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_3); t_5 = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_3 * (((x1 * x1) * ((4.0 * ((((x2 * 2.0) + t_1) - x1) / t_3)) - 6.0)) + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))))))); t_6 = x1 + ((x1 - (4.0 * (x1 * t_2))) + t_4); tmp = 0.0; if (x1 <= -5.6e+102) tmp = t_0; elseif (x1 <= -125.0) tmp = t_5; elseif (x1 <= -3.25e-196) tmp = t_6; elseif (x1 <= 4e-176) tmp = t_0; elseif (x1 <= 2.4e+45) tmp = t_6; elseif (x1 <= 1.35e+154) tmp = t_5; else tmp = x1 + (x1 * (1.0 - (4.0 * t_2))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] - N[(x2 * N[(6.0 - N[(x1 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x2 * N[(3.0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$1 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(t$95$4 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$1), $MachinePrecision] + N[(t$95$3 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x1), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(1.0 / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(N[(x1 - N[(4.0 * N[(x1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], t$95$0, If[LessEqual[x1, -125.0], t$95$5, If[LessEqual[x1, -3.25e-196], t$95$6, If[LessEqual[x1, 4e-176], t$95$0, If[LessEqual[x1, 2.4e+45], t$95$6, If[LessEqual[x1, 1.35e+154], t$95$5, N[(x1 + N[(x1 * N[(1.0 - N[(4.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 \cdot -2 - x2 \cdot \left(6 - x1 \cdot -12\right)\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x2 \cdot \left(3 - x2 \cdot 2\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := 3 \cdot \frac{\left(t\_1 - x2 \cdot 2\right) - x1}{t\_3}\\
t_5 := x1 + \left(t\_4 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_1 + t\_3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x2 \cdot 2 + t\_1\right) - x1}{t\_3} - 6\right) + \frac{1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right)\right)\right)\right)\right)\\
t_6 := x1 + \left(\left(x1 - 4 \cdot \left(x1 \cdot t\_2\right)\right) + t\_4\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq -125:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;x1 \leq -3.25 \cdot 10^{-196}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{-176}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 2.4 \cdot 10^{+45}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot t\_2\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102 or -3.2500000000000002e-196 < x1 < 4e-176Initial program 53.8%
Taylor expanded in x1 around 0 39.5%
Taylor expanded in x1 around 0 40.6%
fma-def41.8%
fma-neg41.8%
fma-neg41.8%
metadata-eval41.8%
metadata-eval41.8%
Simplified41.8%
Taylor expanded in x2 around 0 60.7%
if -5.60000000000000037e102 < x1 < -125 or 2.39999999999999989e45 < x1 < 1.35000000000000003e154Initial program 99.5%
Taylor expanded in x1 around inf 88.2%
Taylor expanded in x1 around inf 88.2%
Taylor expanded in x1 around inf 88.2%
if -125 < x1 < -3.2500000000000002e-196 or 4e-176 < x1 < 2.39999999999999989e45Initial program 99.3%
Taylor expanded in x1 around 0 91.8%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 52.8%
Final simplification74.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (- (* x1 -2.0) (* x2 (- 6.0 (* x1 -12.0))))))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* x2 (- 3.0 (* x2 2.0))))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (* 3.0 (/ (- (- t_1 (* x2 2.0)) x1) t_3)))
(t_5
(+
x1
(-
t_4
(-
(-
(-
(*
(+
(* 6.0 (* x1 x1))
(*
(- (/ (- (+ (* x2 2.0) t_1) x1) t_3) 3.0)
(* (* x1 2.0) (+ 3.0 (/ -1.0 x1)))))
(- -1.0 (* x1 x1)))
(* 3.0 t_1))
(* x1 (* x1 x1)))
x1))))
(t_6 (+ x1 (+ (- x1 (* 4.0 (* x1 t_2))) t_4))))
(if (<= x1 -3.5e+96)
t_0
(if (<= x1 -1.35e+19)
t_5
(if (<= x1 -3.2e-202)
t_6
(if (<= x1 9.5e-174)
t_0
(if (<= x1 2.4e+45)
t_6
(if (<= x1 1.35e+154)
t_5
(+ x1 (* x1 (- 1.0 (* 4.0 t_2))))))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0))));
double t_1 = x1 * (x1 * 3.0);
double t_2 = x2 * (3.0 - (x2 * 2.0));
double t_3 = (x1 * x1) + 1.0;
double t_4 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_3);
double t_5 = x1 + (t_4 - ((((((6.0 * (x1 * x1)) + ((((((x2 * 2.0) + t_1) - x1) / t_3) - 3.0) * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))) * (-1.0 - (x1 * x1))) - (3.0 * t_1)) - (x1 * (x1 * x1))) - x1));
double t_6 = x1 + ((x1 - (4.0 * (x1 * t_2))) + t_4);
double tmp;
if (x1 <= -3.5e+96) {
tmp = t_0;
} else if (x1 <= -1.35e+19) {
tmp = t_5;
} else if (x1 <= -3.2e-202) {
tmp = t_6;
} else if (x1 <= 9.5e-174) {
tmp = t_0;
} else if (x1 <= 2.4e+45) {
tmp = t_6;
} else if (x1 <= 1.35e+154) {
tmp = t_5;
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * t_2)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 + ((x1 * (-2.0d0)) - (x2 * (6.0d0 - (x1 * (-12.0d0)))))
t_1 = x1 * (x1 * 3.0d0)
t_2 = x2 * (3.0d0 - (x2 * 2.0d0))
t_3 = (x1 * x1) + 1.0d0
t_4 = 3.0d0 * (((t_1 - (x2 * 2.0d0)) - x1) / t_3)
t_5 = x1 + (t_4 - ((((((6.0d0 * (x1 * x1)) + ((((((x2 * 2.0d0) + t_1) - x1) / t_3) - 3.0d0) * ((x1 * 2.0d0) * (3.0d0 + ((-1.0d0) / x1))))) * ((-1.0d0) - (x1 * x1))) - (3.0d0 * t_1)) - (x1 * (x1 * x1))) - x1))
t_6 = x1 + ((x1 - (4.0d0 * (x1 * t_2))) + t_4)
if (x1 <= (-3.5d+96)) then
tmp = t_0
else if (x1 <= (-1.35d+19)) then
tmp = t_5
else if (x1 <= (-3.2d-202)) then
tmp = t_6
else if (x1 <= 9.5d-174) then
tmp = t_0
else if (x1 <= 2.4d+45) then
tmp = t_6
else if (x1 <= 1.35d+154) then
tmp = t_5
else
tmp = x1 + (x1 * (1.0d0 - (4.0d0 * t_2)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0))));
double t_1 = x1 * (x1 * 3.0);
double t_2 = x2 * (3.0 - (x2 * 2.0));
double t_3 = (x1 * x1) + 1.0;
double t_4 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_3);
double t_5 = x1 + (t_4 - ((((((6.0 * (x1 * x1)) + ((((((x2 * 2.0) + t_1) - x1) / t_3) - 3.0) * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))) * (-1.0 - (x1 * x1))) - (3.0 * t_1)) - (x1 * (x1 * x1))) - x1));
double t_6 = x1 + ((x1 - (4.0 * (x1 * t_2))) + t_4);
double tmp;
if (x1 <= -3.5e+96) {
tmp = t_0;
} else if (x1 <= -1.35e+19) {
tmp = t_5;
} else if (x1 <= -3.2e-202) {
tmp = t_6;
} else if (x1 <= 9.5e-174) {
tmp = t_0;
} else if (x1 <= 2.4e+45) {
tmp = t_6;
} else if (x1 <= 1.35e+154) {
tmp = t_5;
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * t_2)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0)))) t_1 = x1 * (x1 * 3.0) t_2 = x2 * (3.0 - (x2 * 2.0)) t_3 = (x1 * x1) + 1.0 t_4 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_3) t_5 = x1 + (t_4 - ((((((6.0 * (x1 * x1)) + ((((((x2 * 2.0) + t_1) - x1) / t_3) - 3.0) * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))) * (-1.0 - (x1 * x1))) - (3.0 * t_1)) - (x1 * (x1 * x1))) - x1)) t_6 = x1 + ((x1 - (4.0 * (x1 * t_2))) + t_4) tmp = 0 if x1 <= -3.5e+96: tmp = t_0 elif x1 <= -1.35e+19: tmp = t_5 elif x1 <= -3.2e-202: tmp = t_6 elif x1 <= 9.5e-174: tmp = t_0 elif x1 <= 2.4e+45: tmp = t_6 elif x1 <= 1.35e+154: tmp = t_5 else: tmp = x1 + (x1 * (1.0 - (4.0 * t_2))) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x1 * -2.0) - Float64(x2 * Float64(6.0 - Float64(x1 * -12.0))))) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(x2 * Float64(3.0 - Float64(x2 * 2.0))) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(x2 * 2.0)) - x1) / t_3)) t_5 = Float64(x1 + Float64(t_4 - Float64(Float64(Float64(Float64(Float64(Float64(6.0 * Float64(x1 * x1)) + Float64(Float64(Float64(Float64(Float64(Float64(x2 * 2.0) + t_1) - x1) / t_3) - 3.0) * Float64(Float64(x1 * 2.0) * Float64(3.0 + Float64(-1.0 / x1))))) * Float64(-1.0 - Float64(x1 * x1))) - Float64(3.0 * t_1)) - Float64(x1 * Float64(x1 * x1))) - x1))) t_6 = Float64(x1 + Float64(Float64(x1 - Float64(4.0 * Float64(x1 * t_2))) + t_4)) tmp = 0.0 if (x1 <= -3.5e+96) tmp = t_0; elseif (x1 <= -1.35e+19) tmp = t_5; elseif (x1 <= -3.2e-202) tmp = t_6; elseif (x1 <= 9.5e-174) tmp = t_0; elseif (x1 <= 2.4e+45) tmp = t_6; elseif (x1 <= 1.35e+154) tmp = t_5; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 - Float64(4.0 * t_2)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0)))); t_1 = x1 * (x1 * 3.0); t_2 = x2 * (3.0 - (x2 * 2.0)); t_3 = (x1 * x1) + 1.0; t_4 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_3); t_5 = x1 + (t_4 - ((((((6.0 * (x1 * x1)) + ((((((x2 * 2.0) + t_1) - x1) / t_3) - 3.0) * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))) * (-1.0 - (x1 * x1))) - (3.0 * t_1)) - (x1 * (x1 * x1))) - x1)); t_6 = x1 + ((x1 - (4.0 * (x1 * t_2))) + t_4); tmp = 0.0; if (x1 <= -3.5e+96) tmp = t_0; elseif (x1 <= -1.35e+19) tmp = t_5; elseif (x1 <= -3.2e-202) tmp = t_6; elseif (x1 <= 9.5e-174) tmp = t_0; elseif (x1 <= 2.4e+45) tmp = t_6; elseif (x1 <= 1.35e+154) tmp = t_5; else tmp = x1 + (x1 * (1.0 - (4.0 * t_2))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] - N[(x2 * N[(6.0 - N[(x1 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x2 * N[(3.0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$1 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(t$95$4 - N[(N[(N[(N[(N[(N[(6.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(N[(x1 - N[(4.0 * N[(x1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.5e+96], t$95$0, If[LessEqual[x1, -1.35e+19], t$95$5, If[LessEqual[x1, -3.2e-202], t$95$6, If[LessEqual[x1, 9.5e-174], t$95$0, If[LessEqual[x1, 2.4e+45], t$95$6, If[LessEqual[x1, 1.35e+154], t$95$5, N[(x1 + N[(x1 * N[(1.0 - N[(4.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 \cdot -2 - x2 \cdot \left(6 - x1 \cdot -12\right)\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x2 \cdot \left(3 - x2 \cdot 2\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := 3 \cdot \frac{\left(t\_1 - x2 \cdot 2\right) - x1}{t\_3}\\
t_5 := x1 + \left(t\_4 - \left(\left(\left(\left(6 \cdot \left(x1 \cdot x1\right) + \left(\frac{\left(x2 \cdot 2 + t\_1\right) - x1}{t\_3} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 + \frac{-1}{x1}\right)\right)\right) \cdot \left(-1 - x1 \cdot x1\right) - 3 \cdot t\_1\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\
t_6 := x1 + \left(\left(x1 - 4 \cdot \left(x1 \cdot t\_2\right)\right) + t\_4\right)\\
\mathbf{if}\;x1 \leq -3.5 \cdot 10^{+96}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq -1.35 \cdot 10^{+19}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;x1 \leq -3.2 \cdot 10^{-202}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;x1 \leq 9.5 \cdot 10^{-174}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 2.4 \cdot 10^{+45}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot t\_2\right)\\
\end{array}
\end{array}
if x1 < -3.4999999999999999e96 or -3.2000000000000001e-202 < x1 < 9.50000000000000075e-174Initial program 54.9%
Taylor expanded in x1 around 0 39.7%
Taylor expanded in x1 around 0 40.8%
fma-def42.0%
fma-neg42.0%
fma-neg42.0%
metadata-eval42.0%
metadata-eval42.0%
Simplified42.0%
Taylor expanded in x2 around 0 60.5%
if -3.4999999999999999e96 < x1 < -1.35e19 or 2.39999999999999989e45 < x1 < 1.35000000000000003e154Initial program 99.5%
Taylor expanded in x1 around inf 88.7%
Taylor expanded in x1 around inf 88.7%
Taylor expanded in x1 around inf 84.4%
if -1.35e19 < x1 < -3.2000000000000001e-202 or 9.50000000000000075e-174 < x1 < 2.39999999999999989e45Initial program 99.3%
Taylor expanded in x1 around 0 89.7%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 52.8%
Final simplification73.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x2 2.0) t_0))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- x1 t_1) t_2)))
(if (<= x1 -5.6e+102)
(+ x1 (- (* x1 -2.0) (* x2 (- 6.0 (* x1 -12.0)))))
(if (<= x1 1.35e+154)
(+
x1
(+
(+
x1
(+
(+
(*
(+
(* (* (* x1 2.0) (/ (- t_1 x1) t_2)) (+ 3.0 t_3))
(* (* x1 x1) (+ 6.0 (* 4.0 t_3))))
(- -1.0 (* x1 x1)))
(* 3.0 t_0))
(* x1 (* x1 x1))))
(* 3.0 (- (* x2 -2.0) x1))))
(+ x1 (* x1 (- 1.0 (* 4.0 (* x2 (- 3.0 (* x2 2.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x2 * 2.0) + t_0;
double t_2 = (x1 * x1) + 1.0;
double t_3 = (x1 - t_1) / t_2;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (((((((x1 * 2.0) * ((t_1 - x1) / t_2)) * (3.0 + t_3)) + ((x1 * x1) * (6.0 + (4.0 * t_3)))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (x2 * 2.0))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x2 * 2.0d0) + t_0
t_2 = (x1 * x1) + 1.0d0
t_3 = (x1 - t_1) / t_2
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x1 * (-2.0d0)) - (x2 * (6.0d0 - (x1 * (-12.0d0)))))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((x1 + (((((((x1 * 2.0d0) * ((t_1 - x1) / t_2)) * (3.0d0 + t_3)) + ((x1 * x1) * (6.0d0 + (4.0d0 * t_3)))) * ((-1.0d0) - (x1 * x1))) + (3.0d0 * t_0)) + (x1 * (x1 * x1)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else
tmp = x1 + (x1 * (1.0d0 - (4.0d0 * (x2 * (3.0d0 - (x2 * 2.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x2 * 2.0) + t_0;
double t_2 = (x1 * x1) + 1.0;
double t_3 = (x1 - t_1) / t_2;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (((((((x1 * 2.0) * ((t_1 - x1) / t_2)) * (3.0 + t_3)) + ((x1 * x1) * (6.0 + (4.0 * t_3)))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (x2 * 2.0))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x2 * 2.0) + t_0 t_2 = (x1 * x1) + 1.0 t_3 = (x1 - t_1) / t_2 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0)))) elif x1 <= 1.35e+154: tmp = x1 + ((x1 + (((((((x1 * 2.0) * ((t_1 - x1) / t_2)) * (3.0 + t_3)) + ((x1 * x1) * (6.0 + (4.0 * t_3)))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (x2 * 2.0)))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x2 * 2.0) + t_0) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(x1 - t_1) / t_2) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) - Float64(x2 * Float64(6.0 - Float64(x1 * -12.0))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(t_1 - x1) / t_2)) * Float64(3.0 + t_3)) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_3)))) * Float64(-1.0 - Float64(x1 * x1))) + Float64(3.0 * t_0)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 - Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(x2 * 2.0))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x2 * 2.0) + t_0; t_2 = (x1 * x1) + 1.0; t_3 = (x1 - t_1) / t_2; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0)))); elseif (x1 <= 1.35e+154) tmp = x1 + ((x1 + (((((((x1 * 2.0) * ((t_1 - x1) / t_2)) * (3.0 + t_3)) + ((x1 * x1) * (6.0 + (4.0 * t_3)))) * (-1.0 - (x1 * x1))) + (3.0 * t_0)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (x2 * 2.0)))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 - t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] - N[(x2 * N[(6.0 - N[(x1 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(t$95$1 - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 - N[(4.0 * N[(x2 * N[(3.0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x2 \cdot 2 + t\_0\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{x1 - t\_1}{t\_2}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 - x2 \cdot \left(6 - x1 \cdot -12\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(\left(\left(x1 \cdot 2\right) \cdot \frac{t\_1 - x1}{t\_2}\right) \cdot \left(3 + t\_3\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_3\right)\right) \cdot \left(-1 - x1 \cdot x1\right) + 3 \cdot t\_0\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot \left(x2 \cdot \left(3 - x2 \cdot 2\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 2.5%
fma-def2.5%
fma-neg2.5%
fma-neg2.5%
metadata-eval2.5%
metadata-eval2.5%
Simplified2.5%
Taylor expanded in x2 around 0 28.5%
if -5.60000000000000037e102 < x1 < 1.35000000000000003e154Initial program 98.9%
Taylor expanded in x1 around inf 97.6%
Taylor expanded in x1 around 0 98.9%
mul-1-neg98.9%
unsub-neg98.9%
*-commutative98.9%
Simplified98.9%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 52.8%
Final simplification81.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ (* x2 2.0) t_0) x1) t_1)))
(if (<= x1 -5.6e+102)
(+ x1 (- (* x1 -2.0) (* x2 (- 6.0 (* x1 -12.0)))))
(if (<= x1 1.35e+154)
(-
x1
(-
(* 3.0 (/ (+ x1 (- (* x2 2.0) t_0)) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(-
(* 3.0 t_0)
(*
(+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* 6.0 (* x1 x1)))
(- -1.0 (* x1 x1))))))))
(+ x1 (* x1 (- 1.0 (* 4.0 (* x2 (- 3.0 (* x2 2.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0))));
} else if (x1 <= 1.35e+154) {
tmp = x1 - ((3.0 * ((x1 + ((x2 * 2.0) - t_0)) / t_1)) - (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) - (((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + (6.0 * (x1 * x1))) * (-1.0 - (x1 * x1)))))));
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (x2 * 2.0))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = (((x2 * 2.0d0) + t_0) - x1) / t_1
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x1 * (-2.0d0)) - (x2 * (6.0d0 - (x1 * (-12.0d0)))))
else if (x1 <= 1.35d+154) then
tmp = x1 - ((3.0d0 * ((x1 + ((x2 * 2.0d0) - t_0)) / t_1)) - (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) - (((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + (6.0d0 * (x1 * x1))) * ((-1.0d0) - (x1 * x1)))))))
else
tmp = x1 + (x1 * (1.0d0 - (4.0d0 * (x2 * (3.0d0 - (x2 * 2.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0))));
} else if (x1 <= 1.35e+154) {
tmp = x1 - ((3.0 * ((x1 + ((x2 * 2.0) - t_0)) / t_1)) - (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) - (((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + (6.0 * (x1 * x1))) * (-1.0 - (x1 * x1)))))));
} else {
tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (x2 * 2.0))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = (((x2 * 2.0) + t_0) - x1) / t_1 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0)))) elif x1 <= 1.35e+154: tmp = x1 - ((3.0 * ((x1 + ((x2 * 2.0) - t_0)) / t_1)) - (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) - (((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + (6.0 * (x1 * x1))) * (-1.0 - (x1 * x1))))))) else: tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (x2 * 2.0)))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_0) - x1) / t_1) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) - Float64(x2 * Float64(6.0 - Float64(x1 * -12.0))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(x1 + Float64(Float64(x2 * 2.0) - t_0)) / t_1)) - Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_0) - Float64(Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(6.0 * Float64(x1 * x1))) * Float64(-1.0 - Float64(x1 * x1)))))))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 - Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(x2 * 2.0))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = (((x2 * 2.0) + t_0) - x1) / t_1; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0)))); elseif (x1 <= 1.35e+154) tmp = x1 - ((3.0 * ((x1 + ((x2 * 2.0) - t_0)) / t_1)) - (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) - (((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + (6.0 * (x1 * x1))) * (-1.0 - (x1 * x1))))))); else tmp = x1 + (x1 * (1.0 - (4.0 * (x2 * (3.0 - (x2 * 2.0)))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] - N[(x2 * N[(6.0 - N[(x1 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 - N[(N[(3.0 * N[(N[(x1 + N[(N[(x2 * 2.0), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$0), $MachinePrecision] - N[(N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(6.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 - N[(4.0 * N[(x2 * N[(3.0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(x2 \cdot 2 + t\_0\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 - x2 \cdot \left(6 - x1 \cdot -12\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(x2 \cdot 2 - t\_0\right)}{t\_1} - \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_0 - \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + 6 \cdot \left(x1 \cdot x1\right)\right) \cdot \left(-1 - x1 \cdot x1\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 - 4 \cdot \left(x2 \cdot \left(3 - x2 \cdot 2\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 2.5%
fma-def2.5%
fma-neg2.5%
fma-neg2.5%
metadata-eval2.5%
metadata-eval2.5%
Simplified2.5%
Taylor expanded in x2 around 0 28.5%
if -5.60000000000000037e102 < x1 < 1.35000000000000003e154Initial program 98.9%
Taylor expanded in x1 around inf 97.6%
Taylor expanded in x1 around inf 94.9%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 52.8%
Final simplification78.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (- (* x1 -2.0) (* x2 (- 6.0 (* x1 -12.0))))))
(t_1 (* x2 (- 3.0 (* x2 2.0)))))
(if (<= x1 -7e+47)
t_0
(if (<= x1 -2.9e-200)
(- (* -6.0 x2) (* x1 (- (* 4.0 t_1) -1.0)))
(if (<= x1 2.2e-170)
t_0
(+
x1
(-
(- x1 (* 4.0 (* x1 t_1)))
(* 3.0 (/ (- x1 (* x2 -2.0)) (+ (* x1 x1) 1.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0))));
double t_1 = x2 * (3.0 - (x2 * 2.0));
double tmp;
if (x1 <= -7e+47) {
tmp = t_0;
} else if (x1 <= -2.9e-200) {
tmp = (-6.0 * x2) - (x1 * ((4.0 * t_1) - -1.0));
} else if (x1 <= 2.2e-170) {
tmp = t_0;
} else {
tmp = x1 + ((x1 - (4.0 * (x1 * t_1))) - (3.0 * ((x1 - (x2 * -2.0)) / ((x1 * x1) + 1.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 * (-2.0d0)) - (x2 * (6.0d0 - (x1 * (-12.0d0)))))
t_1 = x2 * (3.0d0 - (x2 * 2.0d0))
if (x1 <= (-7d+47)) then
tmp = t_0
else if (x1 <= (-2.9d-200)) then
tmp = ((-6.0d0) * x2) - (x1 * ((4.0d0 * t_1) - (-1.0d0)))
else if (x1 <= 2.2d-170) then
tmp = t_0
else
tmp = x1 + ((x1 - (4.0d0 * (x1 * t_1))) - (3.0d0 * ((x1 - (x2 * (-2.0d0))) / ((x1 * x1) + 1.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0))));
double t_1 = x2 * (3.0 - (x2 * 2.0));
double tmp;
if (x1 <= -7e+47) {
tmp = t_0;
} else if (x1 <= -2.9e-200) {
tmp = (-6.0 * x2) - (x1 * ((4.0 * t_1) - -1.0));
} else if (x1 <= 2.2e-170) {
tmp = t_0;
} else {
tmp = x1 + ((x1 - (4.0 * (x1 * t_1))) - (3.0 * ((x1 - (x2 * -2.0)) / ((x1 * x1) + 1.0))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0)))) t_1 = x2 * (3.0 - (x2 * 2.0)) tmp = 0 if x1 <= -7e+47: tmp = t_0 elif x1 <= -2.9e-200: tmp = (-6.0 * x2) - (x1 * ((4.0 * t_1) - -1.0)) elif x1 <= 2.2e-170: tmp = t_0 else: tmp = x1 + ((x1 - (4.0 * (x1 * t_1))) - (3.0 * ((x1 - (x2 * -2.0)) / ((x1 * x1) + 1.0)))) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x1 * -2.0) - Float64(x2 * Float64(6.0 - Float64(x1 * -12.0))))) t_1 = Float64(x2 * Float64(3.0 - Float64(x2 * 2.0))) tmp = 0.0 if (x1 <= -7e+47) tmp = t_0; elseif (x1 <= -2.9e-200) tmp = Float64(Float64(-6.0 * x2) - Float64(x1 * Float64(Float64(4.0 * t_1) - -1.0))); elseif (x1 <= 2.2e-170) tmp = t_0; else tmp = Float64(x1 + Float64(Float64(x1 - Float64(4.0 * Float64(x1 * t_1))) - Float64(3.0 * Float64(Float64(x1 - Float64(x2 * -2.0)) / Float64(Float64(x1 * x1) + 1.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0)))); t_1 = x2 * (3.0 - (x2 * 2.0)); tmp = 0.0; if (x1 <= -7e+47) tmp = t_0; elseif (x1 <= -2.9e-200) tmp = (-6.0 * x2) - (x1 * ((4.0 * t_1) - -1.0)); elseif (x1 <= 2.2e-170) tmp = t_0; else tmp = x1 + ((x1 - (4.0 * (x1 * t_1))) - (3.0 * ((x1 - (x2 * -2.0)) / ((x1 * x1) + 1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] - N[(x2 * N[(6.0 - N[(x1 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x2 * N[(3.0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -7e+47], t$95$0, If[LessEqual[x1, -2.9e-200], N[(N[(-6.0 * x2), $MachinePrecision] - N[(x1 * N[(N[(4.0 * t$95$1), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.2e-170], t$95$0, N[(x1 + N[(N[(x1 - N[(4.0 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * N[(N[(x1 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 \cdot -2 - x2 \cdot \left(6 - x1 \cdot -12\right)\right)\\
t_1 := x2 \cdot \left(3 - x2 \cdot 2\right)\\
\mathbf{if}\;x1 \leq -7 \cdot 10^{+47}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq -2.9 \cdot 10^{-200}:\\
\;\;\;\;-6 \cdot x2 - x1 \cdot \left(4 \cdot t\_1 - -1\right)\\
\mathbf{elif}\;x1 \leq 2.2 \cdot 10^{-170}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 - 4 \cdot \left(x1 \cdot t\_1\right)\right) - 3 \cdot \frac{x1 - x2 \cdot -2}{x1 \cdot x1 + 1}\right)\\
\end{array}
\end{array}
if x1 < -7.00000000000000031e47 or -2.9e-200 < x1 < 2.20000000000000015e-170Initial program 60.9%
Taylor expanded in x1 around 0 34.4%
Taylor expanded in x1 around 0 35.7%
fma-def36.7%
fma-neg36.7%
fma-neg36.7%
metadata-eval36.7%
metadata-eval36.7%
Simplified36.7%
Taylor expanded in x2 around 0 53.9%
if -7.00000000000000031e47 < x1 < -2.9e-200Initial program 99.3%
Taylor expanded in x1 around 0 87.9%
Taylor expanded in x1 around 0 88.1%
fma-def88.1%
fma-neg88.1%
fma-neg88.1%
metadata-eval88.1%
metadata-eval88.1%
Simplified88.1%
Taylor expanded in x1 around 0 88.1%
if 2.20000000000000015e-170 < x1 Initial program 62.3%
Taylor expanded in x1 around 0 28.4%
Taylor expanded in x1 around 0 46.8%
*-commutative46.8%
Simplified46.8%
Final simplification58.3%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -7e+47) (and (not (<= x1 -1.9e-200)) (<= x1 6.6e-177))) (+ x1 (- (* x1 -2.0) (* x2 (- 6.0 (* x1 -12.0))))) (- (* -6.0 x2) (* x1 (- (* 4.0 (* x2 (- 3.0 (* x2 2.0)))) -1.0)))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -7e+47) || (!(x1 <= -1.9e-200) && (x1 <= 6.6e-177))) {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0))));
} else {
tmp = (-6.0 * x2) - (x1 * ((4.0 * (x2 * (3.0 - (x2 * 2.0)))) - -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-7d+47)) .or. (.not. (x1 <= (-1.9d-200))) .and. (x1 <= 6.6d-177)) then
tmp = x1 + ((x1 * (-2.0d0)) - (x2 * (6.0d0 - (x1 * (-12.0d0)))))
else
tmp = ((-6.0d0) * x2) - (x1 * ((4.0d0 * (x2 * (3.0d0 - (x2 * 2.0d0)))) - (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -7e+47) || (!(x1 <= -1.9e-200) && (x1 <= 6.6e-177))) {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0))));
} else {
tmp = (-6.0 * x2) - (x1 * ((4.0 * (x2 * (3.0 - (x2 * 2.0)))) - -1.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -7e+47) or (not (x1 <= -1.9e-200) and (x1 <= 6.6e-177)): tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0)))) else: tmp = (-6.0 * x2) - (x1 * ((4.0 * (x2 * (3.0 - (x2 * 2.0)))) - -1.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -7e+47) || (!(x1 <= -1.9e-200) && (x1 <= 6.6e-177))) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) - Float64(x2 * Float64(6.0 - Float64(x1 * -12.0))))); else tmp = Float64(Float64(-6.0 * x2) - Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(x2 * 2.0)))) - -1.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -7e+47) || (~((x1 <= -1.9e-200)) && (x1 <= 6.6e-177))) tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0)))); else tmp = (-6.0 * x2) - (x1 * ((4.0 * (x2 * (3.0 - (x2 * 2.0)))) - -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -7e+47], And[N[Not[LessEqual[x1, -1.9e-200]], $MachinePrecision], LessEqual[x1, 6.6e-177]]], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] - N[(x2 * N[(6.0 - N[(x1 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-6.0 * x2), $MachinePrecision] - N[(x1 * N[(N[(4.0 * N[(x2 * N[(3.0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -7 \cdot 10^{+47} \lor \neg \left(x1 \leq -1.9 \cdot 10^{-200}\right) \land x1 \leq 6.6 \cdot 10^{-177}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 - x2 \cdot \left(6 - x1 \cdot -12\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot x2 - x1 \cdot \left(4 \cdot \left(x2 \cdot \left(3 - x2 \cdot 2\right)\right) - -1\right)\\
\end{array}
\end{array}
if x1 < -7.00000000000000031e47 or -1.9e-200 < x1 < 6.5999999999999999e-177Initial program 60.9%
Taylor expanded in x1 around 0 34.4%
Taylor expanded in x1 around 0 35.7%
fma-def36.7%
fma-neg36.7%
fma-neg36.7%
metadata-eval36.7%
metadata-eval36.7%
Simplified36.7%
Taylor expanded in x2 around 0 53.9%
if -7.00000000000000031e47 < x1 < -1.9e-200 or 6.5999999999999999e-177 < x1 Initial program 75.3%
Taylor expanded in x1 around 0 49.4%
Taylor expanded in x1 around 0 59.9%
fma-def60.6%
fma-neg60.6%
fma-neg60.6%
metadata-eval60.6%
metadata-eval60.6%
Simplified60.6%
Taylor expanded in x1 around 0 59.9%
Final simplification57.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (- (* x1 -2.0) (* x2 (- 6.0 (* x1 -12.0))))))
(t_1 (* 4.0 (* x2 (- 3.0 (* x2 2.0))))))
(if (<= x1 -7e+47)
t_0
(if (<= x1 -1.15e-145)
(* x1 (- -1.0 t_1))
(if (<= x1 1.45e-20) t_0 (+ x1 (* x1 (- 1.0 t_1))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0))));
double t_1 = 4.0 * (x2 * (3.0 - (x2 * 2.0)));
double tmp;
if (x1 <= -7e+47) {
tmp = t_0;
} else if (x1 <= -1.15e-145) {
tmp = x1 * (-1.0 - t_1);
} else if (x1 <= 1.45e-20) {
tmp = t_0;
} else {
tmp = x1 + (x1 * (1.0 - t_1));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 + ((x1 * (-2.0d0)) - (x2 * (6.0d0 - (x1 * (-12.0d0)))))
t_1 = 4.0d0 * (x2 * (3.0d0 - (x2 * 2.0d0)))
if (x1 <= (-7d+47)) then
tmp = t_0
else if (x1 <= (-1.15d-145)) then
tmp = x1 * ((-1.0d0) - t_1)
else if (x1 <= 1.45d-20) then
tmp = t_0
else
tmp = x1 + (x1 * (1.0d0 - t_1))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0))));
double t_1 = 4.0 * (x2 * (3.0 - (x2 * 2.0)));
double tmp;
if (x1 <= -7e+47) {
tmp = t_0;
} else if (x1 <= -1.15e-145) {
tmp = x1 * (-1.0 - t_1);
} else if (x1 <= 1.45e-20) {
tmp = t_0;
} else {
tmp = x1 + (x1 * (1.0 - t_1));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0)))) t_1 = 4.0 * (x2 * (3.0 - (x2 * 2.0))) tmp = 0 if x1 <= -7e+47: tmp = t_0 elif x1 <= -1.15e-145: tmp = x1 * (-1.0 - t_1) elif x1 <= 1.45e-20: tmp = t_0 else: tmp = x1 + (x1 * (1.0 - t_1)) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x1 * -2.0) - Float64(x2 * Float64(6.0 - Float64(x1 * -12.0))))) t_1 = Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(x2 * 2.0)))) tmp = 0.0 if (x1 <= -7e+47) tmp = t_0; elseif (x1 <= -1.15e-145) tmp = Float64(x1 * Float64(-1.0 - t_1)); elseif (x1 <= 1.45e-20) tmp = t_0; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 - t_1))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0)))); t_1 = 4.0 * (x2 * (3.0 - (x2 * 2.0))); tmp = 0.0; if (x1 <= -7e+47) tmp = t_0; elseif (x1 <= -1.15e-145) tmp = x1 * (-1.0 - t_1); elseif (x1 <= 1.45e-20) tmp = t_0; else tmp = x1 + (x1 * (1.0 - t_1)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] - N[(x2 * N[(6.0 - N[(x1 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(4.0 * N[(x2 * N[(3.0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -7e+47], t$95$0, If[LessEqual[x1, -1.15e-145], N[(x1 * N[(-1.0 - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.45e-20], t$95$0, N[(x1 + N[(x1 * N[(1.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 \cdot -2 - x2 \cdot \left(6 - x1 \cdot -12\right)\right)\\
t_1 := 4 \cdot \left(x2 \cdot \left(3 - x2 \cdot 2\right)\right)\\
\mathbf{if}\;x1 \leq -7 \cdot 10^{+47}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq -1.15 \cdot 10^{-145}:\\
\;\;\;\;x1 \cdot \left(-1 - t\_1\right)\\
\mathbf{elif}\;x1 \leq 1.45 \cdot 10^{-20}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 - t\_1\right)\\
\end{array}
\end{array}
if x1 < -7.00000000000000031e47 or -1.15000000000000004e-145 < x1 < 1.45e-20Initial program 68.7%
Taylor expanded in x1 around 0 46.0%
Taylor expanded in x1 around 0 47.2%
fma-def48.0%
fma-neg48.0%
fma-neg48.0%
metadata-eval48.0%
metadata-eval48.0%
Simplified48.0%
Taylor expanded in x2 around 0 57.6%
if -7.00000000000000031e47 < x1 < -1.15000000000000004e-145Initial program 99.3%
Taylor expanded in x1 around 0 87.7%
Taylor expanded in x1 around 0 87.8%
fma-def87.9%
fma-neg87.9%
fma-neg87.9%
metadata-eval87.9%
metadata-eval87.9%
Simplified87.9%
Taylor expanded in x1 around inf 68.2%
if 1.45e-20 < x1 Initial program 54.6%
Taylor expanded in x1 around 0 14.8%
Taylor expanded in x1 around inf 37.1%
Final simplification52.9%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -7e+47) (and (not (<= x1 -2.05e-145)) (<= x1 3.8e-95))) (+ x1 (- (* x1 -2.0) (* x2 (- 6.0 (* x1 -12.0))))) (* x1 (- -1.0 (* 4.0 (* x2 (- 3.0 (* x2 2.0))))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -7e+47) || (!(x1 <= -2.05e-145) && (x1 <= 3.8e-95))) {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0))));
} else {
tmp = x1 * (-1.0 - (4.0 * (x2 * (3.0 - (x2 * 2.0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-7d+47)) .or. (.not. (x1 <= (-2.05d-145))) .and. (x1 <= 3.8d-95)) then
tmp = x1 + ((x1 * (-2.0d0)) - (x2 * (6.0d0 - (x1 * (-12.0d0)))))
else
tmp = x1 * ((-1.0d0) - (4.0d0 * (x2 * (3.0d0 - (x2 * 2.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -7e+47) || (!(x1 <= -2.05e-145) && (x1 <= 3.8e-95))) {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0))));
} else {
tmp = x1 * (-1.0 - (4.0 * (x2 * (3.0 - (x2 * 2.0)))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -7e+47) or (not (x1 <= -2.05e-145) and (x1 <= 3.8e-95)): tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0)))) else: tmp = x1 * (-1.0 - (4.0 * (x2 * (3.0 - (x2 * 2.0))))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -7e+47) || (!(x1 <= -2.05e-145) && (x1 <= 3.8e-95))) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) - Float64(x2 * Float64(6.0 - Float64(x1 * -12.0))))); else tmp = Float64(x1 * Float64(-1.0 - Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(x2 * 2.0)))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -7e+47) || (~((x1 <= -2.05e-145)) && (x1 <= 3.8e-95))) tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - (x1 * -12.0)))); else tmp = x1 * (-1.0 - (4.0 * (x2 * (3.0 - (x2 * 2.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -7e+47], And[N[Not[LessEqual[x1, -2.05e-145]], $MachinePrecision], LessEqual[x1, 3.8e-95]]], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] - N[(x2 * N[(6.0 - N[(x1 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(-1.0 - N[(4.0 * N[(x2 * N[(3.0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -7 \cdot 10^{+47} \lor \neg \left(x1 \leq -2.05 \cdot 10^{-145}\right) \land x1 \leq 3.8 \cdot 10^{-95}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 - x2 \cdot \left(6 - x1 \cdot -12\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(-1 - 4 \cdot \left(x2 \cdot \left(3 - x2 \cdot 2\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -7.00000000000000031e47 or -2.0499999999999999e-145 < x1 < 3.7999999999999997e-95Initial program 66.7%
Taylor expanded in x1 around 0 42.5%
Taylor expanded in x1 around 0 43.7%
fma-def44.6%
fma-neg44.6%
fma-neg44.6%
metadata-eval44.6%
metadata-eval44.6%
Simplified44.6%
Taylor expanded in x2 around 0 57.2%
if -7.00000000000000031e47 < x1 < -2.0499999999999999e-145 or 3.7999999999999997e-95 < x1 Initial program 72.1%
Taylor expanded in x1 around 0 44.1%
Taylor expanded in x1 around 0 55.9%
fma-def56.7%
fma-neg56.7%
fma-neg56.7%
metadata-eval56.7%
metadata-eval56.7%
Simplified56.7%
Taylor expanded in x1 around inf 48.7%
Final simplification52.7%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -6e-153) (not (<= x1 3.9e-116))) (* x1 (- -1.0 (* 4.0 (* x2 (- 3.0 (* x2 2.0)))))) (* -6.0 x2)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -6e-153) || !(x1 <= 3.9e-116)) {
tmp = x1 * (-1.0 - (4.0 * (x2 * (3.0 - (x2 * 2.0)))));
} else {
tmp = -6.0 * x2;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-6d-153)) .or. (.not. (x1 <= 3.9d-116))) then
tmp = x1 * ((-1.0d0) - (4.0d0 * (x2 * (3.0d0 - (x2 * 2.0d0)))))
else
tmp = (-6.0d0) * x2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -6e-153) || !(x1 <= 3.9e-116)) {
tmp = x1 * (-1.0 - (4.0 * (x2 * (3.0 - (x2 * 2.0)))));
} else {
tmp = -6.0 * x2;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -6e-153) or not (x1 <= 3.9e-116): tmp = x1 * (-1.0 - (4.0 * (x2 * (3.0 - (x2 * 2.0))))) else: tmp = -6.0 * x2 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -6e-153) || !(x1 <= 3.9e-116)) tmp = Float64(x1 * Float64(-1.0 - Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(x2 * 2.0)))))); else tmp = Float64(-6.0 * x2); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -6e-153) || ~((x1 <= 3.9e-116))) tmp = x1 * (-1.0 - (4.0 * (x2 * (3.0 - (x2 * 2.0))))); else tmp = -6.0 * x2; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -6e-153], N[Not[LessEqual[x1, 3.9e-116]], $MachinePrecision]], N[(x1 * N[(-1.0 - N[(4.0 * N[(x2 * N[(3.0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-6.0 * x2), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -6 \cdot 10^{-153} \lor \neg \left(x1 \leq 3.9 \cdot 10^{-116}\right):\\
\;\;\;\;x1 \cdot \left(-1 - 4 \cdot \left(x2 \cdot \left(3 - x2 \cdot 2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot x2\\
\end{array}
\end{array}
if x1 < -6e-153 or 3.9000000000000001e-116 < x1 Initial program 60.6%
Taylor expanded in x1 around 0 33.2%
Taylor expanded in x1 around 0 42.0%
fma-def42.6%
fma-neg42.6%
fma-neg42.6%
metadata-eval42.6%
metadata-eval42.6%
Simplified42.6%
Taylor expanded in x1 around inf 36.1%
if -6e-153 < x1 < 3.9000000000000001e-116Initial program 98.0%
Taylor expanded in x1 around 0 75.9%
Taylor expanded in x1 around 0 76.1%
*-commutative76.1%
Simplified76.1%
Taylor expanded in x1 around 0 76.3%
*-commutative76.3%
Simplified76.3%
Final simplification45.7%
(FPCore (x1 x2) :precision binary64 (if (<= x2 -1.35e-120) (* -6.0 x2) (if (<= x2 4.4e-251) (- x1) (+ x1 (* -6.0 x2)))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -1.35e-120) {
tmp = -6.0 * x2;
} else if (x2 <= 4.4e-251) {
tmp = -x1;
} else {
tmp = x1 + (-6.0 * x2);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x2 <= (-1.35d-120)) then
tmp = (-6.0d0) * x2
else if (x2 <= 4.4d-251) then
tmp = -x1
else
tmp = x1 + ((-6.0d0) * x2)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= -1.35e-120) {
tmp = -6.0 * x2;
} else if (x2 <= 4.4e-251) {
tmp = -x1;
} else {
tmp = x1 + (-6.0 * x2);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -1.35e-120: tmp = -6.0 * x2 elif x2 <= 4.4e-251: tmp = -x1 else: tmp = x1 + (-6.0 * x2) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -1.35e-120) tmp = Float64(-6.0 * x2); elseif (x2 <= 4.4e-251) tmp = Float64(-x1); else tmp = Float64(x1 + Float64(-6.0 * x2)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= -1.35e-120) tmp = -6.0 * x2; elseif (x2 <= 4.4e-251) tmp = -x1; else tmp = x1 + (-6.0 * x2); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -1.35e-120], N[(-6.0 * x2), $MachinePrecision], If[LessEqual[x2, 4.4e-251], (-x1), N[(x1 + N[(-6.0 * x2), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.35 \cdot 10^{-120}:\\
\;\;\;\;-6 \cdot x2\\
\mathbf{elif}\;x2 \leq 4.4 \cdot 10^{-251}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x1 + -6 \cdot x2\\
\end{array}
\end{array}
if x2 < -1.3499999999999999e-120Initial program 68.4%
Taylor expanded in x1 around 0 45.3%
Taylor expanded in x1 around 0 29.0%
*-commutative29.0%
Simplified29.0%
Taylor expanded in x1 around 0 29.1%
*-commutative29.1%
Simplified29.1%
if -1.3499999999999999e-120 < x2 < 4.4e-251Initial program 70.3%
Taylor expanded in x1 around 0 38.9%
Taylor expanded in x1 around 0 38.8%
fma-def38.8%
fma-neg38.8%
fma-neg38.8%
metadata-eval38.8%
metadata-eval38.8%
Simplified38.8%
Taylor expanded in x2 around 0 34.9%
distribute-rgt1-in34.9%
metadata-eval34.9%
mul-1-neg34.9%
Simplified34.9%
if 4.4e-251 < x2 Initial program 70.1%
Taylor expanded in x1 around 0 43.9%
Taylor expanded in x1 around 0 28.8%
*-commutative28.8%
Simplified28.8%
Final simplification30.1%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -2.5e-120) (not (<= x2 4.4e-251))) (* -6.0 x2) (- x1)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -2.5e-120) || !(x2 <= 4.4e-251)) {
tmp = -6.0 * x2;
} else {
tmp = -x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-2.5d-120)) .or. (.not. (x2 <= 4.4d-251))) then
tmp = (-6.0d0) * x2
else
tmp = -x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -2.5e-120) || !(x2 <= 4.4e-251)) {
tmp = -6.0 * x2;
} else {
tmp = -x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -2.5e-120) or not (x2 <= 4.4e-251): tmp = -6.0 * x2 else: tmp = -x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -2.5e-120) || !(x2 <= 4.4e-251)) tmp = Float64(-6.0 * x2); else tmp = Float64(-x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -2.5e-120) || ~((x2 <= 4.4e-251))) tmp = -6.0 * x2; else tmp = -x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -2.5e-120], N[Not[LessEqual[x2, 4.4e-251]], $MachinePrecision]], N[(-6.0 * x2), $MachinePrecision], (-x1)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -2.5 \cdot 10^{-120} \lor \neg \left(x2 \leq 4.4 \cdot 10^{-251}\right):\\
\;\;\;\;-6 \cdot x2\\
\mathbf{else}:\\
\;\;\;\;-x1\\
\end{array}
\end{array}
if x2 < -2.50000000000000003e-120 or 4.4e-251 < x2 Initial program 69.4%
Taylor expanded in x1 around 0 44.5%
Taylor expanded in x1 around 0 28.9%
*-commutative28.9%
Simplified28.9%
Taylor expanded in x1 around 0 28.5%
*-commutative28.5%
Simplified28.5%
if -2.50000000000000003e-120 < x2 < 4.4e-251Initial program 70.3%
Taylor expanded in x1 around 0 38.9%
Taylor expanded in x1 around 0 38.8%
fma-def38.8%
fma-neg38.8%
fma-neg38.8%
metadata-eval38.8%
metadata-eval38.8%
Simplified38.8%
Taylor expanded in x2 around 0 34.9%
distribute-rgt1-in34.9%
metadata-eval34.9%
mul-1-neg34.9%
Simplified34.9%
Final simplification29.8%
(FPCore (x1 x2) :precision binary64 (- x1))
double code(double x1, double x2) {
return -x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = -x1
end function
public static double code(double x1, double x2) {
return -x1;
}
def code(x1, x2): return -x1
function code(x1, x2) return Float64(-x1) end
function tmp = code(x1, x2) tmp = -x1; end
code[x1_, x2_] := (-x1)
\begin{array}{l}
\\
-x1
\end{array}
Initial program 69.5%
Taylor expanded in x1 around 0 43.4%
Taylor expanded in x1 around 0 50.1%
fma-def51.0%
fma-neg51.0%
fma-neg51.0%
metadata-eval51.0%
metadata-eval51.0%
Simplified51.0%
Taylor expanded in x2 around 0 11.4%
distribute-rgt1-in11.4%
metadata-eval11.4%
mul-1-neg11.4%
Simplified11.4%
Final simplification11.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 69.5%
Taylor expanded in x1 around 0 43.4%
Taylor expanded in x1 around 0 24.5%
*-commutative24.5%
Simplified24.5%
Taylor expanded in x1 around inf 3.3%
Final simplification3.3%
herbie shell --seed 2024027
(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))))))