Jmat.Real.erfi, branch x less than or equal to 0.5

Percentage Accurate: 99.8% → 99.8%
Time: 14.4s
Alternatives: 12
Speedup: 2.7×

Specification

?
\[x \leq 0.5\]
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\\ t_1 := \left(t_0 \cdot \left|x\right|\right) \cdot \left|x\right|\\ \left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot t_0\right) + \frac{1}{5} \cdot t_1\right) + \frac{1}{21} \cdot \left(\left(t_1 \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (* (* (fabs x) (fabs x)) (fabs x)))
        (t_1 (* (* t_0 (fabs x)) (fabs x))))
   (fabs
    (*
     (/ 1.0 (sqrt PI))
     (+
      (+ (+ (* 2.0 (fabs x)) (* (/ 2.0 3.0) t_0)) (* (/ 1.0 5.0) t_1))
      (* (/ 1.0 21.0) (* (* t_1 (fabs x)) (fabs x))))))))
double code(double x) {
	double t_0 = (fabs(x) * fabs(x)) * fabs(x);
	double t_1 = (t_0 * fabs(x)) * fabs(x);
	return fabs(((1.0 / sqrt(((double) M_PI))) * ((((2.0 * fabs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * fabs(x)) * fabs(x))))));
}
public static double code(double x) {
	double t_0 = (Math.abs(x) * Math.abs(x)) * Math.abs(x);
	double t_1 = (t_0 * Math.abs(x)) * Math.abs(x);
	return Math.abs(((1.0 / Math.sqrt(Math.PI)) * ((((2.0 * Math.abs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * Math.abs(x)) * Math.abs(x))))));
}
def code(x):
	t_0 = (math.fabs(x) * math.fabs(x)) * math.fabs(x)
	t_1 = (t_0 * math.fabs(x)) * math.fabs(x)
	return math.fabs(((1.0 / math.sqrt(math.pi)) * ((((2.0 * math.fabs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * math.fabs(x)) * math.fabs(x))))))
function code(x)
	t_0 = Float64(Float64(abs(x) * abs(x)) * abs(x))
	t_1 = Float64(Float64(t_0 * abs(x)) * abs(x))
	return abs(Float64(Float64(1.0 / sqrt(pi)) * Float64(Float64(Float64(Float64(2.0 * abs(x)) + Float64(Float64(2.0 / 3.0) * t_0)) + Float64(Float64(1.0 / 5.0) * t_1)) + Float64(Float64(1.0 / 21.0) * Float64(Float64(t_1 * abs(x)) * abs(x))))))
end
function tmp = code(x)
	t_0 = (abs(x) * abs(x)) * abs(x);
	t_1 = (t_0 * abs(x)) * abs(x);
	tmp = abs(((1.0 / sqrt(pi)) * ((((2.0 * abs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * abs(x)) * abs(x))))));
