
(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 29 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (fma x1 (* x1 3.0) (fma 2.0 x2 (- x1))))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2)))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_1 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(fma
x1
(* x1 (/ t_0 (/ (fma x1 x1 1.0) 3.0)))
(*
(fma x1 x1 1.0)
(+
x1
(+
(* x1 (* x1 -6.0))
(*
(/ t_0 (fma x1 x1 1.0))
(+
(* x1 (+ -6.0 (/ t_0 (/ (fma x1 x1 1.0) 2.0))))
(* (* x1 x1) 4.0)))))))))
(+
x1
(fma
3.0
(* x2 -2.0)
(fma
x1
(* x1 9.0)
(* (fma x1 x1 1.0) (+ x1 (fma x1 -4.0 (* (* x1 x1) 6.0))))))))))
double code(double x1, double x2) {
double t_0 = fma(x1, (x1 * 3.0), fma(2.0, x2, -x1));
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double tmp;
if ((x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), fma(x1, (x1 * (t_0 / (fma(x1, x1, 1.0) / 3.0))), (fma(x1, x1, 1.0) * (x1 + ((x1 * (x1 * -6.0)) + ((t_0 / fma(x1, x1, 1.0)) * ((x1 * (-6.0 + (t_0 / (fma(x1, x1, 1.0) / 2.0)))) + ((x1 * x1) * 4.0))))))));
} else {
tmp = x1 + fma(3.0, (x2 * -2.0), fma(x1, (x1 * 9.0), (fma(x1, x1, 1.0) * (x1 + fma(x1, -4.0, ((x1 * x1) * 6.0))))));
}
return tmp;
}
function code(x1, x2) t_0 = fma(x1, Float64(x1 * 3.0), fma(2.0, x2, Float64(-x1))) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), fma(x1, Float64(x1 * Float64(t_0 / Float64(fma(x1, x1, 1.0) / 3.0))), Float64(fma(x1, x1, 1.0) * Float64(x1 + Float64(Float64(x1 * Float64(x1 * -6.0)) + Float64(Float64(t_0 / fma(x1, x1, 1.0)) * Float64(Float64(x1 * Float64(-6.0 + Float64(t_0 / Float64(fma(x1, x1, 1.0) / 2.0)))) + Float64(Float64(x1 * x1) * 4.0))))))))); else tmp = Float64(x1 + fma(3.0, Float64(x2 * -2.0), fma(x1, Float64(x1 * 9.0), Float64(fma(x1, x1, 1.0) * Float64(x1 + fma(x1, -4.0, Float64(Float64(x1 * x1) * 6.0))))))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2 + (-x1)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$1 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * N[(t$95$0 / N[(N[(x1 * x1 + 1.0), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(N[(x1 * N[(x1 * -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(x1 * N[(-6.0 + N[(t$95$0 / N[(N[(x1 * x1 + 1.0), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(3.0 * N[(x2 * -2.0), $MachinePrecision] + N[(x1 * N[(x1 * 9.0), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(x1 * -4.0 + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1, x1 \cdot 3, \mathsf{fma}\left(2, x2, -x1\right)\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + t_1 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_1 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, \mathsf{fma}\left(x1, x1 \cdot \frac{t_0}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{3}}, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \left(x1 \cdot \left(x1 \cdot -6\right) + \frac{t_0}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(x1 \cdot \left(-6 + \frac{t_0}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{2}}\right) + \left(x1 \cdot x1\right) \cdot 4\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, x2 \cdot -2, \mathsf{fma}\left(x1, x1 \cdot 9, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \mathsf{fma}\left(x1, -4, \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.2%
Simplified99.6%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Simplified7.2%
Taylor expanded in x1 around inf 7.2%
*-commutative7.2%
fma-def7.2%
*-commutative7.2%
unpow27.2%
Simplified7.2%
Taylor expanded in x1 around inf 8.7%
*-commutative8.7%
Simplified8.7%
Taylor expanded in x1 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (cbrt (/ (- (fma (* x1 3.0) x1 (* 2.0 x2)) x1) (fma x1 x1 1.0))))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_5
(*
t_2
(+
(* (* (* x1 2.0) t_4) (- t_4 3.0))
(* (* x1 x1) (- (* t_4 4.0) 6.0)))))
(t_6 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
(if (<= (+ x1 (+ (+ x1 (+ (+ t_5 (* t_1 t_4)) t_0)) t_6)) INFINITY)
(+ x1 (+ t_6 (+ x1 (+ t_0 (+ t_5 (* t_1 (* t_3 (* t_3 t_3))))))))
(+
x1
(fma
3.0
(* x2 -2.0)
(fma
x1
(* x1 9.0)
(* (fma x1 x1 1.0) (+ x1 (fma x1 -4.0 (* (* x1 x1) 6.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = cbrt(((fma((x1 * 3.0), x1, (2.0 * x2)) - x1) / fma(x1, x1, 1.0)));
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_5 = t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)));
double t_6 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double tmp;
if ((x1 + ((x1 + ((t_5 + (t_1 * t_4)) + t_0)) + t_6)) <= ((double) INFINITY)) {
tmp = x1 + (t_6 + (x1 + (t_0 + (t_5 + (t_1 * (t_3 * (t_3 * t_3)))))));
} else {
tmp = x1 + fma(3.0, (x2 * -2.0), fma(x1, (x1 * 9.0), (fma(x1, x1, 1.0) * (x1 + fma(x1, -4.0, ((x1 * x1) * 6.0))))));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = cbrt(Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0))) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_5 = Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)))) t_6 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(t_5 + Float64(t_1 * t_4)) + t_0)) + t_6)) <= Inf) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(t_0 + Float64(t_5 + Float64(t_1 * Float64(t_3 * Float64(t_3 * t_3)))))))); else tmp = Float64(x1 + fma(3.0, Float64(x2 * -2.0), fma(x1, Float64(x1 * 9.0), Float64(fma(x1, x1, 1.0) * Float64(x1 + fma(x1, -4.0, Float64(Float64(x1 * x1) * 6.0))))))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(t$95$5 + N[(t$95$1 * t$95$4), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$6 + N[(x1 + N[(t$95$0 + N[(t$95$5 + N[(t$95$1 * N[(t$95$3 * N[(t$95$3 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(3.0 * N[(x2 * -2.0), $MachinePrecision] + N[(x1 * N[(x1 * 9.0), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(x1 * -4.0 + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \sqrt[3]{\frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}}\\
t_4 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
t_5 := t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(t_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\right)\\
t_6 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_5 + t_1 \cdot t_4\right) + t_0\right)\right) + t_6\right) \leq \infty:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_0 + \left(t_5 + t_1 \cdot \left(t_3 \cdot \left(t_3 \cdot t_3\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, x2 \cdot -2, \mathsf{fma}\left(x1, x1 \cdot 9, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \mathsf{fma}\left(x1, -4, \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.2%
fma-def99.2%
*-commutative99.2%
fma-def99.2%
add-cube-cbrt99.3%
*-commutative99.3%
*-commutative99.3%
Applied egg-rr99.3%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Simplified7.2%
Taylor expanded in x1 around inf 7.2%
*-commutative7.2%
fma-def7.2%
*-commutative7.2%
unpow27.2%
Simplified7.2%
Taylor expanded in x1 around inf 8.7%
*-commutative8.7%
Simplified8.7%
Taylor expanded in x1 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))))
(if (<= (+ x1 (+ t_3 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1)))) INFINITY)
(+
x1
(+
t_3
(*
3.0
(-
(/ (fma 3.0 (* x1 x1) (* x2 -2.0)) (fma x1 x1 1.0))
(/ x1 (fma x1 x1 1.0))))))
(+
x1
(fma
3.0
(* x2 -2.0)
(fma
x1
(* x1 9.0)
(* (fma x1 x1 1.0) (+ x1 (fma x1 -4.0 (* (* x1 x1) 6.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)));
double tmp;
if ((x1 + (t_3 + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= ((double) INFINITY)) {
tmp = x1 + (t_3 + (3.0 * ((fma(3.0, (x1 * x1), (x2 * -2.0)) / fma(x1, x1, 1.0)) - (x1 / fma(x1, x1, 1.0)))));
} else {
tmp = x1 + fma(3.0, (x2 * -2.0), fma(x1, (x1 * 9.0), (fma(x1, x1, 1.0) * (x1 + fma(x1, -4.0, ((x1 * x1) * 6.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(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) tmp = 0.0 if (Float64(x1 + Float64(t_3 + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) <= Inf) tmp = Float64(x1 + Float64(t_3 + Float64(3.0 * Float64(Float64(fma(3.0, Float64(x1 * x1), Float64(x2 * -2.0)) / fma(x1, x1, 1.0)) - Float64(x1 / fma(x1, x1, 1.0)))))); else tmp = Float64(x1 + fma(3.0, Float64(x2 * -2.0), fma(x1, Float64(x1 * 9.0), Float64(fma(x1, x1, 1.0) * Float64(x1 + fma(x1, -4.0, Float64(Float64(x1 * x1) * 6.0))))))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(t$95$3 + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$3 + N[(3.0 * N[(N[(N[(3.0 * N[(x1 * x1), $MachinePrecision] + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] - N[(x1 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(3.0 * N[(x2 * -2.0), $MachinePrecision] + N[(x1 * N[(x1 * 9.0), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(x1 * -4.0 + N[(N[(x1 * x1), $MachinePrecision] * 6.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(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_3 := x1 + \left(\left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_0 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\\
\mathbf{if}\;x1 + \left(t_3 + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right) \leq \infty:\\
\;\;\;\;x1 + \left(t_3 + 3 \cdot \left(\frac{\mathsf{fma}\left(3, x1 \cdot x1, x2 \cdot -2\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - \frac{x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, x2 \cdot -2, \mathsf{fma}\left(x1, x1 \cdot 9, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \mathsf{fma}\left(x1, -4, \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.2%
fma-def99.2%
div-sub99.2%
cancel-sign-sub-inv99.2%
associate-*l*99.2%
metadata-eval99.2%
Applied egg-rr99.2%
fma-def99.3%
*-commutative99.3%
Simplified99.3%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Simplified7.2%
Taylor expanded in x1 around inf 7.2%
*-commutative7.2%
fma-def7.2%
*-commutative7.2%
unpow27.2%
Simplified7.2%
Taylor expanded in x1 around inf 8.7%
*-commutative8.7%
Simplified8.7%
Taylor expanded in x1 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0)))))
(t_5 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
(if (<= (+ x1 (+ (+ x1 (+ (+ t_4 (* t_1 t_3)) t_0)) t_5)) INFINITY)
(+
x1
(+
t_5
(+
x1
(+
t_0
(+
t_4
(*
t_1
(*
(- (fma (* x1 3.0) x1 (* 2.0 x2)) x1)
(/ 1.0 (fma x1 x1 1.0)))))))))
(+
x1
(fma
3.0
(* x2 -2.0)
(fma
x1
(* x1 9.0)
(* (fma x1 x1 1.0) (+ x1 (fma x1 -4.0 (* (* x1 x1) 6.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)));
double t_5 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double tmp;
if ((x1 + ((x1 + ((t_4 + (t_1 * t_3)) + t_0)) + t_5)) <= ((double) INFINITY)) {
tmp = x1 + (t_5 + (x1 + (t_0 + (t_4 + (t_1 * ((fma((x1 * 3.0), x1, (2.0 * x2)) - x1) * (1.0 / fma(x1, x1, 1.0))))))));
} else {
tmp = x1 + fma(3.0, (x2 * -2.0), fma(x1, (x1 * 9.0), (fma(x1, x1, 1.0) * (x1 + fma(x1, -4.0, ((x1 * x1) * 6.0))))));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) t_5 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(t_4 + Float64(t_1 * t_3)) + t_0)) + t_5)) <= Inf) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_0 + Float64(t_4 + Float64(t_1 * Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(2.0 * x2)) - x1) * Float64(1.0 / fma(x1, x1, 1.0))))))))); else tmp = Float64(x1 + fma(3.0, Float64(x2 * -2.0), fma(x1, Float64(x1 * 9.0), Float64(fma(x1, x1, 1.0) * Float64(x1 + fma(x1, -4.0, Float64(Float64(x1 * x1) * 6.0))))))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(t$95$4 + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$0 + N[(t$95$4 + N[(t$95$1 * N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] * N[(1.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(3.0 * N[(x2 * -2.0), $MachinePrecision] + N[(x1 * N[(x1 * 9.0), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(x1 * -4.0 + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
t_4 := t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right)\\
t_5 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_4 + t_1 \cdot t_3\right) + t_0\right)\right) + t_5\right) \leq \infty:\\
\;\;\;\;x1 + \left(t_5 + \left(x1 + \left(t_0 + \left(t_4 + t_1 \cdot \left(\left(\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1\right) \cdot \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, x2 \cdot -2, \mathsf{fma}\left(x1, x1 \cdot 9, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \mathsf{fma}\left(x1, -4, \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.2%
fma-def99.2%
div-inv99.2%
fma-def99.2%
Applied egg-rr99.2%
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%
Simplified7.2%
Taylor expanded in x1 around inf 7.2%
*-commutative7.2%
fma-def7.2%
*-commutative7.2%
unpow27.2%
Simplified7.2%
Taylor expanded in x1 around inf 8.7%
*-commutative8.7%
Simplified8.7%
Taylor expanded in x1 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1)))
(t_4 (+ x1 (* x2 6.0))))
(if (<= x1 -1.5e+247)
(/ (fma x1 x1 (log1p (expm1 (* x2 (* x2 -36.0))))) t_4)
(if (<= x1 -3.5e+157)
(+
x1
(+
(* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))
(+ (* x2 -6.0) (* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0)))))))
(if (<= x1 -5.8e+102)
(+ x1 (+ t_3 (+ x1 (* 6.0 (pow x1 4.0)))))
(if (<= x1 1.35e+154)
(+
x1
(+
t_3
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(*
t_0
(*
(- (fma (* x1 3.0) x1 (* 2.0 x2)) x1)
(/ 1.0 (fma x1 x1 1.0)))))))))
(/ (* x1 x1) t_4)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double t_4 = x1 + (x2 * 6.0);
double tmp;
if (x1 <= -1.5e+247) {
tmp = fma(x1, x1, log1p(expm1((x2 * (x2 * -36.0))))) / t_4;
} else if (x1 <= -3.5e+157) {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + ((x2 * -6.0) + (3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0))))));
} else if (x1 <= -5.8e+102) {
tmp = x1 + (t_3 + (x1 + (6.0 * pow(x1, 4.0))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * ((fma((x1 * 3.0), x1, (2.0 * x2)) - x1) * (1.0 / fma(x1, x1, 1.0))))))));
} else {
tmp = (x1 * x1) / t_4;
}
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(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) t_4 = Float64(x1 + Float64(x2 * 6.0)) tmp = 0.0 if (x1 <= -1.5e+247) tmp = Float64(fma(x1, x1, log1p(expm1(Float64(x2 * Float64(x2 * -36.0))))) / t_4); elseif (x1 <= -3.5e+157) tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(Float64(x2 * -6.0) + Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0))))))); elseif (x1 <= -5.8e+102) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(2.0 * x2)) - x1) * Float64(1.0 / fma(x1, x1, 1.0))))))))); else tmp = Float64(Float64(x1 * x1) / t_4); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.5e+247], N[(N[(x1 * x1 + N[Log[1 + N[(Exp[N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision], If[LessEqual[x1, -3.5e+157], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * -6.0), $MachinePrecision] + N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5.8e+102], N[(x1 + N[(t$95$3 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] * N[(1.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] / t$95$4), $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(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_3 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\\
t_4 := x1 + x2 \cdot 6\\
\mathbf{if}\;x1 \leq -1.5 \cdot 10^{+247}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x1, x1, \mathsf{log1p}\left(\mathsf{expm1}\left(x2 \cdot \left(x2 \cdot -36\right)\right)\right)\right)}{t_4}\\
\mathbf{elif}\;x1 \leq -3.5 \cdot 10^{+157}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + \left(x2 \cdot -6 + 3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_0 \cdot \left(\left(\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1\right) \cdot \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_4}\\
\end{array}
\end{array}
if x1 < -1.5e247Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.9%
flip-+0.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
fma-neg13.3%
swap-sqr13.3%
unpow213.3%
distribute-rgt-neg-in13.3%
unpow213.3%
metadata-eval13.3%
metadata-eval13.3%
sub-neg13.3%
distribute-rgt-neg-in13.3%
metadata-eval13.3%
Simplified13.3%
log1p-expm1-u66.7%
associate-*l*66.7%
Applied egg-rr66.7%
if -1.5e247 < x1 < -3.50000000000000002e157Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 64.7%
if -3.50000000000000002e157 < x1 < -5.8000000000000005e102Initial program 0.0%
Taylor expanded in x1 around inf 83.3%
*-commutative83.3%
Simplified83.3%
if -5.8000000000000005e102 < x1 < 1.35000000000000003e154Initial program 98.7%
fma-def98.7%
div-inv98.7%
fma-def98.7%
Applied egg-rr98.7%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification93.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1)))
(t_4 (+ x1 (* x2 6.0))))
(if (<= x1 -7.2e+252)
(/ (fma x1 x1 (log1p (expm1 (* x2 (* x2 -36.0))))) t_4)
(if (<= x1 -3.5e+157)
(+
x1
(+
(* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))
(+ (* x2 -6.0) (* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0)))))))
(if (<= x1 -1e+103)
(+ x1 (+ t_3 (+ x1 (* 6.0 (pow x1 4.0)))))
(if (<= x1 1.35e+154)
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
t_3))
(/ (* x1 x1) t_4)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double t_4 = x1 + (x2 * 6.0);
double tmp;
if (x1 <= -7.2e+252) {
tmp = fma(x1, x1, log1p(expm1((x2 * (x2 * -36.0))))) / t_4;
} else if (x1 <= -3.5e+157) {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + ((x2 * -6.0) + (3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0))))));
} else if (x1 <= -1e+103) {
tmp = x1 + (t_3 + (x1 + (6.0 * pow(x1, 4.0))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + t_3);
} else {
tmp = (x1 * x1) / t_4;
}
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(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) t_4 = Float64(x1 + Float64(x2 * 6.0)) tmp = 0.0 if (x1 <= -7.2e+252) tmp = Float64(fma(x1, x1, log1p(expm1(Float64(x2 * Float64(x2 * -36.0))))) / t_4); elseif (x1 <= -3.5e+157) tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(Float64(x2 * -6.0) + Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0))))))); elseif (x1 <= -1e+103) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + t_3)); else tmp = Float64(Float64(x1 * x1) / t_4); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -7.2e+252], N[(N[(x1 * x1 + N[Log[1 + N[(Exp[N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision], If[LessEqual[x1, -3.5e+157], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * -6.0), $MachinePrecision] + N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1e+103], N[(x1 + N[(t$95$3 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] / t$95$4), $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(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_3 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\\
t_4 := x1 + x2 \cdot 6\\
\mathbf{if}\;x1 \leq -7.2 \cdot 10^{+252}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x1, x1, \mathsf{log1p}\left(\mathsf{expm1}\left(x2 \cdot \left(x2 \cdot -36\right)\right)\right)\right)}{t_4}\\
\mathbf{elif}\;x1 \leq -3.5 \cdot 10^{+157}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + \left(x2 \cdot -6 + 3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -1 \cdot 10^{+103}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_0 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + t_3\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_4}\\
\end{array}
\end{array}
if x1 < -7.1999999999999997e252Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.9%
flip-+0.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
fma-neg13.3%
swap-sqr13.3%
unpow213.3%
distribute-rgt-neg-in13.3%
unpow213.3%
metadata-eval13.3%
metadata-eval13.3%
sub-neg13.3%
distribute-rgt-neg-in13.3%
metadata-eval13.3%
Simplified13.3%
log1p-expm1-u66.7%
associate-*l*66.7%
Applied egg-rr66.7%
if -7.1999999999999997e252 < x1 < -3.50000000000000002e157Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 64.7%
if -3.50000000000000002e157 < x1 < -1e103Initial program 0.0%
Taylor expanded in x1 around inf 83.3%
*-commutative83.3%
Simplified83.3%
if -1e103 < x1 < 1.35000000000000003e154Initial program 98.7%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification93.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1)))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -3.5e+157)
(+
x1
(+
(* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))
(+ (* x2 -6.0) (* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0)))))))
(if (<= x1 -5.5e+102)
(+ x1 (+ t_2 (+ x1 (* 6.0 (pow x1 4.0)))))
(if (<= x1 1.35e+154)
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_0 t_3))
(* x1 (* x1 x1))))
t_2))
(/ (* x1 x1) (+ x1 (* x2 6.0))))))))
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 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -3.5e+157) {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + ((x2 * -6.0) + (3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0))))));
} else if (x1 <= -5.5e+102) {
tmp = x1 + (t_2 + (x1 + (6.0 * pow(x1, 4.0))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + t_2);
} else {
tmp = (x1 * x1) / (x1 + (x2 * 6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)
t_3 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-3.5d+157)) then
tmp = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + ((x2 * (-6.0d0)) + (3.0d0 * ((x1 ** 2.0d0) * (3.0d0 - (x2 * (-2.0d0)))))))
else if (x1 <= (-5.5d+102)) then
tmp = x1 + (t_2 + (x1 + (6.0d0 * (x1 ** 4.0d0))))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0d0) * t_3) * (t_3 - 3.0d0)) + ((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + t_2)
else
tmp = (x1 * x1) / (x1 + (x2 * 6.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 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -3.5e+157) {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + ((x2 * -6.0) + (3.0 * (Math.pow(x1, 2.0) * (3.0 - (x2 * -2.0))))));
} else if (x1 <= -5.5e+102) {
tmp = x1 + (t_2 + (x1 + (6.0 * Math.pow(x1, 4.0))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + t_2);
} else {
tmp = (x1 * x1) / (x1 + (x2 * 6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1) t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -3.5e+157: tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + ((x2 * -6.0) + (3.0 * (math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)))))) elif x1 <= -5.5e+102: tmp = x1 + (t_2 + (x1 + (6.0 * math.pow(x1, 4.0)))) elif x1 <= 1.35e+154: tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + t_2) else: tmp = (x1 * x1) / (x1 + (x2 * 6.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(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -3.5e+157) tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(Float64(x2 * -6.0) + Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0))))))); elseif (x1 <= -5.5e+102) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + t_2)); else tmp = Float64(Float64(x1 * x1) / Float64(x1 + Float64(x2 * 6.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 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1); t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -3.5e+157) tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + ((x2 * -6.0) + (3.0 * ((x1 ^ 2.0) * (3.0 - (x2 * -2.0)))))); elseif (x1 <= -5.5e+102) tmp = x1 + (t_2 + (x1 + (6.0 * (x1 ^ 4.0)))); elseif (x1 <= 1.35e+154) tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + t_2); else tmp = (x1 * x1) / (x1 + (x2 * 6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -3.5e+157], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * -6.0), $MachinePrecision] + N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5.5e+102], N[(x1 + N[(t$95$2 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] / N[(x1 + N[(x2 * 6.0), $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 \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\\
t_3 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -3.5 \cdot 10^{+157}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + \left(x2 \cdot -6 + 3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -5.5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + t_0 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{x1 + x2 \cdot 6}\\
\end{array}
\end{array}
if x1 < -3.50000000000000002e157Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 50.0%
if -3.50000000000000002e157 < x1 < -5.49999999999999981e102Initial program 0.0%
Taylor expanded in x1 around inf 83.3%
*-commutative83.3%
Simplified83.3%
if -5.49999999999999981e102 < x1 < 1.35000000000000003e154Initial program 98.7%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification91.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -6.2e+102)
(/ (fma x1 x1 (* -36.0 (* x2 x2))) (* x2 6.0))
(if (<= x1 1.35e+154)
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))
(/ (* x1 x1) (+ x1 (* x2 6.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -6.2e+102) {
tmp = fma(x1, x1, (-36.0 * (x2 * x2))) / (x2 * 6.0);
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
} else {
tmp = (x1 * x1) / (x1 + (x2 * 6.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(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -6.2e+102) tmp = Float64(fma(x1, x1, Float64(-36.0 * Float64(x2 * x2))) / Float64(x2 * 6.0)); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))); else tmp = Float64(Float64(x1 * x1) / Float64(x1 + Float64(x2 * 6.0))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -6.2e+102], N[(N[(x1 * x1 + N[(-36.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] / N[(x1 + N[(x2 * 6.0), $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(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -6.2 \cdot 10^{+102}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x1, x1, -36 \cdot \left(x2 \cdot x2\right)\right)}{x2 \cdot 6}\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_0 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{x1 + x2 \cdot 6}\\
\end{array}
\end{array}
if x1 < -6.19999999999999973e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.9%
flip-+0.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
fma-neg13.2%
swap-sqr13.2%
unpow213.2%
distribute-rgt-neg-in13.2%
unpow213.2%
metadata-eval13.2%
metadata-eval13.2%
sub-neg13.2%
distribute-rgt-neg-in13.2%
metadata-eval13.2%
Simplified13.2%
Taylor expanded in x1 around 0 42.1%
*-commutative42.1%
Simplified42.1%
if -6.19999999999999973e102 < x1 < 1.35000000000000003e154Initial program 98.7%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification89.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (+ x1 (* x2 6.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* x1 (* x1 3.0)))
(t_4 (/ (- (+ t_3 (* 2.0 x2)) x1) t_2))
(t_5
(*
t_2
(+
(* (* (* x1 2.0) t_4) (- t_4 3.0))
(* (* x1 x1) (- (* t_4 4.0) 6.0))))))
(if (<= x1 -3.8e+109)
(/ (* x2 (* x2 -36.0)) t_1)
(if (<= x1 2e-34)
(+
x1
(+
(* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_2))
(+ x1 (+ t_0 (+ t_5 (* 3.0 t_3))))))
(if (<= x1 1.35e+154)
(+
x1
(+
(+ x1 (+ t_0 (+ t_5 (* t_3 (+ 3.0 (/ -1.0 x1))))))
(* 3.0 (* x2 -2.0))))
(/ (* x1 x1) t_1))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 + (x2 * 6.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_2;
double t_5 = t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)));
double tmp;
if (x1 <= -3.8e+109) {
tmp = (x2 * (x2 * -36.0)) / t_1;
} else if (x1 <= 2e-34) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_0 + (t_5 + (3.0 * t_3)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (t_0 + (t_5 + (t_3 * (3.0 + (-1.0 / x1)))))) + (3.0 * (x2 * -2.0)));
} else {
tmp = (x1 * x1) / t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 + (x2 * 6.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = x1 * (x1 * 3.0d0)
t_4 = ((t_3 + (2.0d0 * x2)) - x1) / t_2
t_5 = t_2 * ((((x1 * 2.0d0) * t_4) * (t_4 - 3.0d0)) + ((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)))
if (x1 <= (-3.8d+109)) then
tmp = (x2 * (x2 * (-36.0d0))) / t_1
else if (x1 <= 2d-34) then
tmp = x1 + ((3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + (t_0 + (t_5 + (3.0d0 * t_3)))))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((x1 + (t_0 + (t_5 + (t_3 * (3.0d0 + ((-1.0d0) / x1)))))) + (3.0d0 * (x2 * (-2.0d0))))
else
tmp = (x1 * x1) / t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 + (x2 * 6.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_2;
double t_5 = t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)));
double tmp;
if (x1 <= -3.8e+109) {
tmp = (x2 * (x2 * -36.0)) / t_1;
} else if (x1 <= 2e-34) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_0 + (t_5 + (3.0 * t_3)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (t_0 + (t_5 + (t_3 * (3.0 + (-1.0 / x1)))))) + (3.0 * (x2 * -2.0)));
} else {
tmp = (x1 * x1) / t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 + (x2 * 6.0) t_2 = (x1 * x1) + 1.0 t_3 = x1 * (x1 * 3.0) t_4 = ((t_3 + (2.0 * x2)) - x1) / t_2 t_5 = t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0))) tmp = 0 if x1 <= -3.8e+109: tmp = (x2 * (x2 * -36.0)) / t_1 elif x1 <= 2e-34: tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_0 + (t_5 + (3.0 * t_3))))) elif x1 <= 1.35e+154: tmp = x1 + ((x1 + (t_0 + (t_5 + (t_3 * (3.0 + (-1.0 / x1)))))) + (3.0 * (x2 * -2.0))) else: tmp = (x1 * x1) / t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 + Float64(x2 * 6.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_2) t_5 = Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)))) tmp = 0.0 if (x1 <= -3.8e+109) tmp = Float64(Float64(x2 * Float64(x2 * -36.0)) / t_1); elseif (x1 <= 2e-34) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(t_0 + Float64(t_5 + Float64(3.0 * t_3)))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_0 + Float64(t_5 + Float64(t_3 * Float64(3.0 + Float64(-1.0 / x1)))))) + Float64(3.0 * Float64(x2 * -2.0)))); else tmp = Float64(Float64(x1 * x1) / t_1); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 + (x2 * 6.0); t_2 = (x1 * x1) + 1.0; t_3 = x1 * (x1 * 3.0); t_4 = ((t_3 + (2.0 * x2)) - x1) / t_2; t_5 = t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0))); tmp = 0.0; if (x1 <= -3.8e+109) tmp = (x2 * (x2 * -36.0)) / t_1; elseif (x1 <= 2e-34) tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_0 + (t_5 + (3.0 * t_3))))); elseif (x1 <= 1.35e+154) tmp = x1 + ((x1 + (t_0 + (t_5 + (t_3 * (3.0 + (-1.0 / x1)))))) + (3.0 * (x2 * -2.0))); else tmp = (x1 * x1) / t_1; 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[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.8e+109], N[(N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[x1, 2e-34], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$0 + N[(t$95$5 + N[(3.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(t$95$0 + N[(t$95$5 + N[(t$95$3 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 + x2 \cdot 6\\
t_2 := x1 \cdot x1 + 1\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := \frac{\left(t_3 + 2 \cdot x2\right) - x1}{t_2}\\
t_5 := t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(t_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\right)\\
\mathbf{if}\;x1 \leq -3.8 \cdot 10^{+109}:\\
\;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_1}\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{-34}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + \left(t_0 + \left(t_5 + 3 \cdot t_3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_0 + \left(t_5 + t_3 \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_1}\\
\end{array}
\end{array}
if x1 < -3.80000000000000039e109Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.9%
flip-+0.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
fma-neg13.2%
swap-sqr13.2%
unpow213.2%
distribute-rgt-neg-in13.2%
unpow213.2%
metadata-eval13.2%
metadata-eval13.2%
sub-neg13.2%
distribute-rgt-neg-in13.2%
metadata-eval13.2%
Simplified13.2%
Taylor expanded in x1 around 0 14.8%
*-commutative14.8%
unpow214.8%
associate-*r*14.8%
Simplified14.8%
if -3.80000000000000039e109 < x1 < 1.99999999999999986e-34Initial program 98.6%
Taylor expanded in x1 around inf 98.6%
if 1.99999999999999986e-34 < x1 < 1.35000000000000003e154Initial program 99.1%
Taylor expanded in x1 around inf 82.5%
Taylor expanded in x1 around 0 99.1%
*-commutative33.8%
Simplified99.1%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification85.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_1))
(t_4
(*
t_1
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))))
(if (<= x1 -5.8e+102)
(/ (fma x1 x1 (* -36.0 (* x2 x2))) (* x2 6.0))
(if (<= x1 1e-34)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_1))
(+ x1 (+ t_0 (+ t_4 (* 3.0 t_2))))))
(if (<= x1 1.35e+154)
(+
x1
(+
(+ x1 (+ t_0 (+ t_4 (* t_2 (+ 3.0 (/ -1.0 x1))))))
(* 3.0 (* x2 -2.0))))
(/ (* x1 x1) (+ x1 (* x2 6.0))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1;
double t_4 = t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)));
double tmp;
if (x1 <= -5.8e+102) {
tmp = fma(x1, x1, (-36.0 * (x2 * x2))) / (x2 * 6.0);
} else if (x1 <= 1e-34) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_0 + (t_4 + (3.0 * t_2)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (t_0 + (t_4 + (t_2 * (3.0 + (-1.0 / x1)))))) + (3.0 * (x2 * -2.0)));
} else {
tmp = (x1 * x1) / (x1 + (x2 * 6.0));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_1) t_4 = Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) tmp = 0.0 if (x1 <= -5.8e+102) tmp = Float64(fma(x1, x1, Float64(-36.0 * Float64(x2 * x2))) / Float64(x2 * 6.0)); elseif (x1 <= 1e-34) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(t_0 + Float64(t_4 + Float64(3.0 * t_2)))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_0 + Float64(t_4 + Float64(t_2 * Float64(3.0 + Float64(-1.0 / x1)))))) + Float64(3.0 * Float64(x2 * -2.0)))); else tmp = Float64(Float64(x1 * x1) / Float64(x1 + Float64(x2 * 6.0))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], N[(N[(x1 * x1 + N[(-36.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e-34], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$0 + N[(t$95$4 + N[(3.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(t$95$0 + N[(t$95$4 + N[(t$95$2 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] / N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_1}\\
t_4 := t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x1, x1, -36 \cdot \left(x2 \cdot x2\right)\right)}{x2 \cdot 6}\\
\mathbf{elif}\;x1 \leq 10^{-34}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(t_0 + \left(t_4 + 3 \cdot t_2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_0 + \left(t_4 + t_2 \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{x1 + x2 \cdot 6}\\
\end{array}
\end{array}
if x1 < -5.8000000000000005e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.9%
flip-+0.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
fma-neg13.2%
swap-sqr13.2%
unpow213.2%
distribute-rgt-neg-in13.2%
unpow213.2%
metadata-eval13.2%
metadata-eval13.2%
sub-neg13.2%
distribute-rgt-neg-in13.2%
metadata-eval13.2%
Simplified13.2%
Taylor expanded in x1 around 0 42.1%
*-commutative42.1%
Simplified42.1%
if -5.8000000000000005e102 < x1 < 9.99999999999999928e-35Initial program 98.6%
Taylor expanded in x1 around inf 98.6%
if 9.99999999999999928e-35 < x1 < 1.35000000000000003e154Initial program 99.1%
Taylor expanded in x1 around inf 82.5%
Taylor expanded in x1 around 0 99.1%
*-commutative33.8%
Simplified99.1%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification89.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ x1 (* x2 6.0)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_3))
(t_5 (* (* (* x1 2.0) t_4) (- t_4 3.0))))
(if (<= x1 -5.8e+107)
(/ (* x2 (* x2 -36.0)) t_2)
(if (<= x1 1e-34)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_3))
(+ x1 (+ t_0 (+ (* t_1 t_4) (* t_3 (+ t_5 (* (* x1 x1) 6.0))))))))
(if (<= x1 1.35e+154)
(+
x1
(+
(+
x1
(+
t_0
(+
(* t_3 (+ t_5 (* (* x1 x1) (- (* t_4 4.0) 6.0))))
(* t_1 (+ 3.0 (/ -1.0 x1))))))
(* 3.0 (* x2 -2.0))))
(/ (* x1 x1) t_2))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 + (x2 * 6.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_5 = ((x1 * 2.0) * t_4) * (t_4 - 3.0);
double tmp;
if (x1 <= -5.8e+107) {
tmp = (x2 * (x2 * -36.0)) / t_2;
} else if (x1 <= 1e-34) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + ((t_1 * t_4) + (t_3 * (t_5 + ((x1 * x1) * 6.0)))))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (t_0 + ((t_3 * (t_5 + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_1 * (3.0 + (-1.0 / x1)))))) + (3.0 * (x2 * -2.0)));
} else {
tmp = (x1 * x1) / 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) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = x1 + (x2 * 6.0d0)
t_3 = (x1 * x1) + 1.0d0
t_4 = ((t_1 + (2.0d0 * x2)) - x1) / t_3
t_5 = ((x1 * 2.0d0) * t_4) * (t_4 - 3.0d0)
if (x1 <= (-5.8d+107)) then
tmp = (x2 * (x2 * (-36.0d0))) / t_2
else if (x1 <= 1d-34) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_3)) + (x1 + (t_0 + ((t_1 * t_4) + (t_3 * (t_5 + ((x1 * x1) * 6.0d0)))))))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((x1 + (t_0 + ((t_3 * (t_5 + ((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)))) + (t_1 * (3.0d0 + ((-1.0d0) / x1)))))) + (3.0d0 * (x2 * (-2.0d0))))
else
tmp = (x1 * x1) / t_2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 + (x2 * 6.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_5 = ((x1 * 2.0) * t_4) * (t_4 - 3.0);
double tmp;
if (x1 <= -5.8e+107) {
tmp = (x2 * (x2 * -36.0)) / t_2;
} else if (x1 <= 1e-34) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + ((t_1 * t_4) + (t_3 * (t_5 + ((x1 * x1) * 6.0)))))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (t_0 + ((t_3 * (t_5 + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_1 * (3.0 + (-1.0 / x1)))))) + (3.0 * (x2 * -2.0)));
} else {
tmp = (x1 * x1) / t_2;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = x1 + (x2 * 6.0) t_3 = (x1 * x1) + 1.0 t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3 t_5 = ((x1 * 2.0) * t_4) * (t_4 - 3.0) tmp = 0 if x1 <= -5.8e+107: tmp = (x2 * (x2 * -36.0)) / t_2 elif x1 <= 1e-34: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + ((t_1 * t_4) + (t_3 * (t_5 + ((x1 * x1) * 6.0))))))) elif x1 <= 1.35e+154: tmp = x1 + ((x1 + (t_0 + ((t_3 * (t_5 + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_1 * (3.0 + (-1.0 / x1)))))) + (3.0 * (x2 * -2.0))) else: tmp = (x1 * x1) / t_2 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(x1 + Float64(x2 * 6.0)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_3) t_5 = Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) tmp = 0.0 if (x1 <= -5.8e+107) tmp = Float64(Float64(x2 * Float64(x2 * -36.0)) / t_2); elseif (x1 <= 1e-34) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_3)) + Float64(x1 + Float64(t_0 + Float64(Float64(t_1 * t_4) + Float64(t_3 * Float64(t_5 + Float64(Float64(x1 * x1) * 6.0)))))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_0 + Float64(Float64(t_3 * Float64(t_5 + Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)))) + Float64(t_1 * Float64(3.0 + Float64(-1.0 / x1)))))) + Float64(3.0 * Float64(x2 * -2.0)))); else tmp = Float64(Float64(x1 * x1) / t_2); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = x1 + (x2 * 6.0); t_3 = (x1 * x1) + 1.0; t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3; t_5 = ((x1 * 2.0) * t_4) * (t_4 - 3.0); tmp = 0.0; if (x1 <= -5.8e+107) tmp = (x2 * (x2 * -36.0)) / t_2; elseif (x1 <= 1e-34) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + ((t_1 * t_4) + (t_3 * (t_5 + ((x1 * x1) * 6.0))))))); elseif (x1 <= 1.35e+154) tmp = x1 + ((x1 + (t_0 + ((t_3 * (t_5 + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_1 * (3.0 + (-1.0 / x1)))))) + (3.0 * (x2 * -2.0))); else tmp = (x1 * x1) / t_2; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+107], N[(N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[x1, 1e-34], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$0 + N[(N[(t$95$1 * t$95$4), $MachinePrecision] + N[(t$95$3 * N[(t$95$5 + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(t$95$0 + N[(N[(t$95$3 * N[(t$95$5 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] / t$95$2), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 + x2 \cdot 6\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_3}\\
t_5 := \left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(t_4 - 3\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+107}:\\
\;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_2}\\
\mathbf{elif}\;x1 \leq 10^{-34}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_3} + \left(x1 + \left(t_0 + \left(t_1 \cdot t_4 + t_3 \cdot \left(t_5 + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_0 + \left(t_3 \cdot \left(t_5 + \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\right) + t_1 \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_2}\\
\end{array}
\end{array}
if x1 < -5.79999999999999975e107Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.9%
flip-+0.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
fma-neg13.2%
swap-sqr13.2%
unpow213.2%
distribute-rgt-neg-in13.2%
unpow213.2%
metadata-eval13.2%
metadata-eval13.2%
sub-neg13.2%
distribute-rgt-neg-in13.2%
metadata-eval13.2%
Simplified13.2%
Taylor expanded in x1 around 0 14.8%
*-commutative14.8%
unpow214.8%
associate-*r*14.8%
Simplified14.8%
if -5.79999999999999975e107 < x1 < 9.99999999999999928e-35Initial program 98.6%
Taylor expanded in x1 around inf 98.0%
if 9.99999999999999928e-35 < x1 < 1.35000000000000003e154Initial program 99.1%
Taylor expanded in x1 around inf 82.5%
Taylor expanded in x1 around 0 99.1%
*-commutative33.8%
Simplified99.1%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification85.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 (+ 3.0 (/ -1.0 x1))))))
(* 3.0 (* x2 -2.0)))))
(t_4 (+ x1 (* x2 6.0))))
(if (<= x1 -5.2e+105)
(/ (* x2 (* x2 -36.0)) t_4)
(if (<= x1 -3.15e-9)
t_3
(if (<= x1 1e-10)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
(if (<= x1 1.35e+154) t_3 (/ (* x1 x1) t_4)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * (3.0 + (-1.0 / x1)))))) + (3.0 * (x2 * -2.0)));
double t_4 = x1 + (x2 * 6.0);
double tmp;
if (x1 <= -5.2e+105) {
tmp = (x2 * (x2 * -36.0)) / t_4;
} else if (x1 <= -3.15e-9) {
tmp = t_3;
} else if (x1 <= 1e-10) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 1.35e+154) {
tmp = t_3;
} else {
tmp = (x1 * x1) / t_4;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
t_3 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (t_0 * (3.0d0 + ((-1.0d0) / x1)))))) + (3.0d0 * (x2 * (-2.0d0))))
t_4 = x1 + (x2 * 6.0d0)
if (x1 <= (-5.2d+105)) then
tmp = (x2 * (x2 * (-36.0d0))) / t_4
else if (x1 <= (-3.15d-9)) then
tmp = t_3
else if (x1 <= 1d-10) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
else if (x1 <= 1.35d+154) then
tmp = t_3
else
tmp = (x1 * x1) / t_4
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * (3.0 + (-1.0 / x1)))))) + (3.0 * (x2 * -2.0)));
double t_4 = x1 + (x2 * 6.0);
double tmp;
if (x1 <= -5.2e+105) {
tmp = (x2 * (x2 * -36.0)) / t_4;
} else if (x1 <= -3.15e-9) {
tmp = t_3;
} else if (x1 <= 1e-10) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 1.35e+154) {
tmp = t_3;
} else {
tmp = (x1 * x1) / t_4;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * (3.0 + (-1.0 / x1)))))) + (3.0 * (x2 * -2.0))) t_4 = x1 + (x2 * 6.0) tmp = 0 if x1 <= -5.2e+105: tmp = (x2 * (x2 * -36.0)) / t_4 elif x1 <= -3.15e-9: tmp = t_3 elif x1 <= 1e-10: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) elif x1 <= 1.35e+154: tmp = t_3 else: tmp = (x1 * x1) / t_4 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(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * Float64(3.0 + Float64(-1.0 / x1)))))) + Float64(3.0 * Float64(x2 * -2.0)))) t_4 = Float64(x1 + Float64(x2 * 6.0)) tmp = 0.0 if (x1 <= -5.2e+105) tmp = Float64(Float64(x2 * Float64(x2 * -36.0)) / t_4); elseif (x1 <= -3.15e-9) tmp = t_3; elseif (x1 <= 1e-10) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); elseif (x1 <= 1.35e+154) tmp = t_3; else tmp = Float64(Float64(x1 * x1) / t_4); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * (3.0 + (-1.0 / x1)))))) + (3.0 * (x2 * -2.0))); t_4 = x1 + (x2 * 6.0); tmp = 0.0; if (x1 <= -5.2e+105) tmp = (x2 * (x2 * -36.0)) / t_4; elseif (x1 <= -3.15e-9) tmp = t_3; elseif (x1 <= 1e-10) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); elseif (x1 <= 1.35e+154) tmp = t_3; else tmp = (x1 * x1) / t_4; 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[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.2e+105], N[(N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision], If[LessEqual[x1, -3.15e-9], t$95$3, If[LessEqual[x1, 1e-10], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$3, N[(N[(x1 * x1), $MachinePrecision] / t$95$4), $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(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_3 := x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_0 \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
t_4 := x1 + x2 \cdot 6\\
\mathbf{if}\;x1 \leq -5.2 \cdot 10^{+105}:\\
\;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_4}\\
\mathbf{elif}\;x1 \leq -3.15 \cdot 10^{-9}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x1 \leq 10^{-10}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_4}\\
\end{array}
\end{array}
if x1 < -5.2000000000000004e105Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.9%
flip-+0.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
fma-neg13.2%
swap-sqr13.2%
unpow213.2%
distribute-rgt-neg-in13.2%
unpow213.2%
metadata-eval13.2%
metadata-eval13.2%
sub-neg13.2%
distribute-rgt-neg-in13.2%
metadata-eval13.2%
Simplified13.2%
Taylor expanded in x1 around 0 14.8%
*-commutative14.8%
unpow214.8%
associate-*r*14.8%
Simplified14.8%
if -5.2000000000000004e105 < x1 < -3.1500000000000001e-9 or 1.00000000000000004e-10 < x1 < 1.35000000000000003e154Initial program 99.2%
Taylor expanded in x1 around inf 92.9%
Taylor expanded in x1 around 0 99.2%
*-commutative21.5%
Simplified99.2%
if -3.1500000000000001e-9 < x1 < 1.00000000000000004e-10Initial program 98.4%
Taylor expanded in x1 around 0 99.3%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification86.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ x1 (* x2 6.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2)))
(t_4 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_5
(+
x1
(+
t_3
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 (+ 3.0 (/ -1.0 x1)))
(*
t_2
(+ (* (* (* x1 2.0) t_4) (- t_4 3.0)) (* (* x1 x1) 6.0))))))))))
(if (<= x1 -4e+106)
(/ (* x2 (* x2 -36.0)) t_1)
(if (<= x1 -7.3e-6)
t_5
(if (<= x1 1.75)
(+ x1 (+ t_3 (+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
(if (<= x1 1.35e+154) t_5 (/ (* x1 x1) t_1)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 + (x2 * 6.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_5 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (3.0 + (-1.0 / x1))) + (t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * 6.0)))))));
double tmp;
if (x1 <= -4e+106) {
tmp = (x2 * (x2 * -36.0)) / t_1;
} else if (x1 <= -7.3e-6) {
tmp = t_5;
} else if (x1 <= 1.75) {
tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 1.35e+154) {
tmp = t_5;
} else {
tmp = (x1 * x1) / t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = x1 + (x2 * 6.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_2)
t_4 = ((t_0 + (2.0d0 * x2)) - x1) / t_2
t_5 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (3.0d0 + ((-1.0d0) / x1))) + (t_2 * ((((x1 * 2.0d0) * t_4) * (t_4 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
if (x1 <= (-4d+106)) then
tmp = (x2 * (x2 * (-36.0d0))) / t_1
else if (x1 <= (-7.3d-6)) then
tmp = t_5
else if (x1 <= 1.75d0) then
tmp = x1 + (t_3 + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
else if (x1 <= 1.35d+154) then
tmp = t_5
else
tmp = (x1 * x1) / t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 + (x2 * 6.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_5 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (3.0 + (-1.0 / x1))) + (t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * 6.0)))))));
double tmp;
if (x1 <= -4e+106) {
tmp = (x2 * (x2 * -36.0)) / t_1;
} else if (x1 <= -7.3e-6) {
tmp = t_5;
} else if (x1 <= 1.75) {
tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 1.35e+154) {
tmp = t_5;
} else {
tmp = (x1 * x1) / t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = x1 + (x2 * 6.0) t_2 = (x1 * x1) + 1.0 t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2) t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2 t_5 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (3.0 + (-1.0 / x1))) + (t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * 6.0))))))) tmp = 0 if x1 <= -4e+106: tmp = (x2 * (x2 * -36.0)) / t_1 elif x1 <= -7.3e-6: tmp = t_5 elif x1 <= 1.75: tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) elif x1 <= 1.35e+154: tmp = t_5 else: tmp = (x1 * x1) / t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 + Float64(x2 * 6.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)) t_4 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_5 = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * Float64(3.0 + Float64(-1.0 / x1))) + Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))) tmp = 0.0 if (x1 <= -4e+106) tmp = Float64(Float64(x2 * Float64(x2 * -36.0)) / t_1); elseif (x1 <= -7.3e-6) tmp = t_5; elseif (x1 <= 1.75) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); elseif (x1 <= 1.35e+154) tmp = t_5; else tmp = Float64(Float64(x1 * x1) / t_1); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = x1 + (x2 * 6.0); t_2 = (x1 * x1) + 1.0; t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2); t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2; t_5 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (3.0 + (-1.0 / x1))) + (t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * 6.0))))))); tmp = 0.0; if (x1 <= -4e+106) tmp = (x2 * (x2 * -36.0)) / t_1; elseif (x1 <= -7.3e-6) tmp = t_5; elseif (x1 <= 1.75) tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); elseif (x1 <= 1.35e+154) tmp = t_5; else tmp = (x1 * x1) / 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[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4e+106], N[(N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[x1, -7.3e-6], t$95$5, If[LessEqual[x1, 1.75], N[(x1 + N[(t$95$3 + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$5, N[(N[(x1 * x1), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 + x2 \cdot 6\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_2}\\
t_4 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_2}\\
t_5 := x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot \left(3 + \frac{-1}{x1}\right) + t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(t_4 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -4 \cdot 10^{+106}:\\
\;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_1}\\
\mathbf{elif}\;x1 \leq -7.3 \cdot 10^{-6}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x1 \leq 1.75:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_5\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_1}\\
\end{array}
\end{array}
if x1 < -4.00000000000000036e106Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.9%
flip-+0.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
fma-neg13.2%
swap-sqr13.2%
unpow213.2%
distribute-rgt-neg-in13.2%
unpow213.2%
metadata-eval13.2%
metadata-eval13.2%
sub-neg13.2%
distribute-rgt-neg-in13.2%
metadata-eval13.2%
Simplified13.2%
Taylor expanded in x1 around 0 14.8%
*-commutative14.8%
unpow214.8%
associate-*r*14.8%
Simplified14.8%
if -4.00000000000000036e106 < x1 < -7.30000000000000041e-6 or 1.75 < x1 < 1.35000000000000003e154Initial program 99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around inf 90.8%
if -7.30000000000000041e-6 < x1 < 1.75Initial program 98.4%
Taylor expanded in x1 around 0 96.4%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification82.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* (* (* x1 2.0) 3.0) (/ -1.0 x1)))
(t_3 (+ x1 (* x2 6.0)))
(t_4 (+ (* x1 x1) 1.0))
(t_5 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_4)))
(t_6 (* t_1 (+ 3.0 (/ -1.0 x1)))))
(if (<= x1 -1.55e+103)
(/ (* x2 (* x2 -36.0)) t_3)
(if (<= x1 -52000000.0)
(+
x1
(+
t_5
(+
x1
(+
t_0
(+
t_6
(*
t_4
(+
t_2
(*
(* x1 x1)
(-
(*
4.0
(+
3.0
(+
(* 2.0 (/ x2 (* x1 x1)))
(- (/ -1.0 x1) (/ 3.0 (* x1 x1))))))
6.0)))))))))
(if (<= x1 0.48)
(+ x1 (+ t_5 (+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
(if (<= x1 1.35e+154)
(+
x1
(+
(+
x1
(+
t_0
(+
t_6
(*
t_4
(+
(*
(* x1 x1)
(- (* (/ (- (+ t_1 (* 2.0 x2)) x1) t_4) 4.0) 6.0))
t_2)))))
(* 3.0 (- (* x2 -2.0) x1))))
(/ (* x1 x1) t_3)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((x1 * 2.0) * 3.0) * (-1.0 / x1);
double t_3 = x1 + (x2 * 6.0);
double t_4 = (x1 * x1) + 1.0;
double t_5 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_4);
double t_6 = t_1 * (3.0 + (-1.0 / x1));
double tmp;
if (x1 <= -1.55e+103) {
tmp = (x2 * (x2 * -36.0)) / t_3;
} else if (x1 <= -52000000.0) {
tmp = x1 + (t_5 + (x1 + (t_0 + (t_6 + (t_4 * (t_2 + ((x1 * x1) * ((4.0 * (3.0 + ((2.0 * (x2 / (x1 * x1))) + ((-1.0 / x1) - (3.0 / (x1 * x1)))))) - 6.0))))))));
} else if (x1 <= 0.48) {
tmp = x1 + (t_5 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (t_0 + (t_6 + (t_4 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_4) * 4.0) - 6.0)) + t_2))))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = (x1 * x1) / t_3;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = ((x1 * 2.0d0) * 3.0d0) * ((-1.0d0) / x1)
t_3 = x1 + (x2 * 6.0d0)
t_4 = (x1 * x1) + 1.0d0
t_5 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_4)
t_6 = t_1 * (3.0d0 + ((-1.0d0) / x1))
if (x1 <= (-1.55d+103)) then
tmp = (x2 * (x2 * (-36.0d0))) / t_3
else if (x1 <= (-52000000.0d0)) then
tmp = x1 + (t_5 + (x1 + (t_0 + (t_6 + (t_4 * (t_2 + ((x1 * x1) * ((4.0d0 * (3.0d0 + ((2.0d0 * (x2 / (x1 * x1))) + (((-1.0d0) / x1) - (3.0d0 / (x1 * x1)))))) - 6.0d0))))))))
else if (x1 <= 0.48d0) then
tmp = x1 + (t_5 + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((x1 + (t_0 + (t_6 + (t_4 * (((x1 * x1) * (((((t_1 + (2.0d0 * x2)) - x1) / t_4) * 4.0d0) - 6.0d0)) + t_2))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else
tmp = (x1 * x1) / t_3
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((x1 * 2.0) * 3.0) * (-1.0 / x1);
double t_3 = x1 + (x2 * 6.0);
double t_4 = (x1 * x1) + 1.0;
double t_5 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_4);
double t_6 = t_1 * (3.0 + (-1.0 / x1));
double tmp;
if (x1 <= -1.55e+103) {
tmp = (x2 * (x2 * -36.0)) / t_3;
} else if (x1 <= -52000000.0) {
tmp = x1 + (t_5 + (x1 + (t_0 + (t_6 + (t_4 * (t_2 + ((x1 * x1) * ((4.0 * (3.0 + ((2.0 * (x2 / (x1 * x1))) + ((-1.0 / x1) - (3.0 / (x1 * x1)))))) - 6.0))))))));
} else if (x1 <= 0.48) {
tmp = x1 + (t_5 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (t_0 + (t_6 + (t_4 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_4) * 4.0) - 6.0)) + t_2))))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = (x1 * x1) / t_3;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = ((x1 * 2.0) * 3.0) * (-1.0 / x1) t_3 = x1 + (x2 * 6.0) t_4 = (x1 * x1) + 1.0 t_5 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_4) t_6 = t_1 * (3.0 + (-1.0 / x1)) tmp = 0 if x1 <= -1.55e+103: tmp = (x2 * (x2 * -36.0)) / t_3 elif x1 <= -52000000.0: tmp = x1 + (t_5 + (x1 + (t_0 + (t_6 + (t_4 * (t_2 + ((x1 * x1) * ((4.0 * (3.0 + ((2.0 * (x2 / (x1 * x1))) + ((-1.0 / x1) - (3.0 / (x1 * x1)))))) - 6.0)))))))) elif x1 <= 0.48: tmp = x1 + (t_5 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) elif x1 <= 1.35e+154: tmp = x1 + ((x1 + (t_0 + (t_6 + (t_4 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_4) * 4.0) - 6.0)) + t_2))))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = (x1 * x1) / t_3 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(Float64(x1 * 2.0) * 3.0) * Float64(-1.0 / x1)) t_3 = Float64(x1 + Float64(x2 * 6.0)) t_4 = Float64(Float64(x1 * x1) + 1.0) t_5 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_4)) t_6 = Float64(t_1 * Float64(3.0 + Float64(-1.0 / x1))) tmp = 0.0 if (x1 <= -1.55e+103) tmp = Float64(Float64(x2 * Float64(x2 * -36.0)) / t_3); elseif (x1 <= -52000000.0) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_0 + Float64(t_6 + Float64(t_4 * Float64(t_2 + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(3.0 + Float64(Float64(2.0 * Float64(x2 / Float64(x1 * x1))) + Float64(Float64(-1.0 / x1) - Float64(3.0 / Float64(x1 * x1)))))) - 6.0))))))))); elseif (x1 <= 0.48) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_0 + Float64(t_6 + Float64(t_4 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_4) * 4.0) - 6.0)) + t_2))))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(Float64(x1 * x1) / t_3); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = ((x1 * 2.0) * 3.0) * (-1.0 / x1); t_3 = x1 + (x2 * 6.0); t_4 = (x1 * x1) + 1.0; t_5 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_4); t_6 = t_1 * (3.0 + (-1.0 / x1)); tmp = 0.0; if (x1 <= -1.55e+103) tmp = (x2 * (x2 * -36.0)) / t_3; elseif (x1 <= -52000000.0) tmp = x1 + (t_5 + (x1 + (t_0 + (t_6 + (t_4 * (t_2 + ((x1 * x1) * ((4.0 * (3.0 + ((2.0 * (x2 / (x1 * x1))) + ((-1.0 / x1) - (3.0 / (x1 * x1)))))) - 6.0)))))))); elseif (x1 <= 0.48) tmp = x1 + (t_5 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); elseif (x1 <= 1.35e+154) tmp = x1 + ((x1 + (t_0 + (t_6 + (t_4 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_4) * 4.0) - 6.0)) + t_2))))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = (x1 * x1) / t_3; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision] * N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$1 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.55e+103], N[(N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[x1, -52000000.0], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$0 + N[(t$95$6 + N[(t$95$4 * N[(t$95$2 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(3.0 + N[(N[(2.0 * N[(x2 / N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / x1), $MachinePrecision] - N[(3.0 / N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.48], N[(x1 + N[(t$95$5 + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(t$95$0 + N[(t$95$6 + N[(t$95$4 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] / t$95$3), $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 := \left(\left(x1 \cdot 2\right) \cdot 3\right) \cdot \frac{-1}{x1}\\
t_3 := x1 + x2 \cdot 6\\
t_4 := x1 \cdot x1 + 1\\
t_5 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_4}\\
t_6 := t_1 \cdot \left(3 + \frac{-1}{x1}\right)\\
\mathbf{if}\;x1 \leq -1.55 \cdot 10^{+103}:\\
\;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_3}\\
\mathbf{elif}\;x1 \leq -52000000:\\
\;\;\;\;x1 + \left(t_5 + \left(x1 + \left(t_0 + \left(t_6 + t_4 \cdot \left(t_2 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \left(2 \cdot \frac{x2}{x1 \cdot x1} + \left(\frac{-1}{x1} - \frac{3}{x1 \cdot x1}\right)\right)\right) - 6\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 0.48:\\
\;\;\;\;x1 + \left(t_5 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_0 + \left(t_6 + t_4 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_4} \cdot 4 - 6\right) + t_2\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_3}\\
\end{array}
\end{array}
if x1 < -1.5500000000000001e103Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.9%
flip-+0.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
fma-neg13.2%
swap-sqr13.2%
unpow213.2%
distribute-rgt-neg-in13.2%
unpow213.2%
metadata-eval13.2%
metadata-eval13.2%
sub-neg13.2%
distribute-rgt-neg-in13.2%
metadata-eval13.2%
Simplified13.2%
Taylor expanded in x1 around 0 14.8%
*-commutative14.8%
unpow214.8%
associate-*r*14.8%
Simplified14.8%
if -1.5500000000000001e103 < x1 < -5.2e7Initial program 99.3%
Taylor expanded in x1 around inf 99.3%
Taylor expanded in x1 around inf 92.3%
Taylor expanded in x1 around inf 92.3%
Taylor expanded in x1 around inf 92.5%
associate--l+92.5%
unpow292.5%
+-commutative92.5%
associate-*r/92.5%
metadata-eval92.5%
unpow292.5%
Simplified92.5%
if -5.2e7 < x1 < 0.47999999999999998Initial program 98.4%
Taylor expanded in x1 around 0 96.8%
if 0.47999999999999998 < x1 < 1.35000000000000003e154Initial program 99.2%
Taylor expanded in x1 around inf 91.7%
Taylor expanded in x1 around inf 75.9%
Taylor expanded in x1 around inf 76.2%
Taylor expanded in x1 around 0 76.7%
+-commutative26.9%
neg-mul-126.9%
unsub-neg26.9%
*-commutative26.9%
Simplified76.7%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification81.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (+ x1 (* x2 6.0)))
(t_2 (* x1 (* x1 3.0)))
(t_3
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_2 (+ 3.0 (/ -1.0 x1)))
(*
t_0
(+
(* (* x1 x1) (- (* (/ (- (+ t_2 (* 2.0 x2)) x1) t_0) 4.0) 6.0))
(* (* (* x1 2.0) 3.0) (/ -1.0 x1)))))))))
(if (<= x1 -2.7e+107)
(/ (* x2 (* x2 -36.0)) t_1)
(if (<= x1 -52000000.0)
(+ x1 (+ (* 3.0 (* x2 -2.0)) t_3))
(if (<= x1 0.48)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
(+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
(if (<= x1 1.35e+154)
(+ x1 (+ t_3 (* 3.0 (- (* x2 -2.0) x1))))
(/ (* x1 x1) t_1)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 + (x2 * 6.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = x1 + ((x1 * (x1 * x1)) + ((t_2 * (3.0 + (-1.0 / x1))) + (t_0 * (((x1 * x1) * (((((t_2 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1))))));
double tmp;
if (x1 <= -2.7e+107) {
tmp = (x2 * (x2 * -36.0)) / t_1;
} else if (x1 <= -52000000.0) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + t_3);
} else if (x1 <= 0.48) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_3 + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = (x1 * x1) / 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) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 + (x2 * 6.0d0)
t_2 = x1 * (x1 * 3.0d0)
t_3 = x1 + ((x1 * (x1 * x1)) + ((t_2 * (3.0d0 + ((-1.0d0) / x1))) + (t_0 * (((x1 * x1) * (((((t_2 + (2.0d0 * x2)) - x1) / t_0) * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * 3.0d0) * ((-1.0d0) / x1))))))
if (x1 <= (-2.7d+107)) then
tmp = (x2 * (x2 * (-36.0d0))) / t_1
else if (x1 <= (-52000000.0d0)) then
tmp = x1 + ((3.0d0 * (x2 * (-2.0d0))) + t_3)
else if (x1 <= 0.48d0) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
else if (x1 <= 1.35d+154) then
tmp = x1 + (t_3 + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else
tmp = (x1 * x1) / t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 + (x2 * 6.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = x1 + ((x1 * (x1 * x1)) + ((t_2 * (3.0 + (-1.0 / x1))) + (t_0 * (((x1 * x1) * (((((t_2 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1))))));
double tmp;
if (x1 <= -2.7e+107) {
tmp = (x2 * (x2 * -36.0)) / t_1;
} else if (x1 <= -52000000.0) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + t_3);
} else if (x1 <= 0.48) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_3 + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = (x1 * x1) / t_1;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 + (x2 * 6.0) t_2 = x1 * (x1 * 3.0) t_3 = x1 + ((x1 * (x1 * x1)) + ((t_2 * (3.0 + (-1.0 / x1))) + (t_0 * (((x1 * x1) * (((((t_2 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1)))))) tmp = 0 if x1 <= -2.7e+107: tmp = (x2 * (x2 * -36.0)) / t_1 elif x1 <= -52000000.0: tmp = x1 + ((3.0 * (x2 * -2.0)) + t_3) elif x1 <= 0.48: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) elif x1 <= 1.35e+154: tmp = x1 + (t_3 + (3.0 * ((x2 * -2.0) - x1))) else: tmp = (x1 * x1) / t_1 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 + Float64(x2 * 6.0)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * Float64(3.0 + Float64(-1.0 / x1))) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * 3.0) * Float64(-1.0 / x1))))))) tmp = 0.0 if (x1 <= -2.7e+107) tmp = Float64(Float64(x2 * Float64(x2 * -36.0)) / t_1); elseif (x1 <= -52000000.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + t_3)); elseif (x1 <= 0.48) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(t_3 + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(Float64(x1 * x1) / t_1); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 + (x2 * 6.0); t_2 = x1 * (x1 * 3.0); t_3 = x1 + ((x1 * (x1 * x1)) + ((t_2 * (3.0 + (-1.0 / x1))) + (t_0 * (((x1 * x1) * (((((t_2 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1)))))); tmp = 0.0; if (x1 <= -2.7e+107) tmp = (x2 * (x2 * -36.0)) / t_1; elseif (x1 <= -52000000.0) tmp = x1 + ((3.0 * (x2 * -2.0)) + t_3); elseif (x1 <= 0.48) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); elseif (x1 <= 1.35e+154) tmp = x1 + (t_3 + (3.0 * ((x2 * -2.0) - x1))); else tmp = (x1 * x1) / t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision] * N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.7e+107], N[(N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[x1, -52000000.0], N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.48], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$3 + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 + x2 \cdot 6\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_2 \cdot \left(3 + \frac{-1}{x1}\right) + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_0} \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot 3\right) \cdot \frac{-1}{x1}\right)\right)\right)\\
\mathbf{if}\;x1 \leq -2.7 \cdot 10^{+107}:\\
\;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_1}\\
\mathbf{elif}\;x1 \leq -52000000:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + t_3\right)\\
\mathbf{elif}\;x1 \leq 0.48:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t_3 + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_1}\\
\end{array}
\end{array}
if x1 < -2.7000000000000001e107Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.9%
flip-+0.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
fma-neg13.2%
swap-sqr13.2%
unpow213.2%
distribute-rgt-neg-in13.2%
unpow213.2%
metadata-eval13.2%
metadata-eval13.2%
sub-neg13.2%
distribute-rgt-neg-in13.2%
metadata-eval13.2%
Simplified13.2%
Taylor expanded in x1 around 0 14.8%
*-commutative14.8%
unpow214.8%
associate-*r*14.8%
Simplified14.8%
if -2.7000000000000001e107 < x1 < -5.2e7Initial program 99.3%
Taylor expanded in x1 around inf 99.3%
Taylor expanded in x1 around inf 92.3%
Taylor expanded in x1 around inf 92.3%
Taylor expanded in x1 around 0 92.3%
*-commutative12.0%
Simplified92.3%
if -5.2e7 < x1 < 0.47999999999999998Initial program 98.4%
Taylor expanded in x1 around 0 96.8%
if 0.47999999999999998 < x1 < 1.35000000000000003e154Initial program 99.2%
Taylor expanded in x1 around inf 91.7%
Taylor expanded in x1 around inf 75.9%
Taylor expanded in x1 around inf 76.2%
Taylor expanded in x1 around 0 76.7%
+-commutative26.9%
neg-mul-126.9%
unsub-neg26.9%
*-commutative26.9%
Simplified76.7%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification81.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (+ x1 (* x2 6.0)))
(t_2 (* x1 (* x1 3.0)))
(t_3
(+
x1
(+
(* 3.0 (* x2 -2.0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_2 (+ 3.0 (/ -1.0 x1)))
(*
t_0
(+
(* (* x1 x1) (- (* (/ (- (+ t_2 (* 2.0 x2)) x1) t_0) 4.0) 6.0))
(* (* (* x1 2.0) 3.0) (/ -1.0 x1)))))))))))
(if (<= x1 -6.8e+108)
(/ (* x2 (* x2 -36.0)) t_1)
(if (<= x1 -52000000.0)
t_3
(if (<= x1 0.48)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
(+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
(if (<= x1 1.35e+154) t_3 (/ (* x1 x1) t_1)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 + (x2 * 6.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (3.0 + (-1.0 / x1))) + (t_0 * (((x1 * x1) * (((((t_2 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1))))))));
double tmp;
if (x1 <= -6.8e+108) {
tmp = (x2 * (x2 * -36.0)) / t_1;
} else if (x1 <= -52000000.0) {
tmp = t_3;
} else if (x1 <= 0.48) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 1.35e+154) {
tmp = t_3;
} else {
tmp = (x1 * x1) / 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) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 + (x2 * 6.0d0)
t_2 = x1 * (x1 * 3.0d0)
t_3 = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (3.0d0 + ((-1.0d0) / x1))) + (t_0 * (((x1 * x1) * (((((t_2 + (2.0d0 * x2)) - x1) / t_0) * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * 3.0d0) * ((-1.0d0) / x1))))))))
if (x1 <= (-6.8d+108)) then
tmp = (x2 * (x2 * (-36.0d0))) / t_1
else if (x1 <= (-52000000.0d0)) then
tmp = t_3
else if (x1 <= 0.48d0) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
else if (x1 <= 1.35d+154) then
tmp = t_3
else
tmp = (x1 * x1) / t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 + (x2 * 6.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (3.0 + (-1.0 / x1))) + (t_0 * (((x1 * x1) * (((((t_2 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1))))))));
double tmp;
if (x1 <= -6.8e+108) {
tmp = (x2 * (x2 * -36.0)) / t_1;
} else if (x1 <= -52000000.0) {
tmp = t_3;
} else if (x1 <= 0.48) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 1.35e+154) {
tmp = t_3;
} else {
tmp = (x1 * x1) / t_1;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 + (x2 * 6.0) t_2 = x1 * (x1 * 3.0) t_3 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (3.0 + (-1.0 / x1))) + (t_0 * (((x1 * x1) * (((((t_2 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1)))))))) tmp = 0 if x1 <= -6.8e+108: tmp = (x2 * (x2 * -36.0)) / t_1 elif x1 <= -52000000.0: tmp = t_3 elif x1 <= 0.48: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) elif x1 <= 1.35e+154: tmp = t_3 else: tmp = (x1 * x1) / t_1 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 + Float64(x2 * 6.0)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * Float64(3.0 + Float64(-1.0 / x1))) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * 3.0) * Float64(-1.0 / x1))))))))) tmp = 0.0 if (x1 <= -6.8e+108) tmp = Float64(Float64(x2 * Float64(x2 * -36.0)) / t_1); elseif (x1 <= -52000000.0) tmp = t_3; elseif (x1 <= 0.48) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); elseif (x1 <= 1.35e+154) tmp = t_3; else tmp = Float64(Float64(x1 * x1) / t_1); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 + (x2 * 6.0); t_2 = x1 * (x1 * 3.0); t_3 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (3.0 + (-1.0 / x1))) + (t_0 * (((x1 * x1) * (((((t_2 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1)))))))); tmp = 0.0; if (x1 <= -6.8e+108) tmp = (x2 * (x2 * -36.0)) / t_1; elseif (x1 <= -52000000.0) tmp = t_3; elseif (x1 <= 0.48) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); elseif (x1 <= 1.35e+154) tmp = t_3; else tmp = (x1 * x1) / t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision] * N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -6.8e+108], N[(N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[x1, -52000000.0], t$95$3, If[LessEqual[x1, 0.48], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$3, N[(N[(x1 * x1), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 + x2 \cdot 6\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_2 \cdot \left(3 + \frac{-1}{x1}\right) + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_0} \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot 3\right) \cdot \frac{-1}{x1}\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -6.8 \cdot 10^{+108}:\\
\;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_1}\\
\mathbf{elif}\;x1 \leq -52000000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x1 \leq 0.48:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_1}\\
\end{array}
\end{array}
if x1 < -6.79999999999999992e108Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.9%
flip-+0.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
fma-neg13.2%
swap-sqr13.2%
unpow213.2%
distribute-rgt-neg-in13.2%
unpow213.2%
metadata-eval13.2%
metadata-eval13.2%
sub-neg13.2%
distribute-rgt-neg-in13.2%
metadata-eval13.2%
Simplified13.2%
Taylor expanded in x1 around 0 14.8%
*-commutative14.8%
unpow214.8%
associate-*r*14.8%
Simplified14.8%
if -6.79999999999999992e108 < x1 < -5.2e7 or 0.47999999999999998 < x1 < 1.35000000000000003e154Initial program 99.3%
Taylor expanded in x1 around inf 95.1%
Taylor expanded in x1 around inf 83.3%
Taylor expanded in x1 around inf 83.5%
Taylor expanded in x1 around 0 83.5%
*-commutative21.7%
Simplified83.5%
if -5.2e7 < x1 < 0.47999999999999998Initial program 98.4%
Taylor expanded in x1 around 0 96.8%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification81.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ x1 (* x2 6.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2)))
(t_4
(+
x1
(+
t_3
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 (+ 3.0 (/ -1.0 x1)))
(*
t_2
(+ (* (* x1 x1) 6.0) (* (* (* x1 2.0) 3.0) (/ -1.0 x1)))))))))))
(if (<= x1 -5.8e+102)
(/ (* x2 (* x2 -36.0)) t_1)
(if (<= x1 -8.6e+16)
t_4
(if (<= x1 0.47)
(+ x1 (+ t_3 (+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
(if (<= x1 1.35e+154) t_4 (/ (* x1 x1) t_1)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 + (x2 * 6.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2);
double t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (3.0 + (-1.0 / x1))) + (t_2 * (((x1 * x1) * 6.0) + (((x1 * 2.0) * 3.0) * (-1.0 / x1))))))));
double tmp;
if (x1 <= -5.8e+102) {
tmp = (x2 * (x2 * -36.0)) / t_1;
} else if (x1 <= -8.6e+16) {
tmp = t_4;
} else if (x1 <= 0.47) {
tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 1.35e+154) {
tmp = t_4;
} else {
tmp = (x1 * x1) / t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = x1 + (x2 * 6.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_2)
t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (3.0d0 + ((-1.0d0) / x1))) + (t_2 * (((x1 * x1) * 6.0d0) + (((x1 * 2.0d0) * 3.0d0) * ((-1.0d0) / x1))))))))
if (x1 <= (-5.8d+102)) then
tmp = (x2 * (x2 * (-36.0d0))) / t_1
else if (x1 <= (-8.6d+16)) then
tmp = t_4
else if (x1 <= 0.47d0) then
tmp = x1 + (t_3 + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
else if (x1 <= 1.35d+154) then
tmp = t_4
else
tmp = (x1 * x1) / t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 + (x2 * 6.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2);
double t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (3.0 + (-1.0 / x1))) + (t_2 * (((x1 * x1) * 6.0) + (((x1 * 2.0) * 3.0) * (-1.0 / x1))))))));
double tmp;
if (x1 <= -5.8e+102) {
tmp = (x2 * (x2 * -36.0)) / t_1;
} else if (x1 <= -8.6e+16) {
tmp = t_4;
} else if (x1 <= 0.47) {
tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 1.35e+154) {
tmp = t_4;
} else {
tmp = (x1 * x1) / t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = x1 + (x2 * 6.0) t_2 = (x1 * x1) + 1.0 t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2) t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (3.0 + (-1.0 / x1))) + (t_2 * (((x1 * x1) * 6.0) + (((x1 * 2.0) * 3.0) * (-1.0 / x1)))))))) tmp = 0 if x1 <= -5.8e+102: tmp = (x2 * (x2 * -36.0)) / t_1 elif x1 <= -8.6e+16: tmp = t_4 elif x1 <= 0.47: tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) elif x1 <= 1.35e+154: tmp = t_4 else: tmp = (x1 * x1) / t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 + Float64(x2 * 6.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)) t_4 = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * Float64(3.0 + Float64(-1.0 / x1))) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * 6.0) + Float64(Float64(Float64(x1 * 2.0) * 3.0) * Float64(-1.0 / x1))))))))) tmp = 0.0 if (x1 <= -5.8e+102) tmp = Float64(Float64(x2 * Float64(x2 * -36.0)) / t_1); elseif (x1 <= -8.6e+16) tmp = t_4; elseif (x1 <= 0.47) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); elseif (x1 <= 1.35e+154) tmp = t_4; else tmp = Float64(Float64(x1 * x1) / t_1); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = x1 + (x2 * 6.0); t_2 = (x1 * x1) + 1.0; t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2); t_4 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (3.0 + (-1.0 / x1))) + (t_2 * (((x1 * x1) * 6.0) + (((x1 * 2.0) * 3.0) * (-1.0 / x1)))))))); tmp = 0.0; if (x1 <= -5.8e+102) tmp = (x2 * (x2 * -36.0)) / t_1; elseif (x1 <= -8.6e+16) tmp = t_4; elseif (x1 <= 0.47) tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); elseif (x1 <= 1.35e+154) tmp = t_4; else tmp = (x1 * x1) / 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[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision] * N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], N[(N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[x1, -8.6e+16], t$95$4, If[LessEqual[x1, 0.47], N[(x1 + N[(t$95$3 + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$4, N[(N[(x1 * x1), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 + x2 \cdot 6\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_2}\\
t_4 := x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot \left(3 + \frac{-1}{x1}\right) + t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + \left(\left(x1 \cdot 2\right) \cdot 3\right) \cdot \frac{-1}{x1}\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_1}\\
\mathbf{elif}\;x1 \leq -8.6 \cdot 10^{+16}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x1 \leq 0.47:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_1}\\
\end{array}
\end{array}
if x1 < -5.8000000000000005e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.9%
flip-+0.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
fma-neg13.2%
swap-sqr13.2%
unpow213.2%
distribute-rgt-neg-in13.2%
unpow213.2%
metadata-eval13.2%
metadata-eval13.2%
sub-neg13.2%
distribute-rgt-neg-in13.2%
metadata-eval13.2%
Simplified13.2%
Taylor expanded in x1 around 0 14.8%
*-commutative14.8%
unpow214.8%
associate-*r*14.8%
Simplified14.8%
if -5.8000000000000005e102 < x1 < -8.6e16 or 0.46999999999999997 < x1 < 1.35000000000000003e154Initial program 99.3%
Taylor expanded in x1 around inf 95.0%
Taylor expanded in x1 around inf 84.3%
Taylor expanded in x1 around inf 84.5%
Taylor expanded in x1 around inf 76.0%
if -8.6e16 < x1 < 0.46999999999999997Initial program 98.4%
Taylor expanded in x1 around 0 96.1%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification79.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* x2 6.0))))
(if (<= x1 -4.8e+30)
(/ (* x2 (* x2 -36.0)) t_0)
(if (<= x1 1.35e+154)
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
(/ (* x1 x1) t_0)))))
double code(double x1, double x2) {
double t_0 = x1 + (x2 * 6.0);
double tmp;
if (x1 <= -4.8e+30) {
tmp = (x2 * (x2 * -36.0)) / t_0;
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else {
tmp = (x1 * x1) / t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + (x2 * 6.0d0)
if (x1 <= (-4.8d+30)) then
tmp = (x2 * (x2 * (-36.0d0))) / t_0
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
else
tmp = (x1 * x1) / t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x2 * 6.0);
double tmp;
if (x1 <= -4.8e+30) {
tmp = (x2 * (x2 * -36.0)) / t_0;
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else {
tmp = (x1 * x1) / t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x2 * 6.0) tmp = 0 if x1 <= -4.8e+30: tmp = (x2 * (x2 * -36.0)) / t_0 elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) else: tmp = (x1 * x1) / t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x2 * 6.0)) tmp = 0.0 if (x1 <= -4.8e+30) tmp = Float64(Float64(x2 * Float64(x2 * -36.0)) / t_0); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); else tmp = Float64(Float64(x1 * x1) / t_0); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x2 * 6.0); tmp = 0.0; if (x1 <= -4.8e+30) tmp = (x2 * (x2 * -36.0)) / t_0; elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); else tmp = (x1 * x1) / t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.8e+30], N[(N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x2 \cdot 6\\
\mathbf{if}\;x1 \leq -4.8 \cdot 10^{+30}:\\
\;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_0}\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_0}\\
\end{array}
\end{array}
if x1 < -4.7999999999999999e30Initial program 32.1%
Taylor expanded in x1 around 0 2.1%
Taylor expanded in x1 around 0 1.0%
flip-+2.0%
*-commutative2.0%
*-commutative2.0%
*-commutative2.0%
Applied egg-rr2.0%
fma-neg11.0%
swap-sqr11.0%
unpow211.0%
distribute-rgt-neg-in11.0%
unpow211.0%
metadata-eval11.0%
metadata-eval11.0%
sub-neg11.0%
distribute-rgt-neg-in11.0%
metadata-eval11.0%
Simplified11.0%
Taylor expanded in x1 around 0 12.4%
*-commutative12.4%
unpow212.4%
associate-*r*12.4%
Simplified12.4%
if -4.7999999999999999e30 < x1 < 1.35000000000000003e154Initial program 98.6%
Taylor expanded in x1 around 0 79.9%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification66.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* 2.0 x2) 3.0))
(t_1 (+ x1 (+ (* x1 (- (* 4.0 (* x2 t_0)) 2.0)) (* x2 -6.0))))
(t_2 (+ x1 (* x2 6.0))))
(if (<= x1 -1.02e+154)
(/ (* x2 (* x2 -36.0)) t_2)
(if (<= x1 -1.42e-153)
t_1
(if (<= x1 1.3e-271)
(+ x1 (+ (* 3.0 (* x2 -2.0)) (+ x1 (* 4.0 (* x2 (* x1 t_0))))))
(if (<= x1 1.35e+154) t_1 (/ (* x1 x1) t_2)))))))
double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = x1 + ((x1 * ((4.0 * (x2 * t_0)) - 2.0)) + (x2 * -6.0));
double t_2 = x1 + (x2 * 6.0);
double tmp;
if (x1 <= -1.02e+154) {
tmp = (x2 * (x2 * -36.0)) / t_2;
} else if (x1 <= -1.42e-153) {
tmp = t_1;
} else if (x1 <= 1.3e-271) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (4.0 * (x2 * (x1 * t_0)))));
} else if (x1 <= 1.35e+154) {
tmp = t_1;
} else {
tmp = (x1 * x1) / 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) :: tmp
t_0 = (2.0d0 * x2) - 3.0d0
t_1 = x1 + ((x1 * ((4.0d0 * (x2 * t_0)) - 2.0d0)) + (x2 * (-6.0d0)))
t_2 = x1 + (x2 * 6.0d0)
if (x1 <= (-1.02d+154)) then
tmp = (x2 * (x2 * (-36.0d0))) / t_2
else if (x1 <= (-1.42d-153)) then
tmp = t_1
else if (x1 <= 1.3d-271) then
tmp = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + (4.0d0 * (x2 * (x1 * t_0)))))
else if (x1 <= 1.35d+154) then
tmp = t_1
else
tmp = (x1 * x1) / t_2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = x1 + ((x1 * ((4.0 * (x2 * t_0)) - 2.0)) + (x2 * -6.0));
double t_2 = x1 + (x2 * 6.0);
double tmp;
if (x1 <= -1.02e+154) {
tmp = (x2 * (x2 * -36.0)) / t_2;
} else if (x1 <= -1.42e-153) {
tmp = t_1;
} else if (x1 <= 1.3e-271) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (4.0 * (x2 * (x1 * t_0)))));
} else if (x1 <= 1.35e+154) {
tmp = t_1;
} else {
tmp = (x1 * x1) / t_2;
}
return tmp;
}
def code(x1, x2): t_0 = (2.0 * x2) - 3.0 t_1 = x1 + ((x1 * ((4.0 * (x2 * t_0)) - 2.0)) + (x2 * -6.0)) t_2 = x1 + (x2 * 6.0) tmp = 0 if x1 <= -1.02e+154: tmp = (x2 * (x2 * -36.0)) / t_2 elif x1 <= -1.42e-153: tmp = t_1 elif x1 <= 1.3e-271: tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (4.0 * (x2 * (x1 * t_0))))) elif x1 <= 1.35e+154: tmp = t_1 else: tmp = (x1 * x1) / t_2 return tmp
function code(x1, x2) t_0 = Float64(Float64(2.0 * x2) - 3.0) t_1 = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * t_0)) - 2.0)) + Float64(x2 * -6.0))) t_2 = Float64(x1 + Float64(x2 * 6.0)) tmp = 0.0 if (x1 <= -1.02e+154) tmp = Float64(Float64(x2 * Float64(x2 * -36.0)) / t_2); elseif (x1 <= -1.42e-153) tmp = t_1; elseif (x1 <= 1.3e-271) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * t_0)))))); elseif (x1 <= 1.35e+154) tmp = t_1; else tmp = Float64(Float64(x1 * x1) / t_2); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (2.0 * x2) - 3.0; t_1 = x1 + ((x1 * ((4.0 * (x2 * t_0)) - 2.0)) + (x2 * -6.0)); t_2 = x1 + (x2 * 6.0); tmp = 0.0; if (x1 <= -1.02e+154) tmp = (x2 * (x2 * -36.0)) / t_2; elseif (x1 <= -1.42e-153) tmp = t_1; elseif (x1 <= 1.3e-271) tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (4.0 * (x2 * (x1 * t_0))))); elseif (x1 <= 1.35e+154) tmp = t_1; else tmp = (x1 * x1) / t_2; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * t$95$0), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.02e+154], N[(N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[x1, -1.42e-153], t$95$1, If[LessEqual[x1, 1.3e-271], N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$1, N[(N[(x1 * x1), $MachinePrecision] / t$95$2), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot x2 - 3\\
t_1 := x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot t_0\right) - 2\right) + x2 \cdot -6\right)\\
t_2 := x1 + x2 \cdot 6\\
\mathbf{if}\;x1 \leq -1.02 \cdot 10^{+154}:\\
\;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_2}\\
\mathbf{elif}\;x1 \leq -1.42 \cdot 10^{-153}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 1.3 \cdot 10^{-271}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot t_0\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_2}\\
\end{array}
\end{array}
if x1 < -1.02000000000000007e154Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 1.0%
flip-+0.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
fma-neg15.2%
swap-sqr15.2%
unpow215.2%
distribute-rgt-neg-in15.2%
unpow215.2%
metadata-eval15.2%
metadata-eval15.2%
sub-neg15.2%
distribute-rgt-neg-in15.2%
metadata-eval15.2%
Simplified15.2%
Taylor expanded in x1 around 0 16.8%
*-commutative16.8%
unpow216.8%
associate-*r*16.8%
Simplified16.8%
if -1.02000000000000007e154 < x1 < -1.42000000000000007e-153 or 1.3e-271 < x1 < 1.35000000000000003e154Initial program 95.3%
Taylor expanded in x1 around 0 63.8%
Taylor expanded in x1 around 0 61.2%
if -1.42000000000000007e-153 < x1 < 1.3e-271Initial program 99.3%
Taylor expanded in x1 around 0 99.3%
Taylor expanded in x1 around 0 87.7%
*-commutative87.7%
Simplified87.7%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification63.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* x2 6.0))))
(if (<= x1 -7.5e+153)
(/ (* x2 (* x2 -36.0)) t_0)
(if (<= x1 1.35e+154)
(+
x1
(+
(+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))
(* 3.0 (- (* x2 -2.0) x1))))
(/ (* x1 x1) t_0)))))
double code(double x1, double x2) {
double t_0 = x1 + (x2 * 6.0);
double tmp;
if (x1 <= -7.5e+153) {
tmp = (x2 * (x2 * -36.0)) / t_0;
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = (x1 * x1) / t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + (x2 * 6.0d0)
if (x1 <= (-7.5d+153)) then
tmp = (x2 * (x2 * (-36.0d0))) / t_0
else if (x1 <= 1.35d+154) then
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else
tmp = (x1 * x1) / t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x2 * 6.0);
double tmp;
if (x1 <= -7.5e+153) {
tmp = (x2 * (x2 * -36.0)) / t_0;
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = (x1 * x1) / t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x2 * 6.0) tmp = 0 if x1 <= -7.5e+153: tmp = (x2 * (x2 * -36.0)) / t_0 elif x1 <= 1.35e+154: tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = (x1 * x1) / t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x2 * 6.0)) tmp = 0.0 if (x1 <= -7.5e+153) tmp = Float64(Float64(x2 * Float64(x2 * -36.0)) / t_0); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(Float64(x1 * x1) / t_0); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x2 * 6.0); tmp = 0.0; if (x1 <= -7.5e+153) tmp = (x2 * (x2 * -36.0)) / t_0; elseif (x1 <= 1.35e+154) tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = (x1 * x1) / t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -7.5e+153], N[(N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x2 \cdot 6\\
\mathbf{if}\;x1 \leq -7.5 \cdot 10^{+153}:\\
\;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_0}\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_0}\\
\end{array}
\end{array}
if x1 < -7.50000000000000065e153Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 1.0%
flip-+0.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
fma-neg15.2%
swap-sqr15.2%
unpow215.2%
distribute-rgt-neg-in15.2%
unpow215.2%
metadata-eval15.2%
metadata-eval15.2%
sub-neg15.2%
distribute-rgt-neg-in15.2%
metadata-eval15.2%
Simplified15.2%
Taylor expanded in x1 around 0 16.8%
*-commutative16.8%
unpow216.8%
associate-*r*16.8%
Simplified16.8%
if -7.50000000000000065e153 < x1 < 1.35000000000000003e154Initial program 96.1%
Taylor expanded in x1 around 0 71.0%
Taylor expanded in x1 around 0 70.6%
+-commutative70.6%
neg-mul-170.6%
unsub-neg70.6%
*-commutative70.6%
Simplified70.6%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification66.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ 9.0 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))))
(t_1 (+ x1 (* x2 6.0))))
(if (<= x1 -4.8e+30)
(/ (* x2 (* x2 -36.0)) t_1)
(if (<= x1 -4e-105)
t_0
(if (<= x1 3.7e-122)
(* x2 -6.0)
(if (<= x1 1.35e+154) t_0 (/ (* x1 x1) t_1)))))))
double code(double x1, double x2) {
double t_0 = x1 + (9.0 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))));
double t_1 = x1 + (x2 * 6.0);
double tmp;
if (x1 <= -4.8e+30) {
tmp = (x2 * (x2 * -36.0)) / t_1;
} else if (x1 <= -4e-105) {
tmp = t_0;
} else if (x1 <= 3.7e-122) {
tmp = x2 * -6.0;
} else if (x1 <= 1.35e+154) {
tmp = t_0;
} else {
tmp = (x1 * x1) / 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 + (9.0d0 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))))
t_1 = x1 + (x2 * 6.0d0)
if (x1 <= (-4.8d+30)) then
tmp = (x2 * (x2 * (-36.0d0))) / t_1
else if (x1 <= (-4d-105)) then
tmp = t_0
else if (x1 <= 3.7d-122) then
tmp = x2 * (-6.0d0)
else if (x1 <= 1.35d+154) then
tmp = t_0
else
tmp = (x1 * x1) / t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (9.0 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))));
double t_1 = x1 + (x2 * 6.0);
double tmp;
if (x1 <= -4.8e+30) {
tmp = (x2 * (x2 * -36.0)) / t_1;
} else if (x1 <= -4e-105) {
tmp = t_0;
} else if (x1 <= 3.7e-122) {
tmp = x2 * -6.0;
} else if (x1 <= 1.35e+154) {
tmp = t_0;
} else {
tmp = (x1 * x1) / t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (9.0 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))))) t_1 = x1 + (x2 * 6.0) tmp = 0 if x1 <= -4.8e+30: tmp = (x2 * (x2 * -36.0)) / t_1 elif x1 <= -4e-105: tmp = t_0 elif x1 <= 3.7e-122: tmp = x2 * -6.0 elif x1 <= 1.35e+154: tmp = t_0 else: tmp = (x1 * x1) / t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(9.0 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))))) t_1 = Float64(x1 + Float64(x2 * 6.0)) tmp = 0.0 if (x1 <= -4.8e+30) tmp = Float64(Float64(x2 * Float64(x2 * -36.0)) / t_1); elseif (x1 <= -4e-105) tmp = t_0; elseif (x1 <= 3.7e-122) tmp = Float64(x2 * -6.0); elseif (x1 <= 1.35e+154) tmp = t_0; else tmp = Float64(Float64(x1 * x1) / t_1); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (9.0 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))))); t_1 = x1 + (x2 * 6.0); tmp = 0.0; if (x1 <= -4.8e+30) tmp = (x2 * (x2 * -36.0)) / t_1; elseif (x1 <= -4e-105) tmp = t_0; elseif (x1 <= 3.7e-122) tmp = x2 * -6.0; elseif (x1 <= 1.35e+154) tmp = t_0; else tmp = (x1 * x1) / t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(9.0 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.8e+30], N[(N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[x1, -4e-105], t$95$0, If[LessEqual[x1, 3.7e-122], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$0, N[(N[(x1 * x1), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(9 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\\
t_1 := x1 + x2 \cdot 6\\
\mathbf{if}\;x1 \leq -4.8 \cdot 10^{+30}:\\
\;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_1}\\
\mathbf{elif}\;x1 \leq -4 \cdot 10^{-105}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 3.7 \cdot 10^{-122}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_1}\\
\end{array}
\end{array}
if x1 < -4.7999999999999999e30Initial program 32.1%
Taylor expanded in x1 around 0 2.1%
Taylor expanded in x1 around 0 1.0%
flip-+2.0%
*-commutative2.0%
*-commutative2.0%
*-commutative2.0%
Applied egg-rr2.0%
fma-neg11.0%
swap-sqr11.0%
unpow211.0%
distribute-rgt-neg-in11.0%
unpow211.0%
metadata-eval11.0%
metadata-eval11.0%
sub-neg11.0%
distribute-rgt-neg-in11.0%
metadata-eval11.0%
Simplified11.0%
Taylor expanded in x1 around 0 12.4%
*-commutative12.4%
unpow212.4%
associate-*r*12.4%
Simplified12.4%
if -4.7999999999999999e30 < x1 < -3.99999999999999986e-105 or 3.6999999999999997e-122 < x1 < 1.35000000000000003e154Initial program 98.0%
Taylor expanded in x1 around 0 63.0%
Taylor expanded in x1 around inf 39.3%
if -3.99999999999999986e-105 < x1 < 3.6999999999999997e-122Initial program 99.3%
Taylor expanded in x1 around 0 99.3%
Taylor expanded in x1 around 0 59.4%
Taylor expanded in x1 around 0 59.8%
*-commutative59.8%
Simplified59.8%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification46.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))
(t_1 (+ x1 (* x2 6.0))))
(if (<= x1 -4.8e+30)
(/ (* x2 (* x2 -36.0)) t_1)
(if (<= x1 -5.5e-106)
t_0
(if (<= x1 3.8e-122)
(* x2 -6.0)
(if (<= x1 1.35e+154) t_0 (/ (* x1 x1) t_1)))))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
double t_1 = x1 + (x2 * 6.0);
double tmp;
if (x1 <= -4.8e+30) {
tmp = (x2 * (x2 * -36.0)) / t_1;
} else if (x1 <= -5.5e-106) {
tmp = t_0;
} else if (x1 <= 3.8e-122) {
tmp = x2 * -6.0;
} else if (x1 <= 1.35e+154) {
tmp = t_0;
} else {
tmp = (x1 * x1) / 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 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
t_1 = x1 + (x2 * 6.0d0)
if (x1 <= (-4.8d+30)) then
tmp = (x2 * (x2 * (-36.0d0))) / t_1
else if (x1 <= (-5.5d-106)) then
tmp = t_0
else if (x1 <= 3.8d-122) then
tmp = x2 * (-6.0d0)
else if (x1 <= 1.35d+154) then
tmp = t_0
else
tmp = (x1 * x1) / t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
double t_1 = x1 + (x2 * 6.0);
double tmp;
if (x1 <= -4.8e+30) {
tmp = (x2 * (x2 * -36.0)) / t_1;
} else if (x1 <= -5.5e-106) {
tmp = t_0;
} else if (x1 <= 3.8e-122) {
tmp = x2 * -6.0;
} else if (x1 <= 1.35e+154) {
tmp = t_0;
} else {
tmp = (x1 * x1) / t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) t_1 = x1 + (x2 * 6.0) tmp = 0 if x1 <= -4.8e+30: tmp = (x2 * (x2 * -36.0)) / t_1 elif x1 <= -5.5e-106: tmp = t_0 elif x1 <= 3.8e-122: tmp = x2 * -6.0 elif x1 <= 1.35e+154: tmp = t_0 else: tmp = (x1 * x1) / t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))) t_1 = Float64(x1 + Float64(x2 * 6.0)) tmp = 0.0 if (x1 <= -4.8e+30) tmp = Float64(Float64(x2 * Float64(x2 * -36.0)) / t_1); elseif (x1 <= -5.5e-106) tmp = t_0; elseif (x1 <= 3.8e-122) tmp = Float64(x2 * -6.0); elseif (x1 <= 1.35e+154) tmp = t_0; else tmp = Float64(Float64(x1 * x1) / t_1); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); t_1 = x1 + (x2 * 6.0); tmp = 0.0; if (x1 <= -4.8e+30) tmp = (x2 * (x2 * -36.0)) / t_1; elseif (x1 <= -5.5e-106) tmp = t_0; elseif (x1 <= 3.8e-122) tmp = x2 * -6.0; elseif (x1 <= 1.35e+154) tmp = t_0; else tmp = (x1 * x1) / t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.8e+30], N[(N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[x1, -5.5e-106], t$95$0, If[LessEqual[x1, 3.8e-122], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$0, N[(N[(x1 * x1), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
t_1 := x1 + x2 \cdot 6\\
\mathbf{if}\;x1 \leq -4.8 \cdot 10^{+30}:\\
\;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_1}\\
\mathbf{elif}\;x1 \leq -5.5 \cdot 10^{-106}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 3.8 \cdot 10^{-122}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_1}\\
\end{array}
\end{array}
if x1 < -4.7999999999999999e30Initial program 32.1%
Taylor expanded in x1 around 0 2.1%
Taylor expanded in x1 around 0 1.0%
flip-+2.0%
*-commutative2.0%
*-commutative2.0%
*-commutative2.0%
Applied egg-rr2.0%
fma-neg11.0%
swap-sqr11.0%
unpow211.0%
distribute-rgt-neg-in11.0%
unpow211.0%
metadata-eval11.0%
metadata-eval11.0%
sub-neg11.0%
distribute-rgt-neg-in11.0%
metadata-eval11.0%
Simplified11.0%
Taylor expanded in x1 around 0 12.4%
*-commutative12.4%
unpow212.4%
associate-*r*12.4%
Simplified12.4%
if -4.7999999999999999e30 < x1 < -5.5000000000000001e-106 or 3.8000000000000001e-122 < x1 < 1.35000000000000003e154Initial program 98.0%
Taylor expanded in x1 around 0 63.0%
Taylor expanded in x1 around inf 39.0%
if -5.5000000000000001e-106 < x1 < 3.8000000000000001e-122Initial program 99.3%
Taylor expanded in x1 around 0 99.3%
Taylor expanded in x1 around 0 59.4%
Taylor expanded in x1 around 0 59.8%
*-commutative59.8%
Simplified59.8%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification46.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* x2 6.0))))
(if (<= x1 -4.5e+153)
(/ (* x2 (* x2 -36.0)) t_0)
(if (<= x1 1.35e+154)
(+ x1 (+ (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)) (* x2 -6.0)))
(/ (* x1 x1) t_0)))))
double code(double x1, double x2) {
double t_0 = x1 + (x2 * 6.0);
double tmp;
if (x1 <= -4.5e+153) {
tmp = (x2 * (x2 * -36.0)) / t_0;
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
} else {
tmp = (x1 * x1) / t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + (x2 * 6.0d0)
if (x1 <= (-4.5d+153)) then
tmp = (x2 * (x2 * (-36.0d0))) / t_0
else if (x1 <= 1.35d+154) then
tmp = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (x2 * (-6.0d0)))
else
tmp = (x1 * x1) / t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x2 * 6.0);
double tmp;
if (x1 <= -4.5e+153) {
tmp = (x2 * (x2 * -36.0)) / t_0;
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
} else {
tmp = (x1 * x1) / t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x2 * 6.0) tmp = 0 if x1 <= -4.5e+153: tmp = (x2 * (x2 * -36.0)) / t_0 elif x1 <= 1.35e+154: tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)) else: tmp = (x1 * x1) / t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x2 * 6.0)) tmp = 0.0 if (x1 <= -4.5e+153) tmp = Float64(Float64(x2 * Float64(x2 * -36.0)) / t_0); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(x2 * -6.0))); else tmp = Float64(Float64(x1 * x1) / t_0); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x2 * 6.0); tmp = 0.0; if (x1 <= -4.5e+153) tmp = (x2 * (x2 * -36.0)) / t_0; elseif (x1 <= 1.35e+154) tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)); else tmp = (x1 * x1) / t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], N[(N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x2 \cdot 6\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_0}\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_0}\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 1.0%
flip-+0.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
fma-neg15.2%
swap-sqr15.2%
unpow215.2%
distribute-rgt-neg-in15.2%
unpow215.2%
metadata-eval15.2%
metadata-eval15.2%
sub-neg15.2%
distribute-rgt-neg-in15.2%
metadata-eval15.2%
Simplified15.2%
Taylor expanded in x1 around 0 16.8%
*-commutative16.8%
unpow216.8%
associate-*r*16.8%
Simplified16.8%
if -4.5000000000000001e153 < x1 < 1.35000000000000003e154Initial program 96.1%
Taylor expanded in x1 around 0 71.0%
Taylor expanded in x1 around 0 62.7%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification60.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* x1 (* (* x2 x2) 8.0)))) (t_1 (+ x1 (* x2 6.0))))
(if (<= x1 -2.05e+30)
(/ (* x2 (* x2 -36.0)) t_1)
(if (<= x1 -1.35e-104)
t_0
(if (<= x1 3.8e-122)
(* x2 -6.0)
(if (<= x1 1.35e+154) t_0 (/ (* x1 x1) t_1)))))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 * ((x2 * x2) * 8.0));
double t_1 = x1 + (x2 * 6.0);
double tmp;
if (x1 <= -2.05e+30) {
tmp = (x2 * (x2 * -36.0)) / t_1;
} else if (x1 <= -1.35e-104) {
tmp = t_0;
} else if (x1 <= 3.8e-122) {
tmp = x2 * -6.0;
} else if (x1 <= 1.35e+154) {
tmp = t_0;
} else {
tmp = (x1 * x1) / 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 * ((x2 * x2) * 8.0d0))
t_1 = x1 + (x2 * 6.0d0)
if (x1 <= (-2.05d+30)) then
tmp = (x2 * (x2 * (-36.0d0))) / t_1
else if (x1 <= (-1.35d-104)) then
tmp = t_0
else if (x1 <= 3.8d-122) then
tmp = x2 * (-6.0d0)
else if (x1 <= 1.35d+154) then
tmp = t_0
else
tmp = (x1 * x1) / t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 * ((x2 * x2) * 8.0));
double t_1 = x1 + (x2 * 6.0);
double tmp;
if (x1 <= -2.05e+30) {
tmp = (x2 * (x2 * -36.0)) / t_1;
} else if (x1 <= -1.35e-104) {
tmp = t_0;
} else if (x1 <= 3.8e-122) {
tmp = x2 * -6.0;
} else if (x1 <= 1.35e+154) {
tmp = t_0;
} else {
tmp = (x1 * x1) / t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 * ((x2 * x2) * 8.0)) t_1 = x1 + (x2 * 6.0) tmp = 0 if x1 <= -2.05e+30: tmp = (x2 * (x2 * -36.0)) / t_1 elif x1 <= -1.35e-104: tmp = t_0 elif x1 <= 3.8e-122: tmp = x2 * -6.0 elif x1 <= 1.35e+154: tmp = t_0 else: tmp = (x1 * x1) / t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 * Float64(Float64(x2 * x2) * 8.0))) t_1 = Float64(x1 + Float64(x2 * 6.0)) tmp = 0.0 if (x1 <= -2.05e+30) tmp = Float64(Float64(x2 * Float64(x2 * -36.0)) / t_1); elseif (x1 <= -1.35e-104) tmp = t_0; elseif (x1 <= 3.8e-122) tmp = Float64(x2 * -6.0); elseif (x1 <= 1.35e+154) tmp = t_0; else tmp = Float64(Float64(x1 * x1) / t_1); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 * ((x2 * x2) * 8.0)); t_1 = x1 + (x2 * 6.0); tmp = 0.0; if (x1 <= -2.05e+30) tmp = (x2 * (x2 * -36.0)) / t_1; elseif (x1 <= -1.35e-104) tmp = t_0; elseif (x1 <= 3.8e-122) tmp = x2 * -6.0; elseif (x1 <= 1.35e+154) tmp = t_0; else tmp = (x1 * x1) / t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 * N[(N[(x2 * x2), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.05e+30], N[(N[(x2 * N[(x2 * -36.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[x1, -1.35e-104], t$95$0, If[LessEqual[x1, 3.8e-122], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$0, N[(N[(x1 * x1), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\\
t_1 := x1 + x2 \cdot 6\\
\mathbf{if}\;x1 \leq -2.05 \cdot 10^{+30}:\\
\;\;\;\;\frac{x2 \cdot \left(x2 \cdot -36\right)}{t_1}\\
\mathbf{elif}\;x1 \leq -1.35 \cdot 10^{-104}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 3.8 \cdot 10^{-122}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_1}\\
\end{array}
\end{array}
if x1 < -2.05000000000000003e30Initial program 32.1%
Taylor expanded in x1 around 0 2.1%
Taylor expanded in x1 around 0 1.0%
flip-+2.0%
*-commutative2.0%
*-commutative2.0%
*-commutative2.0%
Applied egg-rr2.0%
fma-neg11.0%
swap-sqr11.0%
unpow211.0%
distribute-rgt-neg-in11.0%
unpow211.0%
metadata-eval11.0%
metadata-eval11.0%
sub-neg11.0%
distribute-rgt-neg-in11.0%
metadata-eval11.0%
Simplified11.0%
Taylor expanded in x1 around 0 12.4%
*-commutative12.4%
unpow212.4%
associate-*r*12.4%
Simplified12.4%
if -2.05000000000000003e30 < x1 < -1.3499999999999999e-104 or 3.8000000000000001e-122 < x1 < 1.35000000000000003e154Initial program 98.0%
Taylor expanded in x1 around 0 63.0%
Taylor expanded in x2 around inf 39.0%
*-commutative39.0%
*-commutative39.0%
associate-*l*39.0%
unpow239.0%
Simplified39.0%
if -1.3499999999999999e-104 < x1 < 3.8000000000000001e-122Initial program 99.3%
Taylor expanded in x1 around 0 99.3%
Taylor expanded in x1 around 0 59.4%
Taylor expanded in x1 around 0 59.8%
*-commutative59.8%
Simplified59.8%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification46.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* x1 (* (* x2 x2) 8.0)))))
(if (<= x1 -2.75e-106)
t_0
(if (<= x1 3.8e-122)
(* x2 -6.0)
(if (<= x1 1.35e+154) t_0 (/ (* x1 x1) (+ x1 (* x2 6.0))))))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 * ((x2 * x2) * 8.0));
double tmp;
if (x1 <= -2.75e-106) {
tmp = t_0;
} else if (x1 <= 3.8e-122) {
tmp = x2 * -6.0;
} else if (x1 <= 1.35e+154) {
tmp = t_0;
} else {
tmp = (x1 * x1) / (x1 + (x2 * 6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + (x1 * ((x2 * x2) * 8.0d0))
if (x1 <= (-2.75d-106)) then
tmp = t_0
else if (x1 <= 3.8d-122) then
tmp = x2 * (-6.0d0)
else if (x1 <= 1.35d+154) then
tmp = t_0
else
tmp = (x1 * x1) / (x1 + (x2 * 6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 * ((x2 * x2) * 8.0));
double tmp;
if (x1 <= -2.75e-106) {
tmp = t_0;
} else if (x1 <= 3.8e-122) {
tmp = x2 * -6.0;
} else if (x1 <= 1.35e+154) {
tmp = t_0;
} else {
tmp = (x1 * x1) / (x1 + (x2 * 6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 * ((x2 * x2) * 8.0)) tmp = 0 if x1 <= -2.75e-106: tmp = t_0 elif x1 <= 3.8e-122: tmp = x2 * -6.0 elif x1 <= 1.35e+154: tmp = t_0 else: tmp = (x1 * x1) / (x1 + (x2 * 6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 * Float64(Float64(x2 * x2) * 8.0))) tmp = 0.0 if (x1 <= -2.75e-106) tmp = t_0; elseif (x1 <= 3.8e-122) tmp = Float64(x2 * -6.0); elseif (x1 <= 1.35e+154) tmp = t_0; else tmp = Float64(Float64(x1 * x1) / Float64(x1 + Float64(x2 * 6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 * ((x2 * x2) * 8.0)); tmp = 0.0; if (x1 <= -2.75e-106) tmp = t_0; elseif (x1 <= 3.8e-122) tmp = x2 * -6.0; elseif (x1 <= 1.35e+154) tmp = t_0; else tmp = (x1 * x1) / (x1 + (x2 * 6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 * N[(N[(x2 * x2), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.75e-106], t$95$0, If[LessEqual[x1, 3.8e-122], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$0, N[(N[(x1 * x1), $MachinePrecision] / N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\\
\mathbf{if}\;x1 \leq -2.75 \cdot 10^{-106}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 3.8 \cdot 10^{-122}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{x1 + x2 \cdot 6}\\
\end{array}
\end{array}
if x1 < -2.75000000000000005e-106 or 3.8000000000000001e-122 < x1 < 1.35000000000000003e154Initial program 72.9%
Taylor expanded in x1 around 0 39.8%
Taylor expanded in x2 around inf 24.9%
*-commutative24.9%
*-commutative24.9%
associate-*l*24.9%
unpow224.9%
Simplified24.9%
if -2.75000000000000005e-106 < x1 < 3.8000000000000001e-122Initial program 99.3%
Taylor expanded in x1 around 0 99.3%
Taylor expanded in x1 around 0 59.4%
Taylor expanded in x1 around 0 59.8%
*-commutative59.8%
Simplified59.8%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
flip-+83.3%
*-commutative83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
fma-neg90.0%
swap-sqr90.0%
unpow290.0%
distribute-rgt-neg-in90.0%
unpow290.0%
metadata-eval90.0%
metadata-eval90.0%
sub-neg90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x1 around inf 93.3%
unpow293.3%
Simplified93.3%
Final simplification43.7%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -8.1e-106) (not (<= x1 3.7e-122))) (+ x1 (* x1 (* (* x2 x2) 8.0))) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -8.1e-106) || !(x1 <= 3.7e-122)) {
tmp = x1 + (x1 * ((x2 * x2) * 8.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-8.1d-106)) .or. (.not. (x1 <= 3.7d-122))) then
tmp = x1 + (x1 * ((x2 * x2) * 8.0d0))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -8.1e-106) || !(x1 <= 3.7e-122)) {
tmp = x1 + (x1 * ((x2 * x2) * 8.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -8.1e-106) or not (x1 <= 3.7e-122): tmp = x1 + (x1 * ((x2 * x2) * 8.0)) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -8.1e-106) || !(x1 <= 3.7e-122)) tmp = Float64(x1 + Float64(x1 * Float64(Float64(x2 * x2) * 8.0))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -8.1e-106) || ~((x1 <= 3.7e-122))) tmp = x1 + (x1 * ((x2 * x2) * 8.0)); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -8.1e-106], N[Not[LessEqual[x1, 3.7e-122]], $MachinePrecision]], N[(x1 + N[(x1 * N[(N[(x2 * x2), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -8.1 \cdot 10^{-106} \lor \neg \left(x1 \leq 3.7 \cdot 10^{-122}\right):\\
\;\;\;\;x1 + x1 \cdot \left(\left(x2 \cdot x2\right) \cdot 8\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -8.1000000000000002e-106 or 3.6999999999999997e-122 < x1 Initial program 60.5%
Taylor expanded in x1 around 0 33.1%
Taylor expanded in x2 around inf 29.2%
*-commutative29.2%
*-commutative29.2%
associate-*l*29.2%
unpow229.2%
Simplified29.2%
if -8.1000000000000002e-106 < x1 < 3.6999999999999997e-122Initial program 99.3%
Taylor expanded in x1 around 0 99.3%
Taylor expanded in x1 around 0 59.4%
Taylor expanded in x1 around 0 59.8%
*-commutative59.8%
Simplified59.8%
Final simplification38.7%
(FPCore (x1 x2) :precision binary64 (+ x1 (* x2 -6.0)))
double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + (x2 * (-6.0d0))
end function
public static double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
def code(x1, x2): return x1 + (x2 * -6.0)
function code(x1, x2) return Float64(x1 + Float64(x2 * -6.0)) end
function tmp = code(x1, x2) tmp = x1 + (x2 * -6.0); end
code[x1_, x2_] := N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + x2 \cdot -6
\end{array}
Initial program 72.5%
Taylor expanded in x1 around 0 53.5%
Taylor expanded in x1 around 0 21.9%
Final simplification21.9%
(FPCore (x1 x2) :precision binary64 (* x2 -6.0))
double code(double x1, double x2) {
return x2 * -6.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * (-6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * -6.0;
}
def code(x1, x2): return x2 * -6.0
function code(x1, x2) return Float64(x2 * -6.0) end
function tmp = code(x1, x2) tmp = x2 * -6.0; end
code[x1_, x2_] := N[(x2 * -6.0), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6
\end{array}
Initial program 72.5%
Taylor expanded in x1 around 0 53.5%
Taylor expanded in x1 around 0 21.9%
Taylor expanded in x1 around 0 21.9%
*-commutative21.9%
Simplified21.9%
Final simplification21.9%
(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 72.5%
Taylor expanded in x1 around 0 53.5%
Taylor expanded in x1 around 0 21.9%
flip-+31.5%
*-commutative31.5%
*-commutative31.5%
*-commutative31.5%
Applied egg-rr31.5%
fma-neg34.3%
swap-sqr34.2%
unpow234.2%
distribute-rgt-neg-in34.2%
unpow234.2%
metadata-eval34.2%
metadata-eval34.2%
sub-neg34.2%
distribute-rgt-neg-in34.2%
metadata-eval34.2%
Simplified34.2%
Taylor expanded in x1 around inf 3.4%
Final simplification3.4%
herbie shell --seed 2023221
(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))))))