| Alternative 1 | |
|---|---|
| Error | 0.0 |
| Cost | 7424 |
\[\frac{\left(1 - v \cdot v\right) \cdot \sqrt{-\left(-2 + v \cdot \left(v \cdot 6\right)\right)}}{4}
\]
(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)) (sqrt (* 2.0 (- -2.0 (+ (* 3.0 (* v v)) -3.0))))) 4.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)) * sqrt((2.0 * (-2.0 - ((3.0 * (v * v)) + -3.0))))) / 4.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)) * sqrt((2.0d0 * ((-2.0d0) - ((3.0d0 * (v * v)) + (-3.0d0)))))) / 4.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)) * Math.sqrt((2.0 * (-2.0 - ((3.0 * (v * v)) + -3.0))))) / 4.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)) * math.sqrt((2.0 * (-2.0 - ((3.0 * (v * v)) + -3.0))))) / 4.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(Float64(1.0 - Float64(v * v)) * sqrt(Float64(2.0 * Float64(-2.0 - Float64(Float64(3.0 * Float64(v * v)) + -3.0))))) / 4.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)) * sqrt((2.0 * (-2.0 - ((3.0 * (v * v)) + -3.0))))) / 4.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[(N[(1.0 - N[(v * v), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(-2.0 - N[(N[(3.0 * N[(v * v), $MachinePrecision]), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 4.0), $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{\left(1 - v \cdot v\right) \cdot \sqrt{2 \cdot \left(-2 - \left(3 \cdot \left(v \cdot v\right) + -3\right)\right)}}{4}
Results
Initial program 0.0
Applied egg-rr0.0
Applied egg-rr0.0
Applied egg-rr0.0
Applied egg-rr0.0
Final simplification0.0
| Alternative 1 | |
|---|---|
| Error | 0.0 |
| Cost | 7424 |
| Alternative 2 | |
|---|---|
| Error | 0.7 |
| Cost | 6976 |
| Alternative 3 | |
|---|---|
| Error | 0.7 |
| Cost | 6592 |
herbie shell --seed 2023067
(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))))