end
code[x_] := Block[{t$95$0 = N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(1.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(2.0 * N[Abs[x], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / 3.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 5.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 21.0), $MachinePrecision] * N[(N[(t$95$1 * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\\
t_1 := \left(t_0 \cdot \left|x\right|\right) \cdot \left|x\right|\\
\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot t_0\right) + \frac{1}{5} \cdot t_1\right) + \frac{1}{21} \cdot \left(\left(t_1 \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right|
\end{array}
\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 12 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: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\\ t_1 := \left(t_0 \cdot \left|x\right|\right) \cdot \left|x\right|\\ \left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot t_0\right) + \frac{1}{5} \cdot t_1\right) + \frac{1}{21} \cdot \left(\left(t_1 \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (* (* (fabs x) (fabs x)) (fabs x)))
        (t_1 (* (* t_0 (fabs x)) (fabs x))))
   (fabs
    (*
     (/ 1.0 (sqrt PI))
     (+
      (+ (+ (* 2.0 (fabs x)) (* (/ 2.0 3.0) t_0)) (* (/ 1.0 5.0) t_1))
      (* (/ 1.0 21.0) (* (* t_1 (fabs x)) (fabs x))))))))
double code(double x) {
	double t_0 = (fabs(x) * fabs(x)) * fabs(x);
	double t_1 = (t_0 * fabs(x)) * fabs(x);
	return fabs(((1.0 / sqrt(((double) M_PI))) * ((((2.0 * fabs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * fabs(x)) * fabs(x))))));
}
public static double code(double x) {
	double t_0 = (Math.abs(x) * Math.abs(x)) * Math.abs(x);
	double t_1 = (t_0 * Math.abs(x)) * Math.abs(x);
	return Math.abs(((1.0 / Math.sqrt(Math.PI)) * ((((2.0 * Math.abs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * Math.abs(x)) * Math.abs(x))))));
}
def code(x):
	t_0 = (math.fabs(x) * math.fabs(x)) * math.fabs(x)
	t_1 = (t_0 * math.fabs(x)) * math.fabs(x)
	return math.fabs(((1.0 / math.sqrt(math.pi)) * ((((2.0 * math.fabs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * math.fabs(x)) * math.fabs(x))))))
function code(x)
	t_0 = Float64(Float64(abs(x) * abs(x)) * abs(x))
	t_1 = Float64(Float64(t_0 * abs(x)) * abs(x))
	return abs(Float64(Float64(1.0 / sqrt(pi)) * Float64(Float64(Float64(Float64(2.0 * abs(x)) + Float64(Float64(2.0 / 3.0) * t_0)) + Float64(Float64(1.0 / 5.0) * t_1)) + Float64(Float64(1.0 / 21.0) * Float64(Float64(t_1 * abs(x)) * abs(x))))))
end
function tmp = code(x)
	t_0 = (abs(x) * abs(x)) * abs(x);
	t_1 = (t_0 * abs(x)) * abs(x);
	tmp = abs(((1.0 / sqrt(pi)) * ((((2.0 * abs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * abs(x)) * abs(x))))));
end
code[x_] := Block[{t$95$0 = N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(1.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(2.0 * N[Abs[x], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / 3.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 5.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 21.0), $MachinePrecision] * N[(N[(t$95$1 * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\\
t_1 := \left(t_0 \cdot \left|x\right|\right) \cdot \left|x\right|\\
\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot t_0\right) + \frac{1}{5} \cdot t_1\right) + \frac{1}{21} \cdot \left(\left(t_1 \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right|
\end{array}
\end{array}

Alternative 1: 99.8% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \end{array} \]
(FPCore (x)
 :precision binary64
 (fabs
  (*
   (pow PI -0.5)
   (fma
    0.047619047619047616
    (pow x 7.0)
    (fma x 2.0 (fma 0.6666666666666666 (pow x 3.0) (* 0.2 (pow x 5.0))))))))
double code(double x) {
	return fabs((pow(((double) M_PI), -0.5) * fma(0.047619047619047616, pow(x, 7.0), fma(x, 2.0, fma(0.6666666666666666, pow(x, 3.0), (0.2 * pow(x, 5.0)))))));
}
function code(x)
	return abs(Float64((pi ^ -0.5) * fma(0.047619047619047616, (x ^ 7.0), fma(x, 2.0, fma(0.6666666666666666, (x ^ 3.0), Float64(0.2 * (x ^ 5.0)))))))
end
code[x_] := N[Abs[N[(N[Power[Pi, -0.5], $MachinePrecision] * N[(0.047619047619047616 * N[Power[x, 7.0], $MachinePrecision] + N[(x * 2.0 + N[(0.6666666666666666 * N[Power[x, 3.0], $MachinePrecision] + N[(0.2 * N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right|
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]
  2. Simplified99.4%

    \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(0.047619047619047616, \left({\left(\left|x\right|\right)}^{3} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right), \mathsf{fma}\left(2, \left|x\right|, \mathsf{fma}\left(0.6666666666666666, {\left(\left|x\right|\right)}^{3}, {\left(\left|x\right|\right)}^{3} \cdot \left(\left(x \cdot x\right) \cdot 0.2\right)\right)\right)\right)}{\sqrt{\pi}}\right|} \]
  3. Applied egg-rr99.9%

    \[\leadsto \left|\color{blue}{\mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right) \cdot {\pi}^{-0.5}}\right| \]
  4. Step-by-step derivation
    1. *-commutative99.9%

      \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
    2. *-commutative99.9%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{6} \cdot x}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
    3. pow-plus99.9%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{\left(6 + 1\right)}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
    4. metadata-eval99.9%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{\color{blue}{7}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
    5. fma-udef99.9%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{2 \cdot x + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)}\right)\right| \]
    6. *-commutative99.9%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{x \cdot 2} + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right| \]
    7. fma-def99.9%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)}\right)\right| \]
  5. Simplified99.9%

    \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
  6. Final simplification99.9%

    \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]

Alternative 2: 99.9% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \left|\left({\pi}^{-0.5} \cdot x\right) \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \end{array} \]
(FPCore (x)
 :precision binary64
 (fabs
  (*
   (* (pow PI -0.5) x)
   (+
    (fma 0.6666666666666666 (* x x) 2.0)
    (fma 0.2 (pow x 4.0) (* 0.047619047619047616 (pow x 6.0)))))))
double code(double x) {
	return fabs(((pow(((double) M_PI), -0.5) * x) * (fma(0.6666666666666666, (x * x), 2.0) + fma(0.2, pow(x, 4.0), (0.047619047619047616 * pow(x, 6.0))))));
}
function code(x)
	return abs(Float64(Float64((pi ^ -0.5) * x) * Float64(fma(0.6666666666666666, Float64(x * x), 2.0) + fma(0.2, (x ^ 4.0), Float64(0.047619047619047616 * (x ^ 6.0))))))
end
code[x_] := N[Abs[N[(N[(N[Power[Pi, -0.5], $MachinePrecision] * x), $MachinePrecision] * N[(N[(0.6666666666666666 * N[(x * x), $MachinePrecision] + 2.0), $MachinePrecision] + N[(0.2 * N[Power[x, 4.0], $MachinePrecision] + N[(0.047619047619047616 * N[Power[x, 6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\left|\left({\pi}^{-0.5} \cdot x\right) \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right|
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]
  2. Simplified99.4%

    \[\leadsto \color{blue}{\left|\frac{\left|x\right|}{\sqrt{\pi}} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right|} \]
  3. Step-by-step derivation
    1. div-inv99.9%

      \[\leadsto \left|\color{blue}{\left(\left|x\right| \cdot \frac{1}{\sqrt{\pi}}\right)} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    2. add-sqr-sqrt32.6%

      \[\leadsto \left|\left(\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right| \cdot \frac{1}{\sqrt{\pi}}\right) \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    3. fabs-sqr32.6%

      \[\leadsto \left|\left(\color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{1}{\sqrt{\pi}}\right) \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    4. add-sqr-sqrt99.9%

      \[\leadsto \left|\left(\color{blue}{x} \cdot \frac{1}{\sqrt{\pi}}\right) \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    5. pow1/299.9%

      \[\leadsto \left|\left(x \cdot \frac{1}{\color{blue}{{\pi}^{0.5}}}\right) \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    6. pow-flip99.9%

      \[\leadsto \left|\left(x \cdot \color{blue}{{\pi}^{\left(-0.5\right)}}\right) \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    7. metadata-eval99.9%

      \[\leadsto \left|\left(x \cdot {\pi}^{\color{blue}{-0.5}}\right) \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
  4. Applied egg-rr99.9%

    \[\leadsto \left|\color{blue}{\left(x \cdot {\pi}^{-0.5}\right)} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
  5. Final simplification99.9%

    \[\leadsto \left|\left({\pi}^{-0.5} \cdot x\right) \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]

Alternative 3: 93.5% accurate, 3.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1.88:\\ \;\;\;\;\left|{\pi}^{-0.5} \cdot \left(0.2 \cdot {x}^{5} + \left(0.6666666666666666 \cdot {x}^{3} + x \cdot 2\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{x}{\sqrt{\pi}} \cdot \left(\mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right) + 0.6666666666666666 \cdot \left(x \cdot x\right)\right)\right|\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= x 1.88)
   (fabs
    (*
     (pow PI -0.5)
     (+ (* 0.2 (pow x 5.0)) (+ (* 0.6666666666666666 (pow x 3.0)) (* x 2.0)))))
   (fabs
    (*
     (/ x (sqrt PI))
     (+
      (fma 0.2 (pow x 4.0) (* 0.047619047619047616 (pow x 6.0)))
      (* 0.6666666666666666 (* x x)))))))
double code(double x) {
	double tmp;
	if (x <= 1.88) {
		tmp = fabs((pow(((double) M_PI), -0.5) * ((0.2 * pow(x, 5.0)) + ((0.6666666666666666 * pow(x, 3.0)) + (x * 2.0)))));
	} else {
		tmp = fabs(((x / sqrt(((double) M_PI))) * (fma(0.2, pow(x, 4.0), (0.047619047619047616 * pow(x, 6.0))) + (0.6666666666666666 * (x * x)))));
	}
	return tmp;
}
function code(x)
	tmp = 0.0
	if (x <= 1.88)
		tmp = abs(Float64((pi ^ -0.5) * Float64(Float64(0.2 * (x ^ 5.0)) + Float64(Float64(0.6666666666666666 * (x ^ 3.0)) + Float64(x * 2.0)))));
	else
		tmp = abs(Float64(Float64(x / sqrt(pi)) * Float64(fma(0.2, (x ^ 4.0), Float64(0.047619047619047616 * (x ^ 6.0))) + Float64(0.6666666666666666 * Float64(x * x)))));
	end
	return tmp
end
code[x_] := If[LessEqual[x, 1.88], N[Abs[N[(N[Power[Pi, -0.5], $MachinePrecision] * N[(N[(0.2 * N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision] + N[(N[(0.6666666666666666 * N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(x / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(N[(0.2 * N[Power[x, 4.0], $MachinePrecision] + N[(0.047619047619047616 * N[Power[x, 6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.6666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.88:\\
\;\;\;\;\left|{\pi}^{-0.5} \cdot \left(0.2 \cdot {x}^{5} + \left(0.6666666666666666 \cdot {x}^{3} + x \cdot 2\right)\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{\sqrt{\pi}} \cdot \left(\mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right) + 0.6666666666666666 \cdot \left(x \cdot x\right)\right)\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1.8799999999999999

    1. Initial program 99.9%

      \[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]
    2. Simplified99.4%

      \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(0.047619047619047616, \left({\left(\left|x\right|\right)}^{3} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right), \mathsf{fma}\left(2, \left|x\right|, \mathsf{fma}\left(0.6666666666666666, {\left(\left|x\right|\right)}^{3}, {\left(\left|x\right|\right)}^{3} \cdot \left(\left(x \cdot x\right) \cdot 0.2\right)\right)\right)\right)}{\sqrt{\pi}}\right|} \]
    3. Applied egg-rr99.9%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right) \cdot {\pi}^{-0.5}}\right| \]
    4. Step-by-step derivation
      1. *-commutative99.9%

        \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
      2. *-commutative99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{6} \cdot x}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      3. pow-plus99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{\left(6 + 1\right)}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      4. metadata-eval99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{\color{blue}{7}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      5. fma-udef99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{2 \cdot x + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)}\right)\right| \]
      6. *-commutative99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{x \cdot 2} + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right| \]
      7. fma-def99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)}\right)\right| \]
    5. Simplified99.9%

      \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
    6. Taylor expanded in x around 0 93.0%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \color{blue}{\left(0.2 \cdot {x}^{5} + \left(0.6666666666666666 \cdot {x}^{3} + 2 \cdot x\right)\right)}\right| \]

    if 1.8799999999999999 < x

    1. Initial program 99.9%

      \[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]
    2. Simplified99.4%

      \[\leadsto \color{blue}{\left|\frac{\left|x\right|}{\sqrt{\pi}} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right|} \]
    3. Step-by-step derivation
      1. expm1-log1p-u99.2%

        \[\leadsto \left|\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\left|x\right|}{\sqrt{\pi}}\right)\right)} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
      2. expm1-udef39.9%

        \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\left|x\right|}{\sqrt{\pi}}\right)} - 1\right)} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
      3. add-sqr-sqrt2.1%

        \[\leadsto \left|\left(e^{\mathsf{log1p}\left(\frac{\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right|}{\sqrt{\pi}}\right)} - 1\right) \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
      4. fabs-sqr2.1%

        \[\leadsto \left|\left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{\sqrt{\pi}}\right)} - 1\right) \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
      5. add-sqr-sqrt6.3%

        \[\leadsto \left|\left(e^{\mathsf{log1p}\left(\frac{\color{blue}{x}}{\sqrt{\pi}}\right)} - 1\right) \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    4. Applied egg-rr6.3%

      \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\sqrt{\pi}}\right)} - 1\right)} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    5. Step-by-step derivation
      1. expm1-def65.4%

        \[\leadsto \left|\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\sqrt{\pi}}\right)\right)} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
      2. expm1-log1p99.4%

        \[\leadsto \left|\color{blue}{\frac{x}{\sqrt{\pi}}} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    6. Simplified99.4%

      \[\leadsto \left|\color{blue}{\frac{x}{\sqrt{\pi}}} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    7. Taylor expanded in x around inf 38.0%

      \[\leadsto \left|\frac{x}{\sqrt{\pi}} \cdot \left(\color{blue}{0.6666666666666666 \cdot {x}^{2}} + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    8. Step-by-step derivation
      1. unpow238.0%

        \[\leadsto \left|\frac{x}{\sqrt{\pi}} \cdot \left(0.6666666666666666 \cdot \color{blue}{\left(x \cdot x\right)} + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    9. Simplified38.0%

      \[\leadsto \left|\frac{x}{\sqrt{\pi}} \cdot \left(\color{blue}{0.6666666666666666 \cdot \left(x \cdot x\right)} + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.88:\\ \;\;\;\;\left|{\pi}^{-0.5} \cdot \left(0.2 \cdot {x}^{5} + \left(0.6666666666666666 \cdot {x}^{3} + x \cdot 2\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{x}{\sqrt{\pi}} \cdot \left(\mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right) + 0.6666666666666666 \cdot \left(x \cdot x\right)\right)\right|\\ \end{array} \]

Alternative 4: 93.5% accurate, 3.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.6666666666666666 \cdot {x}^{3}\\ t_1 := 0.2 \cdot {x}^{5}\\ \mathbf{if}\;x \leq 1.88:\\ \;\;\;\;\left|{\pi}^{-0.5} \cdot \left(t_1 + \left(t_0 + x \cdot 2\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|{\pi}^{-0.5} \cdot \left(0.047619047619047616 \cdot {x}^{7} + \left(t_1 + t_0\right)\right)\right|\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (* 0.6666666666666666 (pow x 3.0))) (t_1 (* 0.2 (pow x 5.0))))
   (if (<= x 1.88)
     (fabs (* (pow PI -0.5) (+ t_1 (+ t_0 (* x 2.0)))))
     (fabs
      (*
       (pow PI -0.5)
       (+ (* 0.047619047619047616 (pow x 7.0)) (+ t_1 t_0)))))))
double code(double x) {
	double t_0 = 0.6666666666666666 * pow(x, 3.0);
	double t_1 = 0.2 * pow(x, 5.0);
	double tmp;
	if (x <= 1.88) {
		tmp = fabs((pow(((double) M_PI), -0.5) * (t_1 + (t_0 + (x * 2.0)))));
	} else {
		tmp = fabs((pow(((double) M_PI), -0.5) * ((0.047619047619047616 * pow(x, 7.0)) + (t_1 + t_0))));
	}
	return tmp;
}
public static double code(double x) {
	double t_0 = 0.6666666666666666 * Math.pow(x, 3.0);
	double t_1 = 0.2 * Math.pow(x, 5.0);
	double tmp;
	if (x <= 1.88) {
		tmp = Math.abs((Math.pow(Math.PI, -0.5) * (t_1 + (t_0 + (x * 2.0)))));
	} else {
		tmp = Math.abs((Math.pow(Math.PI, -0.5) * ((0.047619047619047616 * Math.pow(x, 7.0)) + (t_1 + t_0))));
	}
	return tmp;
}
def code(x):
	t_0 = 0.6666666666666666 * math.pow(x, 3.0)
	t_1 = 0.2 * math.pow(x, 5.0)
	tmp = 0
	if x <= 1.88:
		tmp = math.fabs((math.pow(math.pi, -0.5) * (t_1 + (t_0 + (x * 2.0)))))
	else:
		tmp = math.fabs((math.pow(math.pi, -0.5) * ((0.047619047619047616 * math.pow(x, 7.0)) + (t_1 + t_0))))
	return tmp
function code(x)
	t_0 = Float64(0.6666666666666666 * (x ^ 3.0))
	t_1 = Float64(0.2 * (x ^ 5.0))
	tmp = 0.0
	if (x <= 1.88)
		tmp = abs(Float64((pi ^ -0.5) * Float64(t_1 + Float64(t_0 + Float64(x * 2.0)))));
	else
		tmp = abs(Float64((pi ^ -0.5) * Float64(Float64(0.047619047619047616 * (x ^ 7.0)) + Float64(t_1 + t_0))));
	end
	return tmp
end
function tmp_2 = code(x)
	t_0 = 0.6666666666666666 * (x ^ 3.0);
	t_1 = 0.2 * (x ^ 5.0);
	tmp = 0.0;
	if (x <= 1.88)
		tmp = abs(((pi ^ -0.5) * (t_1 + (t_0 + (x * 2.0)))));
	else
		tmp = abs(((pi ^ -0.5) * ((0.047619047619047616 * (x ^ 7.0)) + (t_1 + t_0))));
	end
	tmp_2 = tmp;
end
code[x_] := Block[{t$95$0 = N[(0.6666666666666666 * N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.2 * N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.88], N[Abs[N[(N[Power[Pi, -0.5], $MachinePrecision] * N[(t$95$1 + N[(t$95$0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Power[Pi, -0.5], $MachinePrecision] * N[(N[(0.047619047619047616 * N[Power[x, 7.0], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.6666666666666666 \cdot {x}^{3}\\
t_1 := 0.2 \cdot {x}^{5}\\
\mathbf{if}\;x \leq 1.88:\\
\;\;\;\;\left|{\pi}^{-0.5} \cdot \left(t_1 + \left(t_0 + x \cdot 2\right)\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\left|{\pi}^{-0.5} \cdot \left(0.047619047619047616 \cdot {x}^{7} + \left(t_1 + t_0\right)\right)\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1.8799999999999999

    1. Initial program 99.9%

      \[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]
    2. Simplified99.4%

      \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(0.047619047619047616, \left({\left(\left|x\right|\right)}^{3} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right), \mathsf{fma}\left(2, \left|x\right|, \mathsf{fma}\left(0.6666666666666666, {\left(\left|x\right|\right)}^{3}, {\left(\left|x\right|\right)}^{3} \cdot \left(\left(x \cdot x\right) \cdot 0.2\right)\right)\right)\right)}{\sqrt{\pi}}\right|} \]
    3. Applied egg-rr99.9%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right) \cdot {\pi}^{-0.5}}\right| \]
    4. Step-by-step derivation
      1. *-commutative99.9%

        \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
      2. *-commutative99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{6} \cdot x}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      3. pow-plus99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{\left(6 + 1\right)}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      4. metadata-eval99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{\color{blue}{7}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      5. fma-udef99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{2 \cdot x + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)}\right)\right| \]
      6. *-commutative99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{x \cdot 2} + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right| \]
      7. fma-def99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)}\right)\right| \]
    5. Simplified99.9%

      \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
    6. Taylor expanded in x around 0 93.0%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \color{blue}{\left(0.2 \cdot {x}^{5} + \left(0.6666666666666666 \cdot {x}^{3} + 2 \cdot x\right)\right)}\right| \]

    if 1.8799999999999999 < x

    1. Initial program 99.9%

      \[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]
    2. Simplified99.4%

      \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(0.047619047619047616, \left({\left(\left|x\right|\right)}^{3} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right), \mathsf{fma}\left(2, \left|x\right|, \mathsf{fma}\left(0.6666666666666666, {\left(\left|x\right|\right)}^{3}, {\left(\left|x\right|\right)}^{3} \cdot \left(\left(x \cdot x\right) \cdot 0.2\right)\right)\right)\right)}{\sqrt{\pi}}\right|} \]
    3. Applied egg-rr99.9%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right) \cdot {\pi}^{-0.5}}\right| \]
    4. Step-by-step derivation
      1. *-commutative99.9%

        \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
      2. *-commutative99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{6} \cdot x}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      3. pow-plus99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{\left(6 + 1\right)}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      4. metadata-eval99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{\color{blue}{7}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      5. fma-udef99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{2 \cdot x + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)}\right)\right| \]
      6. *-commutative99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{x \cdot 2} + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right| \]
      7. fma-def99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)}\right)\right| \]
    5. Simplified99.9%

      \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
    6. Taylor expanded in x around inf 38.0%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \color{blue}{\left(0.047619047619047616 \cdot {x}^{7} + \left(0.2 \cdot {x}^{5} + 0.6666666666666666 \cdot {x}^{3}\right)\right)}\right| \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.88:\\ \;\;\;\;\left|{\pi}^{-0.5} \cdot \left(0.2 \cdot {x}^{5} + \left(0.6666666666666666 \cdot {x}^{3} + x \cdot 2\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|{\pi}^{-0.5} \cdot \left(0.047619047619047616 \cdot {x}^{7} + \left(0.2 \cdot {x}^{5} + 0.6666666666666666 \cdot {x}^{3}\right)\right)\right|\\ \end{array} \]

Alternative 5: 99.4% accurate, 3.2× speedup?

\[\begin{array}{l} \\ \left|\frac{x}{\sqrt{\pi}} \cdot \left(\mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right) + \left(2 + 0.6666666666666666 \cdot \left(x \cdot x\right)\right)\right)\right| \end{array} \]
(FPCore (x)
 :precision binary64
 (fabs
  (*
   (/ x (sqrt PI))
   (+
    (fma 0.2 (pow x 4.0) (* 0.047619047619047616 (pow x 6.0)))
    (+ 2.0 (* 0.6666666666666666 (* x x)))))))
double code(double x) {
	return fabs(((x / sqrt(((double) M_PI))) * (fma(0.2, pow(x, 4.0), (0.047619047619047616 * pow(x, 6.0))) + (2.0 + (0.6666666666666666 * (x * x))))));
}
function code(x)
	return abs(Float64(Float64(x / sqrt(pi)) * Float64(fma(0.2, (x ^ 4.0), Float64(0.047619047619047616 * (x ^ 6.0))) + Float64(2.0 + Float64(0.6666666666666666 * Float64(x * x))))))
end
code[x_] := N[Abs[N[(N[(x / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(N[(0.2 * N[Power[x, 4.0], $MachinePrecision] + N[(0.047619047619047616 * N[Power[x, 6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 + N[(0.6666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\left|\frac{x}{\sqrt{\pi}} \cdot \left(\mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right) + \left(2 + 0.6666666666666666 \cdot \left(x \cdot x\right)\right)\right)\right|
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]
  2. Simplified99.4%

    \[\leadsto \color{blue}{\left|\frac{\left|x\right|}{\sqrt{\pi}} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right|} \]
  3. Step-by-step derivation
    1. expm1-log1p-u99.2%

      \[\leadsto \left|\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\left|x\right|}{\sqrt{\pi}}\right)\right)} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    2. expm1-udef39.9%

      \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\left|x\right|}{\sqrt{\pi}}\right)} - 1\right)} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    3. add-sqr-sqrt2.1%

      \[\leadsto \left|\left(e^{\mathsf{log1p}\left(\frac{\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right|}{\sqrt{\pi}}\right)} - 1\right) \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    4. fabs-sqr2.1%

      \[\leadsto \left|\left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{\sqrt{\pi}}\right)} - 1\right) \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    5. add-sqr-sqrt6.3%

      \[\leadsto \left|\left(e^{\mathsf{log1p}\left(\frac{\color{blue}{x}}{\sqrt{\pi}}\right)} - 1\right) \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
  4. Applied egg-rr6.3%

    \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\sqrt{\pi}}\right)} - 1\right)} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
  5. Step-by-step derivation
    1. expm1-def65.4%

      \[\leadsto \left|\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\sqrt{\pi}}\right)\right)} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    2. expm1-log1p99.4%

      \[\leadsto \left|\color{blue}{\frac{x}{\sqrt{\pi}}} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
  6. Simplified99.4%

    \[\leadsto \left|\color{blue}{\frac{x}{\sqrt{\pi}}} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
  7. Step-by-step derivation
    1. metadata-eval99.4%

      \[\leadsto \left|\frac{x}{\sqrt{\pi}} \cdot \left(\mathsf{fma}\left(\color{blue}{\frac{2}{3}}, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    2. fma-udef99.4%

      \[\leadsto \left|\frac{x}{\sqrt{\pi}} \cdot \left(\color{blue}{\left(\frac{2}{3} \cdot \left(x \cdot x\right) + 2\right)} + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    3. metadata-eval99.4%

      \[\leadsto \left|\frac{x}{\sqrt{\pi}} \cdot \left(\left(\color{blue}{0.6666666666666666} \cdot \left(x \cdot x\right) + 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
  8. Applied egg-rr99.4%

    \[\leadsto \left|\frac{x}{\sqrt{\pi}} \cdot \left(\color{blue}{\left(0.6666666666666666 \cdot \left(x \cdot x\right) + 2\right)} + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
  9. Final simplification99.4%

    \[\leadsto \left|\frac{x}{\sqrt{\pi}} \cdot \left(\mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right) + \left(2 + 0.6666666666666666 \cdot \left(x \cdot x\right)\right)\right)\right| \]

Alternative 6: 98.6% accurate, 3.2× speedup?

\[\begin{array}{l} \\ \left|\frac{x}{\sqrt{\pi}} \cdot \left(2 + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \end{array} \]
(FPCore (x)
 :precision binary64
 (fabs
  (*
   (/ x (sqrt PI))
   (+ 2.0 (fma 0.2 (pow x 4.0) (* 0.047619047619047616 (pow x 6.0)))))))
double code(double x) {
	return fabs(((x / sqrt(((double) M_PI))) * (2.0 + fma(0.2, pow(x, 4.0), (0.047619047619047616 * pow(x, 6.0))))));
}
function code(x)
	return abs(Float64(Float64(x / sqrt(pi)) * Float64(2.0 + fma(0.2, (x ^ 4.0), Float64(0.047619047619047616 * (x ^ 6.0))))))
end
code[x_] := N[Abs[N[(N[(x / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(0.2 * N[Power[x, 4.0], $MachinePrecision] + N[(0.047619047619047616 * N[Power[x, 6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\left|\frac{x}{\sqrt{\pi}} \cdot \left(2 + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right|
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]
  2. Simplified99.4%

    \[\leadsto \color{blue}{\left|\frac{\left|x\right|}{\sqrt{\pi}} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right|} \]
  3. Step-by-step derivation
    1. expm1-log1p-u99.2%

      \[\leadsto \left|\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\left|x\right|}{\sqrt{\pi}}\right)\right)} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    2. expm1-udef39.9%

      \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\left|x\right|}{\sqrt{\pi}}\right)} - 1\right)} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    3. add-sqr-sqrt2.1%

      \[\leadsto \left|\left(e^{\mathsf{log1p}\left(\frac{\left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right|}{\sqrt{\pi}}\right)} - 1\right) \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    4. fabs-sqr2.1%

      \[\leadsto \left|\left(e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{\sqrt{\pi}}\right)} - 1\right) \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    5. add-sqr-sqrt6.3%

      \[\leadsto \left|\left(e^{\mathsf{log1p}\left(\frac{\color{blue}{x}}{\sqrt{\pi}}\right)} - 1\right) \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
  4. Applied egg-rr6.3%

    \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\sqrt{\pi}}\right)} - 1\right)} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
  5. Step-by-step derivation
    1. expm1-def65.4%

      \[\leadsto \left|\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{\sqrt{\pi}}\right)\right)} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
    2. expm1-log1p99.4%

      \[\leadsto \left|\color{blue}{\frac{x}{\sqrt{\pi}}} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
  6. Simplified99.4%

    \[\leadsto \left|\color{blue}{\frac{x}{\sqrt{\pi}}} \cdot \left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right) + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
  7. Taylor expanded in x around 0 97.8%

    \[\leadsto \left|\frac{x}{\sqrt{\pi}} \cdot \left(\color{blue}{2} + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]
  8. Final simplification97.8%

    \[\leadsto \left|\frac{x}{\sqrt{\pi}} \cdot \left(2 + \mathsf{fma}\left(0.2, {x}^{4}, 0.047619047619047616 \cdot {x}^{6}\right)\right)\right| \]

Alternative 7: 93.5% accurate, 3.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.2 \cdot {x}^{5}\\ \mathbf{if}\;x \leq 2.15:\\ \;\;\;\;\left|{\pi}^{-0.5} \cdot \left(t_0 + \left(0.6666666666666666 \cdot {x}^{3} + x \cdot 2\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|{\pi}^{-0.5} \cdot \left(t_0 + 0.047619047619047616 \cdot {x}^{7}\right)\right|\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (* 0.2 (pow x 5.0))))
   (if (<= x 2.15)
     (fabs
      (*
       (pow PI -0.5)
       (+ t_0 (+ (* 0.6666666666666666 (pow x 3.0)) (* x 2.0)))))
     (fabs (* (pow PI -0.5) (+ t_0 (* 0.047619047619047616 (pow x 7.0))))))))
double code(double x) {
	double t_0 = 0.2 * pow(x, 5.0);
	double tmp;
	if (x <= 2.15) {
		tmp = fabs((pow(((double) M_PI), -0.5) * (t_0 + ((0.6666666666666666 * pow(x, 3.0)) + (x * 2.0)))));
	} else {
		tmp = fabs((pow(((double) M_PI), -0.5) * (t_0 + (0.047619047619047616 * pow(x, 7.0)))));
	}
	return tmp;
}
public static double code(double x) {
	double t_0 = 0.2 * Math.pow(x, 5.0);
	double tmp;
	if (x <= 2.15) {
		tmp = Math.abs((Math.pow(Math.PI, -0.5) * (t_0 + ((0.6666666666666666 * Math.pow(x, 3.0)) + (x * 2.0)))));
	} else {
		tmp = Math.abs((Math.pow(Math.PI, -0.5) * (t_0 + (0.047619047619047616 * Math.pow(x, 7.0)))));
	}
	return tmp;
}
def code(x):
	t_0 = 0.2 * math.pow(x, 5.0)
	tmp = 0
	if x <= 2.15:
		tmp = math.fabs((math.pow(math.pi, -0.5) * (t_0 + ((0.6666666666666666 * math.pow(x, 3.0)) + (x * 2.0)))))
	else:
		tmp = math.fabs((math.pow(math.pi, -0.5) * (t_0 + (0.047619047619047616 * math.pow(x, 7.0)))))
	return tmp
function code(x)
	t_0 = Float64(0.2 * (x ^ 5.0))
	tmp = 0.0
	if (x <= 2.15)
		tmp = abs(Float64((pi ^ -0.5) * Float64(t_0 + Float64(Float64(0.6666666666666666 * (x ^ 3.0)) + Float64(x * 2.0)))));
	else
		tmp = abs(Float64((pi ^ -0.5) * Float64(t_0 + Float64(0.047619047619047616 * (x ^ 7.0)))));
	end
	return tmp
end
function tmp_2 = code(x)
	t_0 = 0.2 * (x ^ 5.0);
	tmp = 0.0;
	if (x <= 2.15)
		tmp = abs(((pi ^ -0.5) * (t_0 + ((0.6666666666666666 * (x ^ 3.0)) + (x * 2.0)))));
	else
		tmp = abs(((pi ^ -0.5) * (t_0 + (0.047619047619047616 * (x ^ 7.0)))));
	end
	tmp_2 = tmp;
end
code[x_] := Block[{t$95$0 = N[(0.2 * N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 2.15], N[Abs[N[(N[Power[Pi, -0.5], $MachinePrecision] * N[(t$95$0 + N[(N[(0.6666666666666666 * N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Power[Pi, -0.5], $MachinePrecision] * N[(t$95$0 + N[(0.047619047619047616 * N[Power[x, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.2 \cdot {x}^{5}\\
\mathbf{if}\;x \leq 2.15:\\
\;\;\;\;\left|{\pi}^{-0.5} \cdot \left(t_0 + \left(0.6666666666666666 \cdot {x}^{3} + x \cdot 2\right)\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\left|{\pi}^{-0.5} \cdot \left(t_0 + 0.047619047619047616 \cdot {x}^{7}\right)\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.14999999999999991

    1. Initial program 99.9%

      \[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]
    2. Simplified99.4%

      \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(0.047619047619047616, \left({\left(\left|x\right|\right)}^{3} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right), \mathsf{fma}\left(2, \left|x\right|, \mathsf{fma}\left(0.6666666666666666, {\left(\left|x\right|\right)}^{3}, {\left(\left|x\right|\right)}^{3} \cdot \left(\left(x \cdot x\right) \cdot 0.2\right)\right)\right)\right)}{\sqrt{\pi}}\right|} \]
    3. Applied egg-rr99.9%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right) \cdot {\pi}^{-0.5}}\right| \]
    4. Step-by-step derivation
      1. *-commutative99.9%

        \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
      2. *-commutative99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{6} \cdot x}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      3. pow-plus99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{\left(6 + 1\right)}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      4. metadata-eval99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{\color{blue}{7}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      5. fma-udef99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{2 \cdot x + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)}\right)\right| \]
      6. *-commutative99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{x \cdot 2} + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right| \]
      7. fma-def99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)}\right)\right| \]
    5. Simplified99.9%

      \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
    6. Taylor expanded in x around 0 93.0%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \color{blue}{\left(0.2 \cdot {x}^{5} + \left(0.6666666666666666 \cdot {x}^{3} + 2 \cdot x\right)\right)}\right| \]

    if 2.14999999999999991 < x

    1. Initial program 99.9%

      \[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]
    2. Simplified99.4%

      \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(0.047619047619047616, \left({\left(\left|x\right|\right)}^{3} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right), \mathsf{fma}\left(2, \left|x\right|, \mathsf{fma}\left(0.6666666666666666, {\left(\left|x\right|\right)}^{3}, {\left(\left|x\right|\right)}^{3} \cdot \left(\left(x \cdot x\right) \cdot 0.2\right)\right)\right)\right)}{\sqrt{\pi}}\right|} \]
    3. Applied egg-rr99.9%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right) \cdot {\pi}^{-0.5}}\right| \]
    4. Step-by-step derivation
      1. *-commutative99.9%

        \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
      2. *-commutative99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{6} \cdot x}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      3. pow-plus99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{\left(6 + 1\right)}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      4. metadata-eval99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{\color{blue}{7}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      5. fma-udef99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{2 \cdot x + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)}\right)\right| \]
      6. *-commutative99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{x \cdot 2} + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right| \]
      7. fma-def99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)}\right)\right| \]
    5. Simplified99.9%

      \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
    6. Taylor expanded in x around inf 37.6%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \color{blue}{\left(0.047619047619047616 \cdot {x}^{7} + 0.2 \cdot {x}^{5}\right)}\right| \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.15:\\ \;\;\;\;\left|{\pi}^{-0.5} \cdot \left(0.2 \cdot {x}^{5} + \left(0.6666666666666666 \cdot {x}^{3} + x \cdot 2\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|{\pi}^{-0.5} \cdot \left(0.2 \cdot {x}^{5} + 0.047619047619047616 \cdot {x}^{7}\right)\right|\\ \end{array} \]

Alternative 8: 89.3% accurate, 3.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1.85:\\ \;\;\;\;\left|{\pi}^{-0.5} \cdot \left(x \cdot 2 + 0.6666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|{\pi}^{-0.5} \cdot \left(0.2 \cdot {x}^{5} + 0.047619047619047616 \cdot {x}^{7}\right)\right|\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= x 1.85)
   (fabs (* (pow PI -0.5) (+ (* x 2.0) (* 0.6666666666666666 (* x (* x x))))))
   (fabs
    (*
     (pow PI -0.5)
     (+ (* 0.2 (pow x 5.0)) (* 0.047619047619047616 (pow x 7.0)))))))
