Average Error: 0.0 → 0.1
Time: 17.0s
Precision: 64
\[x - \frac{y}{1 + \frac{x \cdot y}{2}}\]
\[x - \frac{1}{\frac{1}{2} \cdot x + 1 \cdot \frac{1}{y}}\]
x - \frac{y}{1 + \frac{x \cdot y}{2}}
x - \frac{1}{\frac{1}{2} \cdot x + 1 \cdot \frac{1}{y}}
double f(double x, double y) {
        double r331125 = x;
        double r331126 = y;
        double r331127 = 1.0;
        double r331128 = r331125 * r331126;
        double r331129 = 2.0;
        double r331130 = r331128 / r331129;
        double r331131 = r331127 + r331130;
        double r331132 = r331126 / r331131;
        double r331133 = r331125 - r331132;
        return r331133;
}

double f(double x, double y) {
        double r331134 = x;
        double r331135 = 1.0;
        double r331136 = 1.0;
        double r331137 = 2.0;
        double r331138 = r331136 / r331137;
        double r331139 = r331138 * r331134;
        double r331140 = y;
        double r331141 = r331135 / r331140;
        double r331142 = r331136 * r331141;
        double r331143 = r331139 + r331142;
        double r331144 = r331135 / r331143;
        double r331145 = r331134 - r331144;
        return r331145;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[x - \frac{y}{1 + \frac{x \cdot y}{2}}\]
  2. Using strategy rm
  3. Applied clear-num0.1

    \[\leadsto x - \color{blue}{\frac{1}{\frac{1 + \frac{x \cdot y}{2}}{y}}}\]
  4. Taylor expanded around 0 0.1

    \[\leadsto x - \frac{1}{\color{blue}{0.5 \cdot x + 1 \cdot \frac{1}{y}}}\]
  5. Simplified0.1

    \[\leadsto x - \frac{1}{\color{blue}{\frac{1}{2} \cdot x + 1 \cdot \frac{1}{y}}}\]
  6. Final simplification0.1

    \[\leadsto x - \frac{1}{\frac{1}{2} \cdot x + 1 \cdot \frac{1}{y}}\]

Reproduce

herbie shell --seed 2019303 
(FPCore (x y)
  :name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, B"
  :precision binary64
  (- x (/ y (+ 1 (/ (* x y) 2)))))