Falkner and Boettcher, Equation (22+)

Percentage Accurate: 98.5% → 100.0%
Time: 8.7s
Alternatives: 7
Speedup: 1.1×

Specification

?
\[\begin{array}{l} \\ \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)}} \end{array} \]
(FPCore (v)
 :precision binary64
 (/ 4.0 (* (* (* 3.0 PI) (- 1.0 (* v v))) (sqrt (- 2.0 (* 6.0 (* v v)))))))
double code(double v) {
	return 4.0 / (((3.0 * ((double) M_PI)) * (1.0 - (v * v))) * sqrt((2.0 - (6.0 * (v * v)))));
}
public static double code(double v) {
	return 4.0 / (((3.0 * Math.PI) * (1.0 - (v * v))) * Math.sqrt((2.0 - (6.0 * (v * v)))));
}
def code(v):
	return 4.0 / (((3.0 * math.pi) * (1.0 - (v * v))) * math.sqrt((2.0 - (6.0 * (v * v)))))
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 tmp = code(v)
	tmp = 4.0 / (((3.0 * pi) * (1.0 - (v * v))) * sqrt((2.0 - (6.0 * (v * v)))));
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]
\begin{array}{l}

\\
\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)}}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 7 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 98.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \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)}} \end{array} \]
(FPCore (v)
 :precision binary64
 (/ 4.0 (* (* (* 3.0 PI) (- 1.0 (* v v))) (sqrt (- 2.0 (* 6.0 (* v v)))))))
double code(double v) {
	return 4.0 / (((3.0 * ((double) M_PI)) * (1.0 - (v * v))) * sqrt((2.0 - (6.0 * (v * v)))));
}
public static double code(double v) {
	return 4.0 / (((3.0 * Math.PI) * (1.0 - (v * v))) * Math.sqrt((2.0 - (6.0 * (v * v)))));
}
def code(v):
	return 4.0 / (((3.0 * math.pi) * (1.0 - (v * v))) * math.sqrt((2.0 - (6.0 * (v * v)))))
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 tmp = code(v)
	tmp = 4.0 / (((3.0 * pi) * (1.0 - (v * v))) * sqrt((2.0 - (6.0 * (v * v)))));
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]
\begin{array}{l}

\\
\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)}}
\end{array}

Alternative 1: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\frac{\frac{1.3333333333333333}{\pi}}{1 - v \cdot v}}{\sqrt{2 + v \cdot \left(v \cdot -6\right)}} \end{array} \]
(FPCore (v)
 :precision binary64
 (/
  (/ (/ 1.3333333333333333 PI) (- 1.0 (* v v)))
  (sqrt (+ 2.0 (* v (* v -6.0))))))
double code(double v) {
	return ((1.3333333333333333 / ((double) M_PI)) / (1.0 - (v * v))) / sqrt((2.0 + (v * (v * -6.0))));
}
public static double code(double v) {
	return ((1.3333333333333333 / Math.PI) / (1.0 - (v * v))) / Math.sqrt((2.0 + (v * (v * -6.0))));
}
def code(v):
	return ((1.3333333333333333 / math.pi) / (1.0 - (v * v))) / math.sqrt((2.0 + (v * (v * -6.0))))
function code(v)
	return Float64(Float64(Float64(1.3333333333333333 / pi) / Float64(1.0 - Float64(v * v))) / sqrt(Float64(2.0 + Float64(v * Float64(v * -6.0)))))
end
function tmp = code(v)
	tmp = ((1.3333333333333333 / pi) / (1.0 - (v * v))) / sqrt((2.0 + (v * (v * -6.0))));