double code(double x) {
	double tmp;
	if (x <= 1.85) {
		tmp = fabs((pow(((double) M_PI), -0.5) * ((x * 2.0) + (0.6666666666666666 * (x * (x * x))))));
	} else {
		tmp = fabs((pow(((double) M_PI), -0.5) * ((0.2 * pow(x, 5.0)) + (0.047619047619047616 * pow(x, 7.0)))));
	}
	return tmp;
}
public static double code(double x) {
	double tmp;
	if (x <= 1.85) {
		tmp = Math.abs((Math.pow(Math.PI, -0.5) * ((x * 2.0) + (0.6666666666666666 * (x * (x * x))))));
	} else {
		tmp = Math.abs((Math.pow(Math.PI, -0.5) * ((0.2 * Math.pow(x, 5.0)) + (0.047619047619047616 * Math.pow(x, 7.0)))));
	}
	return tmp;
}
def code(x):
	tmp = 0
	if x <= 1.85:
		tmp = math.fabs((math.pow(math.pi, -0.5) * ((x * 2.0) + (0.6666666666666666 * (x * (x * x))))))
	else:
		tmp = math.fabs((math.pow(math.pi, -0.5) * ((0.2 * math.pow(x, 5.0)) + (0.047619047619047616 * math.pow(x, 7.0)))))
	return tmp
