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

Percentage Accurate: 99.9% → 99.9%
Time: 5.1s
Alternatives: 15
Speedup: 1.9×

Specification

?
\[x \leq 0.5\]
\[\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} \]
(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}
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}

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 15 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.9% accurate, 1.0× speedup?

\[\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} \]
(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}
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}

Alternative 1: 99.9% accurate, 1.9× speedup?

\[\left|0.5641895835477563 \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, 0.047619047619047616, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(0.2 \cdot x, x, 0.6666666666666666\right)\right)\right)\right)\right| \]
(FPCore (x)
 :precision binary64
 (fabs
  (*
   0.5641895835477563
   (fma
    (fabs x)
    2.0
    (fma
     (pow (fabs x) 7.0)
     0.047619047619047616
     (* (fabs x) (* (* x x) (fma (* 0.2 x) x 0.6666666666666666))))))))
double code(double x) {
	return fabs((0.5641895835477563 * fma(fabs(x), 2.0, fma(pow(fabs(x), 7.0), 0.047619047619047616, (fabs(x) * ((x * x) * fma((0.2 * x), x, 0.6666666666666666)))))));
}
function code(x)
	return abs(Float64(0.5641895835477563 * fma(abs(x), 2.0, fma((abs(x) ^ 7.0), 0.047619047619047616, Float64(abs(x) * Float64(Float64(x * x) * fma(Float64(0.2 * x), x, 0.6666666666666666)))))))
end
code[x_] := N[Abs[N[(0.5641895835477563 * N[(N[Abs[x], $MachinePrecision] * 2.0 + N[(N[Power[N[Abs[x], $MachinePrecision], 7.0], $MachinePrecision] * 0.047619047619047616 + N[(N[Abs[x], $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(N[(0.2 * x), $MachinePrecision] * x + 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\left|0.5641895835477563 \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, 0.047619047619047616, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(0.2 \cdot x, x, 0.6666666666666666\right)\right)\right)\right)\right|
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. Applied rewrites99.9%

    \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \color{blue}{\mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left(\left|x\right|, \mathsf{fma}\left(0.6666666666666666 \cdot x, x, \left(0.2 \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right), {\left(\left|x\right|\right)}^{7} \cdot 0.047619047619047616\right)\right)}\right| \]
  3. Step-by-step derivation
    1. lift-fma.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \color{blue}{\left|x\right| \cdot \mathsf{fma}\left(\frac{2}{3} \cdot x, x, \left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right) + {\left(\left|x\right|\right)}^{7} \cdot \frac{1}{21}}\right)\right| \]
    2. +-commutativeN/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \color{blue}{{\left(\left|x\right|\right)}^{7} \cdot \frac{1}{21} + \left|x\right| \cdot \mathsf{fma}\left(\frac{2}{3} \cdot x, x, \left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)}\right)\right| \]
    3. lift-*.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \color{blue}{{\left(\left|x\right|\right)}^{7} \cdot \frac{1}{21}} + \left|x\right| \cdot \mathsf{fma}\left(\frac{2}{3} \cdot x, x, \left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)\right)\right| \]
    4. lower-fma.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \color{blue}{\mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \mathsf{fma}\left(\frac{2}{3} \cdot x, x, \left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)\right)}\right)\right| \]
    5. lower-*.f6499.9%

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, 0.047619047619047616, \color{blue}{\left|x\right| \cdot \mathsf{fma}\left(0.6666666666666666 \cdot x, x, \left(0.2 \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)}\right)\right)\right| \]
    6. lift-fma.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \color{blue}{\left(\left(\frac{2}{3} \cdot x\right) \cdot x + \left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)}\right)\right)\right| \]
    7. +-commutativeN/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \color{blue}{\left(\left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right) + \left(\frac{2}{3} \cdot x\right) \cdot x\right)}\right)\right)\right| \]
    8. lift-*.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\color{blue}{\left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)} + \left(\frac{2}{3} \cdot x\right) \cdot x\right)\right)\right)\right| \]
    9. lift-*.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right) + \color{blue}{\left(\frac{2}{3} \cdot x\right)} \cdot x\right)\right)\right)\right| \]
    10. associate-*l*N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right) + \color{blue}{\frac{2}{3} \cdot \left(x \cdot x\right)}\right)\right)\right)\right| \]
    11. lift-*.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right) + \frac{2}{3} \cdot \color{blue}{\left(x \cdot x\right)}\right)\right)\right)\right| \]
    12. distribute-rgt-outN/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot \left(\frac{1}{5} \cdot \left(x \cdot x\right) + \frac{2}{3}\right)\right)}\right)\right)\right| \]
    13. lower-*.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot \left(\frac{1}{5} \cdot \left(x \cdot x\right) + \frac{2}{3}\right)\right)}\right)\right)\right| \]
    14. lift-*.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \left(\color{blue}{\frac{1}{5} \cdot \left(x \cdot x\right)} + \frac{2}{3}\right)\right)\right)\right)\right| \]
    15. lift-*.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \left(\frac{1}{5} \cdot \color{blue}{\left(x \cdot x\right)} + \frac{2}{3}\right)\right)\right)\right)\right| \]
    16. associate-*r*N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \left(\color{blue}{\left(\frac{1}{5} \cdot x\right) \cdot x} + \frac{2}{3}\right)\right)\right)\right)\right| \]
    17. lower-fma.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{5} \cdot x, x, \frac{2}{3}\right)}\right)\right)\right)\right| \]
    18. lower-*.f6499.9%

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, 0.047619047619047616, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(\color{blue}{0.2 \cdot x}, x, 0.6666666666666666\right)\right)\right)\right)\right| \]
  4. Applied rewrites99.9%

    \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \color{blue}{\mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, 0.047619047619047616, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(0.2 \cdot x, x, 0.6666666666666666\right)\right)\right)}\right)\right| \]
  5. Evaluated real constant99.9%

    \[\leadsto \left|\color{blue}{0.5641895835477563} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, 0.047619047619047616, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(0.2 \cdot x, x, 0.6666666666666666\right)\right)\right)\right)\right| \]
  6. Add Preprocessing

Alternative 2: 99.4% accurate, 1.9× speedup?

\[\frac{\left|\mathsf{fma}\left(\left|x\right|, 2 + \left(x \cdot x\right) \cdot \mathsf{fma}\left(0.2 \cdot x, x, 0.6666666666666666\right), {\left(\left|x\right|\right)}^{7} \cdot 0.047619047619047616\right)\right|}{\sqrt{\pi}} \]
(FPCore (x)
 :precision binary64
 (/
  (fabs
   (fma
    (fabs x)
    (+ 2.0 (* (* x x) (fma (* 0.2 x) x 0.6666666666666666)))
    (* (pow (fabs x) 7.0) 0.047619047619047616)))
  (sqrt PI)))
double code(double x) {
	return fabs(fma(fabs(x), (2.0 + ((x * x) * fma((0.2 * x), x, 0.6666666666666666))), (pow(fabs(x), 7.0) * 0.047619047619047616))) / sqrt(((double) M_PI));
}
function code(x)
	return Float64(abs(fma(abs(x), Float64(2.0 + Float64(Float64(x * x) * fma(Float64(0.2 * x), x, 0.6666666666666666))), Float64((abs(x) ^ 7.0) * 0.047619047619047616))) / sqrt(pi))
