?

Average Error: 0.5 → 0.5
Time: 42.2s
Precision: binary64
Cost: 6976

?

\[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
\[\begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := \frac{t_1 + \left(\left(x2 + x2\right) - x1\right)}{t_0}\\ t_0 \cdot \left(t_2 \cdot \left(2 \cdot \left(\left(t_2 - 3\right) \cdot x1\right) + \left(x1 \cdot x1\right) \cdot 4\right) - x1 \cdot \left(6 \cdot x1\right)\right) + \left(\left(x1 + 3 \cdot \frac{\left(t_1 - x1\right) - \left(x2 + x2\right)}{t_0}\right) + x1 \cdot \left(1 + x1 \cdot \left(x1 + t_2 \cdot 3\right)\right)\right) \end{array} \]
(FPCore (x1 x2)
 :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))))))
(FPCore (x1 x2)
 :precision binary64
 (let* ((t_0 (+ (* x1 x1) 1.0))
        (t_1 (* x1 (* x1 3.0)))
        (t_2 (/ (+ t_1 (- (+ x2 x2) x1)) t_0)))
   (+
    (*
     t_0
     (-
      (* t_2 (+ (* 2.0 (* (- t_2 3.0) x1)) (* (* x1 x1) 4.0)))
      (* x1 (* 6.0 x1))))
    (+
     (+ x1 (* 3.0 (/ (- (- t_1 x1) (+ x2 x2)) t_0)))
     (* x1 (+ 1.0 (* x1 (+ x1 (* t_2 3.0)))))))))
double code(double x1, double x2) {
	return 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))));
}
double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 * (x1 * 3.0);
	double t_2 = (t_1 + ((x2 + x2) - x1)) / t_0;
	return (t_0 * ((t_2 * ((2.0 * ((t_2 - 3.0) * x1)) + ((x1 * x1) * 4.0))) - (x1 * (6.0 * x1)))) + ((x1 + (3.0 * (((t_1 - x1) - (x2 + x2)) / t_0))) + (x1 * (1.0 + (x1 * (x1 + (t_2 * 3.0))))));
}
real(8) function code(x1, x2)
    real(8), intent (in) :: x1
    real(8), intent (in) :: x2
    code = x1 + (((((((((2.0d0 * x1) * (((((3.0d0 * x1) * x1) + (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) * ((((((3.0d0 * x1) * x1) + (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0)) - 3.0d0)) + ((x1 * x1) * ((4.0d0 * (((((3.0d0 * x1) * x1) + (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) - 6.0d0))) * ((x1 * x1) + 1.0d0)) + (((3.0d0 * x1) * x1) * (((((3.0d0 * x1) * x1) + (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0)))) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((((3.0d0 * x1) * x1) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))))
end function
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 = (x1 * x1) + 1.0d0
    t_1 = x1 * (x1 * 3.0d0)
    t_2 = (t_1 + ((x2 + x2) - x1)) / t_0
    code = (t_0 * ((t_2 * ((2.0d0 * ((t_2 - 3.0d0) * x1)) + ((x1 * x1) * 4.0d0))) - (x1 * (6.0d0 * x1)))) + ((x1 + (3.0d0 * (((t_1 - x1) - (x2 + x2)) / t_0))) + (x1 * (1.0d0 + (x1 * (x1 + (t_2 * 3.0d0))))))
end function
public static double code(double x1, double x2) {
	return 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))));
}
public static double code(double x1, double x2) {
	double t_0 = (x1 * x1) + 1.0;
	double t_1 = x1 * (x1 * 3.0);
	double t_2 = (t_1 + ((x2 + x2) - x1)) / t_0;
	return (t_0 * ((t_2 * ((2.0 * ((t_2 - 3.0) * x1)) + ((x1 * x1) * 4.0))) - (x1 * (6.0 * x1)))) + ((x1 + (3.0 * (((t_1 - x1) - (x2 + x2)) / t_0))) + (x1 * (1.0 + (x1 * (x1 + (t_2 * 3.0))))));
}
def code(x1, x2):
	return 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))))
def code(x1, x2):
	t_0 = (x1 * x1) + 1.0
	t_1 = x1 * (x1 * 3.0)
	t_2 = (t_1 + ((x2 + x2) - x1)) / t_0
	return (t_0 * ((t_2 * ((2.0 * ((t_2 - 3.0) * x1)) + ((x1 * x1) * 4.0))) - (x1 * (6.0 * x1)))) + ((x1 + (3.0 * (((t_1 - x1) - (x2 + x2)) / t_0))) + (x1 * (1.0 + (x1 * (x1 + (t_2 * 3.0))))))
function code(x1, x2)
	return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * Float64(Float64(Float64(Float64(Float64(3.0 * x1) * x1) + Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) * Float64(Float64(Float64(Float64(Float64(Float64(3.0 * x1) * x1) + Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0)) - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(Float64(Float64(Float64(3.0 * x1) * x1) + Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) - 6.0))) * Float64(Float64(x1 * x1) + 1.0)) + Float64(Float64(Float64(3.0 * x1) * x1) * Float64(Float64(Float64(Float64(Float64(3.0 * x1) * x1) + Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0)))) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(Float64(Float64(3.0 * x1) * x1) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0)))))
end
function code(x1, x2)
	t_0 = Float64(Float64(x1 * x1) + 1.0)
	t_1 = Float64(x1 * Float64(x1 * 3.0))
	t_2 = Float64(Float64(t_1 + Float64(Float64(x2 + x2) - x1)) / t_0)
	return Float64(Float64(t_0 * Float64(Float64(t_2 * Float64(Float64(2.0 * Float64(Float64(t_2 - 3.0) * x1)) + Float64(Float64(x1 * x1) * 4.0))) - Float64(x1 * Float64(6.0 * x1)))) + Float64(Float64(x1 + Float64(3.0 * Float64(Float64(Float64(t_1 - x1) - Float64(x2 + x2)) / t_0))) + Float64(x1 * Float64(1.0 + Float64(x1 * Float64(x1 + Float64(t_2 * 3.0)))))))
end
function tmp = code(x1, x2)
	tmp = 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))));