end
code[v_] := N[(N[(N[(1.3333333333333333 / Pi), $MachinePrecision] / N[(1.0 - N[(v * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(2.0 + N[(v * N[(v * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{\frac{1.3333333333333333}{\pi}}{1 - v \cdot v}}{\sqrt{2 + v \cdot \left(v \cdot -6\right)}}
\end{array}
Derivation
  1. Initial program 98.5%

    \[\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. Step-by-step derivation
    1. associate-/r*N/A

      \[\leadsto \frac{\frac{4}{\left(3 \cdot \mathsf{PI}\left(\right)\right) \cdot \left(1 - v \cdot v\right)}}{\color{blue}{\sqrt{2 - 6 \cdot \left(v \cdot v\right)}}} \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{4}{\left(3 \cdot \mathsf{PI}\left(\right)\right) \cdot \left(1 - v \cdot v\right)}\right), \color{blue}{\left(\sqrt{2 - 6 \cdot \left(v \cdot v\right)}\right)}\right) \]
    3. associate-*l*N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{4}{3 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(1 - v \cdot v\right)\right)}\right), \left(\sqrt{2 - \color{blue}{6 \cdot \left(v \cdot v\right)}}\right)\right) \]
    4. associate-/r*N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{4}{3}}{\mathsf{PI}\left(\right) \cdot \left(1 - v \cdot v\right)}\right), \left(\sqrt{\color{blue}{2 - 6 \cdot \left(v \cdot v\right)}}\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{4}{3}\right), \left(\mathsf{PI}\left(\right) \cdot \left(1 - v \cdot v\right)\right)\right), \left(\sqrt{\color{blue}{2 - 6 \cdot \left(v \cdot v\right)}}\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \left(\mathsf{PI}\left(\right) \cdot \left(1 - v \cdot v\right)\right)\right), \left(\sqrt{\color{blue}{2} - 6 \cdot \left(v \cdot v\right)}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \left(1 - v \cdot v\right)\right)\right), \left(\sqrt{2 - \color{blue}{6 \cdot \left(v \cdot v\right)}}\right)\right) \]
    8. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(1 - v \cdot v\right)\right)\right), \left(\sqrt{2 - \color{blue}{6} \cdot \left(v \cdot v\right)}\right)\right) \]
    9. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \left(v \cdot v\right)\right)\right)\right), \left(\sqrt{2 - 6 \cdot \color{blue}{\left(v \cdot v\right)}}\right)\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \left(\sqrt{2 - 6 \cdot \left(v \cdot \color{blue}{v}\right)}\right)\right) \]
    11. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\left(2 - 6 \cdot \left(v \cdot v\right)\right)\right)\right) \]
    12. sub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\left(2 + \left(\mathsf{neg}\left(6 \cdot \left(v \cdot v\right)\right)\right)\right)\right)\right) \]
    13. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(6 \cdot \left(v \cdot v\right)\right)\right)\right)\right)\right) \]
    14. associate-*r*N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(\left(6 \cdot v\right) \cdot v\right)\right)\right)\right)\right) \]
    15. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(v \cdot \left(6 \cdot v\right)\right)\right)\right)\right)\right) \]
    16. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(v \cdot \left(\mathsf{neg}\left(6 \cdot v\right)\right)\right)\right)\right)\right) \]
    17. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \left(\mathsf{neg}\left(6 \cdot v\right)\right)\right)\right)\right)\right) \]
    18. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \left(\mathsf{neg}\left(v \cdot 6\right)\right)\right)\right)\right)\right) \]
    19. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \left(v \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)\right)\right)\right) \]
    20. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, \left(\mathsf{neg}\left(6\right)\right)\right)\right)\right)\right)\right) \]
    21. metadata-eval100.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, -6\right)\right)\right)\right)\right) \]
  3. Simplified100.0%

    \[\leadsto \color{blue}{\frac{\frac{1.3333333333333333}{\pi \cdot \left(1 - v \cdot v\right)}}{\sqrt{2 + v \cdot \left(v \cdot -6\right)}}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. associate-/r*N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{\frac{4}{3}}{\mathsf{PI}\left(\right)}}{1 - v \cdot v}\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, -6\right)\right)\right)}\right)\right) \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{4}{3}}{\mathsf{PI}\left(\right)}\right), \left(1 - v \cdot v\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, -6\right)\right)\right)}\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{PI}\left(\right)\right), \left(1 - v \cdot v\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\color{blue}{2}, \mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, -6\right)\right)\right)\right)\right) \]
    4. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{PI.f64}\left(\right)\right), \left(1 - v \cdot v\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, -6\right)\right)\right)\right)\right) \]
    5. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{PI.f64}\left(\right)\right), \mathsf{\_.f64}\left(1, \left(v \cdot v\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \color{blue}{\mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, -6\right)\right)}\right)\right)\right) \]
    6. *-lowering-*.f64100.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{PI.f64}\left(\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \color{blue}{\mathsf{*.f64}\left(v, -6\right)}\right)\right)\right)\right) \]
  6. Applied egg-rr100.0%

    \[\leadsto \frac{\color{blue}{\frac{\frac{1.3333333333333333}{\pi}}{1 - v \cdot v}}}{\sqrt{2 + v \cdot \left(v \cdot -6\right)}} \]
  7. Add Preprocessing

Alternative 2: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\frac{1.3333333333333333}{\pi \cdot \left(1 - v \cdot v\right)}}{\sqrt{2 + v \cdot \left(v \cdot -6\right)}} \end{array} \]
(FPCore (v)
 :precision binary64
 (/
  (/ 1.3333333333333333 (* PI (- 1.0 (* v v))))
  (sqrt (+ 2.0 (* v (* v -6.0))))))
double code(double v) {
	return (1.3333333333333333 / (((double) M_PI) * (1.0 - (v * v)))) / sqrt((2.0 + (v * (v * -6.0))));
}
public static double code(double v) {
	return (1.3333333333333333 / (Math.PI * (1.0 - (v * v)))) / Math.sqrt((2.0 + (v * (v * -6.0))));
}
def code(v):
	return (1.3333333333333333 / (math.pi * (1.0 - (v * v)))) / math.sqrt((2.0 + (v * (v * -6.0))))
