Average Error: 1.0 → 0.0
Time: 5.8s
Precision: binary64
Cost: 20160
\[\frac{4}{\left(\left(3 \cdot \pi\right) \cdot \left(1 - v \cdot v\right)\right) \cdot \sqrt{2 - 6 \cdot \left(v \cdot v\right)}} \]
\[\frac{\frac{1.3333333333333333}{\pi \cdot \mathsf{fma}\left(v, -v, 1\right)}}{\sqrt{-6 \cdot \left(v \cdot v\right) + 2}} \]
(FPCore (v)
 :precision binary64
 (/ 4.0 (* (* (* 3.0 PI) (- 1.0 (* v v))) (sqrt (- 2.0 (* 6.0 (* v v)))))))
(FPCore (v)
 :precision binary64
 (/
  (/ 1.3333333333333333 (* PI (fma v (- v) 1.0)))
  (sqrt (+ (* -6.0 (* v v)) 2.0))))
double code(double v) {
	return 4.0 / (((3.0 * ((double) M_PI)) * (1.0 - (v * v))) * sqrt((2.0 - (6.0 * (v * v)))));
}
double code(double v) {
	return (1.3333333333333333 / (((double) M_PI) * fma(v, -v, 1.0))) / sqrt(((-6.0 * (v * v)) + 2.0));
}
function code(v)
	return Float64(4.0 / Float64(Float64(Float64(3.0 * pi) * Float64(1.0 - Float64(v * v))) * sqrt(Float64(2.0 - Float64(6.0 * Float64(v * v))))))
end
function code(v)
	return Float64(Float64(1.3333333333333333 / Float64(pi * fma(v, Float64(-v), 1.0))) / sqrt(Float64(Float64(-6.0 * Float64(v * v)) + 2.0)))
end
code[v_] := N[(4.0 / N[(N[(N[(3.0 * Pi), $MachinePrecision] * N[(1.0 - N[(v * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(2.0 - N[(6.0 * N[(v * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[v_] := N[(N[(1.3333333333333333 / N[(Pi * N[(v * (-v) + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[(-6.0 * N[(v * v), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\frac{4}{\left(\left(3 \cdot \pi\right) \cdot \left(1 - v \cdot v\right)\right) \cdot \sqrt{2 - 6 \cdot \left(v \cdot v\right)}}
\frac{\frac{1.3333333333333333}{\pi \cdot \mathsf{fma}\left(v, -v, 1\right)}}{\sqrt{-6 \cdot \left(v \cdot v\right) + 2}}

Error

Derivation

  1. Initial program 1.0

    \[\frac{4}{\left(\left(3 \cdot \pi\right) \cdot \left(1 - v \cdot v\right)\right) \cdot \sqrt{2 - 6 \cdot \left(v \cdot v\right)}} \]
  2. Applied egg-rr0.0

    \[\leadsto \color{blue}{0 + \frac{\frac{1.3333333333333333}{\pi \cdot \mathsf{fma}\left(v, -v, 1\right)}}{\sqrt{\mathsf{fma}\left(v \cdot v, -6, 2\right)}}} \]
  3. Applied egg-rr0.0

    \[\leadsto 0 + \frac{\frac{1.3333333333333333}{\pi \cdot \mathsf{fma}\left(v, -v, 1\right)}}{\sqrt{\color{blue}{v \cdot \left(v \cdot -6\right) + 2}}} \]
  4. Taylor expanded in v around 0 0.0

    \[\leadsto 0 + \frac{\frac{1.3333333333333333}{\pi \cdot \mathsf{fma}\left(v, -v, 1\right)}}{\sqrt{\color{blue}{-6 \cdot {v}^{2}} + 2}} \]
  5. Simplified0.0

    \[\leadsto 0 + \frac{\frac{1.3333333333333333}{\pi \cdot \mathsf{fma}\left(v, -v, 1\right)}}{\sqrt{\color{blue}{-6 \cdot \left(v \cdot v\right)} + 2}} \]
    Proof
    (*.f64 -6 (*.f64 v v)): 0 points increase in error, 0 points decrease in error
    (*.f64 -6 (Rewrite<= unpow2_binary64 (pow.f64 v 2))): 0 points increase in error, 0 points decrease in error
  6. Final simplification0.0

    \[\leadsto \frac{\frac{1.3333333333333333}{\pi \cdot \mathsf{fma}\left(v, -v, 1\right)}}{\sqrt{-6 \cdot \left(v \cdot v\right) + 2}} \]

Alternatives

Alternative 1
Error0.7
Cost13504
\[\frac{1.3333333333333333}{\pi \cdot \left(1 - v \cdot v\right)} \cdot {2}^{-0.5} \]
Alternative 2
Error0.6
Cost13440
\[\frac{\frac{1.3333333333333333}{\pi}}{\sqrt{2 + v \cdot \left(v \cdot -6\right)}} \]
Alternative 3
Error0.7
Cost13056
\[\frac{1.3333333333333333}{\pi \cdot \sqrt{2}} \]

Error

Reproduce

herbie shell --seed 2022325 
(FPCore (v)
  :name "Falkner and Boettcher, Equation (22+)"
  :precision binary64
  (/ 4.0 (* (* (* 3.0 PI) (- 1.0 (* v v))) (sqrt (- 2.0 (* 6.0 (* v v)))))))