function code(x)
	tmp = 0.0
	if (x <= 1.85)
		tmp = abs(Float64((pi ^ -0.5) * Float64(Float64(x * 2.0) + Float64(0.6666666666666666 * Float64(x * Float64(x * x))))));
	else
		tmp = abs(Float64((pi ^ -0.5) * Float64(Float64(0.2 * (x ^ 5.0)) + Float64(0.047619047619047616 * (x ^ 7.0)))));
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if (x <= 1.85)
		tmp = abs(((pi ^ -0.5) * ((x * 2.0) + (0.6666666666666666 * (x * (x * x))))));
	else
		tmp = abs(((pi ^ -0.5) * ((0.2 * (x ^ 5.0)) + (0.047619047619047616 * (x ^ 7.0)))));
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[x, 1.85], N[Abs[N[(N[Power[Pi, -0.5], $MachinePrecision] * N[(N[(x * 2.0), $MachinePrecision] + N[(0.6666666666666666 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Power[Pi, -0.5], $MachinePrecision] * N[(N[(0.2 * N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision] + N[(0.047619047619047616 * N[Power[x, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.85:\\
\;\;\;\;\left|{\pi}^{-0.5} \cdot \left(x \cdot 2 + 0.6666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\left|{\pi}^{-0.5} \cdot \left(0.2 \cdot {x}^{5} + 0.047619047619047616 \cdot {x}^{7}\right)\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1.8500000000000001

    1. Initial program 99.9%

      \[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]
    2. Simplified99.4%

      \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(0.047619047619047616, \left({\left(\left|x\right|\right)}^{3} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right), \mathsf{fma}\left(2, \left|x\right|, \mathsf{fma}\left(0.6666666666666666, {\left(\left|x\right|\right)}^{3}, {\left(\left|x\right|\right)}^{3} \cdot \left(\left(x \cdot x\right) \cdot 0.2\right)\right)\right)\right)}{\sqrt{\pi}}\right|} \]
    3. Applied egg-rr99.9%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right) \cdot {\pi}^{-0.5}}\right| \]
    4. Step-by-step derivation
      1. *-commutative99.9%

        \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
      2. *-commutative99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{6} \cdot x}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      3. pow-plus99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{\left(6 + 1\right)}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      4. metadata-eval99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{\color{blue}{7}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      5. fma-udef99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{2 \cdot x + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)}\right)\right| \]
      6. *-commutative99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{x \cdot 2} + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right| \]
      7. fma-def99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)}\right)\right| \]
    5. Simplified99.9%

      \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
    6. Taylor expanded in x around 0 88.4%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \color{blue}{\left(0.6666666666666666 \cdot {x}^{3} + 2 \cdot x\right)}\right| \]
    7. Step-by-step derivation
      1. unpow388.4%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \left(0.6666666666666666 \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot x\right)} + 2 \cdot x\right)\right| \]
    8. Applied egg-rr88.4%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \left(0.6666666666666666 \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot x\right)} + 2 \cdot x\right)\right| \]

    if 1.8500000000000001 < x

    1. Initial program 99.9%

      \[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]
    2. Simplified99.4%

      \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(0.047619047619047616, \left({\left(\left|x\right|\right)}^{3} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right), \mathsf{fma}\left(2, \left|x\right|, \mathsf{fma}\left(0.6666666666666666, {\left(\left|x\right|\right)}^{3}, {\left(\left|x\right|\right)}^{3} \cdot \left(\left(x \cdot x\right) \cdot 0.2\right)\right)\right)\right)}{\sqrt{\pi}}\right|} \]
    3. Applied egg-rr99.9%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right) \cdot {\pi}^{-0.5}}\right| \]
    4. Step-by-step derivation
      1. *-commutative99.9%

        \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
      2. *-commutative99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{6} \cdot x}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      3. pow-plus99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{\left(6 + 1\right)}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      4. metadata-eval99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{\color{blue}{7}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      5. fma-udef99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{2 \cdot x + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)}\right)\right| \]
      6. *-commutative99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{x \cdot 2} + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right| \]
      7. fma-def99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)}\right)\right| \]
    5. Simplified99.9%

      \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
    6. Taylor expanded in x around inf 37.6%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \color{blue}{\left(0.047619047619047616 \cdot {x}^{7} + 0.2 \cdot {x}^{5}\right)}\right| \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.85:\\ \;\;\;\;\left|{\pi}^{-0.5} \cdot \left(x \cdot 2 + 0.6666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|{\pi}^{-0.5} \cdot \left(0.2 \cdot {x}^{5} + 0.047619047619047616 \cdot {x}^{7}\right)\right|\\ \end{array} \]

