?

Average Error: 0.0 → 0.0
Time: 4.8s
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{\sqrt{2 + \left(v \cdot v\right) \cdot -6}}{\frac{4}{1 - v \cdot v}} \]
(FPCore (v)
 :precision binary64
 (* (* (/ (sqrt 2.0) 4.0) (sqrt (- 1.0 (* 3.0 (* v v))))) (- 1.0 (* v v))))
(FPCore (v)
 :precision binary64
 (/ (sqrt (+ 2.0 (* (* v v) -6.0))) (/ 4.0 (- 1.0 (* v v)))))
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 sqrt((2.0 + ((v * v) * -6.0))) / (4.0 / (1.0 - (v * v)));
}
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 = sqrt((2.0d0 + ((v * v) * (-6.0d0)))) / (4.0d0 / (1.0d0 - (v * v)))
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 Math.sqrt((2.0 + ((v * v) * -6.0))) / (4.0 / (1.0 - (v * v)));
}
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 math.sqrt((2.0 + ((v * v) * -6.0))) / (4.0 / (1.0 - (v * v)))
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(sqrt(Float64(2.0 + Float64(Float64(v * v) * -6.0))) / Float64(4.0 / Float64(1.0 - Float64(v * v))))
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 = sqrt((2.0 + ((v * v) * -6.0))) / (4.0 / (1.0 - (v * v)));
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[Sqrt[N[(2.0 + N[(N[(v * v), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(4.0 / N[(1.0 - N[(v * v), $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{\sqrt{2 + \left(v \cdot v\right) \cdot -6}}{\frac{4}{1 - v \cdot v}}

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

    [Start]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) \]

    associate-*l* [=>]0.0

    \[ \color{blue}{\frac{\sqrt{2}}{4} \cdot \left(\sqrt{1 - 3 \cdot \left(v \cdot v\right)} \cdot \left(1 - v \cdot v\right)\right)} \]

    associate-*r* [=>]0.0

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

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

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

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

    [Start]1.0

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

    expm1-def [=>]0.0

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

    expm1-log1p [=>]0.0

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

    *-commutative [=>]0.0

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

    associate-*l* [=>]0.0

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

    metadata-eval [=>]0.0

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

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

Alternatives

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

Error

Reproduce?

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