?

Average Error: 0.02% → 0.02%
Time: 9.5s
Precision: binary64
Cost: 7360

?

\[\left(\frac{\sqrt{2}}{4} \cdot \sqrt{1 - 3 \cdot \left(v \cdot v\right)}\right) \cdot \left(1 - v \cdot v\right) \]
\[\frac{1 - v \cdot v}{\frac{4}{\sqrt{2 + \left(v \cdot v\right) \cdot -6}}} \]
(FPCore (v)
 :precision binary64
 (* (* (/ (sqrt 2.0) 4.0) (sqrt (- 1.0 (* 3.0 (* v v))))) (- 1.0 (* v v))))
(FPCore (v)
 :precision binary64
 (/ (- 1.0 (* v v)) (/ 4.0 (sqrt (+ 2.0 (* (* v v) -6.0))))))
double code(double v) {
	return ((sqrt(2.0) / 4.0) * sqrt((1.0 - (3.0 * (v * v))))) * (1.0 - (v * v));
}
double code(double v) {
	return (1.0 - (v * v)) / (4.0 / sqrt((2.0 + ((v * v) * -6.0))));
}
real(8) function code(v)
    real(8), intent (in) :: v
    code = ((sqrt(2.0d0) / 4.0d0) * sqrt((1.0d0 - (3.0d0 * (v * v))))) * (1.0d0 - (v * v))
end function
real(8) function code(v)
    real(8), intent (in) :: v
    code = (1.0d0 - (v * v)) / (4.0d0 / sqrt((2.0d0 + ((v * v) * (-6.0d0)))))
end function
public static double code(double v) {
	return ((Math.sqrt(2.0) / 4.0) * Math.sqrt((1.0 - (3.0 * (v * v))))) * (1.0 - (v * v));
}
public static double code(double v) {
	return (1.0 - (v * v)) / (4.0 / Math.sqrt((2.0 + ((v * v) * -6.0))));
}
def code(v):
	return ((math.sqrt(2.0) / 4.0) * math.sqrt((1.0 - (3.0 * (v * v))))) * (1.0 - (v * v))
def code(v):
	return (1.0 - (v * v)) / (4.0 / math.sqrt((2.0 + ((v * v) * -6.0))))
function code(v)
	return Float64(Float64(Float64(sqrt(2.0) / 4.0) * sqrt(Float64(1.0 - Float64(3.0 * Float64(v * v))))) * Float64(1.0 - Float64(v * v)))
end
function code(v)
	return Float64(Float64(1.0 - Float64(v * v)) / Float64(4.0 / sqrt(Float64(2.0 + Float64(Float64(v * v) * -6.0)))))
end
function tmp = code(v)
	tmp = ((sqrt(2.0) / 4.0) * sqrt((1.0 - (3.0 * (v * v))))) * (1.0 - (v * v));
end
function tmp = code(v)
	tmp = (1.0 - (v * v)) / (4.0 / sqrt((2.0 + ((v * v) * -6.0))));
end
code[v_] := N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] / 4.0), $MachinePrecision] * N[Sqrt[N[(1.0 - N[(3.0 * N[(v * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(v * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[v_] := N[(N[(1.0 - N[(v * v), $MachinePrecision]), $MachinePrecision] / N[(4.0 / N[Sqrt[N[(2.0 + N[(N[(v * v), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\frac{\sqrt{2}}{4} \cdot \sqrt{1 - 3 \cdot \left(v \cdot v\right)}\right) \cdot \left(1 - v \cdot v\right)
\frac{1 - v \cdot v}{\frac{4}{\sqrt{2 + \left(v \cdot v\right) \cdot -6}}}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 0.02

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

    \[\leadsto \color{blue}{\frac{1 - v \cdot v}{\frac{4}{\sqrt{2 \cdot \left(1 + \left(-3 \cdot v\right) \cdot v\right)}}}} \]
  3. Applied egg-rr0.03

    \[\leadsto \frac{1 - v \cdot v}{\color{blue}{e^{\mathsf{log1p}\left(\frac{4}{\sqrt{2 + -6 \cdot \left(v \cdot v\right)}}\right)} - 1}} \]
  4. Simplified0.02

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

    [Start]0.03

    \[ \frac{1 - v \cdot v}{e^{\mathsf{log1p}\left(\frac{4}{\sqrt{2 + -6 \cdot \left(v \cdot v\right)}}\right)} - 1} \]

    expm1-def [=>]0.03

    \[ \frac{1 - v \cdot v}{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{4}{\sqrt{2 + -6 \cdot \left(v \cdot v\right)}}\right)\right)}} \]

    expm1-log1p [=>]0.02

    \[ \frac{1 - v \cdot v}{\color{blue}{\frac{4}{\sqrt{2 + -6 \cdot \left(v \cdot v\right)}}}} \]
  5. Final simplification0.02

    \[\leadsto \frac{1 - v \cdot v}{\frac{4}{\sqrt{2 + \left(v \cdot v\right) \cdot -6}}} \]

Alternatives

Alternative 1
Error0.01%
Cost7360
\[\left(1 - v \cdot v\right) \cdot \left(\sqrt{2 + \left(v \cdot v\right) \cdot -6} \cdot 0.25\right) \]
Alternative 2
Error0.43%
Cost7232
\[\frac{\sqrt{2}}{4} \cdot \left(\left(2 + v \cdot \left(v \cdot -2.5\right)\right) + -1\right) \]
Alternative 3
Error0.42%
Cost7104
\[\frac{\sqrt{2}}{\frac{4}{1 + v \cdot \left(v \cdot -2.5\right)}} \]
Alternative 4
Error0.42%
Cost6976
\[\sqrt{2} \cdot \left(0.25 + \left(v \cdot v\right) \cdot -0.625\right) \]
Alternative 5
Error0.99%
Cost6848
\[\left(1 - v \cdot v\right) \cdot \sqrt{0.125} \]
Alternative 6
Error1.02%
Cost6464
\[\sqrt{0.125} \]

Error

Reproduce?

herbie shell --seed 2023090 
(FPCore (v)
  :name "Falkner and Boettcher, Appendix B, 2"
  :precision binary64
  (* (* (/ (sqrt 2.0) 4.0) (sqrt (- 1.0 (* 3.0 (* v v))))) (- 1.0 (* v v))))