Alternative 9: 89.3% accurate, 4.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2.15:\\ \;\;\;\;\left|{\pi}^{-0.5} \cdot \left(x \cdot 2 + 0.6666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sqrt{\frac{{x}^{14} \cdot 0.0022675736961451248}{\pi}}\right|\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= x 2.15)
   (fabs (* (pow PI -0.5) (+ (* x 2.0) (* 0.6666666666666666 (* x (* x x))))))
   (fabs (sqrt (/ (* (pow x 14.0) 0.0022675736961451248) PI)))))
double code(double x) {
	double tmp;
	if (x <= 2.15) {
		tmp = fabs((pow(((double) M_PI), -0.5) * ((x * 2.0) + (0.6666666666666666 * (x * (x * x))))));
	} else {
		tmp = fabs(sqrt(((pow(x, 14.0) * 0.0022675736961451248) / ((double) M_PI))));
	}
	return tmp;
}
public static double code(double x) {
	double tmp;
	if (x <= 2.15) {
		tmp = Math.abs((Math.pow(Math.PI, -0.5) * ((x * 2.0) + (0.6666666666666666 * (x * (x * x))))));
	} else {
		tmp = Math.abs(Math.sqrt(((Math.pow(x, 14.0) * 0.0022675736961451248) / Math.PI)));
	}
	return tmp;
}
def code(x):
	tmp = 0
	if x <= 2.15:
		tmp = math.fabs((math.pow(math.pi, -0.5) * ((x * 2.0) + (0.6666666666666666 * (x * (x * x))))))
	else:
		tmp = math.fabs(math.sqrt(((math.pow(x, 14.0) * 0.0022675736961451248) / math.pi)))
	return tmp
