Average Error: 0.0 → 0.0
Time: 7.0s
Precision: binary64
Cost: 7744
\[\left(\frac{\sqrt{2}}{4} \cdot \sqrt{1 - 3 \cdot \left(v \cdot v\right)}\right) \cdot \left(1 - v \cdot v\right) \]
\[\begin{array}{l} t_0 := 1 - v \cdot v\\ \sqrt{\left(\left(1 + -3 \cdot \left(v \cdot v\right)\right) \cdot \left(t_0 \cdot t_0\right)\right) \cdot 0.125} \end{array} \]
(FPCore (v)
 :precision binary64
 (* (* (/ (sqrt 2.0) 4.0) (sqrt (- 1.0 (* 3.0 (* v v))))) (- 1.0 (* v v))))
(FPCore (v)
 :precision binary64
 (let* ((t_0 (- 1.0 (* v v))))
   (sqrt (* (* (+ 1.0 (* -3.0 (* v v))) (* t_0 t_0)) 0.125))))
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) {
	double t_0 = 1.0 - (v * v);
	return sqrt((((1.0 + (-3.0 * (v * v))) * (t_0 * t_0)) * 0.125));
}
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
    real(8) :: t_0
    t_0 = 1.0d0 - (v * v)
    code = sqrt((((1.0d0 + ((-3.0d0) * (v * v))) * (t_0 * t_0)) * 0.125d0))
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) {
	double t_0 = 1.0 - (v * v);
	return Math.sqrt((((1.0 + (-3.0 * (v * v))) * (t_0 * t_0)) * 0.125));
}
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):
	t_0 = 1.0 - (v * v)
	return math.sqrt((((1.0 + (-3.0 * (v * v))) * (t_0 * t_0)) * 0.125))
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)
	t_0 = Float64(1.0 - Float64(v * v))
	return sqrt(Float64(Float64(Float64(1.0 + Float64(-3.0 * Float64(v * v))) * Float64(t_0 * t_0)) * 0.125))
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)
	t_0 = 1.0 - (v * v);
	tmp = sqrt((((1.0 + (-3.0 * (v * v))) * (t_0 * t_0)) * 0.125));
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_] := Block[{t$95$0 = N[(1.0 - N[(v * v), $MachinePrecision]), $MachinePrecision]}, N[Sqrt[N[(N[(N[(1.0 + N[(-3.0 * N[(v * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.125), $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)
\begin{array}{l}
t_0 := 1 - v \cdot v\\
\sqrt{\left(\left(1 + -3 \cdot \left(v \cdot v\right)\right) \cdot \left(t_0 \cdot t_0\right)\right) \cdot 0.125}
\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\left(\frac{\sqrt{2}}{4} \cdot \sqrt{1 - 3 \cdot \left(v \cdot v\right)}\right) \cdot \left(1 - v \cdot v\right) \]
  2. Simplified0.0

    \[\leadsto \color{blue}{\frac{\sqrt{2}}{4} \cdot \left(\sqrt{1 - \left(3 \cdot v\right) \cdot v} \cdot \left(1 - v \cdot v\right)\right)} \]
    Proof
    (*.f64 (/.f64 (sqrt.f64 2) 4) (*.f64 (sqrt.f64 (-.f64 1 (*.f64 (*.f64 3 v) v))) (-.f64 1 (*.f64 v v)))): 0 points increase in error, 0 points decrease in error
    (*.f64 (/.f64 (sqrt.f64 2) 4) (*.f64 (sqrt.f64 (-.f64 1 (Rewrite<= associate-*r*_binary64 (*.f64 3 (*.f64 v v))))) (-.f64 1 (*.f64 v v)))): 0 points increase in error, 0 points decrease in error
    (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (/.f64 (sqrt.f64 2) 4) (sqrt.f64 (-.f64 1 (*.f64 3 (*.f64 v v))))) (-.f64 1 (*.f64 v v)))): 0 points increase in error, 0 points decrease in error
  3. Applied egg-rr0.0

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

    \[\leadsto \sqrt{\left(\left(1 - 3 \cdot \left(v \cdot v\right)\right) \cdot \color{blue}{\left(\left(1 - v \cdot v\right) \cdot \left(1 - v \cdot v\right)\right)}\right) \cdot 0.125} \]
  5. Final simplification0.0

    \[\leadsto \sqrt{\left(\left(1 + -3 \cdot \left(v \cdot v\right)\right) \cdot \left(\left(1 - v \cdot v\right) \cdot \left(1 - v \cdot v\right)\right)\right) \cdot 0.125} \]

Alternatives

Alternative 1
Error0.3
Cost7488
\[\sqrt{0.125 \cdot \left(\left(1 - 3 \cdot \left(v \cdot v\right)\right) \cdot \left(1 + v \cdot \left(v \cdot -2\right)\right)\right)} \]
Alternative 2
Error0.3
Cost6976
\[\sqrt{0.125 \cdot \left(1 + v \cdot \left(v \cdot -5\right)\right)} \]
Alternative 3
Error0.3
Cost6976
\[\sqrt{2} \cdot \left(0.25 + \left(v \cdot v\right) \cdot -0.625\right) \]
Alternative 4
Error0.7
Cost6848
\[\left(1 - v \cdot v\right) \cdot \sqrt{0.125} \]
Alternative 5
Error0.7
Cost6464
\[\sqrt{0.125} \]

Error

Reproduce

herbie shell --seed 2022342 
(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))))