| Alternative 1 | |
|---|---|
| Error | 7.8 |
| Cost | 2240 |
\[\begin{array}{l}
t_0 := 1 - x \cdot x\\
t_1 := t_0 \cdot \frac{1}{t_0}\\
\frac{10}{\left(t_0 \cdot t_1\right) \cdot t_1}
\end{array}
\]
(FPCore (x) :precision binary64 (/ 10.0 (- 1.0 (* x x))))
(FPCore (x) :precision binary64 (let* ((t_0 (- 1.0 (* x x))) (t_1 (* t_0 (/ 1.0 t_0)))) (/ 10.0 (* (* (* t_0 t_1) t_1) t_1))))
double code(double x) {
return 10.0 / (1.0 - (x * x));
}
double code(double x) {
double t_0 = 1.0 - (x * x);
double t_1 = t_0 * (1.0 / t_0);
return 10.0 / (((t_0 * t_1) * t_1) * t_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) :: t_1
t_0 = 1.0d0 - (x * x)
t_1 = t_0 * (1.0d0 / t_0)
code = 10.0d0 / (((t_0 * t_1) * t_1) * t_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 = 1.0 - (x * x);
double t_1 = t_0 * (1.0 / t_0);
return 10.0 / (((t_0 * t_1) * t_1) * t_1);
}
def code(x): return 10.0 / (1.0 - (x * x))
def code(x): t_0 = 1.0 - (x * x) t_1 = t_0 * (1.0 / t_0) return 10.0 / (((t_0 * t_1) * t_1) * t_1)
function code(x) return Float64(10.0 / Float64(1.0 - Float64(x * x))) end
function code(x) t_0 = Float64(1.0 - Float64(x * x)) t_1 = Float64(t_0 * Float64(1.0 / t_0)) return Float64(10.0 / Float64(Float64(Float64(t_0 * t_1) * t_1) * t_1)) end
function tmp = code(x) tmp = 10.0 / (1.0 - (x * x)); end
function tmp = code(x) t_0 = 1.0 - (x * x); t_1 = t_0 * (1.0 / t_0); tmp = 10.0 / (((t_0 * t_1) * t_1) * t_1); end
code[x_] := N[(10.0 / N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]}, N[(10.0 / N[(N[(N[(t$95$0 * t$95$1), $MachinePrecision] * t$95$1), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]
\frac{10}{1 - x \cdot x}
\begin{array}{l}
t_0 := 1 - x \cdot x\\
t_1 := t_0 \cdot \frac{1}{t_0}\\
\frac{10}{\left(\left(t_0 \cdot t_1\right) \cdot t_1\right) \cdot t_1}
\end{array}
Results
Initial program 7.8
Applied egg-rr7.8
Applied egg-rr7.8
Applied egg-rr7.8
Final simplification7.8
| Alternative 1 | |
|---|---|
| Error | 7.8 |
| Cost | 2240 |
| Alternative 2 | |
|---|---|
| Error | 7.8 |
| Cost | 1344 |
| Alternative 3 | |
|---|---|
| Error | 7.8 |
| Cost | 1344 |
| Alternative 4 | |
|---|---|
| Error | 7.8 |
| Cost | 448 |
| Alternative 5 | |
|---|---|
| Error | 57.9 |
| Cost | 64 |
herbie shell --seed 2023090
(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))))