?

Average Error: 7.9 → 5.9
Time: 17.6s
Precision: binary64
Cost: 8904

?

\[0.999 \leq x \land x \leq 1.001\]
\[\frac{10}{1 - x \cdot x} \]
\[\begin{array}{l} t_0 := \left(x \cdot x\right) \cdot \left(x \cdot x\right)\\ \frac{10}{\begin{array}{l} \mathbf{if}\;-1 - x \cdot x \ne 0:\\ \;\;\;\;\frac{\begin{array}{l} \mathbf{if}\;-1 - t_0 \ne 0:\\ \;\;\;\;\frac{1 + \left(-{x}^{8}\right)}{1 + t_0}\\ \mathbf{else}:\\ \;\;\;\;1 - t_0\\ \end{array}}{x \cdot x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 - x \cdot x\\ \end{array}} \end{array} \]
(FPCore (x) :precision binary64 (/ 10.0 (- 1.0 (* x x))))
(FPCore (x)
 :precision binary64
 (let* ((t_0 (* (* x x) (* x x))))
   (/
    10.0
    (if (!= (- -1.0 (* x x)) 0.0)
      (/
       (if (!= (- -1.0 t_0) 0.0)
         (/ (+ 1.0 (- (pow x 8.0))) (+ 1.0 t_0))
         (- 1.0 t_0))
       (+ (* x x) 1.0))
      (- 1.0 (* x x))))))
double code(double x) {
	return 10.0 / (1.0 - (x * x));
}
double code(double x) {
	double t_0 = (x * x) * (x * x);
	double tmp_1;
	if ((-1.0 - (x * x)) != 0.0) {
		double tmp_2;
		if ((-1.0 - t_0) != 0.0) {
			tmp_2 = (1.0 + -pow(x, 8.0)) / (1.0 + t_0);
		} else {
			tmp_2 = 1.0 - t_0;
		}
		tmp_1 = tmp_2 / ((x * x) + 1.0);
	} else {
		tmp_1 = 1.0 - (x * x);
	}
	return 10.0 / tmp_1;
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = 10.0d0 / (1.0d0 - (x * x))
end function
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    real(8) :: tmp_1
    real(8) :: tmp_2
    t_0 = (x * x) * (x * x)
    if (((-1.0d0) - (x * x)) /= 0.0d0) then
        if (((-1.0d0) - t_0) /= 0.0d0) then
            tmp_2 = (1.0d0 + -(x ** 8.0d0)) / (1.0d0 + t_0)
        else
            tmp_2 = 1.0d0 - t_0
        end if
        tmp_1 = tmp_2 / ((x * x) + 1.0d0)
    else
        tmp_1 = 1.0d0 - (x * x)
    end if
    code = 10.0d0 / tmp_1
end function
public static double code(double x) {
	return 10.0 / (1.0 - (x * x));
}
public static double code(double x) {
	double t_0 = (x * x) * (x * x);
	double tmp_1;
	if ((-1.0 - (x * x)) != 0.0) {
		double tmp_2;
		if ((-1.0 - t_0) != 0.0) {
			tmp_2 = (1.0 + -Math.pow(x, 8.0)) / (1.0 + t_0);
		} else {
			tmp_2 = 1.0 - t_0;
		}
		tmp_1 = tmp_2 / ((x * x) + 1.0);
	} else {
		tmp_1 = 1.0 - (x * x);
	}
	return 10.0 / tmp_1;
}
def code(x):
	return 10.0 / (1.0 - (x * x))
def code(x):
	t_0 = (x * x) * (x * x)
	tmp_1 = 0
	if (-1.0 - (x * x)) != 0.0:
		tmp_2 = 0
		if (-1.0 - t_0) != 0.0:
			tmp_2 = (1.0 + -math.pow(x, 8.0)) / (1.0 + t_0)
		else:
			tmp_2 = 1.0 - t_0
		tmp_1 = tmp_2 / ((x * x) + 1.0)
	else:
		tmp_1 = 1.0 - (x * x)
	return 10.0 / tmp_1
function code(x)
	return Float64(10.0 / Float64(1.0 - Float64(x * x)))
end
function code(x)
	t_0 = Float64(Float64(x * x) * Float64(x * x))
	tmp_1 = 0.0
	if (Float64(-1.0 - Float64(x * x)) != 0.0)
		tmp_2 = 0.0
		if (Float64(-1.0 - t_0) != 0.0)
			tmp_2 = Float64(Float64(1.0 + Float64(-(x ^ 8.0))) / Float64(1.0 + t_0));
		else
			tmp_2 = Float64(1.0 - t_0);
		end
		tmp_1 = Float64(tmp_2 / Float64(Float64(x * x) + 1.0));
	else
		tmp_1 = Float64(1.0 - Float64(x * x));
	end
	return Float64(10.0 / tmp_1)
end
function tmp = code(x)
	tmp = 10.0 / (1.0 - (x * x));
end
function tmp_4 = code(x)
	t_0 = (x * x) * (x * x);
	tmp_2 = 0.0;
	if ((-1.0 - (x * x)) ~= 0.0)
		tmp_3 = 0.0;
		if ((-1.0 - t_0) ~= 0.0)
			tmp_3 = (1.0 + -(x ^ 8.0)) / (1.0 + t_0);
		else
			tmp_3 = 1.0 - t_0;
		end
		tmp_2 = tmp_3 / ((x * x) + 1.0);
	else
		tmp_2 = 1.0 - (x * x);
	end
	tmp_4 = 10.0 / tmp_2;
end
code[x_] := N[(10.0 / N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]}, N[(10.0 / If[Unequal[N[(-1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision], 0.0], N[(If[Unequal[N[(-1.0 - t$95$0), $MachinePrecision], 0.0], N[(N[(1.0 + (-N[Power[x, 8.0], $MachinePrecision])), $MachinePrecision] / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], N[(1.0 - t$95$0), $MachinePrecision]] / N[(N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\frac{10}{1 - x \cdot x}
\begin{array}{l}
t_0 := \left(x \cdot x\right) \cdot \left(x \cdot x\right)\\
\frac{10}{\begin{array}{l}
\mathbf{if}\;-1 - x \cdot x \ne 0:\\
\;\;\;\;\frac{\begin{array}{l}
\mathbf{if}\;-1 - t_0 \ne 0:\\
\;\;\;\;\frac{1 + \left(-{x}^{8}\right)}{1 + t_0}\\

\mathbf{else}:\\
\;\;\;\;1 - t_0\\


\end{array}}{x \cdot x + 1}\\

\mathbf{else}:\\
\;\;\;\;1 - x \cdot x\\


\end{array}}
\end{array}

Error?

Derivation?

  1. Initial program 7.9

    \[\frac{10}{1 - x \cdot x} \]
  2. Applied egg-rr7.9

    \[\leadsto \frac{10}{\color{blue}{\frac{x \cdot \left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot \left(1 - x \cdot x\right)\right)\right)}{\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)}}} \]
  3. Simplified7.9

    \[\leadsto \frac{10}{\color{blue}{\frac{x \cdot \left(x \cdot \left(\left(x \cdot \left(\left(x \cdot x\right) \cdot x\right)\right) \cdot \left(1 - x \cdot x\right)\right)\right)}{\left(x \cdot x\right) \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)}}} \]
    Proof

    [Start]7.9

    \[ \frac{10}{\frac{x \cdot \left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot \left(1 - x \cdot x\right)\right)\right)}{\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)}} \]

    rational_best-simplify-113 [=>]7.9

    \[ \frac{10}{\frac{x \cdot \color{blue}{\left(x \cdot \left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(1 - x \cdot x\right)\right)\right)}}{\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)}} \]

    rational_best-simplify-113 [=>]7.9

    \[ \frac{10}{\frac{x \cdot \left(x \cdot \left(\color{blue}{\left(x \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)} \cdot \left(1 - x \cdot x\right)\right)\right)}{\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)}} \]

    rational_best-simplify-113 [=>]7.9

    \[ \frac{10}{\frac{x \cdot \left(x \cdot \left(\left(x \cdot \left(\left(x \cdot x\right) \cdot x\right)\right) \cdot \left(1 - x \cdot x\right)\right)\right)}{\left(x \cdot x\right) \cdot \color{blue}{\left(x \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)}}} \]
  4. Applied egg-rr7.4

    \[\leadsto \frac{10}{\color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;-1 - x \cdot x \ne 0:\\ \;\;\;\;\frac{1 - x \cdot \left(x \cdot \left(x \cdot x\right)\right)}{x \cdot x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 - x \cdot x\\ } \end{array}}} \]
  5. Applied egg-rr7.6

    \[\leadsto \frac{10}{\begin{array}{l} \mathbf{if}\;-1 - x \cdot x \ne 0:\\ \;\;\;\;\frac{\color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;-1 - \left(x \cdot x\right) \cdot \left(x \cdot x\right) \ne 0:\\ \;\;\;\;\frac{1 - x \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)\right)\right)}{1 + \left(x \cdot x\right) \cdot \left(x \cdot x\right)}\\ \mathbf{else}:\\ \;\;\;\;1 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)\\ } \end{array}}}{x \cdot x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 - x \cdot x\\ \end{array}} \]
  6. Taylor expanded in x around 0 5.9

    \[\leadsto \frac{10}{\begin{array}{l} \mathbf{if}\;-1 - x \cdot x \ne 0:\\ \;\;\;\;\frac{\begin{array}{l} \mathbf{if}\;-1 - \left(x \cdot x\right) \cdot \left(x \cdot x\right) \ne 0:\\ \;\;\;\;\frac{\color{blue}{1 + -1 \cdot {x}^{8}}}{1 + \left(x \cdot x\right) \cdot \left(x \cdot x\right)}\\ \mathbf{else}:\\ \;\;\;\;1 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)\\ \end{array}}{x \cdot x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 - x \cdot x\\ \end{array}} \]
  7. Simplified5.9

    \[\leadsto \frac{10}{\begin{array}{l} \mathbf{if}\;-1 - x \cdot x \ne 0:\\ \;\;\;\;\frac{\begin{array}{l} \mathbf{if}\;-1 - \left(x \cdot x\right) \cdot \left(x \cdot x\right) \ne 0:\\ \;\;\;\;\frac{\color{blue}{1 + \left(-{x}^{8}\right)}}{1 + \left(x \cdot x\right) \cdot \left(x \cdot x\right)}\\ \mathbf{else}:\\ \;\;\;\;1 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)\\ \end{array}}{x \cdot x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 - x \cdot x\\ \end{array}} \]
    Proof

    [Start]5.9

    \[ \frac{10}{\begin{array}{l} \mathbf{if}\;-1 - x \cdot x \ne 0:\\ \;\;\;\;\frac{\begin{array}{l} \mathbf{if}\;-1 - \left(x \cdot x\right) \cdot \left(x \cdot x\right) \ne 0:\\ \;\;\;\;\frac{1 + -1 \cdot {x}^{8}}{1 + \left(x \cdot x\right) \cdot \left(x \cdot x\right)}\\ \mathbf{else}:\\ \;\;\;\;1 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)\\ \end{array}}{x \cdot x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 - x \cdot x\\ \end{array}} \]

    rational_best-simplify-3 [=>]5.9

    \[ \frac{10}{\begin{array}{l} \mathbf{if}\;-1 - x \cdot x \ne 0:\\ \;\;\;\;\frac{\begin{array}{l} \mathbf{if}\;-1 - \left(x \cdot x\right) \cdot \left(x \cdot x\right) \ne 0:\\ \;\;\;\;\frac{1 + \color{blue}{{x}^{8} \cdot -1}}{1 + \left(x \cdot x\right) \cdot \left(x \cdot x\right)}\\ \mathbf{else}:\\ \;\;\;\;1 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)\\ \end{array}}{x \cdot x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 - x \cdot x\\ \end{array}} \]

    rational_best-simplify-17 [=>]5.9

    \[ \frac{10}{\begin{array}{l} \mathbf{if}\;-1 - x \cdot x \ne 0:\\ \;\;\;\;\frac{\begin{array}{l} \mathbf{if}\;-1 - \left(x \cdot x\right) \cdot \left(x \cdot x\right) \ne 0:\\ \;\;\;\;\frac{1 + \color{blue}{\left(-{x}^{8}\right)}}{1 + \left(x \cdot x\right) \cdot \left(x \cdot x\right)}\\ \mathbf{else}:\\ \;\;\;\;1 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)\\ \end{array}}{x \cdot x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 - x \cdot x\\ \end{array}} \]
  8. Final simplification5.9

    \[\leadsto \frac{10}{\begin{array}{l} \mathbf{if}\;-1 - x \cdot x \ne 0:\\ \;\;\;\;\frac{\begin{array}{l} \mathbf{if}\;-1 - \left(x \cdot x\right) \cdot \left(x \cdot x\right) \ne 0:\\ \;\;\;\;\frac{1 + \left(-{x}^{8}\right)}{1 + \left(x \cdot x\right) \cdot \left(x \cdot x\right)}\\ \mathbf{else}:\\ \;\;\;\;1 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)\\ \end{array}}{x \cdot x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 - x \cdot x\\ \end{array}} \]