function code(v)
	return Float64(Float64(1.3333333333333333 / Float64(pi * Float64(1.0 - Float64(v * v)))) / sqrt(Float64(2.0 + Float64(v * Float64(v * -6.0)))))
end
function tmp = code(v)
	tmp = (1.3333333333333333 / (pi * (1.0 - (v * v)))) / sqrt((2.0 + (v * (v * -6.0))));
end
code[v_] := N[(N[(1.3333333333333333 / N[(Pi * N[(1.0 - N[(v * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(2.0 + N[(v * N[(v * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{1.3333333333333333}{\pi \cdot \left(1 - v \cdot v\right)}}{\sqrt{2 + v \cdot \left(v \cdot -6\right)}}
\end{array}
Derivation
  1. Initial program 98.5%

    \[\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. Step-by-step derivation
    1. associate-/r*N/A

      \[\leadsto \frac{\frac{4}{\left(3 \cdot \mathsf{PI}\left(\right)\right) \cdot \left(1 - v \cdot v\right)}}{\color{blue}{\sqrt{2 - 6 \cdot \left(v \cdot v\right)}}} \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{4}{\left(3 \cdot \mathsf{PI}\left(\right)\right) \cdot \left(1 - v \cdot v\right)}\right), \color{blue}{\left(\sqrt{2 - 6 \cdot \left(v \cdot v\right)}\right)}\right) \]
    3. associate-*l*N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{4}{3 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(1 - v \cdot v\right)\right)}\right), \left(\sqrt{2 - \color{blue}{6 \cdot \left(v \cdot v\right)}}\right)\right) \]
    4. associate-/r*N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{4}{3}}{\mathsf{PI}\left(\right) \cdot \left(1 - v \cdot v\right)}\right), \left(\sqrt{\color{blue}{2 - 6 \cdot \left(v \cdot v\right)}}\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{4}{3}\right), \left(\mathsf{PI}\left(\right) \cdot \left(1 - v \cdot v\right)\right)\right), \left(\sqrt{\color{blue}{2 - 6 \cdot \left(v \cdot v\right)}}\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \left(\mathsf{PI}\left(\right) \cdot \left(1 - v \cdot v\right)\right)\right), \left(\sqrt{\color{blue}{2} - 6 \cdot \left(v \cdot v\right)}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \left(1 - v \cdot v\right)\right)\right), \left(\sqrt{2 - \color{blue}{6 \cdot \left(v \cdot v\right)}}\right)\right) \]
    8. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(1 - v \cdot v\right)\right)\right), \left(\sqrt{2 - \color{blue}{6} \cdot \left(v \cdot v\right)}\right)\right) \]
    9. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \left(v \cdot v\right)\right)\right)\right), \left(\sqrt{2 - 6 \cdot \color{blue}{\left(v \cdot v\right)}}\right)\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \left(\sqrt{2 - 6 \cdot \left(v \cdot \color{blue}{v}\right)}\right)\right) \]
    11. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\left(2 - 6 \cdot \left(v \cdot v\right)\right)\right)\right) \]
    12. sub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\left(2 + \left(\mathsf{neg}\left(6 \cdot \left(v \cdot v\right)\right)\right)\right)\right)\right) \]
    13. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(6 \cdot \left(v \cdot v\right)\right)\right)\right)\right)\right) \]
    14. associate-*r*N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(\left(6 \cdot v\right) \cdot v\right)\right)\right)\right)\right) \]
    15. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(v \cdot \left(6 \cdot v\right)\right)\right)\right)\right)\right) \]
    16. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(v \cdot \left(\mathsf{neg}\left(6 \cdot v\right)\right)\right)\right)\right)\right) \]
    17. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \left(\mathsf{neg}\left(6 \cdot v\right)\right)\right)\right)\right)\right) \]
    18. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \left(\mathsf{neg}\left(v \cdot 6\right)\right)\right)\right)\right)\right) \]
    19. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \left(v \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)\right)\right)\right) \]
    20. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, \left(\mathsf{neg}\left(6\right)\right)\right)\right)\right)\right)\right) \]
    21. metadata-eval100.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, -6\right)\right)\right)\right)\right) \]
  3. Simplified100.0%

    \[\leadsto \color{blue}{\frac{\frac{1.3333333333333333}{\pi \cdot \left(1 - v \cdot v\right)}}{\sqrt{2 + v \cdot \left(v \cdot -6\right)}}} \]
  4. Add Preprocessing
  5. Add Preprocessing

Alternative 3: 99.0% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \frac{4}{\pi \cdot \left(\sqrt{2 + v \cdot \left(v \cdot -6\right)} \cdot 3\right)} \end{array} \]
(FPCore (v)
 :precision binary64
 (/ 4.0 (* PI (* (sqrt (+ 2.0 (* v (* v -6.0)))) 3.0))))
