
(FPCore (x)
:precision binary64
(let* ((t_0 (* (* (fabs x) (fabs x)) (fabs x)))
(t_1 (* (* t_0 (fabs x)) (fabs x))))
(fabs
(*
(/ 1.0 (sqrt PI))
(+
(+ (+ (* 2.0 (fabs x)) (* (/ 2.0 3.0) t_0)) (* (/ 1.0 5.0) t_1))
(* (/ 1.0 21.0) (* (* t_1 (fabs x)) (fabs x))))))))
double code(double x) {
double t_0 = (fabs(x) * fabs(x)) * fabs(x);
double t_1 = (t_0 * fabs(x)) * fabs(x);
return fabs(((1.0 / sqrt(((double) M_PI))) * ((((2.0 * fabs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * fabs(x)) * fabs(x))))));
}
public static double code(double x) {
double t_0 = (Math.abs(x) * Math.abs(x)) * Math.abs(x);
double t_1 = (t_0 * Math.abs(x)) * Math.abs(x);
return Math.abs(((1.0 / Math.sqrt(Math.PI)) * ((((2.0 * Math.abs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * Math.abs(x)) * Math.abs(x))))));
}
def code(x): t_0 = (math.fabs(x) * math.fabs(x)) * math.fabs(x) t_1 = (t_0 * math.fabs(x)) * math.fabs(x) return math.fabs(((1.0 / math.sqrt(math.pi)) * ((((2.0 * math.fabs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * math.fabs(x)) * math.fabs(x))))))
function code(x) t_0 = Float64(Float64(abs(x) * abs(x)) * abs(x)) t_1 = Float64(Float64(t_0 * abs(x)) * abs(x)) return abs(Float64(Float64(1.0 / sqrt(pi)) * Float64(Float64(Float64(Float64(2.0 * abs(x)) + Float64(Float64(2.0 / 3.0) * t_0)) + Float64(Float64(1.0 / 5.0) * t_1)) + Float64(Float64(1.0 / 21.0) * Float64(Float64(t_1 * abs(x)) * abs(x)))))) end
function tmp = code(x) t_0 = (abs(x) * abs(x)) * abs(x); t_1 = (t_0 * abs(x)) * abs(x); tmp = abs(((1.0 / sqrt(pi)) * ((((2.0 * abs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * abs(x)) * abs(x)))))); end
code[x_] := Block[{t$95$0 = N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(1.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(2.0 * N[Abs[x], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / 3.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 5.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 21.0), $MachinePrecision] * N[(N[(t$95$1 * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\\
t_1 := \left(t\_0 \cdot \left|x\right|\right) \cdot \left|x\right|\\
\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot t\_0\right) + \frac{1}{5} \cdot t\_1\right) + \frac{1}{21} \cdot \left(\left(t\_1 \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right|
\end{array}
\end{array}
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x)
:precision binary64
(let* ((t_0 (* (* (fabs x) (fabs x)) (fabs x)))
(t_1 (* (* t_0 (fabs x)) (fabs x))))
(fabs
(*
(/ 1.0 (sqrt PI))
(+
(+ (+ (* 2.0 (fabs x)) (* (/ 2.0 3.0) t_0)) (* (/ 1.0 5.0) t_1))
(* (/ 1.0 21.0) (* (* t_1 (fabs x)) (fabs x))))))))
double code(double x) {
double t_0 = (fabs(x) * fabs(x)) * fabs(x);
double t_1 = (t_0 * fabs(x)) * fabs(x);
return fabs(((1.0 / sqrt(((double) M_PI))) * ((((2.0 * fabs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * fabs(x)) * fabs(x))))));
}
public static double code(double x) {
double t_0 = (Math.abs(x) * Math.abs(x)) * Math.abs(x);
double t_1 = (t_0 * Math.abs(x)) * Math.abs(x);
return Math.abs(((1.0 / Math.sqrt(Math.PI)) * ((((2.0 * Math.abs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * Math.abs(x)) * Math.abs(x))))));
}
def code(x): t_0 = (math.fabs(x) * math.fabs(x)) * math.fabs(x) t_1 = (t_0 * math.fabs(x)) * math.fabs(x) return math.fabs(((1.0 / math.sqrt(math.pi)) * ((((2.0 * math.fabs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * math.fabs(x)) * math.fabs(x))))))
function code(x) t_0 = Float64(Float64(abs(x) * abs(x)) * abs(x)) t_1 = Float64(Float64(t_0 * abs(x)) * abs(x)) return abs(Float64(Float64(1.0 / sqrt(pi)) * Float64(Float64(Float64(Float64(2.0 * abs(x)) + Float64(Float64(2.0 / 3.0) * t_0)) + Float64(Float64(1.0 / 5.0) * t_1)) + Float64(Float64(1.0 / 21.0) * Float64(Float64(t_1 * abs(x)) * abs(x)))))) end
function tmp = code(x) t_0 = (abs(x) * abs(x)) * abs(x); t_1 = (t_0 * abs(x)) * abs(x); tmp = abs(((1.0 / sqrt(pi)) * ((((2.0 * abs(x)) + ((2.0 / 3.0) * t_0)) + ((1.0 / 5.0) * t_1)) + ((1.0 / 21.0) * ((t_1 * abs(x)) * abs(x)))))); end
code[x_] := Block[{t$95$0 = N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(1.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(2.0 * N[Abs[x], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / 3.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 5.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 21.0), $MachinePrecision] * N[(N[(t$95$1 * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\\
t_1 := \left(t\_0 \cdot \left|x\right|\right) \cdot \left|x\right|\\
\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot t\_0\right) + \frac{1}{5} \cdot t\_1\right) + \frac{1}{21} \cdot \left(\left(t\_1 \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right|
\end{array}
\end{array}
(FPCore (x)
:precision binary64
(let* ((t_0 (* (* (fabs x) (fabs x)) (fabs x))))
(fabs
(*
(/ 1.0 (sqrt PI))
(+
(+
(+ (* 2.0 (fabs x)) (* (/ 2.0 3.0) t_0))
(* (/ 1.0 5.0) (* (* t_0 (fabs x)) (fabs x))))
(* (/ 1.0 21.0) (* (pow (fabs x) 6.0) (fabs x))))))))
double code(double x) {
double t_0 = (fabs(x) * 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_0 * fabs(x)) * fabs(x)))) + ((1.0 / 21.0) * (pow(fabs(x), 6.0) * fabs(x))))));
}
public static double code(double x) {
double t_0 = (Math.abs(x) * 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_0 * Math.abs(x)) * Math.abs(x)))) + ((1.0 / 21.0) * (Math.pow(Math.abs(x), 6.0) * Math.abs(x))))));
}
def code(x): t_0 = (math.fabs(x) * 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_0 * math.fabs(x)) * math.fabs(x)))) + ((1.0 / 21.0) * (math.pow(math.fabs(x), 6.0) * math.fabs(x))))))
function code(x) t_0 = Float64(Float64(abs(x) * 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) * Float64(Float64(t_0 * abs(x)) * abs(x)))) + Float64(Float64(1.0 / 21.0) * Float64((abs(x) ^ 6.0) * abs(x)))))) end
function tmp = code(x) t_0 = (abs(x) * 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_0 * abs(x)) * abs(x)))) + ((1.0 / 21.0) * ((abs(x) ^ 6.0) * 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]}, 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] * N[(N[(t$95$0 * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 21.0), $MachinePrecision] * N[(N[Power[N[Abs[x], $MachinePrecision], 6.0], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\\
\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 \left(\left(t\_0 \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left({\left(\left|x\right|\right)}^{6} \cdot \left|x\right|\right)\right)\right|
\end{array}
\end{array}
Initial program 99.9%
Taylor expanded in x around 0
lower-pow.f64N/A
lower-fabs.f6499.9
Applied rewrites99.9%
(FPCore (x)
:precision binary64
(let* ((t_0 (* (* (* x x) x) x)))
(fabs
(*
(/ 1.0 (sqrt PI))
(fma
(* t_0 (fabs x))
(* (* x x) 0.047619047619047616)
(fma
(* 0.2 (fabs x))
t_0
(* (fabs x) (fma (* x x) 0.6666666666666666 2.0))))))))
double code(double x) {
double t_0 = ((x * x) * x) * x;
return fabs(((1.0 / sqrt(((double) M_PI))) * fma((t_0 * fabs(x)), ((x * x) * 0.047619047619047616), fma((0.2 * fabs(x)), t_0, (fabs(x) * fma((x * x), 0.6666666666666666, 2.0))))));
}
function code(x) t_0 = Float64(Float64(Float64(x * x) * x) * x) return abs(Float64(Float64(1.0 / sqrt(pi)) * fma(Float64(t_0 * abs(x)), Float64(Float64(x * x) * 0.047619047619047616), fma(Float64(0.2 * abs(x)), t_0, Float64(abs(x) * fma(Float64(x * x), 0.6666666666666666, 2.0)))))) end
code[x_] := Block[{t$95$0 = N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision]}, N[Abs[N[(N[(1.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 0.047619047619047616), $MachinePrecision] + N[(N[(0.2 * N[Abs[x], $MachinePrecision]), $MachinePrecision] * t$95$0 + N[(N[Abs[x], $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 0.6666666666666666 + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x \cdot x\right) \cdot x\right) \cdot x\\
\left|\frac{1}{\sqrt{\pi}} \cdot \mathsf{fma}\left(t\_0 \cdot \left|x\right|, \left(x \cdot x\right) \cdot 0.047619047619047616, \mathsf{fma}\left(0.2 \cdot \left|x\right|, t\_0, \left|x\right| \cdot \mathsf{fma}\left(x \cdot x, 0.6666666666666666, 2\right)\right)\right)\right|
\end{array}
\end{array}
Initial program 99.9%
Applied rewrites99.9%
(FPCore (x)
:precision binary64
(fabs
(*
(/ 1.0 (sqrt PI))
(fma
(fabs x)
2.0
(fma
(fabs x)
(fma (* 0.6666666666666666 x) x (* (* 0.2 (* x x)) (* x x)))
(* (* (* (* (* (* (* x x) x) x) (fabs x)) x) x) 0.047619047619047616))))))
double code(double x) {
return fabs(((1.0 / sqrt(((double) M_PI))) * fma(fabs(x), 2.0, fma(fabs(x), fma((0.6666666666666666 * x), x, ((0.2 * (x * x)) * (x * x))), (((((((x * x) * x) * x) * fabs(x)) * x) * x) * 0.047619047619047616)))));
}
function code(x) return abs(Float64(Float64(1.0 / sqrt(pi)) * fma(abs(x), 2.0, fma(abs(x), fma(Float64(0.6666666666666666 * x), x, Float64(Float64(0.2 * Float64(x * x)) * Float64(x * x))), Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * x) * x) * x) * abs(x)) * x) * x) * 0.047619047619047616))))) end
code[x_] := N[Abs[N[(N[(1.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(N[Abs[x], $MachinePrecision] * 2.0 + N[(N[Abs[x], $MachinePrecision] * N[(N[(0.6666666666666666 * x), $MachinePrecision] * x + N[(N[(0.2 * N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * 0.047619047619047616), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{1}{\sqrt{\pi}} \cdot \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(\left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right) \cdot \left|x\right|\right) \cdot x\right) \cdot x\right) \cdot 0.047619047619047616\right)\right)\right|
\end{array}
Initial program 99.9%
Applied rewrites99.9%
(FPCore (x)
:precision binary64
(*
(/ 1.0 (sqrt PI))
(fabs
(fma
(fma 0.6666666666666666 (* x x) 2.0)
(fabs x)
(*
(* (* (fabs x) x) (* (* x x) x))
(fma (* 0.047619047619047616 x) x 0.2))))))
double code(double x) {
return (1.0 / sqrt(((double) M_PI))) * fabs(fma(fma(0.6666666666666666, (x * x), 2.0), fabs(x), (((fabs(x) * x) * ((x * x) * x)) * fma((0.047619047619047616 * x), x, 0.2))));
}
function code(x) return Float64(Float64(1.0 / sqrt(pi)) * abs(fma(fma(0.6666666666666666, Float64(x * x), 2.0), abs(x), Float64(Float64(Float64(abs(x) * x) * Float64(Float64(x * x) * x)) * fma(Float64(0.047619047619047616 * x), x, 0.2))))) end
code[x_] := N[(N[(1.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[Abs[N[(N[(0.6666666666666666 * N[(x * x), $MachinePrecision] + 2.0), $MachinePrecision] * N[Abs[x], $MachinePrecision] + N[(N[(N[(N[Abs[x], $MachinePrecision] * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * N[(N[(0.047619047619047616 * x), $MachinePrecision] * x + 0.2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\sqrt{\pi}} \cdot \left|\mathsf{fma}\left(\mathsf{fma}\left(0.6666666666666666, x \cdot x, 2\right), \left|x\right|, \left(\left(\left|x\right| \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\right) \cdot \mathsf{fma}\left(0.047619047619047616 \cdot x, x, 0.2\right)\right)\right|
\end{array}
Initial program 99.9%
Applied rewrites99.9%
Applied rewrites99.9%
(FPCore (x)
:precision binary64
(*
(/ 1.0 (sqrt PI))
(fabs
(-
(* (* (fma (* 0.047619047619047616 x) x 0.2) (* (* (* (- x) x) x) x)) x)
(* x 2.0)))))
double code(double x) {
return (1.0 / sqrt(((double) M_PI))) * fabs((((fma((0.047619047619047616 * x), x, 0.2) * (((-x * x) * x) * x)) * x) - (x * 2.0)));
}
function code(x) return Float64(Float64(1.0 / sqrt(pi)) * abs(Float64(Float64(Float64(fma(Float64(0.047619047619047616 * x), x, 0.2) * Float64(Float64(Float64(Float64(-x) * x) * x) * x)) * x) - Float64(x * 2.0)))) end
code[x_] := N[(N[(1.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[Abs[N[(N[(N[(N[(N[(0.047619047619047616 * x), $MachinePrecision] * x + 0.2), $MachinePrecision] * N[(N[(N[((-x) * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\sqrt{\pi}} \cdot \left|\left(\mathsf{fma}\left(0.047619047619047616 \cdot x, x, 0.2\right) \cdot \left(\left(\left(\left(-x\right) \cdot x\right) \cdot x\right) \cdot x\right)\right) \cdot x - x \cdot 2\right|
\end{array}
Initial program 99.9%
Applied rewrites99.9%
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites99.1%
Applied rewrites99.1%
(FPCore (x) :precision binary64 (if (<= x 1.9) (fabs (* (/ 2.0 (sqrt PI)) (- x))) (fabs (* 0.047619047619047616 (/ (* (pow x 6.0) (- x)) (sqrt PI))))))
double code(double x) {
double tmp;
if (x <= 1.9) {
tmp = fabs(((2.0 / sqrt(((double) M_PI))) * -x));
} else {
tmp = fabs((0.047619047619047616 * ((pow(x, 6.0) * -x) / sqrt(((double) M_PI)))));
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 1.9) {
tmp = Math.abs(((2.0 / Math.sqrt(Math.PI)) * -x));
} else {
tmp = Math.abs((0.047619047619047616 * ((Math.pow(x, 6.0) * -x) / Math.sqrt(Math.PI))));
}
return tmp;
}
def code(x): tmp = 0 if x <= 1.9: tmp = math.fabs(((2.0 / math.sqrt(math.pi)) * -x)) else: tmp = math.fabs((0.047619047619047616 * ((math.pow(x, 6.0) * -x) / math.sqrt(math.pi)))) return tmp
function code(x) tmp = 0.0 if (x <= 1.9) tmp = abs(Float64(Float64(2.0 / sqrt(pi)) * Float64(-x))); else tmp = abs(Float64(0.047619047619047616 * Float64(Float64((x ^ 6.0) * Float64(-x)) / sqrt(pi)))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 1.9) tmp = abs(((2.0 / sqrt(pi)) * -x)); else tmp = abs((0.047619047619047616 * (((x ^ 6.0) * -x) / sqrt(pi)))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 1.9], N[Abs[N[(N[(2.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * (-x)), $MachinePrecision]], $MachinePrecision], N[Abs[N[(0.047619047619047616 * N[(N[(N[Power[x, 6.0], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.9:\\
\;\;\;\;\left|\frac{2}{\sqrt{\pi}} \cdot \left(-x\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|0.047619047619047616 \cdot \frac{{x}^{6} \cdot \left(-x\right)}{\sqrt{\pi}}\right|\\
\end{array}
\end{array}
if x < 1.8999999999999999Initial program 99.9%
Applied rewrites99.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-fabs.f64N/A
lower-sqrt.f64N/A
lower-PI.f6467.1
Applied rewrites67.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6467.5
Applied rewrites67.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.5
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqr-neg-revN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqrt-unprodN/A
rem-square-sqrt67.5
Applied rewrites67.5%
if 1.8999999999999999 < x Initial program 99.9%
Applied rewrites99.9%
Taylor expanded in x around inf
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-fabs.f64N/A
lower-sqrt.f64N/A
lower-PI.f6437.1
Applied rewrites37.1%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqr-neg-revN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqrt-unprodN/A
rem-square-sqrt37.1
Applied rewrites37.1%
(FPCore (x)
:precision binary64
(if (<= x 1.9)
(fabs (* (/ 2.0 (sqrt PI)) (- x)))
(fabs
(/
0.047619047619047616
(/ (- (sqrt PI)) (* (* (* (* (* x x) x) x) x) (* x x)))))))
double code(double x) {
double tmp;
if (x <= 1.9) {
tmp = fabs(((2.0 / sqrt(((double) M_PI))) * -x));
} else {
tmp = fabs((0.047619047619047616 / (-sqrt(((double) M_PI)) / (((((x * x) * x) * x) * x) * (x * x)))));
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 1.9) {
tmp = Math.abs(((2.0 / Math.sqrt(Math.PI)) * -x));
} else {
tmp = Math.abs((0.047619047619047616 / (-Math.sqrt(Math.PI) / (((((x * x) * x) * x) * x) * (x * x)))));
}
return tmp;
}
def code(x): tmp = 0 if x <= 1.9: tmp = math.fabs(((2.0 / math.sqrt(math.pi)) * -x)) else: tmp = math.fabs((0.047619047619047616 / (-math.sqrt(math.pi) / (((((x * x) * x) * x) * x) * (x * x))))) return tmp
function code(x) tmp = 0.0 if (x <= 1.9) tmp = abs(Float64(Float64(2.0 / sqrt(pi)) * Float64(-x))); else tmp = abs(Float64(0.047619047619047616 / Float64(Float64(-sqrt(pi)) / Float64(Float64(Float64(Float64(Float64(x * x) * x) * x) * x) * Float64(x * x))))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 1.9) tmp = abs(((2.0 / sqrt(pi)) * -x)); else tmp = abs((0.047619047619047616 / (-sqrt(pi) / (((((x * x) * x) * x) * x) * (x * x))))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 1.9], N[Abs[N[(N[(2.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * (-x)), $MachinePrecision]], $MachinePrecision], N[Abs[N[(0.047619047619047616 / N[((-N[Sqrt[Pi], $MachinePrecision]) / N[(N[(N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.9:\\
\;\;\;\;\left|\frac{2}{\sqrt{\pi}} \cdot \left(-x\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{0.047619047619047616}{\frac{-\sqrt{\pi}}{\left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot \left(x \cdot x\right)}}\right|\\
\end{array}
\end{array}
if x < 1.8999999999999999Initial program 99.9%
Applied rewrites99.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-fabs.f64N/A
lower-sqrt.f64N/A
lower-PI.f6467.1
Applied rewrites67.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6467.5
Applied rewrites67.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.5
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqr-neg-revN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqrt-unprodN/A
rem-square-sqrt67.5
Applied rewrites67.5%
if 1.8999999999999999 < x Initial program 99.9%
Applied rewrites99.9%
Taylor expanded in x around inf
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-fabs.f64N/A
lower-sqrt.f64N/A
lower-PI.f6437.1
Applied rewrites37.1%
Applied rewrites37.1%
(FPCore (x)
:precision binary64
(if (<= x 1.9)
(fabs (* (/ 2.0 (sqrt PI)) (- x)))
(fabs
(*
0.047619047619047616
(* (* (* (* x x) x) x) (* (* x x) (/ (- x) (sqrt PI))))))))
double code(double x) {
double tmp;
if (x <= 1.9) {
tmp = fabs(((2.0 / sqrt(((double) M_PI))) * -x));
} else {
tmp = fabs((0.047619047619047616 * ((((x * x) * x) * x) * ((x * x) * (-x / sqrt(((double) M_PI)))))));
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 1.9) {
tmp = Math.abs(((2.0 / Math.sqrt(Math.PI)) * -x));
} else {
tmp = Math.abs((0.047619047619047616 * ((((x * x) * x) * x) * ((x * x) * (-x / Math.sqrt(Math.PI))))));
}
return tmp;
}
def code(x): tmp = 0 if x <= 1.9: tmp = math.fabs(((2.0 / math.sqrt(math.pi)) * -x)) else: tmp = math.fabs((0.047619047619047616 * ((((x * x) * x) * x) * ((x * x) * (-x / math.sqrt(math.pi)))))) return tmp
function code(x) tmp = 0.0 if (x <= 1.9) tmp = abs(Float64(Float64(2.0 / sqrt(pi)) * Float64(-x))); else tmp = abs(Float64(0.047619047619047616 * Float64(Float64(Float64(Float64(x * x) * x) * x) * Float64(Float64(x * x) * Float64(Float64(-x) / sqrt(pi)))))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 1.9) tmp = abs(((2.0 / sqrt(pi)) * -x)); else tmp = abs((0.047619047619047616 * ((((x * x) * x) * x) * ((x * x) * (-x / sqrt(pi)))))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 1.9], N[Abs[N[(N[(2.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * (-x)), $MachinePrecision]], $MachinePrecision], N[Abs[N[(0.047619047619047616 * N[(N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[((-x) / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.9:\\
\;\;\;\;\left|\frac{2}{\sqrt{\pi}} \cdot \left(-x\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|0.047619047619047616 \cdot \left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \frac{-x}{\sqrt{\pi}}\right)\right)\right|\\
\end{array}
\end{array}
if x < 1.8999999999999999Initial program 99.9%
Applied rewrites99.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-fabs.f64N/A
lower-sqrt.f64N/A
lower-PI.f6467.1
Applied rewrites67.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6467.5
Applied rewrites67.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.5
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqr-neg-revN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqrt-unprodN/A
rem-square-sqrt67.5
Applied rewrites67.5%
if 1.8999999999999999 < x Initial program 99.9%
Applied rewrites99.9%
Taylor expanded in x around inf
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-fabs.f64N/A
lower-sqrt.f64N/A
lower-PI.f6437.1
Applied rewrites37.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
pow3N/A
associate-*l*N/A
lift-fabs.f64N/A
neg-fabsN/A
lift-neg.f64N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
fabs-sqrN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l*N/A
Applied rewrites37.1%
(FPCore (x)
:precision binary64
(if (<= x 1.9)
(fabs (* (/ 2.0 (sqrt PI)) (- x)))
(fabs
(*
(* (* 0.047619047619047616 (* (* (* (* x x) x) x) x)) x)
(/ (- x) (sqrt PI))))))
double code(double x) {
double tmp;
if (x <= 1.9) {
tmp = fabs(((2.0 / sqrt(((double) M_PI))) * -x));
} else {
tmp = fabs((((0.047619047619047616 * ((((x * x) * x) * x) * x)) * x) * (-x / sqrt(((double) M_PI)))));
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 1.9) {
tmp = Math.abs(((2.0 / Math.sqrt(Math.PI)) * -x));
} else {
tmp = Math.abs((((0.047619047619047616 * ((((x * x) * x) * x) * x)) * x) * (-x / Math.sqrt(Math.PI))));
}
return tmp;
}
def code(x): tmp = 0 if x <= 1.9: tmp = math.fabs(((2.0 / math.sqrt(math.pi)) * -x)) else: tmp = math.fabs((((0.047619047619047616 * ((((x * x) * x) * x) * x)) * x) * (-x / math.sqrt(math.pi)))) return tmp
function code(x) tmp = 0.0 if (x <= 1.9) tmp = abs(Float64(Float64(2.0 / sqrt(pi)) * Float64(-x))); else tmp = abs(Float64(Float64(Float64(0.047619047619047616 * Float64(Float64(Float64(Float64(x * x) * x) * x) * x)) * x) * Float64(Float64(-x) / sqrt(pi)))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 1.9) tmp = abs(((2.0 / sqrt(pi)) * -x)); else tmp = abs((((0.047619047619047616 * ((((x * x) * x) * x) * x)) * x) * (-x / sqrt(pi)))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 1.9], N[Abs[N[(N[(2.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * (-x)), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(0.047619047619047616 * N[(N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] * N[((-x) / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.9:\\
\;\;\;\;\left|\frac{2}{\sqrt{\pi}} \cdot \left(-x\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\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 \frac{-x}{\sqrt{\pi}}\right|\\
\end{array}
\end{array}
if x < 1.8999999999999999Initial program 99.9%
Applied rewrites99.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-fabs.f64N/A
lower-sqrt.f64N/A
lower-PI.f6467.1
Applied rewrites67.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6467.5
Applied rewrites67.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.5
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqr-neg-revN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqrt-unprodN/A
rem-square-sqrt67.5
Applied rewrites67.5%
if 1.8999999999999999 < x Initial program 99.9%
Applied rewrites99.9%
Taylor expanded in x around inf
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-fabs.f64N/A
lower-sqrt.f64N/A
lower-PI.f6437.1
Applied rewrites37.1%
Applied rewrites37.1%
(FPCore (x)
:precision binary64
(if (<= x 1.9)
(fabs (* (/ 2.0 (sqrt PI)) (- x)))
(fabs
(/
(* (* -0.047619047619047616 (* (* (* (* (* x x) x) x) x) x)) x)
(sqrt PI)))))
double code(double x) {
double tmp;
if (x <= 1.9) {
tmp = fabs(((2.0 / sqrt(((double) M_PI))) * -x));
} else {
tmp = fabs((((-0.047619047619047616 * (((((x * x) * x) * x) * x) * x)) * x) / sqrt(((double) M_PI))));
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 1.9) {
tmp = Math.abs(((2.0 / Math.sqrt(Math.PI)) * -x));
} else {
tmp = Math.abs((((-0.047619047619047616 * (((((x * x) * x) * x) * x) * x)) * x) / Math.sqrt(Math.PI)));
}
return tmp;
}
def code(x): tmp = 0 if x <= 1.9: tmp = math.fabs(((2.0 / math.sqrt(math.pi)) * -x)) else: tmp = math.fabs((((-0.047619047619047616 * (((((x * x) * x) * x) * x) * x)) * x) / math.sqrt(math.pi))) return tmp
function code(x) tmp = 0.0 if (x <= 1.9) tmp = abs(Float64(Float64(2.0 / sqrt(pi)) * Float64(-x))); else tmp = abs(Float64(Float64(Float64(-0.047619047619047616 * Float64(Float64(Float64(Float64(Float64(x * x) * x) * x) * x) * x)) * x) / sqrt(pi))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 1.9) tmp = abs(((2.0 / sqrt(pi)) * -x)); else tmp = abs((((-0.047619047619047616 * (((((x * x) * x) * x) * x) * x)) * x) / sqrt(pi))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 1.9], N[Abs[N[(N[(2.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * (-x)), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(-0.047619047619047616 * N[(N[(N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.9:\\
\;\;\;\;\left|\frac{2}{\sqrt{\pi}} \cdot \left(-x\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\left(-0.047619047619047616 \cdot \left(\left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right)\right) \cdot x}{\sqrt{\pi}}\right|\\
\end{array}
\end{array}
if x < 1.8999999999999999Initial program 99.9%
Applied rewrites99.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-fabs.f64N/A
lower-sqrt.f64N/A
lower-PI.f6467.1
Applied rewrites67.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6467.5
Applied rewrites67.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.5
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqr-neg-revN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqrt-unprodN/A
rem-square-sqrt67.5
Applied rewrites67.5%
if 1.8999999999999999 < x Initial program 99.9%
Applied rewrites99.9%
Taylor expanded in x around inf
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-fabs.f64N/A
lower-sqrt.f64N/A
lower-PI.f6437.1
Applied rewrites37.1%
Applied rewrites37.1%
(FPCore (x)
:precision binary64
(/
(fabs
(-
(* (- x) 2.0)
(* (* (* (* (* x x) x) x) x) (fma (* 0.047619047619047616 x) x 0.2))))
(sqrt PI)))
double code(double x) {
return fabs(((-x * 2.0) - (((((x * x) * x) * x) * x) * fma((0.047619047619047616 * x), x, 0.2)))) / sqrt(((double) M_PI));
}
function code(x) return Float64(abs(Float64(Float64(Float64(-x) * 2.0) - Float64(Float64(Float64(Float64(Float64(x * x) * x) * x) * x) * fma(Float64(0.047619047619047616 * x), x, 0.2)))) / sqrt(pi)) end
code[x_] := N[(N[Abs[N[(N[((-x) * 2.0), $MachinePrecision] - N[(N[(N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * N[(N[(0.047619047619047616 * x), $MachinePrecision] * x + 0.2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left|\left(-x\right) \cdot 2 - \left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot \mathsf{fma}\left(0.047619047619047616 \cdot x, x, 0.2\right)\right|}{\sqrt{\pi}}
\end{array}
Initial program 99.9%
Applied rewrites99.9%
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites99.1%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6498.6
Applied rewrites98.6%
(FPCore (x) :precision binary64 (/ (fabs (* (fma (* x x) 0.6666666666666666 2.0) (- x))) (sqrt PI)))
double code(double x) {
return fabs((fma((x * x), 0.6666666666666666, 2.0) * -x)) / sqrt(((double) M_PI));
}
function code(x) return Float64(abs(Float64(fma(Float64(x * x), 0.6666666666666666, 2.0) * Float64(-x))) / sqrt(pi)) end
code[x_] := N[(N[Abs[N[(N[(N[(x * x), $MachinePrecision] * 0.6666666666666666 + 2.0), $MachinePrecision] * (-x)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left|\mathsf{fma}\left(x \cdot x, 0.6666666666666666, 2\right) \cdot \left(-x\right)\right|}{\sqrt{\pi}}
\end{array}
Initial program 99.9%
Applied rewrites99.4%
Taylor expanded in x around 0
metadata-evalN/A
lower-fma.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-fabs.f64N/A
lower-*.f64N/A
lower-fabs.f6488.8
Applied rewrites88.8%
lift-fma.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-fabs.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-fabs.f64N/A
lower-*.f6488.8
Applied rewrites88.8%
lift-fma.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
distribute-lft-inN/A
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
lift-*.f6488.8
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqr-neg-revN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqrt-unprodN/A
rem-square-sqrt88.8
Applied rewrites88.8%
(FPCore (x) :precision binary64 (if (<= x 1e-25) (fabs (* (/ 2.0 (sqrt PI)) (- x))) (fabs (* 2.0 (sqrt (/ (* x x) PI))))))
double code(double x) {
double tmp;
if (x <= 1e-25) {
tmp = fabs(((2.0 / sqrt(((double) M_PI))) * -x));
} else {
tmp = fabs((2.0 * sqrt(((x * x) / ((double) M_PI)))));
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 1e-25) {
tmp = Math.abs(((2.0 / Math.sqrt(Math.PI)) * -x));
} else {
tmp = Math.abs((2.0 * Math.sqrt(((x * x) / Math.PI))));
}
return tmp;
}
def code(x): tmp = 0 if x <= 1e-25: tmp = math.fabs(((2.0 / math.sqrt(math.pi)) * -x)) else: tmp = math.fabs((2.0 * math.sqrt(((x * x) / math.pi)))) return tmp
function code(x) tmp = 0.0 if (x <= 1e-25) tmp = abs(Float64(Float64(2.0 / sqrt(pi)) * Float64(-x))); else tmp = abs(Float64(2.0 * sqrt(Float64(Float64(x * x) / pi)))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 1e-25) tmp = abs(((2.0 / sqrt(pi)) * -x)); else tmp = abs((2.0 * sqrt(((x * x) / pi)))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 1e-25], N[Abs[N[(N[(2.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * (-x)), $MachinePrecision]], $MachinePrecision], N[Abs[N[(2.0 * N[Sqrt[N[(N[(x * x), $MachinePrecision] / Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{-25}:\\
\;\;\;\;\left|\frac{2}{\sqrt{\pi}} \cdot \left(-x\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|2 \cdot \sqrt{\frac{x \cdot x}{\pi}}\right|\\
\end{array}
\end{array}
if x < 1.00000000000000004e-25Initial program 99.9%
Applied rewrites99.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-fabs.f64N/A
lower-sqrt.f64N/A
lower-PI.f6467.1
Applied rewrites67.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6467.5
Applied rewrites67.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.5
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqr-neg-revN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqrt-unprodN/A
rem-square-sqrt67.5
Applied rewrites67.5%
if 1.00000000000000004e-25 < x Initial program 99.9%
Applied rewrites99.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-fabs.f64N/A
lower-sqrt.f64N/A
lower-PI.f6467.1
Applied rewrites67.1%
lift-/.f64N/A
lift-fabs.f64N/A
rem-sqrt-square-revN/A
lift-*.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
lower-sqrt.f64N/A
lower-/.f6453.5
Applied rewrites53.5%
(FPCore (x) :precision binary64 (fabs (* (/ 2.0 (sqrt PI)) (- x))))
double code(double x) {
return fabs(((2.0 / sqrt(((double) M_PI))) * -x));
}
public static double code(double x) {
return Math.abs(((2.0 / Math.sqrt(Math.PI)) * -x));
}
def code(x): return math.fabs(((2.0 / math.sqrt(math.pi)) * -x))
function code(x) return abs(Float64(Float64(2.0 / sqrt(pi)) * Float64(-x))) end
function tmp = code(x) tmp = abs(((2.0 / sqrt(pi)) * -x)); end
code[x_] := N[Abs[N[(N[(2.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * (-x)), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{2}{\sqrt{\pi}} \cdot \left(-x\right)\right|
\end{array}
Initial program 99.9%
Applied rewrites99.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-fabs.f64N/A
lower-sqrt.f64N/A
lower-PI.f6467.1
Applied rewrites67.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6467.5
Applied rewrites67.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.5
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqr-neg-revN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqrt-unprodN/A
rem-square-sqrt67.5
Applied rewrites67.5%
(FPCore (x) :precision binary64 (fabs (/ (+ x x) (- (sqrt PI)))))
double code(double x) {
return fabs(((x + x) / -sqrt(((double) M_PI))));
}
public static double code(double x) {
return Math.abs(((x + x) / -Math.sqrt(Math.PI)));
}
def code(x): return math.fabs(((x + x) / -math.sqrt(math.pi)))
function code(x) return abs(Float64(Float64(x + x) / Float64(-sqrt(pi)))) end
function tmp = code(x) tmp = abs(((x + x) / -sqrt(pi))); end
code[x_] := N[Abs[N[(N[(x + x), $MachinePrecision] / (-N[Sqrt[Pi], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + x}{-\sqrt{\pi}}\right|
\end{array}
Initial program 99.9%
Applied rewrites99.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-fabs.f64N/A
lower-sqrt.f64N/A
lower-PI.f6467.1
Applied rewrites67.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6467.5
Applied rewrites67.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqr-neg-revN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqrt-unprodN/A
rem-square-sqrtN/A
div-flipN/A
mult-flip-revN/A
metadata-evalN/A
Applied rewrites67.1%
herbie shell --seed 2025144
(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)))))))