function code(x)
	tmp = 0.0
	if (x <= 2.15)
		tmp = abs(Float64((pi ^ -0.5) * Float64(Float64(x * 2.0) + Float64(0.6666666666666666 * Float64(x * Float64(x * x))))));
	else
		tmp = abs(sqrt(Float64(Float64((x ^ 14.0) * 0.0022675736961451248) / pi)));
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if (x <= 2.15)
		tmp = abs(((pi ^ -0.5) * ((x * 2.0) + (0.6666666666666666 * (x * (x * x))))));
	else
		tmp = abs(sqrt((((x ^ 14.0) * 0.0022675736961451248) / pi)));
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[x, 2.15], N[Abs[N[(N[Power[Pi, -0.5], $MachinePrecision] * N[(N[(x * 2.0), $MachinePrecision] + N[(0.6666666666666666 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[Sqrt[N[(N[(N[Power[x, 14.0], $MachinePrecision] * 0.0022675736961451248), $MachinePrecision] / Pi), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.15:\\
\;\;\;\;\left|{\pi}^{-0.5} \cdot \left(x \cdot 2 + 0.6666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\left|\sqrt{\frac{{x}^{14} \cdot 0.0022675736961451248}{\pi}}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.14999999999999991

    1. Initial program 99.9%

      \[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]
    2. Simplified99.4%

      \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(0.047619047619047616, \left({\left(\left|x\right|\right)}^{3} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right), \mathsf{fma}\left(2, \left|x\right|, \mathsf{fma}\left(0.6666666666666666, {\left(\left|x\right|\right)}^{3}, {\left(\left|x\right|\right)}^{3} \cdot \left(\left(x \cdot x\right) \cdot 0.2\right)\right)\right)\right)}{\sqrt{\pi}}\right|} \]
    3. Applied egg-rr99.9%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right) \cdot {\pi}^{-0.5}}\right| \]
    4. Step-by-step derivation
      1. *-commutative99.9%

        \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
      2. *-commutative99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{6} \cdot x}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      3. pow-plus99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{\left(6 + 1\right)}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      4. metadata-eval99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{\color{blue}{7}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      5. fma-udef99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{2 \cdot x + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)}\right)\right| \]
      6. *-commutative99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{x \cdot 2} + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right| \]
      7. fma-def99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)}\right)\right| \]
    5. Simplified99.9%

      \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
    6. Taylor expanded in x around 0 88.4%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \color{blue}{\left(0.6666666666666666 \cdot {x}^{3} + 2 \cdot x\right)}\right| \]
    7. Step-by-step derivation
      1. unpow388.4%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \left(0.6666666666666666 \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot x\right)} + 2 \cdot x\right)\right| \]
    8. Applied egg-rr88.4%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \left(0.6666666666666666 \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot x\right)} + 2 \cdot x\right)\right| \]

    if 2.14999999999999991 < x

    1. Initial program 99.9%

      \[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]
    2. Simplified99.4%

      \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(0.047619047619047616, \left({\left(\left|x\right|\right)}^{3} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right), \mathsf{fma}\left(2, \left|x\right|, \mathsf{fma}\left(0.6666666666666666, {\left(\left|x\right|\right)}^{3}, {\left(\left|x\right|\right)}^{3} \cdot \left(\left(x \cdot x\right) \cdot 0.2\right)\right)\right)\right)}{\sqrt{\pi}}\right|} \]
    3. Taylor expanded in x around inf 37.0%

      \[\leadsto \left|\color{blue}{0.047619047619047616 \cdot \left(\left({x}^{4} \cdot {\left(\left|x\right|\right)}^{3}\right) \cdot \sqrt{\frac{1}{\pi}}\right)}\right| \]
    4. Step-by-step derivation
      1. *-commutative37.0%

        \[\leadsto \left|\color{blue}{\left(\left({x}^{4} \cdot {\left(\left|x\right|\right)}^{3}\right) \cdot \sqrt{\frac{1}{\pi}}\right) \cdot 0.047619047619047616}\right| \]
      2. *-commutative37.0%

        \[\leadsto \left|\color{blue}{\left(\sqrt{\frac{1}{\pi}} \cdot \left({x}^{4} \cdot {\left(\left|x\right|\right)}^{3}\right)\right)} \cdot 0.047619047619047616\right| \]
      3. associate-*l*37.0%

        \[\leadsto \left|\color{blue}{\sqrt{\frac{1}{\pi}} \cdot \left(\left({x}^{4} \cdot {\left(\left|x\right|\right)}^{3}\right) \cdot 0.047619047619047616\right)}\right| \]
      4. *-commutative37.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \color{blue}{\left(0.047619047619047616 \cdot \left({x}^{4} \cdot {\left(\left|x\right|\right)}^{3}\right)\right)}\right| \]
      5. unpow337.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left({x}^{4} \cdot \color{blue}{\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)}\right)\right)\right| \]
      6. sqr-abs37.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left({x}^{4} \cdot \left(\color{blue}{\left(x \cdot x\right)} \cdot \left|x\right|\right)\right)\right)\right| \]
      7. associate-*r*37.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \color{blue}{\left(\left({x}^{4} \cdot \left(x \cdot x\right)\right) \cdot \left|x\right|\right)}\right)\right| \]
      8. metadata-eval37.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left(\left({x}^{\color{blue}{\left(2 \cdot 2\right)}} \cdot \left(x \cdot x\right)\right) \cdot \left|x\right|\right)\right)\right| \]
      9. pow-sqr37.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left(\left(\color{blue}{\left({x}^{2} \cdot {x}^{2}\right)} \cdot \left(x \cdot x\right)\right) \cdot \left|x\right|\right)\right)\right| \]
      10. unpow237.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left(\left(\left(\color{blue}{\left(x \cdot x\right)} \cdot {x}^{2}\right) \cdot \left(x \cdot x\right)\right) \cdot \left|x\right|\right)\right)\right| \]
      11. unpow237.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left(\left(\left(\left(x \cdot x\right) \cdot \color{blue}{\left(x \cdot x\right)}\right) \cdot \left(x \cdot x\right)\right) \cdot \left|x\right|\right)\right)\right| \]
      12. unpow337.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left(\color{blue}{{\left(x \cdot x\right)}^{3}} \cdot \left|x\right|\right)\right)\right| \]
      13. cube-prod37.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left(\color{blue}{\left({x}^{3} \cdot {x}^{3}\right)} \cdot \left|x\right|\right)\right)\right| \]
      14. rem-square-sqrt1.8%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left(\left({x}^{3} \cdot {x}^{3}\right) \cdot \left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right|\right)\right)\right| \]
      15. fabs-sqr1.8%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left(\left({x}^{3} \cdot {x}^{3}\right) \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)}\right)\right)\right| \]
      16. rem-square-sqrt37.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left(\left({x}^{3} \cdot {x}^{3}\right) \cdot \color{blue}{x}\right)\right)\right| \]
      17. pow-sqr37.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left(\color{blue}{{x}^{\left(2 \cdot 3\right)}} \cdot x\right)\right)\right| \]
      18. metadata-eval37.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left({x}^{\color{blue}{6}} \cdot x\right)\right)\right| \]
    5. Simplified37.0%

      \[\leadsto \left|\color{blue}{\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot {x}^{7}\right)}\right| \]
    6. Step-by-step derivation
      1. add-cube-cbrt37.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \color{blue}{\left(\left(\sqrt[3]{0.047619047619047616 \cdot {x}^{7}} \cdot \sqrt[3]{0.047619047619047616 \cdot {x}^{7}}\right) \cdot \sqrt[3]{0.047619047619047616 \cdot {x}^{7}}\right)}\right| \]
      2. pow337.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \color{blue}{{\left(\sqrt[3]{0.047619047619047616 \cdot {x}^{7}}\right)}^{3}}\right| \]
    7. Applied egg-rr37.0%

      \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \color{blue}{{\left(\sqrt[3]{0.047619047619047616 \cdot {x}^{7}}\right)}^{3}}\right| \]
    8. Step-by-step derivation
      1. expm1-log1p-u3.8%

        \[\leadsto \left|\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{1}{\pi}} \cdot {\left(\sqrt[3]{0.047619047619047616 \cdot {x}^{7}}\right)}^{3}\right)\right)}\right| \]
      2. expm1-udef3.5%

        \[\leadsto \left|\color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{1}{\pi}} \cdot {\left(\sqrt[3]{0.047619047619047616 \cdot {x}^{7}}\right)}^{3}\right)} - 1}\right| \]
      3. rem-cube-cbrt3.5%

        \[\leadsto \left|e^{\mathsf{log1p}\left(\sqrt{\frac{1}{\pi}} \cdot \color{blue}{\left(0.047619047619047616 \cdot {x}^{7}\right)}\right)} - 1\right| \]
      4. *-commutative3.5%

        \[\leadsto \left|e^{\mathsf{log1p}\left(\color{blue}{\left(0.047619047619047616 \cdot {x}^{7}\right) \cdot \sqrt{\frac{1}{\pi}}}\right)} - 1\right| \]
      5. sqrt-div3.5%

        \[\leadsto \left|e^{\mathsf{log1p}\left(\left(0.047619047619047616 \cdot {x}^{7}\right) \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\pi}}}\right)} - 1\right| \]
      6. metadata-eval3.5%

        \[\leadsto \left|e^{\mathsf{log1p}\left(\left(0.047619047619047616 \cdot {x}^{7}\right) \cdot \frac{\color{blue}{1}}{\sqrt{\pi}}\right)} - 1\right| \]
    9. Applied egg-rr3.5%

      \[\leadsto \left|\color{blue}{e^{\mathsf{log1p}\left(\left(0.047619047619047616 \cdot {x}^{7}\right) \cdot \frac{1}{\sqrt{\pi}}\right)} - 1}\right| \]
    10. Step-by-step derivation
      1. expm1-def3.8%

        \[\leadsto \left|\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(0.047619047619047616 \cdot {x}^{7}\right) \cdot \frac{1}{\sqrt{\pi}}\right)\right)}\right| \]
      2. expm1-log1p37.0%

        \[\leadsto \left|\color{blue}{\left(0.047619047619047616 \cdot {x}^{7}\right) \cdot \frac{1}{\sqrt{\pi}}}\right| \]
      3. associate-*r/37.0%

        \[\leadsto \left|\color{blue}{\frac{\left(0.047619047619047616 \cdot {x}^{7}\right) \cdot 1}{\sqrt{\pi}}}\right| \]
      4. *-rgt-identity37.0%

        \[\leadsto \left|\frac{\color{blue}{0.047619047619047616 \cdot {x}^{7}}}{\sqrt{\pi}}\right| \]
    11. Simplified37.0%

      \[\leadsto \left|\color{blue}{\frac{0.047619047619047616 \cdot {x}^{7}}{\sqrt{\pi}}}\right| \]
    12. Step-by-step derivation
      1. add-sqr-sqrt3.3%

        \[\leadsto \left|\color{blue}{\sqrt{\frac{0.047619047619047616 \cdot {x}^{7}}{\sqrt{\pi}}} \cdot \sqrt{\frac{0.047619047619047616 \cdot {x}^{7}}{\sqrt{\pi}}}}\right| \]
      2. sqrt-unprod34.8%

        \[\leadsto \left|\color{blue}{\sqrt{\frac{0.047619047619047616 \cdot {x}^{7}}{\sqrt{\pi}} \cdot \frac{0.047619047619047616 \cdot {x}^{7}}{\sqrt{\pi}}}}\right| \]
      3. frac-times34.8%

        \[\leadsto \left|\sqrt{\color{blue}{\frac{\left(0.047619047619047616 \cdot {x}^{7}\right) \cdot \left(0.047619047619047616 \cdot {x}^{7}\right)}{\sqrt{\pi} \cdot \sqrt{\pi}}}}\right| \]
      4. pow234.8%

        \[\leadsto \left|\sqrt{\frac{\color{blue}{{\left(0.047619047619047616 \cdot {x}^{7}\right)}^{2}}}{\sqrt{\pi} \cdot \sqrt{\pi}}}\right| \]
      5. add-sqr-sqrt34.8%

        \[\leadsto \left|\sqrt{\frac{{\left(0.047619047619047616 \cdot {x}^{7}\right)}^{2}}{\color{blue}{\pi}}}\right| \]
    13. Applied egg-rr34.8%

      \[\leadsto \left|\color{blue}{\sqrt{\frac{{\left(0.047619047619047616 \cdot {x}^{7}\right)}^{2}}{\pi}}}\right| \]
    14. Step-by-step derivation
      1. unpow234.8%

        \[\leadsto \left|\sqrt{\frac{\color{blue}{\left(0.047619047619047616 \cdot {x}^{7}\right) \cdot \left(0.047619047619047616 \cdot {x}^{7}\right)}}{\pi}}\right| \]
      2. *-commutative34.8%

        \[\leadsto \left|\sqrt{\frac{\color{blue}{\left({x}^{7} \cdot 0.047619047619047616\right)} \cdot \left(0.047619047619047616 \cdot {x}^{7}\right)}{\pi}}\right| \]
      3. *-commutative34.8%

        \[\leadsto \left|\sqrt{\frac{\left({x}^{7} \cdot 0.047619047619047616\right) \cdot \color{blue}{\left({x}^{7} \cdot 0.047619047619047616\right)}}{\pi}}\right| \]
      4. swap-sqr34.8%

        \[\leadsto \left|\sqrt{\frac{\color{blue}{\left({x}^{7} \cdot {x}^{7}\right) \cdot \left(0.047619047619047616 \cdot 0.047619047619047616\right)}}{\pi}}\right| \]
      5. pow-sqr34.8%

        \[\leadsto \left|\sqrt{\frac{\color{blue}{{x}^{\left(2 \cdot 7\right)}} \cdot \left(0.047619047619047616 \cdot 0.047619047619047616\right)}{\pi}}\right| \]
      6. metadata-eval34.8%

        \[\leadsto \left|\sqrt{\frac{{x}^{\color{blue}{14}} \cdot \left(0.047619047619047616 \cdot 0.047619047619047616\right)}{\pi}}\right| \]
      7. metadata-eval34.8%

        \[\leadsto \left|\sqrt{\frac{{x}^{14} \cdot \color{blue}{0.0022675736961451248}}{\pi}}\right| \]
    15. Simplified34.8%

      \[\leadsto \left|\color{blue}{\sqrt{\frac{{x}^{14} \cdot 0.0022675736961451248}{\pi}}}\right| \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.15:\\ \;\;\;\;\left|{\pi}^{-0.5} \cdot \left(x \cdot 2 + 0.6666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sqrt{\frac{{x}^{14} \cdot 0.0022675736961451248}{\pi}}\right|\\ \end{array} \]

Alternative 10: 89.3% accurate, 4.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2.15:\\ \;\;\;\;\left|{\pi}^{-0.5} \cdot \left(x \cdot 2 + 0.6666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{0.047619047619047616}{\frac{\sqrt{\pi}}{{x}^{7}}}\right|\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= x 2.15)
   (fabs (* (pow PI -0.5) (+ (* x 2.0) (* 0.6666666666666666 (* x (* x x))))))
   (fabs (/ 0.047619047619047616 (/ (sqrt PI) (pow x 7.0))))))