double code(double v) {
	return 4.0 / (((double) M_PI) * (sqrt((2.0 + (v * (v * -6.0)))) * 3.0));
}
public static double code(double v) {
	return 4.0 / (Math.PI * (Math.sqrt((2.0 + (v * (v * -6.0)))) * 3.0));
}
def code(v):
	return 4.0 / (math.pi * (math.sqrt((2.0 + (v * (v * -6.0)))) * 3.0))
function code(v)
	return Float64(4.0 / Float64(pi * Float64(sqrt(Float64(2.0 + Float64(v * Float64(v * -6.0)))) * 3.0)))
end
function tmp = code(v)
	tmp = 4.0 / (pi * (sqrt((2.0 + (v * (v * -6.0)))) * 3.0));
end
code[v_] := N[(4.0 / N[(Pi * N[(N[Sqrt[N[(2.0 + N[(v * N[(v * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{4}{\pi \cdot \left(\sqrt{2 + v \cdot \left(v \cdot -6\right)} \cdot 3\right)}
\end{array}
Derivation
  1. Initial program 98.5%

    \[\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. Add Preprocessing
  3. Taylor expanded in v around 0

    \[\leadsto \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(\color{blue}{\left(3 \cdot \mathsf{PI}\left(\right)\right)}, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(2, \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(v, v\right)\right)\right)\right)\right)\right) \]
  4. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(\left(\mathsf{PI}\left(\right) \cdot 3\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{\_.f64}\left(2, \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(v, v\right)\right)\right)}\right)\right)\right) \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), 3\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{\_.f64}\left(2, \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(v, v\right)\right)\right)}\right)\right)\right) \]
    3. PI-lowering-PI.f6497.7%

      \[\leadsto \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), 3\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\color{blue}{2}, \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(v, v\right)\right)\right)\right)\right)\right) \]
  5. Simplified97.7%

    \[\leadsto \frac{4}{\color{blue}{\left(\pi \cdot 3\right)} \cdot \sqrt{2 - 6 \cdot \left(v \cdot v\right)}} \]
  6. Step-by-step derivation
    1. associate-*l*N/A

      \[\leadsto \mathsf{/.f64}\left(4, \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(3 \cdot \sqrt{2 - 6 \cdot \left(v \cdot v\right)}\right)}\right)\right) \]
    2. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(4, \left(\left(3 \cdot \sqrt{2 - 6 \cdot \left(v \cdot v\right)}\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(\left(3 \cdot \sqrt{2 - 6 \cdot \left(v \cdot v\right)}\right), \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(\left(3 \cdot \sqrt{2 + \left(\mathsf{neg}\left(6 \cdot \left(v \cdot v\right)\right)\right)}\right), \mathsf{PI}\left(\right)\right)\right) \]
    5. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(\left(3 \cdot \sqrt{2 + \left(\mathsf{neg}\left(\left(v \cdot v\right) \cdot 6\right)\right)}\right), \mathsf{PI}\left(\right)\right)\right) \]
    6. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(\left(3 \cdot \sqrt{2 + \left(v \cdot v\right) \cdot \left(\mathsf{neg}\left(6\right)\right)}\right), \mathsf{PI}\left(\right)\right)\right) \]
    7. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(\left(3 \cdot \sqrt{2 + \left(v \cdot v\right) \cdot -6}\right), \mathsf{PI}\left(\right)\right)\right) \]
    8. associate-*r*N/A

      \[\leadsto \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(\left(3 \cdot \sqrt{2 + v \cdot \left(v \cdot -6\right)}\right), \mathsf{PI}\left(\right)\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(3, \left(\sqrt{2 + v \cdot \left(v \cdot -6\right)}\right)\right), \mathsf{PI}\left(\right)\right)\right) \]
    10. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(3, \mathsf{sqrt.f64}\left(\left(2 + v \cdot \left(v \cdot -6\right)\right)\right)\right), \mathsf{PI}\left(\right)\right)\right) \]
    11. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(3, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(v \cdot \left(v \cdot -6\right)\right)\right)\right)\right), \mathsf{PI}\left(\right)\right)\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(3, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \left(v \cdot -6\right)\right)\right)\right)\right), \mathsf{PI}\left(\right)\right)\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(3, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, -6\right)\right)\right)\right)\right), \mathsf{PI}\left(\right)\right)\right) \]
    14. PI-lowering-PI.f6499.2%

      \[\leadsto \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(3, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, -6\right)\right)\right)\right)\right), \mathsf{PI.f64}\left(\right)\right)\right) \]
  7. Applied egg-rr99.2%

    \[\leadsto \frac{4}{\color{blue}{\left(3 \cdot \sqrt{2 + v \cdot \left(v \cdot -6\right)}\right) \cdot \pi}} \]
  8. Final simplification99.2%

    \[\leadsto \frac{4}{\pi \cdot \left(\sqrt{2 + v \cdot \left(v \cdot -6\right)} \cdot 3\right)} \]
  9. Add Preprocessing