end
code[x_] := N[(N[Abs[N[(N[Abs[x], $MachinePrecision] * N[(2.0 + N[(N[(x * x), $MachinePrecision] * N[(N[(0.2 * x), $MachinePrecision] * x + 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[Abs[x], $MachinePrecision], 7.0], $MachinePrecision] * 0.047619047619047616), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]
\frac{\left|\mathsf{fma}\left(\left|x\right|, 2 + \left(x \cdot x\right) \cdot \mathsf{fma}\left(0.2 \cdot x, x, 0.6666666666666666\right), {\left(\left|x\right|\right)}^{7} \cdot 0.047619047619047616\right)\right|}{\sqrt{\pi}}
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. Applied rewrites99.4%

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

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

Alternative 3: 99.3% accurate, 2.2× speedup?

\[\left|0.5641895835477563 \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, 0.047619047619047616, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot 0.6666666666666666\right)\right)\right)\right| \]
(FPCore (x)
 :precision binary64
 (fabs
  (*
   0.5641895835477563
   (fma
    (fabs x)
    2.0
    (fma
     (pow (fabs x) 7.0)
     0.047619047619047616
     (* (fabs x) (* (* x x) 0.6666666666666666)))))))
double code(double x) {
	return fabs((0.5641895835477563 * fma(fabs(x), 2.0, fma(pow(fabs(x), 7.0), 0.047619047619047616, (fabs(x) * ((x * x) * 0.6666666666666666))))));
}
function code(x)
	return abs(Float64(0.5641895835477563 * fma(abs(x), 2.0, fma((abs(x) ^ 7.0), 0.047619047619047616, Float64(abs(x) * Float64(Float64(x * x) * 0.6666666666666666))))))
end
code[x_] := N[Abs[N[(0.5641895835477563 * N[(N[Abs[x], $MachinePrecision] * 2.0 + N[(N[Power[N[Abs[x], $MachinePrecision], 7.0], $MachinePrecision] * 0.047619047619047616 + N[(N[Abs[x], $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\left|0.5641895835477563 \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, 0.047619047619047616, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot 0.6666666666666666\right)\right)\right)\right|
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. Applied rewrites99.9%

    \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \color{blue}{\mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left(\left|x\right|, \mathsf{fma}\left(0.6666666666666666 \cdot x, x, \left(0.2 \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right), {\left(\left|x\right|\right)}^{7} \cdot 0.047619047619047616\right)\right)}\right| \]
  3. Step-by-step derivation
    1. lift-fma.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \color{blue}{\left|x\right| \cdot \mathsf{fma}\left(\frac{2}{3} \cdot x, x, \left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right) + {\left(\left|x\right|\right)}^{7} \cdot \frac{1}{21}}\right)\right| \]
    2. +-commutativeN/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \color{blue}{{\left(\left|x\right|\right)}^{7} \cdot \frac{1}{21} + \left|x\right| \cdot \mathsf{fma}\left(\frac{2}{3} \cdot x, x, \left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)}\right)\right| \]
    3. lift-*.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \color{blue}{{\left(\left|x\right|\right)}^{7} \cdot \frac{1}{21}} + \left|x\right| \cdot \mathsf{fma}\left(\frac{2}{3} \cdot x, x, \left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)\right)\right| \]
    4. lower-fma.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \color{blue}{\mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \mathsf{fma}\left(\frac{2}{3} \cdot x, x, \left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)\right)}\right)\right| \]
    5. lower-*.f6499.9%

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, 0.047619047619047616, \color{blue}{\left|x\right| \cdot \mathsf{fma}\left(0.6666666666666666 \cdot x, x, \left(0.2 \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)}\right)\right)\right| \]
    6. lift-fma.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \color{blue}{\left(\left(\frac{2}{3} \cdot x\right) \cdot x + \left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)}\right)\right)\right| \]
    7. +-commutativeN/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \color{blue}{\left(\left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right) + \left(\frac{2}{3} \cdot x\right) \cdot x\right)}\right)\right)\right| \]
    8. lift-*.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\color{blue}{\left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)} + \left(\frac{2}{3} \cdot x\right) \cdot x\right)\right)\right)\right| \]
    9. lift-*.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right) + \color{blue}{\left(\frac{2}{3} \cdot x\right)} \cdot x\right)\right)\right)\right| \]
    10. associate-*l*N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right) + \color{blue}{\frac{2}{3} \cdot \left(x \cdot x\right)}\right)\right)\right)\right| \]
    11. lift-*.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right) + \frac{2}{3} \cdot \color{blue}{\left(x \cdot x\right)}\right)\right)\right)\right| \]
    12. distribute-rgt-outN/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot \left(\frac{1}{5} \cdot \left(x \cdot x\right) + \frac{2}{3}\right)\right)}\right)\right)\right| \]
    13. lower-*.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot \left(\frac{1}{5} \cdot \left(x \cdot x\right) + \frac{2}{3}\right)\right)}\right)\right)\right| \]
    14. lift-*.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \left(\color{blue}{\frac{1}{5} \cdot \left(x \cdot x\right)} + \frac{2}{3}\right)\right)\right)\right)\right| \]
    15. lift-*.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \left(\frac{1}{5} \cdot \color{blue}{\left(x \cdot x\right)} + \frac{2}{3}\right)\right)\right)\right)\right| \]
    16. associate-*r*N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \left(\color{blue}{\left(\frac{1}{5} \cdot x\right) \cdot x} + \frac{2}{3}\right)\right)\right)\right)\right| \]
    17. lower-fma.f64N/A

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{5} \cdot x, x, \frac{2}{3}\right)}\right)\right)\right)\right| \]
    18. lower-*.f6499.9%

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, 0.047619047619047616, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(\color{blue}{0.2 \cdot x}, x, 0.6666666666666666\right)\right)\right)\right)\right| \]
  4. Applied rewrites99.9%

    \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \color{blue}{\mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, 0.047619047619047616, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(0.2 \cdot x, x, 0.6666666666666666\right)\right)\right)}\right)\right| \]
  5. Evaluated real constant99.9%

    \[\leadsto \left|\color{blue}{0.5641895835477563} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, 0.047619047619047616, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(0.2 \cdot x, x, 0.6666666666666666\right)\right)\right)\right)\right| \]
  6. Taylor expanded in x around 0

    \[\leadsto \left|0.5641895835477563 \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, 0.047619047619047616, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \color{blue}{\frac{2}{3}}\right)\right)\right)\right| \]
  7. Step-by-step derivation
    1. Applied rewrites99.3%

      \[\leadsto \left|0.5641895835477563 \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, 0.047619047619047616, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \color{blue}{0.6666666666666666}\right)\right)\right)\right| \]
    2. Add Preprocessing

    Alternative 4: 99.0% accurate, 2.9× speedup?

    \[\left|0.5641895835477563 \cdot \left(\left({\left(\left|x\right|\right)}^{7} \cdot 0.047619047619047616 + \left|x\right|\right) + \left|x\right|\right)\right| \]
    (FPCore (x)
     :precision binary64
     (fabs
      (*
       0.5641895835477563
       (+ (+ (* (pow (fabs x) 7.0) 0.047619047619047616) (fabs x)) (fabs x)))))
    double code(double x) {
    	return fabs((0.5641895835477563 * (((pow(fabs(x), 7.0) * 0.047619047619047616) + fabs(x)) + fabs(x))));
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        code = abs((0.5641895835477563d0 * ((((abs(x) ** 7.0d0) * 0.047619047619047616d0) + abs(x)) + abs(x))))
    end function
    
    public static double code(double x) {
    	return Math.abs((0.5641895835477563 * (((Math.pow(Math.abs(x), 7.0) * 0.047619047619047616) + Math.abs(x)) + Math.abs(x))));
    }
    
    def code(x):
    	return math.fabs((0.5641895835477563 * (((math.pow(math.fabs(x), 7.0) * 0.047619047619047616) + math.fabs(x)) + math.fabs(x))))
    
    function code(x)
    	return abs(Float64(0.5641895835477563 * Float64(Float64(Float64((abs(x) ^ 7.0) * 0.047619047619047616) + abs(x)) + abs(x))))
    end
    
    function tmp = code(x)
    	tmp = abs((0.5641895835477563 * ((((abs(x) ^ 7.0) * 0.047619047619047616) + abs(x)) + abs(x))));
    end
    
    code[x_] := N[Abs[N[(0.5641895835477563 * N[(N[(N[(N[Power[N[Abs[x], $MachinePrecision], 7.0], $MachinePrecision] * 0.047619047619047616), $MachinePrecision] + N[Abs[x], $MachinePrecision]), $MachinePrecision] + N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
    
    \left|0.5641895835477563 \cdot \left(\left({\left(\left|x\right|\right)}^{7} \cdot 0.047619047619047616 + \left|x\right|\right) + \left|x\right|\right)\right|
    
    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. Applied rewrites99.9%

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

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \color{blue}{\frac{1}{21} \cdot {\left(\left|x\right|\right)}^{7}}\right)\right| \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \frac{1}{21} \cdot \color{blue}{{\left(\left|x\right|\right)}^{7}}\right)\right| \]
      2. lower-pow.f64N/A

        \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \frac{1}{21} \cdot {\left(\left|x\right|\right)}^{\color{blue}{7}}\right)\right| \]
      3. lower-fabs.f6499.0%

        \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, 0.047619047619047616 \cdot {\left(\left|x\right|\right)}^{7}\right)\right| \]
    5. Applied rewrites99.0%

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \color{blue}{0.047619047619047616 \cdot {\left(\left|x\right|\right)}^{7}}\right)\right| \]
    6. Evaluated real constant99.0%

      \[\leadsto \left|\color{blue}{0.5641895835477563} \cdot \mathsf{fma}\left(\left|x\right|, 2, 0.047619047619047616 \cdot {\left(\left|x\right|\right)}^{7}\right)\right| \]
    7. Step-by-step derivation
      1. lift-fma.f64N/A

        \[\leadsto \left|\frac{5081767996463981}{9007199254740992} \cdot \color{blue}{\left(\left|x\right| \cdot 2 + \frac{1}{21} \cdot {\left(\left|x\right|\right)}^{7}\right)}\right| \]
      2. +-commutativeN/A

        \[\leadsto \left|\frac{5081767996463981}{9007199254740992} \cdot \color{blue}{\left(\frac{1}{21} \cdot {\left(\left|x\right|\right)}^{7} + \left|x\right| \cdot 2\right)}\right| \]
      3. lift-*.f64N/A

        \[\leadsto \left|\frac{5081767996463981}{9007199254740992} \cdot \left(\frac{1}{21} \cdot \color{blue}{{\left(\left|x\right|\right)}^{7}} + \left|x\right| \cdot 2\right)\right| \]
      4. *-commutativeN/A

        \[\leadsto \left|\frac{5081767996463981}{9007199254740992} \cdot \left({\left(\left|x\right|\right)}^{7} \cdot \color{blue}{\frac{1}{21}} + \left|x\right| \cdot 2\right)\right| \]
      5. lift-*.f64N/A

        \[\leadsto \left|\frac{5081767996463981}{9007199254740992} \cdot \left({\left(\left|x\right|\right)}^{7} \cdot \color{blue}{\frac{1}{21}} + \left|x\right| \cdot 2\right)\right| \]
      6. lift-*.f64N/A

        \[\leadsto \left|\frac{5081767996463981}{9007199254740992} \cdot \left({\left(\left|x\right|\right)}^{7} \cdot \color{blue}{\frac{1}{21}} + \mathsf{Rewrite=>}\left(*-commutative, \left(2 \cdot \left|x\right|\right)\right)\right)\right| \]
      7. lift-*.f64N/A

        \[\leadsto \left|\frac{5081767996463981}{9007199254740992} \cdot \left({\left(\left|x\right|\right)}^{7} \cdot \color{blue}{\frac{1}{21}} + \mathsf{Rewrite=>}\left(count-2-rev, \left(\left|x\right| + \left|x\right|\right)\right)\right)\right| \]
      8. associate-+l+N/A

        \[\leadsto \left|\frac{5081767996463981}{9007199254740992} \cdot \color{blue}{\left(\left({\left(\left|x\right|\right)}^{7} \cdot \frac{1}{21} + \left|x\right|\right) + \left|x\right|\right)}\right| \]
      9. lift-+.f64N/A

        \[\leadsto \left|\frac{5081767996463981}{9007199254740992} \cdot \left(\color{blue}{\left({\left(\left|x\right|\right)}^{7} \cdot \frac{1}{21} + \left|x\right|\right)} + \left|x\right|\right)\right| \]
    8. Applied rewrites99.0%

      \[\leadsto \left|0.5641895835477563 \cdot \color{blue}{\left(\left({\left(\left|x\right|\right)}^{7} \cdot 0.047619047619047616 + \left|x\right|\right) + \left|x\right|\right)}\right| \]
    9. Add Preprocessing

    Alternative 5: 99.0% accurate, 3.0× speedup?

    \[\left|\mathsf{fma}\left(2, \left|x\right|, {\left(\left|x\right|\right)}^{7} \cdot 0.047619047619047616\right)\right| \cdot 0.5641895835477563 \]
    (FPCore (x)
     :precision binary64
     (*
      (fabs (fma 2.0 (fabs x) (* (pow (fabs x) 7.0) 0.047619047619047616)))
      0.5641895835477563))
    double code(double x) {
    	return fabs(fma(2.0, fabs(x), (pow(fabs(x), 7.0) * 0.047619047619047616))) * 0.5641895835477563;
    }
    
    function code(x)
    	return Float64(abs(fma(2.0, abs(x), Float64((abs(x) ^ 7.0) * 0.047619047619047616))) * 0.5641895835477563)
    end
    
    code[x_] := N[(N[Abs[N[(2.0 * N[Abs[x], $MachinePrecision] + N[(N[Power[N[Abs[x], $MachinePrecision], 7.0], $MachinePrecision] * 0.047619047619047616), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.5641895835477563), $MachinePrecision]
    
    \left|\mathsf{fma}\left(2, \left|x\right|, {\left(\left|x\right|\right)}^{7} \cdot 0.047619047619047616\right)\right| \cdot 0.5641895835477563
    
    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. Applied rewrites99.9%

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

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \color{blue}{\frac{1}{21} \cdot {\left(\left|x\right|\right)}^{7}}\right)\right| \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \frac{1}{21} \cdot \color{blue}{{\left(\left|x\right|\right)}^{7}}\right)\right| \]
      2. lower-pow.f64N/A

        \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \frac{1}{21} \cdot {\left(\left|x\right|\right)}^{\color{blue}{7}}\right)\right| \]
      3. lower-fabs.f6499.0%

        \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, 0.047619047619047616 \cdot {\left(\left|x\right|\right)}^{7}\right)\right| \]
    5. Applied rewrites99.0%

      \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \color{blue}{0.047619047619047616 \cdot {\left(\left|x\right|\right)}^{7}}\right)\right| \]
    6. Evaluated real constant99.0%

      \[\leadsto \left|\color{blue}{0.5641895835477563} \cdot \mathsf{fma}\left(\left|x\right|, 2, 0.047619047619047616 \cdot {\left(\left|x\right|\right)}^{7}\right)\right| \]
    7. Step-by-step derivation
      1. lift-fabs.f64N/A

        \[\leadsto \color{blue}{\left|\frac{5081767996463981}{9007199254740992} \cdot \mathsf{fma}\left(\left|x\right|, 2, \frac{1}{21} \cdot {\left(\left|x\right|\right)}^{7}\right)\right|} \]
      2. lift-*.f64N/A

        \[\leadsto \left|\color{blue}{\frac{5081767996463981}{9007199254740992} \cdot \mathsf{fma}\left(\left|x\right|, 2, \frac{1}{21} \cdot {\left(\left|x\right|\right)}^{7}\right)}\right| \]
      3. *-commutativeN/A

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\left|x\right|, 2, \frac{1}{21} \cdot {\left(\left|x\right|\right)}^{7}\right) \cdot \frac{5081767996463981}{9007199254740992}}\right| \]
    8. Applied rewrites99.0%

      \[\leadsto \color{blue}{\left|\mathsf{fma}\left(2, \left|x\right|, {\left(\left|x\right|\right)}^{7} \cdot 0.047619047619047616\right)\right| \cdot 0.5641895835477563} \]
    9. Add Preprocessing

    Alternative 6: 98.9% accurate, 2.6× speedup?

    \[\begin{array}{l} t_0 := \left|\left|x\right|\right|\\ \mathbf{if}\;\left|x\right| \leq 0.145:\\ \;\;\;\;\left(2 \cdot t\_0\right) \cdot 0.5641895835477563\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{\pi}} \cdot \left|{t\_0}^{7} \cdot 0.047619047619047616\right|\\ \end{array} \]
    (FPCore (x)
     :precision binary64
     (let* ((t_0 (fabs (fabs x))))
       (if (<= (fabs x) 0.145)
         (* (* 2.0 t_0) 0.5641895835477563)
         (* (/ 1.0 (sqrt PI)) (fabs (* (pow t_0 7.0) 0.047619047619047616))))))
    double code(double x) {
    	double t_0 = fabs(fabs(x));
    	double tmp;
    	if (fabs(x) <= 0.145) {
    		tmp = (2.0 * t_0) * 0.5641895835477563;
    	} else {
    		tmp = (1.0 / sqrt(((double) M_PI))) * fabs((pow(t_0, 7.0) * 0.047619047619047616));
    	}
    	return tmp;
    }
    
    public static double code(double x) {
    	double t_0 = Math.abs(Math.abs(x));
    	double tmp;
    	if (Math.abs(x) <= 0.145) {
    		tmp = (2.0 * t_0) * 0.5641895835477563;
    	} else {
    		tmp = (1.0 / Math.sqrt(Math.PI)) * Math.abs((Math.pow(t_0, 7.0) * 0.047619047619047616));
    	}
    	return tmp;
    }
    
    def code(x):
    	t_0 = math.fabs(math.fabs(x))
    	tmp = 0
    	if math.fabs(x) <= 0.145:
    		tmp = (2.0 * t_0) * 0.5641895835477563
    	else:
    		tmp = (1.0 / math.sqrt(math.pi)) * math.fabs((math.pow(t_0, 7.0) * 0.047619047619047616))
    	return tmp
    
    function code(x)
    	t_0 = abs(abs(x))
    	tmp = 0.0
    	if (abs(x) <= 0.145)
    		tmp = Float64(Float64(2.0 * t_0) * 0.5641895835477563);
    	else
    		tmp = Float64(Float64(1.0 / sqrt(pi)) * abs(Float64((t_0 ^ 7.0) * 0.047619047619047616)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x)
    	t_0 = abs(abs(x));
    	tmp = 0.0;
    	if (abs(x) <= 0.145)
    		tmp = (2.0 * t_0) * 0.5641895835477563;
    	else
    		tmp = (1.0 / sqrt(pi)) * abs(((t_0 ^ 7.0) * 0.047619047619047616));
    	end
    	tmp_2 = tmp;
    end
    
    code[x_] := Block[{t$95$0 = N[Abs[N[Abs[x], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 0.145], N[(N[(2.0 * t$95$0), $MachinePrecision] * 0.5641895835477563), $MachinePrecision], N[(N[(1.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[Abs[N[(N[Power[t$95$0, 7.0], $MachinePrecision] * 0.047619047619047616), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    t_0 := \left|\left|x\right|\right|\\
    \mathbf{if}\;\left|x\right| \leq 0.145:\\
    \;\;\;\;\left(2 \cdot t\_0\right) \cdot 0.5641895835477563\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{1}{\sqrt{\pi}} \cdot \left|{t\_0}^{7} \cdot 0.047619047619047616\right|\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < 0.14499999999999999

      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. Applied rewrites99.4%

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

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{\left|2 \cdot \color{blue}{\left|x\right|}\right|}{\sqrt{\pi}} \]
        2. lower-fabs.f6467.0%

          \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\sqrt{\pi}} \]
      5. Applied rewrites67.0%

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      6. Evaluated real constant67.3%

        \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\color{blue}{1.772453850905516}} \]
      7. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{\left|2 \cdot \left|x\right|\right|}{\frac{7982422502469483}{4503599627370496}}} \]
      8. Applied rewrites67.5%

        \[\leadsto \color{blue}{\left(2 \cdot \left|x\right|\right) \cdot 0.5641895835477563} \]

      if 0.14499999999999999 < 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. Applied rewrites99.4%

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

        \[\leadsto \frac{\left|\color{blue}{\frac{1}{21} \cdot \left({x}^{6} \cdot \left|x\right|\right)}\right|}{\sqrt{\pi}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{\left|\frac{1}{21} \cdot \color{blue}{\left({x}^{6} \cdot \left|x\right|\right)}\right|}{\sqrt{\pi}} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{\left|\frac{1}{21} \cdot \left({x}^{6} \cdot \color{blue}{\left|x\right|}\right)\right|}{\sqrt{\pi}} \]
        3. lower-pow.f64N/A

          \[\leadsto \frac{\left|\frac{1}{21} \cdot \left({x}^{6} \cdot \left|\color{blue}{x}\right|\right)\right|}{\sqrt{\pi}} \]
        4. lower-fabs.f6437.2%

          \[\leadsto \frac{\left|0.047619047619047616 \cdot \left({x}^{6} \cdot \left|x\right|\right)\right|}{\sqrt{\pi}} \]
      5. Applied rewrites37.2%

        \[\leadsto \frac{\left|\color{blue}{0.047619047619047616 \cdot \left({x}^{6} \cdot \left|x\right|\right)}\right|}{\sqrt{\pi}} \]
      6. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{\left|\frac{1}{21} \cdot \left({x}^{6} \cdot \left|x\right|\right)\right|}{\sqrt{\pi}}} \]
        2. mult-flipN/A

          \[\leadsto \color{blue}{\left|\frac{1}{21} \cdot \left({x}^{6} \cdot \left|x\right|\right)\right| \cdot \frac{1}{\sqrt{\pi}}} \]
        3. lift-/.f64N/A

          \[\leadsto \left|\frac{1}{21} \cdot \left({x}^{6} \cdot \left|x\right|\right)\right| \cdot \color{blue}{\frac{1}{\sqrt{\pi}}} \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{1}{\sqrt{\pi}} \cdot \left|\frac{1}{21} \cdot \left({x}^{6} \cdot \left|x\right|\right)\right|} \]
        5. lower-*.f6437.2%

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

        \[\leadsto \color{blue}{\frac{1}{\sqrt{\pi}} \cdot \left|{\left(\left|x\right|\right)}^{7} \cdot 0.047619047619047616\right|} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 7: 98.9% accurate, 2.2× speedup?

    \[\begin{array}{l} t_0 := \left|\left|x\right|\right|\\ \mathbf{if}\;\left|x\right| \leq 0.145:\\ \;\;\;\;\left(2 \cdot t\_0\right) \cdot 0.5641895835477563\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|\left(\left(0.047619047619047616 \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) \cdot \left|x\right|\right) \cdot t\_0\right|}{\sqrt{\pi}}\\ \end{array} \]
    (FPCore (x)
     :precision binary64
     (let* ((t_0 (fabs (fabs x))))
       (if (<= (fabs x) 0.145)
         (* (* 2.0 t_0) 0.5641895835477563)
         (/
          (fabs
           (*
            (*
             (*
              0.047619047619047616
              (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))
             (fabs x))
            t_0))
          (sqrt PI)))))
    double code(double x) {
    	double t_0 = fabs(fabs(x));
    	double tmp;
    	if (fabs(x) <= 0.145) {
    		tmp = (2.0 * t_0) * 0.5641895835477563;
    	} else {
    		tmp = fabs((((0.047619047619047616 * ((((fabs(x) * fabs(x)) * fabs(x)) * fabs(x)) * fabs(x))) * fabs(x)) * t_0)) / sqrt(((double) M_PI));
    	}
    	return tmp;
    }
    
    public static double code(double x) {
    	double t_0 = Math.abs(Math.abs(x));
    	double tmp;
    	if (Math.abs(x) <= 0.145) {
    		tmp = (2.0 * t_0) * 0.5641895835477563;
    	} else {
    		tmp = Math.abs((((0.047619047619047616 * ((((Math.abs(x) * Math.abs(x)) * Math.abs(x)) * Math.abs(x)) * Math.abs(x))) * Math.abs(x)) * t_0)) / Math.sqrt(Math.PI);
    	}
    	return tmp;
    }
    
    def code(x):
    	t_0 = math.fabs(math.fabs(x))
    	tmp = 0
    	if math.fabs(x) <= 0.145:
    		tmp = (2.0 * t_0) * 0.5641895835477563
    	else:
    		tmp = math.fabs((((0.047619047619047616 * ((((math.fabs(x) * math.fabs(x)) * math.fabs(x)) * math.fabs(x)) * math.fabs(x))) * math.fabs(x)) * t_0)) / math.sqrt(math.pi)
    	return tmp
    
    function code(x)
    	t_0 = abs(abs(x))
    	tmp = 0.0
    	if (abs(x) <= 0.145)
    		tmp = Float64(Float64(2.0 * t_0) * 0.5641895835477563);
    	else
    		tmp = Float64(abs(Float64(Float64(Float64(0.047619047619047616 * Float64(Float64(Float64(Float64(abs(x) * abs(x)) * abs(x)) * abs(x)) * abs(x))) * abs(x)) * t_0)) / sqrt(pi));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x)
    	t_0 = abs(abs(x));
    	tmp = 0.0;
    	if (abs(x) <= 0.145)
    		tmp = (2.0 * t_0) * 0.5641895835477563;
    	else
    		tmp = abs((((0.047619047619047616 * ((((abs(x) * abs(x)) * abs(x)) * abs(x)) * abs(x))) * abs(x)) * t_0)) / sqrt(pi);
    	end
    	tmp_2 = tmp;
    end
    
    code[x_] := Block[{t$95$0 = N[Abs[N[Abs[x], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 0.145], N[(N[(2.0 * t$95$0), $MachinePrecision] * 0.5641895835477563), $MachinePrecision], N[(N[Abs[N[(N[(N[(0.047619047619047616 * N[(N[(N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]], $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    t_0 := \left|\left|x\right|\right|\\
    \mathbf{if}\;\left|x\right| \leq 0.145:\\
    \;\;\;\;\left(2 \cdot t\_0\right) \cdot 0.5641895835477563\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\left|\left(\left(0.047619047619047616 \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) \cdot \left|x\right|\right) \cdot t\_0\right|}{\sqrt{\pi}}\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < 0.14499999999999999

      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. Applied rewrites99.4%

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

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{\left|2 \cdot \color{blue}{\left|x\right|}\right|}{\sqrt{\pi}} \]
        2. lower-fabs.f6467.0%

          \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\sqrt{\pi}} \]
      5. Applied rewrites67.0%

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      6. Evaluated real constant67.3%

        \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\color{blue}{1.772453850905516}} \]
      7. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{\left|2 \cdot \left|x\right|\right|}{\frac{7982422502469483}{4503599627370496}}} \]
      8. Applied rewrites67.5%

        \[\leadsto \color{blue}{\left(2 \cdot \left|x\right|\right) \cdot 0.5641895835477563} \]

      if 0.14499999999999999 < 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. Applied rewrites99.4%

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

        \[\leadsto \frac{\left|\color{blue}{\frac{1}{21} \cdot \left({x}^{6} \cdot \left|x\right|\right)}\right|}{\sqrt{\pi}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{\left|\frac{1}{21} \cdot \color{blue}{\left({x}^{6} \cdot \left|x\right|\right)}\right|}{\sqrt{\pi}} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{\left|\frac{1}{21} \cdot \left({x}^{6} \cdot \color{blue}{\left|x\right|}\right)\right|}{\sqrt{\pi}} \]
        3. lower-pow.f64N/A

          \[\leadsto \frac{\left|\frac{1}{21} \cdot \left({x}^{6} \cdot \left|\color{blue}{x}\right|\right)\right|}{\sqrt{\pi}} \]
        4. lower-fabs.f6437.2%

          \[\leadsto \frac{\left|0.047619047619047616 \cdot \left({x}^{6} \cdot \left|x\right|\right)\right|}{\sqrt{\pi}} \]
      5. Applied rewrites37.2%

        \[\leadsto \frac{\left|\color{blue}{0.047619047619047616 \cdot \left({x}^{6} \cdot \left|x\right|\right)}\right|}{\sqrt{\pi}} \]
      6. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \frac{\left|\frac{1}{21} \cdot \color{blue}{\left({x}^{6} \cdot \left|x\right|\right)}\right|}{\sqrt{\pi}} \]
        2. *-commutativeN/A

          \[\leadsto \frac{\left|\left({x}^{6} \cdot \left|x\right|\right) \cdot \color{blue}{\frac{1}{21}}\right|}{\sqrt{\pi}} \]
        3. lift-*.f64N/A

          \[\leadsto \frac{\left|\left({x}^{6} \cdot \left|x\right|\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        4. *-commutativeN/A

          \[\leadsto \frac{\left|\left(\left|x\right| \cdot {x}^{6}\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        5. lift-pow.f64N/A

          \[\leadsto \frac{\left|\left(\left|x\right| \cdot {x}^{6}\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        6. metadata-evalN/A

          \[\leadsto \frac{\left|\left(\left|x\right| \cdot {x}^{\left(3 + 3\right)}\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        7. pow-prod-upN/A

          \[\leadsto \frac{\left|\left(\left|x\right| \cdot \left({x}^{3} \cdot {x}^{3}\right)\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        8. pow3N/A

          \[\leadsto \frac{\left|\left(\left|x\right| \cdot \left(\left(\left(x \cdot x\right) \cdot x\right) \cdot {x}^{3}\right)\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        9. pow3N/A

          \[\leadsto \frac{\left|\left(\left|x\right| \cdot \left(\left(\left(x \cdot x\right) \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        10. lift-*.f64N/A

          \[\leadsto \frac{\left|\left(\left|x\right| \cdot \left(\left(\left(x \cdot x\right) \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        11. lift-*.f64N/A

          \[\leadsto \frac{\left|\left(\left|x\right| \cdot \left(\left(\left(x \cdot x\right) \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        12. lift-*.f64N/A

          \[\leadsto \frac{\left|\left(\left|x\right| \cdot \left(\left(\left(x \cdot x\right) \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        13. lift-*.f64N/A

          \[\leadsto \frac{\left|\left(\left|x\right| \cdot \left(\left(\left(x \cdot x\right) \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        14. lift-*.f64N/A

          \[\leadsto \frac{\left|\left(\left|x\right| \cdot \left(\left(\left(x \cdot x\right) \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        15. associate-*l*N/A

          \[\leadsto \frac{\left|\left|x\right| \cdot \color{blue}{\left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\right) \cdot \frac{1}{21}\right)}\right|}{\sqrt{\pi}} \]
        16. lift-*.f64N/A

          \[\leadsto \frac{\left|\left|x\right| \cdot \left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\right) \cdot \color{blue}{\frac{1}{21}}\right)\right|}{\sqrt{\pi}} \]
        17. *-commutativeN/A

          \[\leadsto \frac{\left|\left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\right) \cdot \frac{1}{21}\right) \cdot \color{blue}{\left|x\right|}\right|}{\sqrt{\pi}} \]
        18. lower-*.f6437.2%

          \[\leadsto \frac{\left|\left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\right) \cdot 0.047619047619047616\right) \cdot \color{blue}{\left|x\right|}\right|}{\sqrt{\pi}} \]
      7. Applied rewrites37.2%

        \[\leadsto \frac{\left|\left(\left(0.047619047619047616 \cdot \left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right)\right) \cdot x\right) \cdot \color{blue}{\left|x\right|}\right|}{\sqrt{\pi}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 8: 98.9% accurate, 2.6× speedup?

    \[\begin{array}{l} t_0 := \left|\left|x\right|\right|\\ \mathbf{if}\;\left|x\right| \leq 0.145:\\ \;\;\;\;\left(2 \cdot t\_0\right) \cdot 0.5641895835477563\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|0.047619047619047616 \cdot \left({\left(\left|x\right|\right)}^{6} \cdot t\_0\right)\right|}{1.772453850905516}\\ \end{array} \]
    (FPCore (x)
     :precision binary64
     (let* ((t_0 (fabs (fabs x))))
       (if (<= (fabs x) 0.145)
         (* (* 2.0 t_0) 0.5641895835477563)
         (/
          (fabs (* 0.047619047619047616 (* (pow (fabs x) 6.0) t_0)))
          1.772453850905516))))
    double code(double x) {
    	double t_0 = fabs(fabs(x));
    	double tmp;
    	if (fabs(x) <= 0.145) {
    		tmp = (2.0 * t_0) * 0.5641895835477563;
    	} else {
    		tmp = fabs((0.047619047619047616 * (pow(fabs(x), 6.0) * t_0))) / 1.772453850905516;
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        real(8) :: t_0
        real(8) :: tmp
        t_0 = abs(abs(x))
        if (abs(x) <= 0.145d0) then
            tmp = (2.0d0 * t_0) * 0.5641895835477563d0
        else
            tmp = abs((0.047619047619047616d0 * ((abs(x) ** 6.0d0) * t_0))) / 1.772453850905516d0
        end if
        code = tmp
    end function
    
    public static double code(double x) {
    	double t_0 = Math.abs(Math.abs(x));
    	double tmp;
    	if (Math.abs(x) <= 0.145) {
    		tmp = (2.0 * t_0) * 0.5641895835477563;
    	} else {
    		tmp = Math.abs((0.047619047619047616 * (Math.pow(Math.abs(x), 6.0) * t_0))) / 1.772453850905516;
    	}
    	return tmp;
    }
    
    def code(x):
    	t_0 = math.fabs(math.fabs(x))
    	tmp = 0
    	if math.fabs(x) <= 0.145:
    		tmp = (2.0 * t_0) * 0.5641895835477563
    	else:
    		tmp = math.fabs((0.047619047619047616 * (math.pow(math.fabs(x), 6.0) * t_0))) / 1.772453850905516
    	return tmp
    
    function code(x)
    	t_0 = abs(abs(x))
    	tmp = 0.0
    	if (abs(x) <= 0.145)
    		tmp = Float64(Float64(2.0 * t_0) * 0.5641895835477563);
    	else
    		tmp = Float64(abs(Float64(0.047619047619047616 * Float64((abs(x) ^ 6.0) * t_0))) / 1.772453850905516);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x)
    	t_0 = abs(abs(x));
    	tmp = 0.0;
    	if (abs(x) <= 0.145)
    		tmp = (2.0 * t_0) * 0.5641895835477563;
    	else
    		tmp = abs((0.047619047619047616 * ((abs(x) ^ 6.0) * t_0))) / 1.772453850905516;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_] := Block[{t$95$0 = N[Abs[N[Abs[x], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 0.145], N[(N[(2.0 * t$95$0), $MachinePrecision] * 0.5641895835477563), $MachinePrecision], N[(N[Abs[N[(0.047619047619047616 * N[(N[Power[N[Abs[x], $MachinePrecision], 6.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / 1.772453850905516), $MachinePrecision]]]
    
    \begin{array}{l}
    t_0 := \left|\left|x\right|\right|\\
    \mathbf{if}\;\left|x\right| \leq 0.145:\\
    \;\;\;\;\left(2 \cdot t\_0\right) \cdot 0.5641895835477563\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\left|0.047619047619047616 \cdot \left({\left(\left|x\right|\right)}^{6} \cdot t\_0\right)\right|}{1.772453850905516}\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < 0.14499999999999999

      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. Applied rewrites99.4%

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

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{\left|2 \cdot \color{blue}{\left|x\right|}\right|}{\sqrt{\pi}} \]
        2. lower-fabs.f6467.0%

          \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\sqrt{\pi}} \]
      5. Applied rewrites67.0%

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      6. Evaluated real constant67.3%

        \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\color{blue}{1.772453850905516}} \]
      7. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{\left|2 \cdot \left|x\right|\right|}{\frac{7982422502469483}{4503599627370496}}} \]
      8. Applied rewrites67.5%

        \[\leadsto \color{blue}{\left(2 \cdot \left|x\right|\right) \cdot 0.5641895835477563} \]

      if 0.14499999999999999 < 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. Applied rewrites99.4%

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

        \[\leadsto \frac{\left|\color{blue}{\frac{1}{21} \cdot \left({x}^{6} \cdot \left|x\right|\right)}\right|}{\sqrt{\pi}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{\left|\frac{1}{21} \cdot \color{blue}{\left({x}^{6} \cdot \left|x\right|\right)}\right|}{\sqrt{\pi}} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{\left|\frac{1}{21} \cdot \left({x}^{6} \cdot \color{blue}{\left|x\right|}\right)\right|}{\sqrt{\pi}} \]
        3. lower-pow.f64N/A

          \[\leadsto \frac{\left|\frac{1}{21} \cdot \left({x}^{6} \cdot \left|\color{blue}{x}\right|\right)\right|}{\sqrt{\pi}} \]
        4. lower-fabs.f6437.2%

          \[\leadsto \frac{\left|0.047619047619047616 \cdot \left({x}^{6} \cdot \left|x\right|\right)\right|}{\sqrt{\pi}} \]
      5. Applied rewrites37.2%

        \[\leadsto \frac{\left|\color{blue}{0.047619047619047616 \cdot \left({x}^{6} \cdot \left|x\right|\right)}\right|}{\sqrt{\pi}} \]
      6. Evaluated real constant37.2%

        \[\leadsto \frac{\left|0.047619047619047616 \cdot \left({x}^{6} \cdot \left|x\right|\right)\right|}{\color{blue}{1.772453850905516}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 9: 98.9% accurate, 2.8× speedup?

    \[\begin{array}{l} t_0 := \left|\left|x\right|\right|\\ \mathbf{if}\;\left|x\right| \leq 0.145:\\ \;\;\;\;\left(2 \cdot t\_0\right) \cdot 0.5641895835477563\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|{t\_0}^{7} \cdot 0.047619047619047616\right|}{\sqrt{\pi}}\\ \end{array} \]
    (FPCore (x)
     :precision binary64
     (let* ((t_0 (fabs (fabs x))))
       (if (<= (fabs x) 0.145)
         (* (* 2.0 t_0) 0.5641895835477563)
         (/ (fabs (* (pow t_0 7.0) 0.047619047619047616)) (sqrt PI)))))
    double code(double x) {
    	double t_0 = fabs(fabs(x));
    	double tmp;
    	if (fabs(x) <= 0.145) {
    		tmp = (2.0 * t_0) * 0.5641895835477563;
    	} else {
    		tmp = fabs((pow(t_0, 7.0) * 0.047619047619047616)) / sqrt(((double) M_PI));
    	}
    	return tmp;
    }
    
    public static double code(double x) {
    	double t_0 = Math.abs(Math.abs(x));
    	double tmp;
    	if (Math.abs(x) <= 0.145) {
    		tmp = (2.0 * t_0) * 0.5641895835477563;
    	} else {
    		tmp = Math.abs((Math.pow(t_0, 7.0) * 0.047619047619047616)) / Math.sqrt(Math.PI);
    	}
    	return tmp;
    }
    
    def code(x):
    	t_0 = math.fabs(math.fabs(x))
    	tmp = 0
    	if math.fabs(x) <= 0.145:
    		tmp = (2.0 * t_0) * 0.5641895835477563
    	else:
    		tmp = math.fabs((math.pow(t_0, 7.0) * 0.047619047619047616)) / math.sqrt(math.pi)
    	return tmp
    
    function code(x)
    	t_0 = abs(abs(x))
    	tmp = 0.0
    	if (abs(x) <= 0.145)
    		tmp = Float64(Float64(2.0 * t_0) * 0.5641895835477563);
    	else
    		tmp = Float64(abs(Float64((t_0 ^ 7.0) * 0.047619047619047616)) / sqrt(pi));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x)
    	t_0 = abs(abs(x));
    	tmp = 0.0;
    	if (abs(x) <= 0.145)
    		tmp = (2.0 * t_0) * 0.5641895835477563;
    	else
    		tmp = abs(((t_0 ^ 7.0) * 0.047619047619047616)) / sqrt(pi);
    	end
    	tmp_2 = tmp;
    end
    
    code[x_] := Block[{t$95$0 = N[Abs[N[Abs[x], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 0.145], N[(N[(2.0 * t$95$0), $MachinePrecision] * 0.5641895835477563), $MachinePrecision], N[(N[Abs[N[(N[Power[t$95$0, 7.0], $MachinePrecision] * 0.047619047619047616), $MachinePrecision]], $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    t_0 := \left|\left|x\right|\right|\\
    \mathbf{if}\;\left|x\right| \leq 0.145:\\
    \;\;\;\;\left(2 \cdot t\_0\right) \cdot 0.5641895835477563\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\left|{t\_0}^{7} \cdot 0.047619047619047616\right|}{\sqrt{\pi}}\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < 0.14499999999999999

      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. Applied rewrites99.4%

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

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{\left|2 \cdot \color{blue}{\left|x\right|}\right|}{\sqrt{\pi}} \]
        2. lower-fabs.f6467.0%

          \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\sqrt{\pi}} \]
      5. Applied rewrites67.0%

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      6. Evaluated real constant67.3%

        \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\color{blue}{1.772453850905516}} \]
      7. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{\left|2 \cdot \left|x\right|\right|}{\frac{7982422502469483}{4503599627370496}}} \]
      8. Applied rewrites67.5%

        \[\leadsto \color{blue}{\left(2 \cdot \left|x\right|\right) \cdot 0.5641895835477563} \]

      if 0.14499999999999999 < 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. Applied rewrites99.4%

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

        \[\leadsto \frac{\left|\color{blue}{\frac{1}{21} \cdot \left({x}^{6} \cdot \left|x\right|\right)}\right|}{\sqrt{\pi}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{\left|\frac{1}{21} \cdot \color{blue}{\left({x}^{6} \cdot \left|x\right|\right)}\right|}{\sqrt{\pi}} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{\left|\frac{1}{21} \cdot \left({x}^{6} \cdot \color{blue}{\left|x\right|}\right)\right|}{\sqrt{\pi}} \]
        3. lower-pow.f64N/A

          \[\leadsto \frac{\left|\frac{1}{21} \cdot \left({x}^{6} \cdot \left|\color{blue}{x}\right|\right)\right|}{\sqrt{\pi}} \]
        4. lower-fabs.f6437.2%

          \[\leadsto \frac{\left|0.047619047619047616 \cdot \left({x}^{6} \cdot \left|x\right|\right)\right|}{\sqrt{\pi}} \]
      5. Applied rewrites37.2%

        \[\leadsto \frac{\left|\color{blue}{0.047619047619047616 \cdot \left({x}^{6} \cdot \left|x\right|\right)}\right|}{\sqrt{\pi}} \]
      6. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \frac{\left|\frac{1}{21} \cdot \color{blue}{\left({x}^{6} \cdot \left|x\right|\right)}\right|}{\sqrt{\pi}} \]
        2. *-commutativeN/A

          \[\leadsto \frac{\left|\left({x}^{6} \cdot \left|x\right|\right) \cdot \color{blue}{\frac{1}{21}}\right|}{\sqrt{\pi}} \]
        3. lift-*.f64N/A

          \[\leadsto \frac{\left|\left({x}^{6} \cdot \left|x\right|\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        4. lift-pow.f64N/A

          \[\leadsto \frac{\left|\left({x}^{6} \cdot \left|x\right|\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        5. metadata-evalN/A

          \[\leadsto \frac{\left|\left({x}^{\left(3 + 3\right)} \cdot \left|x\right|\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        6. pow-prod-upN/A

          \[\leadsto \frac{\left|\left(\left({x}^{3} \cdot {x}^{3}\right) \cdot \left|x\right|\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        7. pow-prod-downN/A

          \[\leadsto \frac{\left|\left({\left(x \cdot x\right)}^{3} \cdot \left|x\right|\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        8. lift-*.f64N/A

          \[\leadsto \frac{\left|\left({\left(x \cdot x\right)}^{3} \cdot \left|x\right|\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        9. lift-fabs.f64N/A

          \[\leadsto \frac{\left|\left({\left(x \cdot x\right)}^{3} \cdot \left|x\right|\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        10. rem-sqrt-square-revN/A

          \[\leadsto \frac{\left|\left({\left(x \cdot x\right)}^{3} \cdot \sqrt{x \cdot x}\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        11. lift-*.f64N/A

          \[\leadsto \frac{\left|\left({\left(x \cdot x\right)}^{3} \cdot \sqrt{x \cdot x}\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        12. pow1/2N/A

          \[\leadsto \frac{\left|\left({\left(x \cdot x\right)}^{3} \cdot {\left(x \cdot x\right)}^{\frac{1}{2}}\right) \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        13. pow-prod-upN/A

          \[\leadsto \frac{\left|{\left(x \cdot x\right)}^{\left(3 + \frac{1}{2}\right)} \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        14. metadata-evalN/A

          \[\leadsto \frac{\left|{\left(x \cdot x\right)}^{\frac{7}{2}} \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        15. metadata-evalN/A

          \[\leadsto \frac{\left|{\left(x \cdot x\right)}^{\left(\frac{7}{2}\right)} \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        16. sqrt-pow2N/A

          \[\leadsto \frac{\left|{\left(\sqrt{x \cdot x}\right)}^{7} \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        17. lift-*.f64N/A

          \[\leadsto \frac{\left|{\left(\sqrt{x \cdot x}\right)}^{7} \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        18. rem-sqrt-square-revN/A

          \[\leadsto \frac{\left|{\left(\left|x\right|\right)}^{7} \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        19. lift-fabs.f64N/A

          \[\leadsto \frac{\left|{\left(\left|x\right|\right)}^{7} \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        20. lift-pow.f64N/A

          \[\leadsto \frac{\left|{\left(\left|x\right|\right)}^{7} \cdot \frac{1}{21}\right|}{\sqrt{\pi}} \]
        21. lower-*.f6437.2%

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

        \[\leadsto \frac{\left|\color{blue}{{\left(\left|x\right|\right)}^{7} \cdot 0.047619047619047616}\right|}{\sqrt{\pi}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 10: 93.3% accurate, 2.9× speedup?

    \[\begin{array}{l} t_0 := \left|\left|x\right|\right|\\ \mathbf{if}\;\left|x\right| \leq 0.145:\\ \;\;\;\;\left(2 \cdot t\_0\right) \cdot 0.5641895835477563\\ \mathbf{else}:\\ \;\;\;\;\left|0.11283791670955126 \cdot \left({\left(\left|x\right|\right)}^{4} \cdot t\_0\right)\right|\\ \end{array} \]
    (FPCore (x)
     :precision binary64
     (let* ((t_0 (fabs (fabs x))))
       (if (<= (fabs x) 0.145)
         (* (* 2.0 t_0) 0.5641895835477563)
         (fabs (* 0.11283791670955126 (* (pow (fabs x) 4.0) t_0))))))
    double code(double x) {
    	double t_0 = fabs(fabs(x));
    	double tmp;
    	if (fabs(x) <= 0.145) {
    		tmp = (2.0 * t_0) * 0.5641895835477563;
    	} else {
    		tmp = fabs((0.11283791670955126 * (pow(fabs(x), 4.0) * t_0)));
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        real(8) :: t_0
        real(8) :: tmp
        t_0 = abs(abs(x))
        if (abs(x) <= 0.145d0) then
            tmp = (2.0d0 * t_0) * 0.5641895835477563d0
        else
            tmp = abs((0.11283791670955126d0 * ((abs(x) ** 4.0d0) * t_0)))
        end if
        code = tmp
    end function
    
    public static double code(double x) {
    	double t_0 = Math.abs(Math.abs(x));
    	double tmp;
    	if (Math.abs(x) <= 0.145) {
    		tmp = (2.0 * t_0) * 0.5641895835477563;
    	} else {
    		tmp = Math.abs((0.11283791670955126 * (Math.pow(Math.abs(x), 4.0) * t_0)));
    	}
    	return tmp;
    }
    
    def code(x):
    	t_0 = math.fabs(math.fabs(x))
    	tmp = 0
    	if math.fabs(x) <= 0.145:
    		tmp = (2.0 * t_0) * 0.5641895835477563
    	else:
    		tmp = math.fabs((0.11283791670955126 * (math.pow(math.fabs(x), 4.0) * t_0)))
    	return tmp
    
    function code(x)
    	t_0 = abs(abs(x))
    	tmp = 0.0
    	if (abs(x) <= 0.145)
    		tmp = Float64(Float64(2.0 * t_0) * 0.5641895835477563);
    	else
    		tmp = abs(Float64(0.11283791670955126 * Float64((abs(x) ^ 4.0) * t_0)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x)
    	t_0 = abs(abs(x));
    	tmp = 0.0;
    	if (abs(x) <= 0.145)
    		tmp = (2.0 * t_0) * 0.5641895835477563;
    	else
    		tmp = abs((0.11283791670955126 * ((abs(x) ^ 4.0) * t_0)));
    	end
    	tmp_2 = tmp;
    end
    
    code[x_] := Block[{t$95$0 = N[Abs[N[Abs[x], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 0.145], N[(N[(2.0 * t$95$0), $MachinePrecision] * 0.5641895835477563), $MachinePrecision], N[Abs[N[(0.11283791670955126 * N[(N[Power[N[Abs[x], $MachinePrecision], 4.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
    
    \begin{array}{l}
    t_0 := \left|\left|x\right|\right|\\
    \mathbf{if}\;\left|x\right| \leq 0.145:\\
    \;\;\;\;\left(2 \cdot t\_0\right) \cdot 0.5641895835477563\\
    
    \mathbf{else}:\\
    \;\;\;\;\left|0.11283791670955126 \cdot \left({\left(\left|x\right|\right)}^{4} \cdot t\_0\right)\right|\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < 0.14499999999999999

      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. Applied rewrites99.4%

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

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{\left|2 \cdot \color{blue}{\left|x\right|}\right|}{\sqrt{\pi}} \]
        2. lower-fabs.f6467.0%

          \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\sqrt{\pi}} \]
      5. Applied rewrites67.0%

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      6. Evaluated real constant67.3%

        \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\color{blue}{1.772453850905516}} \]
      7. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{\left|2 \cdot \left|x\right|\right|}{\frac{7982422502469483}{4503599627370496}}} \]
      8. Applied rewrites67.5%

        \[\leadsto \color{blue}{\left(2 \cdot \left|x\right|\right) \cdot 0.5641895835477563} \]

      if 0.14499999999999999 < 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. Applied rewrites99.9%

        \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \color{blue}{\mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left(\left|x\right|, \mathsf{fma}\left(0.6666666666666666 \cdot x, x, \left(0.2 \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right), {\left(\left|x\right|\right)}^{7} \cdot 0.047619047619047616\right)\right)}\right| \]
      3. Step-by-step derivation
        1. lift-fma.f64N/A

          \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \color{blue}{\left|x\right| \cdot \mathsf{fma}\left(\frac{2}{3} \cdot x, x, \left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right) + {\left(\left|x\right|\right)}^{7} \cdot \frac{1}{21}}\right)\right| \]
        2. +-commutativeN/A

          \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \color{blue}{{\left(\left|x\right|\right)}^{7} \cdot \frac{1}{21} + \left|x\right| \cdot \mathsf{fma}\left(\frac{2}{3} \cdot x, x, \left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)}\right)\right| \]
        3. lift-*.f64N/A

          \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \color{blue}{{\left(\left|x\right|\right)}^{7} \cdot \frac{1}{21}} + \left|x\right| \cdot \mathsf{fma}\left(\frac{2}{3} \cdot x, x, \left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)\right)\right| \]
        4. lower-fma.f64N/A

          \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \color{blue}{\mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \mathsf{fma}\left(\frac{2}{3} \cdot x, x, \left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)\right)}\right)\right| \]
        5. lower-*.f6499.9%

          \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, 0.047619047619047616, \color{blue}{\left|x\right| \cdot \mathsf{fma}\left(0.6666666666666666 \cdot x, x, \left(0.2 \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)}\right)\right)\right| \]
        6. lift-fma.f64N/A

          \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \color{blue}{\left(\left(\frac{2}{3} \cdot x\right) \cdot x + \left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)}\right)\right)\right| \]
        7. +-commutativeN/A

          \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \color{blue}{\left(\left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right) + \left(\frac{2}{3} \cdot x\right) \cdot x\right)}\right)\right)\right| \]
        8. lift-*.f64N/A

          \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\color{blue}{\left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)} + \left(\frac{2}{3} \cdot x\right) \cdot x\right)\right)\right)\right| \]
        9. lift-*.f64N/A

          \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right) + \color{blue}{\left(\frac{2}{3} \cdot x\right)} \cdot x\right)\right)\right)\right| \]
        10. associate-*l*N/A

          \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right) + \color{blue}{\frac{2}{3} \cdot \left(x \cdot x\right)}\right)\right)\right)\right| \]
        11. lift-*.f64N/A

          \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(\frac{1}{5} \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right) + \frac{2}{3} \cdot \color{blue}{\left(x \cdot x\right)}\right)\right)\right)\right| \]
        12. distribute-rgt-outN/A

          \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot \left(\frac{1}{5} \cdot \left(x \cdot x\right) + \frac{2}{3}\right)\right)}\right)\right)\right| \]
        13. lower-*.f64N/A

          \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot \left(\frac{1}{5} \cdot \left(x \cdot x\right) + \frac{2}{3}\right)\right)}\right)\right)\right| \]
        14. lift-*.f64N/A

          \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \left(\color{blue}{\frac{1}{5} \cdot \left(x \cdot x\right)} + \frac{2}{3}\right)\right)\right)\right)\right| \]
        15. lift-*.f64N/A

          \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \left(\frac{1}{5} \cdot \color{blue}{\left(x \cdot x\right)} + \frac{2}{3}\right)\right)\right)\right)\right| \]
        16. associate-*r*N/A

          \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \left(\color{blue}{\left(\frac{1}{5} \cdot x\right) \cdot x} + \frac{2}{3}\right)\right)\right)\right)\right| \]
        17. lower-fma.f64N/A

          \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, \frac{1}{21}, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{5} \cdot x, x, \frac{2}{3}\right)}\right)\right)\right)\right| \]
        18. lower-*.f6499.9%

          \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, 0.047619047619047616, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(\color{blue}{0.2 \cdot x}, x, 0.6666666666666666\right)\right)\right)\right)\right| \]
      4. Applied rewrites99.9%

        \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(\left|x\right|, 2, \color{blue}{\mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, 0.047619047619047616, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(0.2 \cdot x, x, 0.6666666666666666\right)\right)\right)}\right)\right| \]
      5. Evaluated real constant99.9%

        \[\leadsto \left|\color{blue}{0.5641895835477563} \cdot \mathsf{fma}\left(\left|x\right|, 2, \mathsf{fma}\left({\left(\left|x\right|\right)}^{7}, 0.047619047619047616, \left|x\right| \cdot \left(\left(x \cdot x\right) \cdot \mathsf{fma}\left(0.2 \cdot x, x, 0.6666666666666666\right)\right)\right)\right)\right| \]
      6. Taylor expanded in x around inf

        \[\leadsto \left|\color{blue}{\frac{5081767996463981}{45035996273704960} \cdot \left({x}^{4} \cdot \left|x\right|\right)}\right| \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \left|\frac{5081767996463981}{45035996273704960} \cdot \color{blue}{\left({x}^{4} \cdot \left|x\right|\right)}\right| \]
        2. lower-*.f64N/A

          \[\leadsto \left|\frac{5081767996463981}{45035996273704960} \cdot \left({x}^{4} \cdot \color{blue}{\left|x\right|}\right)\right| \]
        3. lower-pow.f64N/A

          \[\leadsto \left|\frac{5081767996463981}{45035996273704960} \cdot \left({x}^{4} \cdot \left|\color{blue}{x}\right|\right)\right| \]
        4. lower-fabs.f6431.6%

          \[\leadsto \left|0.11283791670955126 \cdot \left({x}^{4} \cdot \left|x\right|\right)\right| \]
      8. Applied rewrites31.6%

        \[\leadsto \left|\color{blue}{0.11283791670955126 \cdot \left({x}^{4} \cdot \left|x\right|\right)}\right| \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 11: 82.9% accurate, 0.8× speedup?

    \[\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|\\ t_2 := 2 \cdot \left|x\right|\\ \mathbf{if}\;\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(t\_2 + \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| \leq 10^{-8}:\\ \;\;\;\;t\_2 \cdot 0.5641895835477563\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{1}{\pi} \cdot \left(t\_2 \cdot t\_2\right)}\\ \end{array} \]
    (FPCore (x)
     :precision binary64
     (let* ((t_0 (* (* (fabs x) (fabs x)) (fabs x)))
            (t_1 (* (* t_0 (fabs x)) (fabs x)))
            (t_2 (* 2.0 (fabs x))))
       (if (<=
            (fabs
             (*
              (/ 1.0 (sqrt PI))
              (+
               (+ (+ t_2 (* (/ 2.0 3.0) t_0)) (* (/ 1.0 5.0) t_1))
               (* (/ 1.0 21.0) (* (* t_1 (fabs x)) (fabs x))))))
            1e-8)
         (* t_2 0.5641895835477563)
         (sqrt (* (/ 1.0 PI) (* t_2 t_2))))))
    double code(double x) {
    	double t_0 = (fabs(x) * fabs(x)) * fabs(x);
    	double t_1 = (t_0 * fabs(x)) * fabs(x);
    	double t_2 = 2.0 * fabs(x);
    	double tmp;
    	if (fabs(((1.0 / sqrt(((double) M_PI))) * (((t_2 + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * fabs(x)) * fabs(x)))))) <= 1e-8) {
    		tmp = t_2 * 0.5641895835477563;
    	} else {
    		tmp = sqrt(((1.0 / ((double) M_PI)) * (t_2 * t_2)));
    	}
    	return tmp;
    }
    
    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);
    	double t_2 = 2.0 * Math.abs(x);
    	double tmp;
    	if (Math.abs(((1.0 / Math.sqrt(Math.PI)) * (((t_2 + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * Math.abs(x)) * Math.abs(x)))))) <= 1e-8) {
    		tmp = t_2 * 0.5641895835477563;
    	} else {
    		tmp = Math.sqrt(((1.0 / Math.PI) * (t_2 * t_2)));
    	}
    	return tmp;
    }
    
    def code(x):
    	t_0 = (math.fabs(x) * math.fabs(x)) * math.fabs(x)
    	t_1 = (t_0 * math.fabs(x)) * math.fabs(x)
    	t_2 = 2.0 * math.fabs(x)
    	tmp = 0
    	if math.fabs(((1.0 / math.sqrt(math.pi)) * (((t_2 + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * math.fabs(x)) * math.fabs(x)))))) <= 1e-8:
    		tmp = t_2 * 0.5641895835477563
    	else:
    		tmp = math.sqrt(((1.0 / math.pi) * (t_2 * t_2)))
    	return tmp
    
    function code(x)
    	t_0 = Float64(Float64(abs(x) * abs(x)) * abs(x))
    	t_1 = Float64(Float64(t_0 * abs(x)) * abs(x))
    	t_2 = Float64(2.0 * abs(x))
    	tmp = 0.0
    	if (abs(Float64(Float64(1.0 / sqrt(pi)) * Float64(Float64(Float64(t_2 + 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)))))) <= 1e-8)
    		tmp = Float64(t_2 * 0.5641895835477563);
    	else
    		tmp = sqrt(Float64(Float64(1.0 / pi) * Float64(t_2 * t_2)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x)
    	t_0 = (abs(x) * abs(x)) * abs(x);
    	t_1 = (t_0 * abs(x)) * abs(x);
    	t_2 = 2.0 * abs(x);
    	tmp = 0.0;
    	if (abs(((1.0 / sqrt(pi)) * (((t_2 + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * abs(x)) * abs(x)))))) <= 1e-8)
    		tmp = t_2 * 0.5641895835477563;
    	else
    		tmp = sqrt(((1.0 / pi) * (t_2 * t_2)));
    	end
    	tmp_2 = tmp;
    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]}, Block[{t$95$2 = N[(2.0 * N[Abs[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[N[(N[(1.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(t$95$2 + 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], 1e-8], N[(t$95$2 * 0.5641895835477563), $MachinePrecision], N[Sqrt[N[(N[(1.0 / Pi), $MachinePrecision] * N[(t$95$2 * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
    
    \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|\\
    t_2 := 2 \cdot \left|x\right|\\
    \mathbf{if}\;\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(t\_2 + \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| \leq 10^{-8}:\\
    \;\;\;\;t\_2 \cdot 0.5641895835477563\\
    
    \mathbf{else}:\\
    \;\;\;\;\sqrt{\frac{1}{\pi} \cdot \left(t\_2 \cdot t\_2\right)}\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (fabs.f64 (*.f64 (/.f64 #s(literal 1 binary64) (sqrt.f64 (PI.f64))) (+.f64 (+.f64 (+.f64 (*.f64 #s(literal 2 binary64) (fabs.f64 x)) (*.f64 (/.f64 #s(literal 2 binary64) #s(literal 3 binary64)) (*.f64 (*.f64 (fabs.f64 x) (fabs.f64 x)) (fabs.f64 x)))) (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 5 binary64)) (*.f64 (*.f64 (*.f64 (*.f64 (fabs.f64 x) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)))) (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 21 binary64)) (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (fabs.f64 x) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)))))) < 1e-8

      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. Applied rewrites99.4%

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

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{\left|2 \cdot \color{blue}{\left|x\right|}\right|}{\sqrt{\pi}} \]
        2. lower-fabs.f6467.0%

          \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\sqrt{\pi}} \]
      5. Applied rewrites67.0%

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      6. Evaluated real constant67.3%

        \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\color{blue}{1.772453850905516}} \]
      7. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{\left|2 \cdot \left|x\right|\right|}{\frac{7982422502469483}{4503599627370496}}} \]
      8. Applied rewrites67.5%

        \[\leadsto \color{blue}{\left(2 \cdot \left|x\right|\right) \cdot 0.5641895835477563} \]

      if 1e-8 < (fabs.f64 (*.f64 (/.f64 #s(literal 1 binary64) (sqrt.f64 (PI.f64))) (+.f64 (+.f64 (+.f64 (*.f64 #s(literal 2 binary64) (fabs.f64 x)) (*.f64 (/.f64 #s(literal 2 binary64) #s(literal 3 binary64)) (*.f64 (*.f64 (fabs.f64 x) (fabs.f64 x)) (fabs.f64 x)))) (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 5 binary64)) (*.f64 (*.f64 (*.f64 (*.f64 (fabs.f64 x) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)))) (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 21 binary64)) (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (fabs.f64 x) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 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. Applied rewrites99.4%

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

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{\left|2 \cdot \color{blue}{\left|x\right|}\right|}{\sqrt{\pi}} \]
        2. lower-fabs.f6467.0%

          \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\sqrt{\pi}} \]
      5. Applied rewrites67.0%

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      6. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{\left|2 \cdot \left|x\right|\right|}{\sqrt{\pi}}} \]
        2. mult-flipN/A

          \[\leadsto \color{blue}{\left|2 \cdot \left|x\right|\right| \cdot \frac{1}{\sqrt{\pi}}} \]
        3. lift-/.f64N/A

          \[\leadsto \left|2 \cdot \left|x\right|\right| \cdot \color{blue}{\frac{1}{\sqrt{\pi}}} \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{1}{\sqrt{\pi}} \cdot \left|2 \cdot \left|x\right|\right|} \]
      7. Applied rewrites52.8%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\pi} \cdot \left(\left(2 \cdot \left|x\right|\right) \cdot \left(2 \cdot \left|x\right|\right)\right)}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 12: 82.9% accurate, 0.8× speedup?

    \[\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|\\ t_2 := 2 \cdot \left|x\right|\\ \mathbf{if}\;\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(t\_2 + \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| \leq 10^{-8}:\\ \;\;\;\;t\_2 \cdot 0.5641895835477563\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|2 \cdot \sqrt{x \cdot x}\right|}{\sqrt{\pi}}\\ \end{array} \]
    (FPCore (x)
     :precision binary64
     (let* ((t_0 (* (* (fabs x) (fabs x)) (fabs x)))
            (t_1 (* (* t_0 (fabs x)) (fabs x)))
            (t_2 (* 2.0 (fabs x))))
       (if (<=
            (fabs
             (*
              (/ 1.0 (sqrt PI))
              (+
               (+ (+ t_2 (* (/ 2.0 3.0) t_0)) (* (/ 1.0 5.0) t_1))
               (* (/ 1.0 21.0) (* (* t_1 (fabs x)) (fabs x))))))
            1e-8)
         (* t_2 0.5641895835477563)
         (/ (fabs (* 2.0 (sqrt (* x x)))) (sqrt PI)))))
    double code(double x) {
    	double t_0 = (fabs(x) * fabs(x)) * fabs(x);
    	double t_1 = (t_0 * fabs(x)) * fabs(x);
    	double t_2 = 2.0 * fabs(x);
    	double tmp;
    	if (fabs(((1.0 / sqrt(((double) M_PI))) * (((t_2 + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * fabs(x)) * fabs(x)))))) <= 1e-8) {
    		tmp = t_2 * 0.5641895835477563;
    	} else {
    		tmp = fabs((2.0 * sqrt((x * x)))) / sqrt(((double) M_PI));
    	}
    	return tmp;
    }
    
    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);
    	double t_2 = 2.0 * Math.abs(x);
    	double tmp;
    	if (Math.abs(((1.0 / Math.sqrt(Math.PI)) * (((t_2 + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * Math.abs(x)) * Math.abs(x)))))) <= 1e-8) {
    		tmp = t_2 * 0.5641895835477563;
    	} else {
    		tmp = Math.abs((2.0 * Math.sqrt((x * x)))) / Math.sqrt(Math.PI);
    	}
    	return tmp;
    }
    
    def code(x):
    	t_0 = (math.fabs(x) * math.fabs(x)) * math.fabs(x)
    	t_1 = (t_0 * math.fabs(x)) * math.fabs(x)
    	t_2 = 2.0 * math.fabs(x)
    	tmp = 0
    	if math.fabs(((1.0 / math.sqrt(math.pi)) * (((t_2 + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * math.fabs(x)) * math.fabs(x)))))) <= 1e-8:
    		tmp = t_2 * 0.5641895835477563
    	else:
    		tmp = math.fabs((2.0 * math.sqrt((x * x)))) / math.sqrt(math.pi)
    	return tmp
    
    function code(x)
    	t_0 = Float64(Float64(abs(x) * abs(x)) * abs(x))
    	t_1 = Float64(Float64(t_0 * abs(x)) * abs(x))
    	t_2 = Float64(2.0 * abs(x))
    	tmp = 0.0
    	if (abs(Float64(Float64(1.0 / sqrt(pi)) * Float64(Float64(Float64(t_2 + 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)))))) <= 1e-8)
    		tmp = Float64(t_2 * 0.5641895835477563);
    	else
    		tmp = Float64(abs(Float64(2.0 * sqrt(Float64(x * x)))) / sqrt(pi));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x)
    	t_0 = (abs(x) * abs(x)) * abs(x);
    	t_1 = (t_0 * abs(x)) * abs(x);
    	t_2 = 2.0 * abs(x);
    	tmp = 0.0;
    	if (abs(((1.0 / sqrt(pi)) * (((t_2 + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * abs(x)) * abs(x)))))) <= 1e-8)
    		tmp = t_2 * 0.5641895835477563;
    	else
    		tmp = abs((2.0 * sqrt((x * x)))) / sqrt(pi);
    	end
    	tmp_2 = tmp;
    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]}, Block[{t$95$2 = N[(2.0 * N[Abs[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[N[(N[(1.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(t$95$2 + 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], 1e-8], N[(t$95$2 * 0.5641895835477563), $MachinePrecision], N[(N[Abs[N[(2.0 * N[Sqrt[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]]]]]
    
    \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|\\
    t_2 := 2 \cdot \left|x\right|\\
    \mathbf{if}\;\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(t\_2 + \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| \leq 10^{-8}:\\
    \;\;\;\;t\_2 \cdot 0.5641895835477563\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\left|2 \cdot \sqrt{x \cdot x}\right|}{\sqrt{\pi}}\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (fabs.f64 (*.f64 (/.f64 #s(literal 1 binary64) (sqrt.f64 (PI.f64))) (+.f64 (+.f64 (+.f64 (*.f64 #s(literal 2 binary64) (fabs.f64 x)) (*.f64 (/.f64 #s(literal 2 binary64) #s(literal 3 binary64)) (*.f64 (*.f64 (fabs.f64 x) (fabs.f64 x)) (fabs.f64 x)))) (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 5 binary64)) (*.f64 (*.f64 (*.f64 (*.f64 (fabs.f64 x) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)))) (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 21 binary64)) (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (fabs.f64 x) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)))))) < 1e-8

      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. Applied rewrites99.4%

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

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{\left|2 \cdot \color{blue}{\left|x\right|}\right|}{\sqrt{\pi}} \]
        2. lower-fabs.f6467.0%

          \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\sqrt{\pi}} \]
      5. Applied rewrites67.0%

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      6. Evaluated real constant67.3%

        \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\color{blue}{1.772453850905516}} \]
      7. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{\left|2 \cdot \left|x\right|\right|}{\frac{7982422502469483}{4503599627370496}}} \]
      8. Applied rewrites67.5%

        \[\leadsto \color{blue}{\left(2 \cdot \left|x\right|\right) \cdot 0.5641895835477563} \]

      if 1e-8 < (fabs.f64 (*.f64 (/.f64 #s(literal 1 binary64) (sqrt.f64 (PI.f64))) (+.f64 (+.f64 (+.f64 (*.f64 #s(literal 2 binary64) (fabs.f64 x)) (*.f64 (/.f64 #s(literal 2 binary64) #s(literal 3 binary64)) (*.f64 (*.f64 (fabs.f64 x) (fabs.f64 x)) (fabs.f64 x)))) (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 5 binary64)) (*.f64 (*.f64 (*.f64 (*.f64 (fabs.f64 x) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)))) (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 21 binary64)) (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (fabs.f64 x) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 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. Applied rewrites99.4%

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

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{\left|2 \cdot \color{blue}{\left|x\right|}\right|}{\sqrt{\pi}} \]
        2. lower-fabs.f6467.0%

          \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\sqrt{\pi}} \]
      5. Applied rewrites67.0%

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      6. Step-by-step derivation
        1. lift-fabs.f64N/A

          \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\sqrt{\pi}} \]
        2. rem-sqrt-square-revN/A

          \[\leadsto \frac{\left|2 \cdot \sqrt{x \cdot x}\right|}{\sqrt{\pi}} \]
        3. lift-*.f64N/A

          \[\leadsto \frac{\left|2 \cdot \sqrt{x \cdot x}\right|}{\sqrt{\pi}} \]
        4. lower-sqrt.f6452.7%

          \[\leadsto \frac{\left|2 \cdot \sqrt{x \cdot x}\right|}{\sqrt{\pi}} \]
      7. Applied rewrites52.7%

        \[\leadsto \frac{\left|2 \cdot \sqrt{x \cdot x}\right|}{\sqrt{\pi}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 13: 82.9% accurate, 0.9× speedup?

    \[\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|\\ t_2 := 2 \cdot \left|x\right|\\ \mathbf{if}\;\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(t\_2 + \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| \leq 5 \cdot 10^{-14}:\\ \;\;\;\;t\_2 \cdot 0.5641895835477563\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|2 \cdot \sqrt{x \cdot x}\right|}{1.772453850905516}\\ \end{array} \]
    (FPCore (x)
     :precision binary64
     (let* ((t_0 (* (* (fabs x) (fabs x)) (fabs x)))
            (t_1 (* (* t_0 (fabs x)) (fabs x)))
            (t_2 (* 2.0 (fabs x))))
       (if (<=
            (fabs
             (*
              (/ 1.0 (sqrt PI))
              (+
               (+ (+ t_2 (* (/ 2.0 3.0) t_0)) (* (/ 1.0 5.0) t_1))
               (* (/ 1.0 21.0) (* (* t_1 (fabs x)) (fabs x))))))
            5e-14)
         (* t_2 0.5641895835477563)
         (/ (fabs (* 2.0 (sqrt (* x x)))) 1.772453850905516))))
    double code(double x) {
    	double t_0 = (fabs(x) * fabs(x)) * fabs(x);
    	double t_1 = (t_0 * fabs(x)) * fabs(x);
    	double t_2 = 2.0 * fabs(x);
    	double tmp;
    	if (fabs(((1.0 / sqrt(((double) M_PI))) * (((t_2 + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * fabs(x)) * fabs(x)))))) <= 5e-14) {
    		tmp = t_2 * 0.5641895835477563;
    	} else {
    		tmp = fabs((2.0 * sqrt((x * x)))) / 1.772453850905516;
    	}
    	return tmp;
    }
    
    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);
    	double t_2 = 2.0 * Math.abs(x);
    	double tmp;
    	if (Math.abs(((1.0 / Math.sqrt(Math.PI)) * (((t_2 + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * Math.abs(x)) * Math.abs(x)))))) <= 5e-14) {
    		tmp = t_2 * 0.5641895835477563;
    	} else {
    		tmp = Math.abs((2.0 * Math.sqrt((x * x)))) / 1.772453850905516;
    	}
    	return tmp;
    }
    
    def code(x):
    	t_0 = (math.fabs(x) * math.fabs(x)) * math.fabs(x)
    	t_1 = (t_0 * math.fabs(x)) * math.fabs(x)
    	t_2 = 2.0 * math.fabs(x)
    	tmp = 0
    	if math.fabs(((1.0 / math.sqrt(math.pi)) * (((t_2 + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * math.fabs(x)) * math.fabs(x)))))) <= 5e-14:
    		tmp = t_2 * 0.5641895835477563
    	else:
    		tmp = math.fabs((2.0 * math.sqrt((x * x)))) / 1.772453850905516
    	return tmp
    
    function code(x)
    	t_0 = Float64(Float64(abs(x) * abs(x)) * abs(x))
    	t_1 = Float64(Float64(t_0 * abs(x)) * abs(x))
    	t_2 = Float64(2.0 * abs(x))
    	tmp = 0.0
    	if (abs(Float64(Float64(1.0 / sqrt(pi)) * Float64(Float64(Float64(t_2 + 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)))))) <= 5e-14)
    		tmp = Float64(t_2 * 0.5641895835477563);
    	else
    		tmp = Float64(abs(Float64(2.0 * sqrt(Float64(x * x)))) / 1.772453850905516);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x)
    	t_0 = (abs(x) * abs(x)) * abs(x);
    	t_1 = (t_0 * abs(x)) * abs(x);
    	t_2 = 2.0 * abs(x);
    	tmp = 0.0;
    	if (abs(((1.0 / sqrt(pi)) * (((t_2 + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * abs(x)) * abs(x)))))) <= 5e-14)
    		tmp = t_2 * 0.5641895835477563;
    	else
    		tmp = abs((2.0 * sqrt((x * x)))) / 1.772453850905516;
    	end
    	tmp_2 = tmp;
    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]}, Block[{t$95$2 = N[(2.0 * N[Abs[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[N[(N[(1.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(t$95$2 + 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], 5e-14], N[(t$95$2 * 0.5641895835477563), $MachinePrecision], N[(N[Abs[N[(2.0 * N[Sqrt[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / 1.772453850905516), $MachinePrecision]]]]]
    
    \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|\\
    t_2 := 2 \cdot \left|x\right|\\
    \mathbf{if}\;\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(t\_2 + \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| \leq 5 \cdot 10^{-14}:\\
    \;\;\;\;t\_2 \cdot 0.5641895835477563\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\left|2 \cdot \sqrt{x \cdot x}\right|}{1.772453850905516}\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (fabs.f64 (*.f64 (/.f64 #s(literal 1 binary64) (sqrt.f64 (PI.f64))) (+.f64 (+.f64 (+.f64 (*.f64 #s(literal 2 binary64) (fabs.f64 x)) (*.f64 (/.f64 #s(literal 2 binary64) #s(literal 3 binary64)) (*.f64 (*.f64 (fabs.f64 x) (fabs.f64 x)) (fabs.f64 x)))) (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 5 binary64)) (*.f64 (*.f64 (*.f64 (*.f64 (fabs.f64 x) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)))) (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 21 binary64)) (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (fabs.f64 x) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)))))) < 5.0000000000000002e-14

      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. Applied rewrites99.4%

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

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{\left|2 \cdot \color{blue}{\left|x\right|}\right|}{\sqrt{\pi}} \]
        2. lower-fabs.f6467.0%

          \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\sqrt{\pi}} \]
      5. Applied rewrites67.0%

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      6. Evaluated real constant67.3%

        \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\color{blue}{1.772453850905516}} \]
      7. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{\left|2 \cdot \left|x\right|\right|}{\frac{7982422502469483}{4503599627370496}}} \]
      8. Applied rewrites67.5%

        \[\leadsto \color{blue}{\left(2 \cdot \left|x\right|\right) \cdot 0.5641895835477563} \]

      if 5.0000000000000002e-14 < (fabs.f64 (*.f64 (/.f64 #s(literal 1 binary64) (sqrt.f64 (PI.f64))) (+.f64 (+.f64 (+.f64 (*.f64 #s(literal 2 binary64) (fabs.f64 x)) (*.f64 (/.f64 #s(literal 2 binary64) #s(literal 3 binary64)) (*.f64 (*.f64 (fabs.f64 x) (fabs.f64 x)) (fabs.f64 x)))) (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 5 binary64)) (*.f64 (*.f64 (*.f64 (*.f64 (fabs.f64 x) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)))) (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 21 binary64)) (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (*.f64 (fabs.f64 x) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 x)) (fabs.f64 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. Applied rewrites99.4%

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

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{\left|2 \cdot \color{blue}{\left|x\right|}\right|}{\sqrt{\pi}} \]
        2. lower-fabs.f6467.0%

          \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\sqrt{\pi}} \]
      5. Applied rewrites67.0%

        \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
      6. Evaluated real constant67.3%

        \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\color{blue}{1.772453850905516}} \]
      7. Step-by-step derivation
        1. lift-fabs.f64N/A

          \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\frac{7982422502469483}{4503599627370496}} \]
        2. rem-sqrt-square-revN/A

          \[\leadsto \frac{\left|2 \cdot \sqrt{x \cdot x}\right|}{\frac{7982422502469483}{4503599627370496}} \]
        3. lower-sqrt.f64N/A

          \[\leadsto \frac{\left|2 \cdot \sqrt{x \cdot x}\right|}{\frac{7982422502469483}{4503599627370496}} \]
        4. lift-*.f6452.8%

          \[\leadsto \frac{\left|2 \cdot \sqrt{x \cdot x}\right|}{1.772453850905516} \]
      8. Applied rewrites52.8%

        \[\leadsto \frac{\left|2 \cdot \sqrt{x \cdot x}\right|}{1.772453850905516} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 14: 67.5% accurate, 11.7× speedup?

    \[\left(2 \cdot \left|x\right|\right) \cdot 0.5641895835477563 \]
    (FPCore (x) :precision binary64 (* (* 2.0 (fabs x)) 0.5641895835477563))
    double code(double x) {
    	return (2.0 * fabs(x)) * 0.5641895835477563;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        code = (2.0d0 * abs(x)) * 0.5641895835477563d0
    end function
    
    public static double code(double x) {
    	return (2.0 * Math.abs(x)) * 0.5641895835477563;
    }
    
    def code(x):
    	return (2.0 * math.fabs(x)) * 0.5641895835477563
    
    function code(x)
    	return Float64(Float64(2.0 * abs(x)) * 0.5641895835477563)
    end
    
    function tmp = code(x)
    	tmp = (2.0 * abs(x)) * 0.5641895835477563;
    end
    
    code[x_] := N[(N[(2.0 * N[Abs[x], $MachinePrecision]), $MachinePrecision] * 0.5641895835477563), $MachinePrecision]
    
    \left(2 \cdot \left|x\right|\right) \cdot 0.5641895835477563
    
    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. Applied rewrites99.4%

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

      \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{\left|2 \cdot \color{blue}{\left|x\right|}\right|}{\sqrt{\pi}} \]
      2. lower-fabs.f6467.0%

        \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\sqrt{\pi}} \]
    5. Applied rewrites67.0%

      \[\leadsto \frac{\left|\color{blue}{2 \cdot \left|x\right|}\right|}{\sqrt{\pi}} \]
    6. Evaluated real constant67.3%

      \[\leadsto \frac{\left|2 \cdot \left|x\right|\right|}{\color{blue}{1.772453850905516}} \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left|2 \cdot \left|x\right|\right|}{\frac{7982422502469483}{4503599627370496}}} \]
    8. Applied rewrites67.5%

      \[\leadsto \color{blue}{\left(2 \cdot \left|x\right|\right) \cdot 0.5641895835477563} \]
    9. Add Preprocessing

    Reproduce

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