double code(double x) {
	double tmp;
	if (x <= 2.15) {
		tmp = fabs((pow(((double) M_PI), -0.5) * ((x * 2.0) + (0.6666666666666666 * (x * (x * x))))));
	} else {
		tmp = fabs((0.047619047619047616 / (sqrt(((double) M_PI)) / pow(x, 7.0))));
	}
	return tmp;
}
public static double code(double x) {
	double tmp;
	if (x <= 2.15) {
		tmp = Math.abs((Math.pow(Math.PI, -0.5) * ((x * 2.0) + (0.6666666666666666 * (x * (x * x))))));
	} else {
		tmp = Math.abs((0.047619047619047616 / (Math.sqrt(Math.PI) / Math.pow(x, 7.0))));
	}
	return tmp;
}
def code(x):
	tmp = 0
	if x <= 2.15:
		tmp = math.fabs((math.pow(math.pi, -0.5) * ((x * 2.0) + (0.6666666666666666 * (x * (x * x))))))
	else:
		tmp = math.fabs((0.047619047619047616 / (math.sqrt(math.pi) / math.pow(x, 7.0))))
	return tmp
function code(x)
	tmp = 0.0
	if (x <= 2.15)
		tmp = abs(Float64((pi ^ -0.5) * Float64(Float64(x * 2.0) + Float64(0.6666666666666666 * Float64(x * Float64(x * x))))));
	else
		tmp = abs(Float64(0.047619047619047616 / Float64(sqrt(pi) / (x ^ 7.0))));
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if (x <= 2.15)
		tmp = abs(((pi ^ -0.5) * ((x * 2.0) + (0.6666666666666666 * (x * (x * x))))));
	else
		tmp = abs((0.047619047619047616 / (sqrt(pi) / (x ^ 7.0))));
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[x, 2.15], N[Abs[N[(N[Power[Pi, -0.5], $MachinePrecision] * N[(N[(x * 2.0), $MachinePrecision] + N[(0.6666666666666666 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(0.047619047619047616 / N[(N[Sqrt[Pi], $MachinePrecision] / N[Power[x, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.15:\\
\;\;\;\;\left|{\pi}^{-0.5} \cdot \left(x \cdot 2 + 0.6666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{0.047619047619047616}{\frac{\sqrt{\pi}}{{x}^{7}}}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.14999999999999991

    1. Initial program 99.9%

      \[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]
    2. Simplified99.4%

      \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(0.047619047619047616, \left({\left(\left|x\right|\right)}^{3} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right), \mathsf{fma}\left(2, \left|x\right|, \mathsf{fma}\left(0.6666666666666666, {\left(\left|x\right|\right)}^{3}, {\left(\left|x\right|\right)}^{3} \cdot \left(\left(x \cdot x\right) \cdot 0.2\right)\right)\right)\right)}{\sqrt{\pi}}\right|} \]
    3. Applied egg-rr99.9%

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right) \cdot {\pi}^{-0.5}}\right| \]
    4. Step-by-step derivation
      1. *-commutative99.9%

        \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
      2. *-commutative99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{6} \cdot x}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      3. pow-plus99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{\left(6 + 1\right)}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      4. metadata-eval99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{\color{blue}{7}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
      5. fma-udef99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{2 \cdot x + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)}\right)\right| \]
      6. *-commutative99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{x \cdot 2} + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right| \]
      7. fma-def99.9%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)}\right)\right| \]
    5. Simplified99.9%

      \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
    6. Taylor expanded in x around 0 88.4%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \color{blue}{\left(0.6666666666666666 \cdot {x}^{3} + 2 \cdot x\right)}\right| \]
    7. Step-by-step derivation
      1. unpow388.4%

        \[\leadsto \left|{\pi}^{-0.5} \cdot \left(0.6666666666666666 \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot x\right)} + 2 \cdot x\right)\right| \]
    8. Applied egg-rr88.4%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \left(0.6666666666666666 \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot x\right)} + 2 \cdot x\right)\right| \]

    if 2.14999999999999991 < x

    1. Initial program 99.9%

      \[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]
    2. Simplified99.4%

      \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(0.047619047619047616, \left({\left(\left|x\right|\right)}^{3} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right), \mathsf{fma}\left(2, \left|x\right|, \mathsf{fma}\left(0.6666666666666666, {\left(\left|x\right|\right)}^{3}, {\left(\left|x\right|\right)}^{3} \cdot \left(\left(x \cdot x\right) \cdot 0.2\right)\right)\right)\right)}{\sqrt{\pi}}\right|} \]
    3. Taylor expanded in x around inf 37.0%

      \[\leadsto \left|\color{blue}{0.047619047619047616 \cdot \left(\left({x}^{4} \cdot {\left(\left|x\right|\right)}^{3}\right) \cdot \sqrt{\frac{1}{\pi}}\right)}\right| \]
    4. Step-by-step derivation
      1. *-commutative37.0%

        \[\leadsto \left|\color{blue}{\left(\left({x}^{4} \cdot {\left(\left|x\right|\right)}^{3}\right) \cdot \sqrt{\frac{1}{\pi}}\right) \cdot 0.047619047619047616}\right| \]
      2. *-commutative37.0%

        \[\leadsto \left|\color{blue}{\left(\sqrt{\frac{1}{\pi}} \cdot \left({x}^{4} \cdot {\left(\left|x\right|\right)}^{3}\right)\right)} \cdot 0.047619047619047616\right| \]
      3. associate-*l*37.0%

        \[\leadsto \left|\color{blue}{\sqrt{\frac{1}{\pi}} \cdot \left(\left({x}^{4} \cdot {\left(\left|x\right|\right)}^{3}\right) \cdot 0.047619047619047616\right)}\right| \]
      4. *-commutative37.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \color{blue}{\left(0.047619047619047616 \cdot \left({x}^{4} \cdot {\left(\left|x\right|\right)}^{3}\right)\right)}\right| \]
      5. unpow337.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left({x}^{4} \cdot \color{blue}{\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)}\right)\right)\right| \]
      6. sqr-abs37.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left({x}^{4} \cdot \left(\color{blue}{\left(x \cdot x\right)} \cdot \left|x\right|\right)\right)\right)\right| \]
      7. associate-*r*37.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \color{blue}{\left(\left({x}^{4} \cdot \left(x \cdot x\right)\right) \cdot \left|x\right|\right)}\right)\right| \]
      8. metadata-eval37.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left(\left({x}^{\color{blue}{\left(2 \cdot 2\right)}} \cdot \left(x \cdot x\right)\right) \cdot \left|x\right|\right)\right)\right| \]
      9. pow-sqr37.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left(\left(\color{blue}{\left({x}^{2} \cdot {x}^{2}\right)} \cdot \left(x \cdot x\right)\right) \cdot \left|x\right|\right)\right)\right| \]
      10. unpow237.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left(\left(\left(\color{blue}{\left(x \cdot x\right)} \cdot {x}^{2}\right) \cdot \left(x \cdot x\right)\right) \cdot \left|x\right|\right)\right)\right| \]
      11. unpow237.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left(\left(\left(\left(x \cdot x\right) \cdot \color{blue}{\left(x \cdot x\right)}\right) \cdot \left(x \cdot x\right)\right) \cdot \left|x\right|\right)\right)\right| \]
      12. unpow337.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left(\color{blue}{{\left(x \cdot x\right)}^{3}} \cdot \left|x\right|\right)\right)\right| \]
      13. cube-prod37.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left(\color{blue}{\left({x}^{3} \cdot {x}^{3}\right)} \cdot \left|x\right|\right)\right)\right| \]
      14. rem-square-sqrt1.8%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left(\left({x}^{3} \cdot {x}^{3}\right) \cdot \left|\color{blue}{\sqrt{x} \cdot \sqrt{x}}\right|\right)\right)\right| \]
      15. fabs-sqr1.8%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left(\left({x}^{3} \cdot {x}^{3}\right) \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)}\right)\right)\right| \]
      16. rem-square-sqrt37.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left(\left({x}^{3} \cdot {x}^{3}\right) \cdot \color{blue}{x}\right)\right)\right| \]
      17. pow-sqr37.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left(\color{blue}{{x}^{\left(2 \cdot 3\right)}} \cdot x\right)\right)\right| \]
      18. metadata-eval37.0%

        \[\leadsto \left|\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot \left({x}^{\color{blue}{6}} \cdot x\right)\right)\right| \]
    5. Simplified37.0%

      \[\leadsto \left|\color{blue}{\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot {x}^{7}\right)}\right| \]
    6. Step-by-step derivation
      1. add-cbrt-cube34.4%

        \[\leadsto \left|\color{blue}{\sqrt[3]{\left(\left(\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot {x}^{7}\right)\right) \cdot \left(\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot {x}^{7}\right)\right)\right) \cdot \left(\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot {x}^{7}\right)\right)}}\right| \]
      2. pow334.4%

        \[\leadsto \left|\sqrt[3]{\color{blue}{{\left(\sqrt{\frac{1}{\pi}} \cdot \left(0.047619047619047616 \cdot {x}^{7}\right)\right)}^{3}}}\right| \]
      3. *-commutative34.4%

        \[\leadsto \left|\sqrt[3]{{\color{blue}{\left(\left(0.047619047619047616 \cdot {x}^{7}\right) \cdot \sqrt{\frac{1}{\pi}}\right)}}^{3}}\right| \]
      4. pow1/234.4%

        \[\leadsto \left|\sqrt[3]{{\left(\left(0.047619047619047616 \cdot {x}^{7}\right) \cdot \color{blue}{{\left(\frac{1}{\pi}\right)}^{0.5}}\right)}^{3}}\right| \]
      5. inv-pow34.4%

        \[\leadsto \left|\sqrt[3]{{\left(\left(0.047619047619047616 \cdot {x}^{7}\right) \cdot {\color{blue}{\left({\pi}^{-1}\right)}}^{0.5}\right)}^{3}}\right| \]
      6. pow-pow34.4%

        \[\leadsto \left|\sqrt[3]{{\left(\left(0.047619047619047616 \cdot {x}^{7}\right) \cdot \color{blue}{{\pi}^{\left(-1 \cdot 0.5\right)}}\right)}^{3}}\right| \]
      7. metadata-eval34.4%

        \[\leadsto \left|\sqrt[3]{{\left(\left(0.047619047619047616 \cdot {x}^{7}\right) \cdot {\pi}^{\color{blue}{-0.5}}\right)}^{3}}\right| \]
    7. Applied egg-rr34.4%

      \[\leadsto \left|\color{blue}{\sqrt[3]{{\left(\left(0.047619047619047616 \cdot {x}^{7}\right) \cdot {\pi}^{-0.5}\right)}^{3}}}\right| \]
    8. Step-by-step derivation
      1. rem-cbrt-cube37.0%

        \[\leadsto \left|\color{blue}{\left(0.047619047619047616 \cdot {x}^{7}\right) \cdot {\pi}^{-0.5}}\right| \]
      2. metadata-eval37.0%

        \[\leadsto \left|\left(0.047619047619047616 \cdot {x}^{7}\right) \cdot {\pi}^{\color{blue}{\left(-0.5\right)}}\right| \]
      3. pow-flip37.0%

        \[\leadsto \left|\left(0.047619047619047616 \cdot {x}^{7}\right) \cdot \color{blue}{\frac{1}{{\pi}^{0.5}}}\right| \]
      4. pow1/237.0%

        \[\leadsto \left|\left(0.047619047619047616 \cdot {x}^{7}\right) \cdot \frac{1}{\color{blue}{\sqrt{\pi}}}\right| \]
      5. div-inv37.0%

        \[\leadsto \left|\color{blue}{\frac{0.047619047619047616 \cdot {x}^{7}}{\sqrt{\pi}}}\right| \]
      6. associate-/l*37.0%

        \[\leadsto \left|\color{blue}{\frac{0.047619047619047616}{\frac{\sqrt{\pi}}{{x}^{7}}}}\right| \]
    9. Applied egg-rr37.0%

      \[\leadsto \left|\color{blue}{\frac{0.047619047619047616}{\frac{\sqrt{\pi}}{{x}^{7}}}}\right| \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.15:\\ \;\;\;\;\left|{\pi}^{-0.5} \cdot \left(x \cdot 2 + 0.6666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{0.047619047619047616}{\frac{\sqrt{\pi}}{{x}^{7}}}\right|\\ \end{array} \]

Alternative 11: 89.3% accurate, 6.2× speedup?

\[\begin{array}{l} \\ \left|{\pi}^{-0.5} \cdot \left(x \cdot 2 + 0.6666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right| \end{array} \]
(FPCore (x)
 :precision binary64
 (fabs (* (pow PI -0.5) (+ (* x 2.0) (* 0.6666666666666666 (* x (* x x)))))))
double code(double x) {
	return fabs((pow(((double) M_PI), -0.5) * ((x * 2.0) + (0.6666666666666666 * (x * (x * x))))));
}
public static double code(double x) {
	return Math.abs((Math.pow(Math.PI, -0.5) * ((x * 2.0) + (0.6666666666666666 * (x * (x * x))))));
}
def code(x):
	return math.fabs((math.pow(math.pi, -0.5) * ((x * 2.0) + (0.6666666666666666 * (x * (x * x))))))
function code(x)
	return abs(Float64((pi ^ -0.5) * Float64(Float64(x * 2.0) + Float64(0.6666666666666666 * Float64(x * Float64(x * x))))))
end
function tmp = code(x)
	tmp = abs(((pi ^ -0.5) * ((x * 2.0) + (0.6666666666666666 * (x * (x * x))))));
end
code[x_] := N[Abs[N[(N[Power[Pi, -0.5], $MachinePrecision] * N[(N[(x * 2.0), $MachinePrecision] + N[(0.6666666666666666 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\left|{\pi}^{-0.5} \cdot \left(x \cdot 2 + 0.6666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right|
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]
  2. Simplified99.4%

    \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(0.047619047619047616, \left({\left(\left|x\right|\right)}^{3} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right), \mathsf{fma}\left(2, \left|x\right|, \mathsf{fma}\left(0.6666666666666666, {\left(\left|x\right|\right)}^{3}, {\left(\left|x\right|\right)}^{3} \cdot \left(\left(x \cdot x\right) \cdot 0.2\right)\right)\right)\right)}{\sqrt{\pi}}\right|} \]
  3. Applied egg-rr99.9%

    \[\leadsto \left|\color{blue}{\mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right) \cdot {\pi}^{-0.5}}\right| \]
  4. Step-by-step derivation
    1. *-commutative99.9%

      \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
    2. *-commutative99.9%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{6} \cdot x}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
    3. pow-plus99.9%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{\left(6 + 1\right)}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
    4. metadata-eval99.9%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{\color{blue}{7}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
    5. fma-udef99.9%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{2 \cdot x + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)}\right)\right| \]
    6. *-commutative99.9%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{x \cdot 2} + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right| \]
    7. fma-def99.9%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)}\right)\right| \]
  5. Simplified99.9%

    \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
  6. Taylor expanded in x around 0 88.4%

    \[\leadsto \left|{\pi}^{-0.5} \cdot \color{blue}{\left(0.6666666666666666 \cdot {x}^{3} + 2 \cdot x\right)}\right| \]
  7. Step-by-step derivation
    1. unpow388.4%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \left(0.6666666666666666 \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot x\right)} + 2 \cdot x\right)\right| \]
  8. Applied egg-rr88.4%

    \[\leadsto \left|{\pi}^{-0.5} \cdot \left(0.6666666666666666 \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot x\right)} + 2 \cdot x\right)\right| \]
  9. Final simplification88.4%

    \[\leadsto \left|{\pi}^{-0.5} \cdot \left(x \cdot 2 + 0.6666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right| \]

Alternative 12: 67.3% accurate, 6.4× speedup?

\[\begin{array}{l} \\ \left|{\pi}^{-0.5} \cdot \left(x \cdot 2\right)\right| \end{array} \]
(FPCore (x) :precision binary64 (fabs (* (pow PI -0.5) (* x 2.0))))
double code(double x) {
	return fabs((pow(((double) M_PI), -0.5) * (x * 2.0)));
}
public static double code(double x) {
	return Math.abs((Math.pow(Math.PI, -0.5) * (x * 2.0)));
}
def code(x):
	return math.fabs((math.pow(math.pi, -0.5) * (x * 2.0)))
function code(x)
	return abs(Float64((pi ^ -0.5) * Float64(x * 2.0)))
end
function tmp = code(x)
	tmp = abs(((pi ^ -0.5) * (x * 2.0)));
end
code[x_] := N[Abs[N[(N[Power[Pi, -0.5], $MachinePrecision] * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\left|{\pi}^{-0.5} \cdot \left(x \cdot 2\right)\right|
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]
  2. Simplified99.4%

    \[\leadsto \color{blue}{\left|\frac{\mathsf{fma}\left(0.047619047619047616, \left({\left(\left|x\right|\right)}^{3} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right), \mathsf{fma}\left(2, \left|x\right|, \mathsf{fma}\left(0.6666666666666666, {\left(\left|x\right|\right)}^{3}, {\left(\left|x\right|\right)}^{3} \cdot \left(\left(x \cdot x\right) \cdot 0.2\right)\right)\right)\right)}{\sqrt{\pi}}\right|} \]
  3. Applied egg-rr99.9%

    \[\leadsto \left|\color{blue}{\mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right) \cdot {\pi}^{-0.5}}\right| \]
  4. Step-by-step derivation
    1. *-commutative99.9%

      \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, x \cdot {x}^{6}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
    2. *-commutative99.9%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{6} \cdot x}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
    3. pow-plus99.9%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, \color{blue}{{x}^{\left(6 + 1\right)}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
    4. metadata-eval99.9%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{\color{blue}{7}}, \mathsf{fma}\left(2, x, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)\right| \]
    5. fma-udef99.9%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{2 \cdot x + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)}\right)\right| \]
    6. *-commutative99.9%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{x \cdot 2} + \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right| \]
    7. fma-def99.9%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \color{blue}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)}\right)\right| \]
  5. Simplified99.9%

    \[\leadsto \left|\color{blue}{{\pi}^{-0.5} \cdot \mathsf{fma}\left(0.047619047619047616, {x}^{7}, \mathsf{fma}\left(x, 2, \mathsf{fma}\left(0.6666666666666666, {x}^{3}, 0.2 \cdot {x}^{5}\right)\right)\right)}\right| \]
  6. Taylor expanded in x around 0 66.5%

    \[\leadsto \left|{\pi}^{-0.5} \cdot \color{blue}{\left(2 \cdot x\right)}\right| \]
  7. Step-by-step derivation
    1. *-commutative66.5%

      \[\leadsto \left|{\pi}^{-0.5} \cdot \color{blue}{\left(x \cdot 2\right)}\right| \]
  8. Simplified66.5%

    \[\leadsto \left|{\pi}^{-0.5} \cdot \color{blue}{\left(x \cdot 2\right)}\right| \]
  9. Final simplification66.5%

    \[\leadsto \left|{\pi}^{-0.5} \cdot \left(x \cdot 2\right)\right| \]

Reproduce

?
herbie shell --seed 2023279 
(FPCore (x)
  :name "Jmat.Real.erfi, branch x less than or equal to 0.5"
  :precision binary64
  :pre (<= x 0.5)
  (fabs (* (/ 1.0 (sqrt PI)) (+ (+ (+ (* 2.0 (fabs x)) (* (/ 2.0 3.0) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1.0 5.0) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1.0 21.0) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)))))))