Alternative 4: 99.0% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \frac{\frac{1.3333333333333333}{\sqrt{2 + v \cdot \left(v \cdot -6\right)}}}{\pi} \end{array} \]
(FPCore (v)
 :precision binary64
 (/ (/ 1.3333333333333333 (sqrt (+ 2.0 (* v (* v -6.0))))) PI))
double code(double v) {
	return (1.3333333333333333 / sqrt((2.0 + (v * (v * -6.0))))) / ((double) M_PI);
}
public static double code(double v) {
	return (1.3333333333333333 / Math.sqrt((2.0 + (v * (v * -6.0))))) / Math.PI;
}
def code(v):
	return (1.3333333333333333 / math.sqrt((2.0 + (v * (v * -6.0))))) / math.pi
function code(v)
	return Float64(Float64(1.3333333333333333 / sqrt(Float64(2.0 + Float64(v * Float64(v * -6.0))))) / pi)
end
function tmp = code(v)
	tmp = (1.3333333333333333 / sqrt((2.0 + (v * (v * -6.0))))) / pi;
end
code[v_] := N[(N[(1.3333333333333333 / N[Sqrt[N[(2.0 + N[(v * N[(v * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{1.3333333333333333}{\sqrt{2 + v \cdot \left(v \cdot -6\right)}}}{\pi}
\end{array}
Derivation
  1. Initial program 98.5%

    \[\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. Add Preprocessing
  3. Taylor expanded in v around 0

    \[\leadsto \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(\color{blue}{\left(3 \cdot \mathsf{PI}\left(\right)\right)}, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(2, \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(v, v\right)\right)\right)\right)\right)\right) \]
  4. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(\left(\mathsf{PI}\left(\right) \cdot 3\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{\_.f64}\left(2, \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(v, v\right)\right)\right)}\right)\right)\right) \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI}\left(\right), 3\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{\_.f64}\left(2, \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(v, v\right)\right)\right)}\right)\right)\right) \]
    3. PI-lowering-PI.f6497.7%

      \[\leadsto \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), 3\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\color{blue}{2}, \mathsf{*.f64}\left(6, \mathsf{*.f64}\left(v, v\right)\right)\right)\right)\right)\right) \]
  5. Simplified97.7%

    \[\leadsto \frac{4}{\color{blue}{\left(\pi \cdot 3\right)} \cdot \sqrt{2 - 6 \cdot \left(v \cdot v\right)}} \]
  6. Step-by-step derivation
    1. associate-/r*N/A

      \[\leadsto \frac{\frac{4}{\mathsf{PI}\left(\right) \cdot 3}}{\color{blue}{\sqrt{2 - 6 \cdot \left(v \cdot v\right)}}} \]
    2. *-commutativeN/A

      \[\leadsto \frac{\frac{4}{3 \cdot \mathsf{PI}\left(\right)}}{\sqrt{2 - \color{blue}{6 \cdot \left(v \cdot v\right)}}} \]
    3. associate-/r*N/A

      \[\leadsto \frac{\frac{\frac{4}{3}}{\mathsf{PI}\left(\right)}}{\sqrt{\color{blue}{2 - 6 \cdot \left(v \cdot v\right)}}} \]
    4. metadata-evalN/A

      \[\leadsto \frac{\frac{\frac{4}{3}}{\mathsf{PI}\left(\right)}}{\sqrt{\color{blue}{2} - 6 \cdot \left(v \cdot v\right)}} \]
    5. sub-negN/A

      \[\leadsto \frac{\frac{\frac{4}{3}}{\mathsf{PI}\left(\right)}}{\sqrt{2 + \left(\mathsf{neg}\left(6 \cdot \left(v \cdot v\right)\right)\right)}} \]
    6. *-commutativeN/A

      \[\leadsto \frac{\frac{\frac{4}{3}}{\mathsf{PI}\left(\right)}}{\sqrt{2 + \left(\mathsf{neg}\left(\left(v \cdot v\right) \cdot 6\right)\right)}} \]
    7. distribute-rgt-neg-inN/A

      \[\leadsto \frac{\frac{\frac{4}{3}}{\mathsf{PI}\left(\right)}}{\sqrt{2 + \left(v \cdot v\right) \cdot \left(\mathsf{neg}\left(6\right)\right)}} \]
    8. metadata-evalN/A

      \[\leadsto \frac{\frac{\frac{4}{3}}{\mathsf{PI}\left(\right)}}{\sqrt{2 + \left(v \cdot v\right) \cdot -6}} \]
    9. associate-*r*N/A

      \[\leadsto \frac{\frac{\frac{4}{3}}{\mathsf{PI}\left(\right)}}{\sqrt{2 + v \cdot \left(v \cdot -6\right)}} \]
    10. associate-/l/N/A

      \[\leadsto \frac{\frac{4}{3}}{\color{blue}{\sqrt{2 + v \cdot \left(v \cdot -6\right)} \cdot \mathsf{PI}\left(\right)}} \]
    11. associate-/r*N/A

      \[\leadsto \frac{\frac{\frac{4}{3}}{\sqrt{2 + v \cdot \left(v \cdot -6\right)}}}{\color{blue}{\mathsf{PI}\left(\right)}} \]
    12. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{4}{3}}{\sqrt{2 + v \cdot \left(v \cdot -6\right)}}\right), \color{blue}{\mathsf{PI}\left(\right)}\right) \]
  7. Applied egg-rr99.2%

    \[\leadsto \color{blue}{\frac{\frac{1.3333333333333333}{\sqrt{2 + v \cdot \left(v \cdot -6\right)}}}{\pi}} \]
  8. Add Preprocessing