end
function tmp = code(x1, x2)
	t_0 = (x1 * x1) + 1.0;
	t_1 = x1 * (x1 * 3.0);
	t_2 = (t_1 + ((x2 + x2) - x1)) / t_0;
	tmp = (t_0 * ((t_2 * ((2.0 * ((t_2 - 3.0) * x1)) + ((x1 * x1) * 4.0))) - (x1 * (6.0 * x1)))) + ((x1 + (3.0 * (((t_1 - x1) - (x2 + x2)) / t_0))) + (x1 * (1.0 + (x1 * (x1 + (t_2 * 3.0))))));
end
code[x1_, x2_] := N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision] * N[(N[(N[(N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(N[(x2 + x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]}, N[(N[(t$95$0 * N[(N[(t$95$2 * N[(N[(2.0 * N[(N[(t$95$2 - 3.0), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(6.0 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 + N[(3.0 * N[(N[(N[(t$95$1 - x1), $MachinePrecision] - N[(x2 + x2), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(1.0 + N[(x1 * N[(x1 + N[(t$95$2 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{t_1 + \left(\left(x2 + x2\right) - x1\right)}{t_0}\\
t_0 \cdot \left(t_2 \cdot \left(2 \cdot \left(\left(t_2 - 3\right) \cdot x1\right) + \left(x1 \cdot x1\right) \cdot 4\right) - x1 \cdot \left(6 \cdot x1\right)\right) + \left(\left(x1 + 3 \cdot \frac{\left(t_1 - x1\right) - \left(x2 + x2\right)}{t_0}\right) + x1 \cdot \left(1 + x1 \cdot \left(x1 + t_2 \cdot 3\right)\right)\right)
\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 0.5

    \[x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]
  2. Simplified0.5

    \[\leadsto \color{blue}{\left(x1 \cdot x1 + 1\right) \cdot \left(\frac{x1 \cdot \left(x1 \cdot 3\right) + \left(\left(x2 + x2\right) - x1\right)}{x1 \cdot x1 + 1} \cdot \left(2 \cdot \left(\left(\frac{x1 \cdot \left(x1 \cdot 3\right) + \left(\left(x2 + x2\right) - x1\right)}{x1 \cdot x1 + 1} - 3\right) \cdot x1\right) + \left(x1 \cdot x1\right) \cdot 4\right) - x1 \cdot \left(6 \cdot x1\right)\right) + \left(\left(x1 + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x1\right) - \left(x2 + x2\right)}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(1 + x1 \cdot \left(x1 + \frac{x1 \cdot \left(x1 \cdot 3\right) + \left(\left(x2 + x2\right) - x1\right)}{x1 \cdot x1 + 1} \cdot 3\right)\right)\right)} \]
    Proof

    [Start]0.5

    \[ x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \]

    rational_best_oopsla_all_46_json_45_simplify-82 [=>]0.5

    \[ \color{blue}{\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + \left(x1 + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)} \]

    rational_best_oopsla_all_46_json_45_simplify-35 [=>]0.5

    \[ \color{blue}{\left(x1 + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right)} \]
  3. Final simplification0.5

    \[\leadsto \left(x1 \cdot x1 + 1\right) \cdot \left(\frac{x1 \cdot \left(x1 \cdot 3\right) + \left(\left(x2 + x2\right) - x1\right)}{x1 \cdot x1 + 1} \cdot \left(2 \cdot \left(\left(\frac{x1 \cdot \left(x1 \cdot 3\right) + \left(\left(x2 + x2\right) - x1\right)}{x1 \cdot x1 + 1} - 3\right) \cdot x1\right) + \left(x1 \cdot x1\right) \cdot 4\right) - x1 \cdot \left(6 \cdot x1\right)\right) + \left(\left(x1 + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x1\right) - \left(x2 + x2\right)}{x1 \cdot x1 + 1}\right) + x1 \cdot \left(1 + x1 \cdot \left(x1 + \frac{x1 \cdot \left(x1 \cdot 3\right) + \left(\left(x2 + x2\right) - x1\right)}{x1 \cdot x1 + 1} \cdot 3\right)\right)\right) \]

Alternatives

Alternative 1
Error1.0
Cost5896
\[\begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := \frac{x2 + \left(t_0 + \left(x2 - x1\right)\right)}{1 + x1 \cdot x1}\\ t_2 := x1 \cdot x1 + 1\\ t_3 := t_2 \cdot \left(-x1 \cdot \left(x1 \cdot 6 - t_1 \cdot \left(2 \cdot t_1 + \left(-6 + 4 \cdot x1\right)\right)\right)\right)\\ t_4 := \frac{t_0 + \left(\left(x2 + x2\right) - x1\right)}{t_2}\\ t_5 := x1 \cdot \left(1 + x1 \cdot \left(x1 + t_4 \cdot 3\right)\right)\\ \mathbf{if}\;x1 \leq -0.09:\\ \;\;\;\;t_3 + \left(x1 + t_5\right)\\ \mathbf{elif}\;x1 \leq 0.042:\\ \;\;\;\;t_2 \cdot \left(t_4 \cdot \left(2 \cdot \left(\left(x2 \cdot 2 + \left(\left(-x1\right) - 3\right)\right) \cdot x1\right) + \left(x1 \cdot x1\right) \cdot 4\right) - x1 \cdot \left(6 \cdot x1\right)\right) + \left(\left(x1 + 3 \cdot \frac{\left(t_0 - x1\right) - \left(x2 + x2\right)}{t_2}\right) + x1 \cdot \left(1 + x1 \cdot \left(x2 \cdot 6 + x1 \cdot -2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_3 + \left(\left(x1 + 9\right) + t_5\right)\\ \end{array} \]
Alternative 2
Error1.0
Cost5768
\[\begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := \frac{x2 + \left(t_0 + \left(x2 - x1\right)\right)}{1 + x1 \cdot x1}\\ t_2 := x1 \cdot x1 + 1\\ t_3 := \frac{t_0 + \left(\left(x2 + x2\right) - x1\right)}{t_2}\\ t_4 := t_2 \cdot \left(-x1 \cdot \left(x1 \cdot 6 - t_1 \cdot \left(2 \cdot t_1 + \left(-6 + 4 \cdot x1\right)\right)\right)\right) + \left(x1 + x1 \cdot \left(1 + x1 \cdot \left(x1 + t_3 \cdot 3\right)\right)\right)\\ \mathbf{if}\;x1 \leq -0.0126:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x1 \leq 0.116:\\ \;\;\;\;t_2 \cdot \left(t_3 \cdot \left(2 \cdot \left(\left(x2 \cdot 2 + \left(\left(-x1\right) - 3\right)\right) \cdot x1\right) + \left(x1 \cdot x1\right) \cdot 4\right) - x1 \cdot \left(6 \cdot x1\right)\right) + \left(\left(x1 + 3 \cdot \frac{\left(t_0 - x1\right) - \left(x2 + x2\right)}{t_2}\right) + x1 \cdot \left(1 + x1 \cdot \left(x2 \cdot 6 + x1 \cdot -2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array} \]
Alternative 3
Error1.1
Cost5696
\[\begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := x1 \cdot \left(x1 \cdot 3\right)\\ t_2 := \frac{t_1 + \left(\left(x2 + x2\right) - x1\right)}{t_0}\\ t_0 \cdot \left(t_2 \cdot \left(2 \cdot \left(\left(t_2 - 3\right) \cdot x1\right) + \left(x1 \cdot x1\right) \cdot 4\right) - x1 \cdot \left(6 \cdot x1\right)\right) + \left(\left(x1 + 3 \cdot \frac{\left(t_1 - x1\right) - \left(x2 + x2\right)}{t_0}\right) + x1 \cdot \left(1 + x1 \cdot x1\right)\right) \end{array} \]
Alternative 4
Error4.2
Cost5316
\[\begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := x1 \cdot x1 + 1\\ t_2 := \frac{t_0 + \left(\left(x2 + x2\right) - x1\right)}{t_1}\\ t_3 := x1 + 3 \cdot \frac{\left(t_0 - x1\right) - \left(x2 + x2\right)}{t_1}\\ \mathbf{if}\;x1 \leq -4000000:\\ \;\;\;\;t_1 \cdot \left(-x1 \cdot \left(\left(-6 \cdot x1 + \left(18 \cdot \frac{1}{x1} + 4\right)\right) - 8 \cdot \frac{x2}{x1}\right)\right) + \left(t_3 + x1 \cdot \left(1 + x1 \cdot \left(x1 + t_2 \cdot 3\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \left(t_2 \cdot \left(2 \cdot \left(\left(x2 \cdot 2 - 3\right) \cdot x1\right) + \left(x1 \cdot x1\right) \cdot 4\right) - x1 \cdot \left(6 \cdot x1\right)\right) + \left(t_3 + x1 \cdot \left(1 + x1 \cdot \left(x2 \cdot 6 + x1 \cdot -2\right)\right)\right)\\ \end{array} \]
Alternative 5
Error3.1
Cost5128
\[\begin{array}{l} t_0 := x1 \cdot \left(x1 \cdot 3\right)\\ t_1 := x1 \cdot x1 + 1\\ t_2 := x1 + 3 \cdot \frac{\left(t_0 - x1\right) - \left(x2 + x2\right)}{t_1}\\ t_3 := t_1 \cdot \left(-x1 \cdot \left(\left(-6 \cdot x1 + \left(18 \cdot \frac{1}{x1} + 4\right)\right) - 8 \cdot \frac{x2}{x1}\right)\right) + \left(t_2 + x1 \cdot \left(1 + x1 \cdot \left(x1 + \frac{t_0 + \left(\left(x2 + x2\right) - x1\right)}{t_1} \cdot 3\right)\right)\right)\\ \mathbf{if}\;x1 \leq -4000000:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x1 \leq 0.29:\\ \;\;\;\;t_1 \cdot \left(4 \cdot \left(\left(x2 \cdot 2 - 3\right) \cdot \left(x2 \cdot x1\right)\right)\right) + \left(t_2 + x1 \cdot \left(1 + x1 \cdot \left(x2 \cdot 6 + x1 \cdot -2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 6
Error3.2
Cost4808
\[\begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := 3 \cdot \left(x1 \cdot x1\right)\\ t_2 := x1 + \left(x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0} + \left(t_0 \cdot \left(-6 + x1 \cdot \left(x1 \cdot \left(-6 + 4 \cdot \frac{x2 + \left(t_1 + \left(x2 - x1\right)\right)}{1 + x1 \cdot x1}\right)\right)\right) + \left(x1 \cdot x1\right) \cdot \left(\left(x1 + 9\right) - 3 \cdot \frac{1}{x1}\right)\right)\right)\right)\\ \mathbf{if}\;x1 \leq -4000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x1 \leq 0.31:\\ \;\;\;\;t_0 \cdot \left(4 \cdot \left(\left(x2 \cdot 2 - 3\right) \cdot \left(x2 \cdot x1\right)\right)\right) + \left(\left(x1 + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x1\right) - \left(x2 + x2\right)}{t_0}\right) + x1 \cdot \left(1 + x1 \cdot \left(x2 \cdot 6 + x1 \cdot -2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 7
Error3.2
Cost4680
\[\begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := 3 \cdot \left(x1 \cdot x1\right)\\ t_2 := t_0 \cdot \left(-6 + \left(x1 \cdot x1\right) \cdot \left(\frac{t_1 + \left(2 \cdot x2 - x1\right)}{t_0} \cdot 4 - 6\right)\right)\\ t_3 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0}\\ \mathbf{if}\;x1 \leq -4000000:\\ \;\;\;\;x1 + \left(x1 + \left(t_3 + \left(t_2 + \left(x1 \cdot x1\right) \cdot \left(x1 + 9\right)\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 0.29:\\ \;\;\;\;t_0 \cdot \left(4 \cdot \left(\left(x2 \cdot 2 - 3\right) \cdot \left(x2 \cdot x1\right)\right)\right) + \left(\left(x1 + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x1\right) - \left(x2 + x2\right)}{t_0}\right) + x1 \cdot \left(1 + x1 \cdot \left(x2 \cdot 6 + x1 \cdot -2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x1 + \left(x1 + \left(t_3 + \left(t_2 + \left(x1 \cdot x1\right) \cdot \left(\left(x1 + 9\right) - \frac{3}{x1}\right)\right)\right)\right)\\ \end{array} \]
Alternative 8
Error3.2
Cost4424
\[\begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := 3 \cdot \left(x1 \cdot x1\right)\\ t_2 := x1 + \left(x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0} + \left(t_0 \cdot \left(-6 + \left(x1 \cdot x1\right) \cdot \left(\frac{t_1 + \left(2 \cdot x2 - x1\right)}{t_0} \cdot 4 - 6\right)\right) + \left(x1 \cdot x1\right) \cdot \left(x1 + 9\right)\right)\right)\right)\\ \mathbf{if}\;x1 \leq -4000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x1 \leq 1.62:\\ \;\;\;\;t_0 \cdot \left(4 \cdot \left(\left(x2 \cdot 2 - 3\right) \cdot \left(x2 \cdot x1\right)\right)\right) + \left(\left(x1 + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x1\right) - \left(x2 + x2\right)}{t_0}\right) + x1 \cdot \left(1 + x1 \cdot \left(x2 \cdot 6 + x1 \cdot -2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 9
Error3.2
Cost4296
\[\begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := 3 \cdot \left(x1 \cdot x1\right)\\ t_2 := x1 + \left(x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0} + \left(t_0 \cdot \left(-6 + \left(x1 \cdot x1\right) \cdot \left(\frac{t_1 + \left(2 \cdot x2 - x1\right)}{t_0} \cdot 4 - 6\right)\right) + \left(x1 \cdot x1\right) \cdot x1\right)\right)\right)\\ \mathbf{if}\;x1 \leq -4000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x1 \leq 0.125:\\ \;\;\;\;t_0 \cdot \left(4 \cdot \left(\left(x2 \cdot 2 - 3\right) \cdot \left(x2 \cdot x1\right)\right)\right) + \left(\left(x1 + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x1\right) - \left(x2 + x2\right)}{t_0}\right) + x1 \cdot \left(1 + x1 \cdot \left(x2 \cdot 6 + x1 \cdot -2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 10
Error3.5
Cost4168
\[\begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := 3 \cdot \left(x1 \cdot x1\right)\\ t_2 := x1 + \left(x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0} + \left(t_0 \cdot \left(-6 + \left(x1 \cdot x1\right) \cdot \left(\frac{t_1 + \left(2 \cdot x2 - x1\right)}{t_0} \cdot 4 - 6\right)\right) + -3 \cdot x1\right)\right)\right)\\ \mathbf{if}\;x1 \leq -4000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x1 \leq 0.36:\\ \;\;\;\;t_0 \cdot \left(4 \cdot \left(\left(x2 \cdot 2 - 3\right) \cdot \left(x2 \cdot x1\right)\right)\right) + \left(\left(x1 + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x1\right) - \left(x2 + x2\right)}{t_0}\right) + x1 \cdot \left(1 + x1 \cdot \left(x2 \cdot 6 + x1 \cdot -2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 11
Error5.4
Cost3656
\[\begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := t_0 \cdot \left(-x1 \cdot \left(x1 \cdot -6\right)\right)\\ t_2 := \left(x1 + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x1\right) - \left(x2 + x2\right)}{t_0}\right) + x1 \cdot \left(1 + x1 \cdot \left(x2 \cdot 6 + x1 \cdot -2\right)\right)\\ \mathbf{if}\;x1 \leq -8.6 \cdot 10^{-63}:\\ \;\;\;\;t_1 + \left(\left(x2 \cdot -6 + x1 \cdot -2\right) + x1 \cdot \left(1 + x1 \cdot \left(x2 \cdot 6\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 1.62:\\ \;\;\;\;t_0 \cdot \left(4 \cdot \left(\left(x2 \cdot 2 - 3\right) \cdot \left(x2 \cdot x1\right)\right)\right) + t_2\\ \mathbf{else}:\\ \;\;\;\;t_1 + t_2\\ \end{array} \]
Alternative 12
Error9.8
Cost3400
\[\begin{array}{l} t_0 := x1 \cdot \left(1 + x1 \cdot \left(x2 \cdot 6\right)\right)\\ t_1 := x1 \cdot x1 + 1\\ t_2 := t_1 \cdot \left(-x1 \cdot \left(x1 \cdot -6\right)\right)\\ t_3 := x1 + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x1\right) - \left(x2 + x2\right)}{t_1}\\ \mathbf{if}\;x1 \leq 1.2 \cdot 10^{-154}:\\ \;\;\;\;t_2 + \left(\left(x2 \cdot -6 + x1 \cdot -2\right) + t_0\right)\\ \mathbf{elif}\;x1 \leq 4.6:\\ \;\;\;\;t_1 \cdot \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\right) + \left(t_3 + t_0\right)\\ \mathbf{else}:\\ \;\;\;\;t_2 + \left(t_3 + x1 \cdot \left(1 + x1 \cdot \left(x2 \cdot 6 + x1 \cdot -2\right)\right)\right)\\ \end{array} \]
Alternative 13
Error9.8
Cost3336
\[\begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := t_0 \cdot \left(-x1 \cdot \left(x1 \cdot -6\right)\right)\\ t_2 := x1 + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x1\right) - \left(x2 + x2\right)}{t_0}\\ \mathbf{if}\;x1 \leq 1.2 \cdot 10^{-154}:\\ \;\;\;\;t_1 + \left(\left(x2 \cdot -6 + x1 \cdot -2\right) + x1 \cdot \left(1 + x1 \cdot \left(x2 \cdot 6\right)\right)\right)\\ \mathbf{elif}\;x1 \leq 8.5:\\ \;\;\;\;t_0 \cdot \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\right) + \left(t_2 + x1 \cdot \left(1 + x1 \cdot x1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 + \left(t_2 + x1 \cdot \left(1 + x1 \cdot \left(x2 \cdot 6 + x1 \cdot -2\right)\right)\right)\\ \end{array} \]
Alternative 14
Error9.8
Cost3272
\[\begin{array}{l} t_0 := x1 \cdot x1 + 1\\ t_1 := t_0 \cdot \left(-x1 \cdot \left(x1 \cdot -6\right)\right) + \left(\left(x2 \cdot -6 + x1 \cdot -2\right) + x1 \cdot \left(1 + x1 \cdot \left(x2 \cdot 6\right)\right)\right)\\ \mathbf{if}\;x1 \leq 1.25 \cdot 10^{-154}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x1 \leq 3.2:\\ \;\;\;\;t_0 \cdot \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\right) + \left(\left(x1 + 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x1\right) - \left(x2 + x2\right)}{t_0}\right) + x1 \cdot \left(1 + x1 \cdot x1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 15
Error11.8
Cost1920
\[\left(x1 \cdot x1 + 1\right) \cdot \left(-x1 \cdot \left(x1 \cdot -6\right)\right) + \left(\left(x2 \cdot -6 + x1 \cdot -2\right) + x1 \cdot \left(1 + x1 \cdot \left(x2 \cdot 6\right)\right)\right) \]
Alternative 16
Error46.5
Cost1800
\[\begin{array}{l} t_0 := \left(x1 \cdot x1 + 1\right) \cdot \left(-x1 \cdot \left(x1 \cdot -6\right)\right) + \left(x1 + x1 \cdot \left(1 + x1 \cdot \left(x2 \cdot 6\right)\right)\right)\\ \mathbf{if}\;x1 \leq -4000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x1 \leq 8.5:\\ \;\;\;\;x2 \cdot \left(\left(\left(x2 + x2\right) - 3\right) \cdot \left(4 \cdot x1\right)\right) + \left(x1 + x1 \cdot \left(1 + x1 \cdot x1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 17
Error26.0
Cost1664
\[\left(x1 \cdot x1 + 1\right) \cdot \left(-x1 \cdot \left(x1 \cdot -6\right)\right) + \left(x2 \cdot -6 + x1 \cdot \left(1 + x1 \cdot \left(x2 \cdot 6\right)\right)\right) \]
Alternative 18
Error54.9
Cost1344
\[x2 \cdot \left(\left(\left(x2 + x2\right) - 3\right) \cdot \left(4 \cdot x1\right)\right) + \left(x1 + x1 \cdot \left(1 + x1 \cdot x1\right)\right) \]

Error

Reproduce?

herbie shell --seed 2023090 
(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))))))