?

Average Error: 47.0 → 0.3
Time: 2.9s
Precision: binary64
Cost: 576

?

\[i > 0\]
\[\frac{\frac{\left(i \cdot i\right) \cdot \left(i \cdot i\right)}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right)}}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1} \]
\[\frac{0.25}{4 + \frac{-1}{i \cdot i}} \]
(FPCore (i)
 :precision binary64
 (/
  (/ (* (* i i) (* i i)) (* (* 2.0 i) (* 2.0 i)))
  (- (* (* 2.0 i) (* 2.0 i)) 1.0)))
(FPCore (i) :precision binary64 (/ 0.25 (+ 4.0 (/ -1.0 (* i i)))))
double code(double i) {
	return (((i * i) * (i * i)) / ((2.0 * i) * (2.0 * i))) / (((2.0 * i) * (2.0 * i)) - 1.0);
}
double code(double i) {
	return 0.25 / (4.0 + (-1.0 / (i * i)));
}
real(8) function code(i)
    real(8), intent (in) :: i
    code = (((i * i) * (i * i)) / ((2.0d0 * i) * (2.0d0 * i))) / (((2.0d0 * i) * (2.0d0 * i)) - 1.0d0)
end function
real(8) function code(i)
    real(8), intent (in) :: i
    code = 0.25d0 / (4.0d0 + ((-1.0d0) / (i * i)))
end function
public static double code(double i) {
	return (((i * i) * (i * i)) / ((2.0 * i) * (2.0 * i))) / (((2.0 * i) * (2.0 * i)) - 1.0);
}
public static double code(double i) {
	return 0.25 / (4.0 + (-1.0 / (i * i)));
}
def code(i):
	return (((i * i) * (i * i)) / ((2.0 * i) * (2.0 * i))) / (((2.0 * i) * (2.0 * i)) - 1.0)
def code(i):
	return 0.25 / (4.0 + (-1.0 / (i * i)))
function code(i)
	return Float64(Float64(Float64(Float64(i * i) * Float64(i * i)) / Float64(Float64(2.0 * i) * Float64(2.0 * i))) / Float64(Float64(Float64(2.0 * i) * Float64(2.0 * i)) - 1.0))
end
function code(i)
	return Float64(0.25 / Float64(4.0 + Float64(-1.0 / Float64(i * i))))
end
function tmp = code(i)
	tmp = (((i * i) * (i * i)) / ((2.0 * i) * (2.0 * i))) / (((2.0 * i) * (2.0 * i)) - 1.0);
end
function tmp = code(i)
	tmp = 0.25 / (4.0 + (-1.0 / (i * i)));
end
code[i_] := N[(N[(N[(N[(i * i), $MachinePrecision] * N[(i * i), $MachinePrecision]), $MachinePrecision] / N[(N[(2.0 * i), $MachinePrecision] * N[(2.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(2.0 * i), $MachinePrecision] * N[(2.0 * i), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]
code[i_] := N[(0.25 / N[(4.0 + N[(-1.0 / N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{\frac{\left(i \cdot i\right) \cdot \left(i \cdot i\right)}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right)}}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1}
\frac{0.25}{4 + \frac{-1}{i \cdot i}}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 47.0

    \[\frac{\frac{\left(i \cdot i\right) \cdot \left(i \cdot i\right)}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right)}}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1} \]
  2. Simplified0.3

    \[\leadsto \color{blue}{\frac{0.25}{4 - \frac{1}{i \cdot i}}} \]
    Proof

    [Start]47.0

    \[ \frac{\frac{\left(i \cdot i\right) \cdot \left(i \cdot i\right)}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right)}}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1} \]

    associate-*l/ [<=]31.1

    \[ \frac{\color{blue}{\frac{i \cdot i}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right)} \cdot \left(i \cdot i\right)}}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1} \]

    associate-/l* [=>]31.4

    \[ \color{blue}{\frac{\frac{i \cdot i}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right)}}{\frac{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1}{i \cdot i}}} \]

    associate-*l* [=>]31.4

    \[ \frac{\frac{i \cdot i}{\color{blue}{2 \cdot \left(i \cdot \left(2 \cdot i\right)\right)}}}{\frac{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1}{i \cdot i}} \]

    *-commutative [=>]31.4

    \[ \frac{\frac{i \cdot i}{\color{blue}{\left(i \cdot \left(2 \cdot i\right)\right) \cdot 2}}}{\frac{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1}{i \cdot i}} \]

    associate-/r* [=>]31.4

    \[ \frac{\color{blue}{\frac{\frac{i \cdot i}{i \cdot \left(2 \cdot i\right)}}{2}}}{\frac{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1}{i \cdot i}} \]

    *-commutative [=>]31.4

    \[ \frac{\frac{\frac{i \cdot i}{i \cdot \color{blue}{\left(i \cdot 2\right)}}}{2}}{\frac{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1}{i \cdot i}} \]

    associate-*r* [=>]31.4

    \[ \frac{\frac{\frac{i \cdot i}{\color{blue}{\left(i \cdot i\right) \cdot 2}}}{2}}{\frac{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1}{i \cdot i}} \]

    associate-/r* [=>]31.4

    \[ \frac{\frac{\color{blue}{\frac{\frac{i \cdot i}{i \cdot i}}{2}}}{2}}{\frac{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1}{i \cdot i}} \]

    *-inverses [=>]16.4

    \[ \frac{\frac{\frac{\color{blue}{1}}{2}}{2}}{\frac{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1}{i \cdot i}} \]

    metadata-eval [=>]16.4

    \[ \frac{\frac{\color{blue}{0.5}}{2}}{\frac{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1}{i \cdot i}} \]

    metadata-eval [=>]16.4

    \[ \frac{\color{blue}{0.25}}{\frac{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1}{i \cdot i}} \]

    *-inverses [<=]16.4

    \[ \frac{0.25}{\frac{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - \color{blue}{\frac{i}{i}}}{i \cdot i}} \]

    div-sub [=>]31.4

    \[ \frac{0.25}{\color{blue}{\frac{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right)}{i \cdot i} - \frac{\frac{i}{i}}{i \cdot i}}} \]
  3. Final simplification0.3

    \[\leadsto \frac{0.25}{4 + \frac{-1}{i \cdot i}} \]

Alternatives

Alternative 1
Error0.5
Cost580
\[\begin{array}{l} \mathbf{if}\;i \leq 0.5:\\ \;\;\;\;i \cdot \left(i \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;0.0625 + \frac{\frac{0.015625}{i}}{i}\\ \end{array} \]
Alternative 2
Error0.7
Cost452
\[\begin{array}{l} \mathbf{if}\;i \leq 0.5:\\ \;\;\;\;i \cdot \left(i \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;0.0625\\ \end{array} \]
Alternative 3
Error31.5
Cost64
\[0.0625 \]

Error

Reproduce?

herbie shell --seed 2023053 
(FPCore (i)
  :name "Octave 3.8, jcobi/4, as called"
  :precision binary64
  :pre (> i 0.0)
  (/ (/ (* (* i i) (* i i)) (* (* 2.0 i) (* 2.0 i))) (- (* (* 2.0 i) (* 2.0 i)) 1.0)))