Alternative 5: 99.0% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \frac{\frac{1.3333333333333333}{\pi}}{\sqrt{2 + v \cdot \left(v \cdot -6\right)}} \end{array} \]
(FPCore (v)
 :precision binary64
 (/ (/ 1.3333333333333333 PI) (sqrt (+ 2.0 (* v (* v -6.0))))))
double code(double v) {
	return (1.3333333333333333 / ((double) M_PI)) / sqrt((2.0 + (v * (v * -6.0))));
}
public static double code(double v) {
	return (1.3333333333333333 / Math.PI) / Math.sqrt((2.0 + (v * (v * -6.0))));
}
def code(v):
	return (1.3333333333333333 / math.pi) / math.sqrt((2.0 + (v * (v * -6.0))))
function code(v)
	return Float64(Float64(1.3333333333333333 / pi) / sqrt(Float64(2.0 + Float64(v * Float64(v * -6.0)))))
end
function tmp = code(v)
	tmp = (1.3333333333333333 / pi) / sqrt((2.0 + (v * (v * -6.0))));
end
code[v_] := N[(N[(1.3333333333333333 / Pi), $MachinePrecision] / N[Sqrt[N[(2.0 + N[(v * N[(v * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{1.3333333333333333}{\pi}}{\sqrt{2 + v \cdot \left(v \cdot -6\right)}}
\end{array}
Derivation
  1. Initial program 98.5%

    \[\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. Step-by-step derivation
    1. associate-/r*N/A

      \[\leadsto \frac{\frac{4}{\left(3 \cdot \mathsf{PI}\left(\right)\right) \cdot \left(1 - v \cdot v\right)}}{\color{blue}{\sqrt{2 - 6 \cdot \left(v \cdot v\right)}}} \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{4}{\left(3 \cdot \mathsf{PI}\left(\right)\right) \cdot \left(1 - v \cdot v\right)}\right), \color{blue}{\left(\sqrt{2 - 6 \cdot \left(v \cdot v\right)}\right)}\right) \]
    3. associate-*l*N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{4}{3 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(1 - v \cdot v\right)\right)}\right), \left(\sqrt{2 - \color{blue}{6 \cdot \left(v \cdot v\right)}}\right)\right) \]
    4. associate-/r*N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{4}{3}}{\mathsf{PI}\left(\right) \cdot \left(1 - v \cdot v\right)}\right), \left(\sqrt{\color{blue}{2 - 6 \cdot \left(v \cdot v\right)}}\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{4}{3}\right), \left(\mathsf{PI}\left(\right) \cdot \left(1 - v \cdot v\right)\right)\right), \left(\sqrt{\color{blue}{2 - 6 \cdot \left(v \cdot v\right)}}\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \left(\mathsf{PI}\left(\right) \cdot \left(1 - v \cdot v\right)\right)\right), \left(\sqrt{\color{blue}{2} - 6 \cdot \left(v \cdot v\right)}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \left(1 - v \cdot v\right)\right)\right), \left(\sqrt{2 - \color{blue}{6 \cdot \left(v \cdot v\right)}}\right)\right) \]
    8. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(1 - v \cdot v\right)\right)\right), \left(\sqrt{2 - \color{blue}{6} \cdot \left(v \cdot v\right)}\right)\right) \]
    9. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \left(v \cdot v\right)\right)\right)\right), \left(\sqrt{2 - 6 \cdot \color{blue}{\left(v \cdot v\right)}}\right)\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \left(\sqrt{2 - 6 \cdot \left(v \cdot \color{blue}{v}\right)}\right)\right) \]
    11. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\left(2 - 6 \cdot \left(v \cdot v\right)\right)\right)\right) \]
    12. sub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\left(2 + \left(\mathsf{neg}\left(6 \cdot \left(v \cdot v\right)\right)\right)\right)\right)\right) \]
    13. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(6 \cdot \left(v \cdot v\right)\right)\right)\right)\right)\right) \]
    14. associate-*r*N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(\left(6 \cdot v\right) \cdot v\right)\right)\right)\right)\right) \]
    15. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(v \cdot \left(6 \cdot v\right)\right)\right)\right)\right)\right) \]
    16. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(v \cdot \left(\mathsf{neg}\left(6 \cdot v\right)\right)\right)\right)\right)\right) \]
    17. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \left(\mathsf{neg}\left(6 \cdot v\right)\right)\right)\right)\right)\right) \]
    18. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \left(\mathsf{neg}\left(v \cdot 6\right)\right)\right)\right)\right)\right) \]
    19. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \left(v \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)\right)\right)\right) \]
    20. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, \left(\mathsf{neg}\left(6\right)\right)\right)\right)\right)\right)\right) \]
    21. metadata-eval100.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, -6\right)\right)\right)\right)\right) \]
  3. Simplified100.0%

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

    \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{\frac{4}{3}}{\mathsf{PI}\left(\right)}\right)}, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, -6\right)\right)\right)\right)\right) \]
  6. Step-by-step derivation
    1. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{PI}\left(\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, -6\right)\right)\right)}\right)\right) \]
    2. PI-lowering-PI.f6499.2%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{PI.f64}\left(\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \color{blue}{\mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, -6\right)\right)}\right)\right)\right) \]
  7. Simplified99.2%

    \[\leadsto \frac{\color{blue}{\frac{1.3333333333333333}{\pi}}}{\sqrt{2 + v \cdot \left(v \cdot -6\right)}} \]
  8. Add Preprocessing