Alternatives

Alternative 1
Error6.9
Cost8068
\[\frac{10}{\frac{x \cdot \left(x \cdot \begin{array}{l} \mathbf{if}\;-1 - x \cdot x \ne 0:\\ \;\;\;\;\frac{1 - {x}^{4}}{1 + x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;1 - x \cdot x\\ \end{array}\right)}{x \cdot x}} \]
Alternative 2
Error6.9
Cost7556
\[\frac{10}{\begin{array}{l} \mathbf{if}\;-1 - x \cdot x \ne 0:\\ \;\;\;\;\frac{1 - {x}^{4}}{x \cdot x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 - x \cdot x\\ \end{array}} \]
Alternative 3
Error7.0
Cost3784
\[\begin{array}{l} t_0 := x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\ \frac{10}{\frac{x \cdot \left(x \cdot \begin{array}{l} \mathbf{if}\;-1 - x \cdot x \ne 0:\\ \;\;\;\;\frac{\begin{array}{l} \mathbf{if}\;-1 - t_0 \ne 0:\\ \;\;\;\;\frac{1 - x \cdot \left(x \cdot \left(x \cdot \left(x \cdot t_0\right)\right)\right)}{1 + t_0}\\ \mathbf{else}:\\ \;\;\;\;1 - t_0\\ \end{array}}{1 + x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;1 - x \cdot x\\ \end{array}\right)}{x \cdot x}} \end{array} \]
Alternative 4
Error7.2
Cost3528
\[\begin{array}{l} t_0 := \left(x \cdot x\right) \cdot \left(x \cdot x\right)\\ \frac{10}{\begin{array}{l} \mathbf{if}\;-1 - x \cdot x \ne 0:\\ \;\;\;\;\frac{\begin{array}{l} \mathbf{if}\;-1 - t_0 \ne 0:\\ \;\;\;\;\frac{\frac{\left(1 - x \cdot \left(x \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)\right)\right) \cdot 2}{2}}{1 + t_0}\\ \mathbf{else}:\\ \;\;\;\;1 - t_0\\ \end{array}}{x \cdot x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 - x \cdot x\\ \end{array}} \end{array} \]
Alternative 5
Error7.2
Cost3272
\[\begin{array}{l} t_0 := \left(x \cdot x\right) \cdot \left(x \cdot x\right)\\ \frac{10}{\begin{array}{l} \mathbf{if}\;-1 - x \cdot x \ne 0:\\ \;\;\;\;\frac{\begin{array}{l} \mathbf{if}\;-1 - t_0 \ne 0:\\ \;\;\;\;\frac{1 - x \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)\right)}{1 + t_0}\\ \mathbf{else}:\\ \;\;\;\;1 - t_0\\ \end{array}}{x \cdot x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 - x \cdot x\\ \end{array}} \end{array} \]
Alternative 6
Error7.4
Cost3012
\[\begin{array}{l} t_0 := x \cdot \left(x \cdot x\right)\\ \frac{10}{\frac{x \cdot \left(x \cdot \begin{array}{l} \mathbf{if}\;-1 - x \cdot x \ne 0:\\ \;\;\;\;\frac{\frac{t_0}{x \cdot x} \cdot \frac{x \cdot \left(1 - x \cdot t_0\right)}{x \cdot x}}{1 + x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;1 - x \cdot x\\ \end{array}\right)}{x \cdot x}} \end{array} \]
Alternative 7
Error7.4
Cost1988
\[\frac{10}{\frac{x \cdot \left(x \cdot \begin{array}{l} \mathbf{if}\;-1 - x \cdot x \ne 0:\\ \;\;\;\;\frac{1 - x \cdot \left(x \cdot \left(x \cdot x\right)\right)}{1 + x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;1 - x \cdot x\\ \end{array}\right)}{x \cdot x}} \]
Alternative 8
Error7.4
Cost1476
\[\frac{10}{\begin{array}{l} \mathbf{if}\;-1 - x \cdot x \ne 0:\\ \;\;\;\;\frac{1 - x \cdot \left(x \cdot \left(x \cdot x\right)\right)}{x \cdot x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 - x \cdot x\\ \end{array}} \]
Alternative 9
Error7.9
Cost1088
\[\frac{10}{\frac{\frac{x \cdot \left(1 - x \cdot x\right)}{\frac{1}{x}}}{x \cdot x}} \]
Alternative 10
Error7.9
Cost960
\[\frac{10}{\frac{x \cdot \left(x \cdot \left(1 - x \cdot x\right)\right)}{x \cdot x}} \]
Alternative 11
Error7.9
Cost448
\[\frac{10}{1 - x \cdot x} \]
Alternative 12
Error57.9
Cost64
\[10 \]

Error

Reproduce?

herbie shell --seed 2023104 
(FPCore (x)
  :name "ENA, Section 1.4, Mentioned, B"
  :precision binary64
  :pre (and (<= 0.999 x) (<= x 1.001))
  (/ 10.0 (- 1.0 (* x x))))