Average Error: 2.9 → 1.2
Time: 9.0s
Precision: binary64
\[x \geq 0.5\]
\[\left(\frac{1}{\sqrt{\pi}} \cdot e^{\left|x\right| \cdot \left|x\right|}\right) \cdot \left(\left(\left(\frac{1}{\left|x\right|} + \frac{1}{2} \cdot \left(\left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right)\right) + \frac{3}{4} \cdot \left(\left(\left(\left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right)\right) + \frac{15}{8} \cdot \left(\left(\left(\left(\left(\left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right)\right)\]
\[\frac{1}{\sqrt{\sqrt{\pi}}} \cdot \left(\frac{1 + \left(\frac{0.5 + \frac{0.75}{x \cdot x}}{x \cdot x} + \frac{1.875}{{x}^{6}}\right)}{x} \cdot \frac{{\left(e^{x}\right)}^{x}}{\sqrt{\sqrt{\pi}}}\right)\]
\left(\frac{1}{\sqrt{\pi}} \cdot e^{\left|x\right| \cdot \left|x\right|}\right) \cdot \left(\left(\left(\frac{1}{\left|x\right|} + \frac{1}{2} \cdot \left(\left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right)\right) + \frac{3}{4} \cdot \left(\left(\left(\left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right)\right) + \frac{15}{8} \cdot \left(\left(\left(\left(\left(\left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right)\right)
\frac{1}{\sqrt{\sqrt{\pi}}} \cdot \left(\frac{1 + \left(\frac{0.5 + \frac{0.75}{x \cdot x}}{x \cdot x} + \frac{1.875}{{x}^{6}}\right)}{x} \cdot \frac{{\left(e^{x}\right)}^{x}}{\sqrt{\sqrt{\pi}}}\right)
(FPCore (x)
 :precision binary64
 (*
  (* (/ 1.0 (sqrt PI)) (exp (* (fabs x) (fabs x))))
  (+
   (+
    (+
     (/ 1.0 (fabs x))
     (*
      (/ 1.0 2.0)
      (* (* (/ 1.0 (fabs x)) (/ 1.0 (fabs x))) (/ 1.0 (fabs x)))))
    (*
     (/ 3.0 4.0)
     (*
      (*
       (* (* (/ 1.0 (fabs x)) (/ 1.0 (fabs x))) (/ 1.0 (fabs x)))
       (/ 1.0 (fabs x)))
      (/ 1.0 (fabs x)))))
   (*
    (/ 15.0 8.0)
    (*
     (*
      (*
       (*
        (* (* (/ 1.0 (fabs x)) (/ 1.0 (fabs x))) (/ 1.0 (fabs x)))
        (/ 1.0 (fabs x)))
       (/ 1.0 (fabs x)))
      (/ 1.0 (fabs x)))
     (/ 1.0 (fabs x)))))))
(FPCore (x)
 :precision binary64
 (*
  (/ 1.0 (sqrt (sqrt PI)))
  (*
   (/ (+ 1.0 (+ (/ (+ 0.5 (/ 0.75 (* x x))) (* x x)) (/ 1.875 (pow x 6.0)))) x)
   (/ (pow (exp x) x) (sqrt (sqrt PI))))))
double code(double x) {
	return ((1.0 / sqrt((double) M_PI)) * exp(fabs(x) * fabs(x))) * ((((1.0 / fabs(x)) + ((1.0 / 2.0) * (((1.0 / fabs(x)) * (1.0 / fabs(x))) * (1.0 / fabs(x))))) + ((3.0 / 4.0) * (((((1.0 / fabs(x)) * (1.0 / fabs(x))) * (1.0 / fabs(x))) * (1.0 / fabs(x))) * (1.0 / fabs(x))))) + ((15.0 / 8.0) * (((((((1.0 / fabs(x)) * (1.0 / fabs(x))) * (1.0 / fabs(x))) * (1.0 / fabs(x))) * (1.0 / fabs(x))) * (1.0 / fabs(x))) * (1.0 / fabs(x)))));
}
double code(double x) {
	return (1.0 / sqrt(sqrt((double) M_PI))) * (((1.0 + (((0.5 + (0.75 / (x * x))) / (x * x)) + (1.875 / pow(x, 6.0)))) / x) * (pow(exp(x), x) / sqrt(sqrt((double) M_PI))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 2.9

    \[\left(\frac{1}{\sqrt{\pi}} \cdot e^{\left|x\right| \cdot \left|x\right|}\right) \cdot \left(\left(\left(\frac{1}{\left|x\right|} + \frac{1}{2} \cdot \left(\left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right)\right) + \frac{3}{4} \cdot \left(\left(\left(\left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right)\right) + \frac{15}{8} \cdot \left(\left(\left(\left(\left(\left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right)\right)\]
  2. Simplified2.7

    \[\leadsto \color{blue}{\frac{\frac{e^{x \cdot x}}{\sqrt{\pi}}}{\left|x\right|} \cdot \left(1 + \left(\frac{1.875}{{x}^{6}} + \frac{0.5 + \frac{0.75}{x \cdot x}}{x \cdot x}\right)\right)}\]
  3. Using strategy rm
  4. Applied div-inv_binary642.7

    \[\leadsto \color{blue}{\left(\frac{e^{x \cdot x}}{\sqrt{\pi}} \cdot \frac{1}{\left|x\right|}\right)} \cdot \left(1 + \left(\frac{1.875}{{x}^{6}} + \frac{0.5 + \frac{0.75}{x \cdot x}}{x \cdot x}\right)\right)\]
  5. Applied associate-*l*_binary642.7

    \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{\sqrt{\pi}} \cdot \left(\frac{1}{\left|x\right|} \cdot \left(1 + \left(\frac{1.875}{{x}^{6}} + \frac{0.5 + \frac{0.75}{x \cdot x}}{x \cdot x}\right)\right)\right)}\]
  6. Simplified2.7

    \[\leadsto \frac{e^{x \cdot x}}{\sqrt{\pi}} \cdot \color{blue}{\frac{1 + \left(\frac{0.5 + \frac{0.75}{x \cdot x}}{x \cdot x} + \frac{1.875}{{x}^{6}}\right)}{x}}\]
  7. Using strategy rm
  8. Applied add-sqr-sqrt_binary642.7

    \[\leadsto \frac{e^{x \cdot x}}{\color{blue}{\sqrt{\sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}}} \cdot \frac{1 + \left(\frac{0.5 + \frac{0.75}{x \cdot x}}{x \cdot x} + \frac{1.875}{{x}^{6}}\right)}{x}\]
  9. Applied *-un-lft-identity_binary642.7

    \[\leadsto \frac{\color{blue}{1 \cdot e^{x \cdot x}}}{\sqrt{\sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}} \cdot \frac{1 + \left(\frac{0.5 + \frac{0.75}{x \cdot x}}{x \cdot x} + \frac{1.875}{{x}^{6}}\right)}{x}\]
  10. Applied times-frac_binary642.7

    \[\leadsto \color{blue}{\left(\frac{1}{\sqrt{\sqrt{\pi}}} \cdot \frac{e^{x \cdot x}}{\sqrt{\sqrt{\pi}}}\right)} \cdot \frac{1 + \left(\frac{0.5 + \frac{0.75}{x \cdot x}}{x \cdot x} + \frac{1.875}{{x}^{6}}\right)}{x}\]
  11. Applied associate-*l*_binary642.7

    \[\leadsto \color{blue}{\frac{1}{\sqrt{\sqrt{\pi}}} \cdot \left(\frac{e^{x \cdot x}}{\sqrt{\sqrt{\pi}}} \cdot \frac{1 + \left(\frac{0.5 + \frac{0.75}{x \cdot x}}{x \cdot x} + \frac{1.875}{{x}^{6}}\right)}{x}\right)}\]
  12. Simplified2.7

    \[\leadsto \frac{1}{\sqrt{\sqrt{\pi}}} \cdot \color{blue}{\left(\frac{1 + \left(\frac{0.5 + \frac{0.75}{x \cdot x}}{x \cdot x} + \frac{1.875}{{x}^{6}}\right)}{x} \cdot \frac{e^{x \cdot x}}{\sqrt{\sqrt{\pi}}}\right)}\]
  13. Using strategy rm
  14. Applied add-log-exp_binary642.7

    \[\leadsto \frac{1}{\sqrt{\sqrt{\pi}}} \cdot \left(\frac{1 + \left(\frac{0.5 + \frac{0.75}{x \cdot x}}{x \cdot x} + \frac{1.875}{{x}^{6}}\right)}{x} \cdot \frac{e^{\color{blue}{\log \left(e^{x}\right)} \cdot x}}{\sqrt{\sqrt{\pi}}}\right)\]
  15. Applied exp-to-pow_binary641.2

    \[\leadsto \frac{1}{\sqrt{\sqrt{\pi}}} \cdot \left(\frac{1 + \left(\frac{0.5 + \frac{0.75}{x \cdot x}}{x \cdot x} + \frac{1.875}{{x}^{6}}\right)}{x} \cdot \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{\sqrt{\sqrt{\pi}}}\right)\]
  16. Final simplification1.2

    \[\leadsto \frac{1}{\sqrt{\sqrt{\pi}}} \cdot \left(\frac{1 + \left(\frac{0.5 + \frac{0.75}{x \cdot x}}{x \cdot x} + \frac{1.875}{{x}^{6}}\right)}{x} \cdot \frac{{\left(e^{x}\right)}^{x}}{\sqrt{\sqrt{\pi}}}\right)\]

Reproduce

herbie shell --seed 2021173 
(FPCore (x)
  :name "Jmat.Real.erfi, branch x greater than or equal to 5"
  :precision binary64
  :pre (>= x 0.5)
  (* (* (/ 1.0 (sqrt PI)) (exp (* (fabs x) (fabs x)))) (+ (+ (+ (/ 1.0 (fabs x)) (* (/ 1.0 2.0) (* (* (/ 1.0 (fabs x)) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))))) (* (/ 3.0 4.0) (* (* (* (* (/ 1.0 (fabs x)) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))))) (* (/ 15.0 8.0) (* (* (* (* (* (* (/ 1.0 (fabs x)) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))) (/ 1.0 (fabs x)))))))