Alternative 6: 99.0% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \frac{\frac{1.3333333333333333}{\pi}}{\sqrt{2}} \end{array} \]
(FPCore (v) :precision binary64 (/ (/ 1.3333333333333333 PI) (sqrt 2.0)))
double code(double v) {
	return (1.3333333333333333 / ((double) M_PI)) / sqrt(2.0);
}
public static double code(double v) {
	return (1.3333333333333333 / Math.PI) / Math.sqrt(2.0);
}
def code(v):
	return (1.3333333333333333 / math.pi) / math.sqrt(2.0)
function code(v)
	return Float64(Float64(1.3333333333333333 / pi) / sqrt(2.0))
end
function tmp = code(v)
	tmp = (1.3333333333333333 / pi) / sqrt(2.0);
end
code[v_] := N[(N[(1.3333333333333333 / Pi), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{1.3333333333333333}{\pi}}{\sqrt{2}}
\end{array}
Derivation
  1. Initial program 98.5%

    \[\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. Step-by-step derivation
    1. associate-/r*N/A

      \[\leadsto \frac{\frac{4}{\left(3 \cdot \mathsf{PI}\left(\right)\right) \cdot \left(1 - v \cdot v\right)}}{\color{blue}{\sqrt{2 - 6 \cdot \left(v \cdot v\right)}}} \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{4}{\left(3 \cdot \mathsf{PI}\left(\right)\right) \cdot \left(1 - v \cdot v\right)}\right), \color{blue}{\left(\sqrt{2 - 6 \cdot \left(v \cdot v\right)}\right)}\right) \]
    3. associate-*l*N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{4}{3 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(1 - v \cdot v\right)\right)}\right), \left(\sqrt{2 - \color{blue}{6 \cdot \left(v \cdot v\right)}}\right)\right) \]
    4. associate-/r*N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{4}{3}}{\mathsf{PI}\left(\right) \cdot \left(1 - v \cdot v\right)}\right), \left(\sqrt{\color{blue}{2 - 6 \cdot \left(v \cdot v\right)}}\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{4}{3}\right), \left(\mathsf{PI}\left(\right) \cdot \left(1 - v \cdot v\right)\right)\right), \left(\sqrt{\color{blue}{2 - 6 \cdot \left(v \cdot v\right)}}\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \left(\mathsf{PI}\left(\right) \cdot \left(1 - v \cdot v\right)\right)\right), \left(\sqrt{\color{blue}{2} - 6 \cdot \left(v \cdot v\right)}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI}\left(\right), \left(1 - v \cdot v\right)\right)\right), \left(\sqrt{2 - \color{blue}{6 \cdot \left(v \cdot v\right)}}\right)\right) \]
    8. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \left(1 - v \cdot v\right)\right)\right), \left(\sqrt{2 - \color{blue}{6} \cdot \left(v \cdot v\right)}\right)\right) \]
    9. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \left(v \cdot v\right)\right)\right)\right), \left(\sqrt{2 - 6 \cdot \color{blue}{\left(v \cdot v\right)}}\right)\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \left(\sqrt{2 - 6 \cdot \left(v \cdot \color{blue}{v}\right)}\right)\right) \]
    11. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\left(2 - 6 \cdot \left(v \cdot v\right)\right)\right)\right) \]
    12. sub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\left(2 + \left(\mathsf{neg}\left(6 \cdot \left(v \cdot v\right)\right)\right)\right)\right)\right) \]
    13. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(6 \cdot \left(v \cdot v\right)\right)\right)\right)\right)\right) \]
    14. associate-*r*N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(\left(6 \cdot v\right) \cdot v\right)\right)\right)\right)\right) \]
    15. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(v \cdot \left(6 \cdot v\right)\right)\right)\right)\right)\right) \]
    16. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \left(v \cdot \left(\mathsf{neg}\left(6 \cdot v\right)\right)\right)\right)\right)\right) \]
    17. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \left(\mathsf{neg}\left(6 \cdot v\right)\right)\right)\right)\right)\right) \]
    18. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \left(\mathsf{neg}\left(v \cdot 6\right)\right)\right)\right)\right)\right) \]
    19. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \left(v \cdot \left(\mathsf{neg}\left(6\right)\right)\right)\right)\right)\right)\right) \]
    20. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, \left(\mathsf{neg}\left(6\right)\right)\right)\right)\right)\right)\right) \]
    21. metadata-eval100.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(v, v\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, -6\right)\right)\right)\right)\right) \]
  3. Simplified100.0%

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

    \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{\frac{4}{3}}{\mathsf{PI}\left(\right)}\right)}, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, -6\right)\right)\right)\right)\right) \]
  6. Step-by-step derivation
    1. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{PI}\left(\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, -6\right)\right)\right)}\right)\right) \]
    2. PI-lowering-PI.f6499.2%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{PI.f64}\left(\right)\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(2, \color{blue}{\mathsf{*.f64}\left(v, \mathsf{*.f64}\left(v, -6\right)\right)}\right)\right)\right) \]
  7. Simplified99.2%

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

    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{PI.f64}\left(\right)\right), \color{blue}{\left(\sqrt{2}\right)}\right) \]
  9. Step-by-step derivation
    1. sqrt-lowering-sqrt.f6499.1%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{4}{3}, \mathsf{PI.f64}\left(\right)\right), \mathsf{sqrt.f64}\left(2\right)\right) \]
  10. Simplified99.1%

    \[\leadsto \frac{\frac{1.3333333333333333}{\pi}}{\color{blue}{\sqrt{2}}} \]
  11. Add Preprocessing

Alternative 7: 97.4% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \frac{1.3333333333333333 \cdot \sqrt{0.5}}{\pi} \end{array} \]
(FPCore (v) :precision binary64 (/ (* 1.3333333333333333 (sqrt 0.5)) PI))
double code(double v) {
	return (1.3333333333333333 * sqrt(0.5)) / ((double) M_PI);
}
public static double code(double v) {
	return (1.3333333333333333 * Math.sqrt(0.5)) / Math.PI;
}
def code(v):
	return (1.3333333333333333 * math.sqrt(0.5)) / math.pi
function code(v)
	return Float64(Float64(1.3333333333333333 * sqrt(0.5)) / pi)
end
function tmp = code(v)
	tmp = (1.3333333333333333 * sqrt(0.5)) / pi;
end
code[v_] := N[(N[(1.3333333333333333 * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]
\begin{array}{l}

\\
\frac{1.3333333333333333 \cdot \sqrt{0.5}}{\pi}
\end{array}
Derivation
  1. Initial program 98.5%

    \[\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. Add Preprocessing
  3. Taylor expanded in v around 0

    \[\leadsto \color{blue}{\frac{4}{3} \cdot \frac{\sqrt{\frac{1}{2}}}{\mathsf{PI}\left(\right)}} \]
  4. Step-by-step derivation
    1. associate-*r/N/A

      \[\leadsto \frac{\frac{4}{3} \cdot \sqrt{\frac{1}{2}}}{\color{blue}{\mathsf{PI}\left(\right)}} \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{4}{3} \cdot \sqrt{\frac{1}{2}}\right), \color{blue}{\mathsf{PI}\left(\right)}\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{4}{3}, \left(\sqrt{\frac{1}{2}}\right)\right), \mathsf{PI}\left(\right)\right) \]
    4. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{4}{3}, \mathsf{sqrt.f64}\left(\frac{1}{2}\right)\right), \mathsf{PI}\left(\right)\right) \]
    5. PI-lowering-PI.f6497.6%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{4}{3}, \mathsf{sqrt.f64}\left(\frac{1}{2}\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
  5. Simplified97.6%

    \[\leadsto \color{blue}{\frac{1.3333333333333333 \cdot \sqrt{0.5}}{\pi}} \]
  6. Add Preprocessing

Reproduce

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