Average Error: 0.0 → 0.0
Time: 14.6s
Precision: 64
\[0.70711 \cdot \left(\frac{2.30753 + x \cdot 0.27061}{1.0 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x\right)\]
\[0.70711 \cdot \left(-x\right) + 0.70711 \cdot \frac{0.27061 \cdot x + 2.30753}{x \cdot \left(x \cdot 0.04481 + 0.99229\right) + 1.0}\]
0.70711 \cdot \left(\frac{2.30753 + x \cdot 0.27061}{1.0 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x\right)
0.70711 \cdot \left(-x\right) + 0.70711 \cdot \frac{0.27061 \cdot x + 2.30753}{x \cdot \left(x \cdot 0.04481 + 0.99229\right) + 1.0}
double f(double x) {
        double r4838919 = 0.70711;
        double r4838920 = 2.30753;
        double r4838921 = x;
        double r4838922 = 0.27061;
        double r4838923 = r4838921 * r4838922;
        double r4838924 = r4838920 + r4838923;
        double r4838925 = 1.0;
        double r4838926 = 0.99229;
        double r4838927 = 0.04481;
        double r4838928 = r4838921 * r4838927;
        double r4838929 = r4838926 + r4838928;
        double r4838930 = r4838921 * r4838929;
        double r4838931 = r4838925 + r4838930;
        double r4838932 = r4838924 / r4838931;
        double r4838933 = r4838932 - r4838921;
        double r4838934 = r4838919 * r4838933;
        return r4838934;
}

double f(double x) {
        double r4838935 = 0.70711;
        double r4838936 = x;
        double r4838937 = -r4838936;
        double r4838938 = r4838935 * r4838937;
        double r4838939 = 0.27061;
        double r4838940 = r4838939 * r4838936;
        double r4838941 = 2.30753;
        double r4838942 = r4838940 + r4838941;
        double r4838943 = 0.04481;
        double r4838944 = r4838936 * r4838943;
        double r4838945 = 0.99229;
        double r4838946 = r4838944 + r4838945;
        double r4838947 = r4838936 * r4838946;
        double r4838948 = 1.0;
        double r4838949 = r4838947 + r4838948;
        double r4838950 = r4838942 / r4838949;
        double r4838951 = r4838935 * r4838950;
        double r4838952 = r4838938 + r4838951;
        return r4838952;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[0.70711 \cdot \left(\frac{2.30753 + x \cdot 0.27061}{1.0 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x\right)\]
  2. Using strategy rm
  3. Applied sub-neg0.0

    \[\leadsto 0.70711 \cdot \color{blue}{\left(\frac{2.30753 + x \cdot 0.27061}{1.0 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} + \left(-x\right)\right)}\]
  4. Applied distribute-rgt-in0.0

    \[\leadsto \color{blue}{\frac{2.30753 + x \cdot 0.27061}{1.0 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} \cdot 0.70711 + \left(-x\right) \cdot 0.70711}\]
  5. Final simplification0.0

    \[\leadsto 0.70711 \cdot \left(-x\right) + 0.70711 \cdot \frac{0.27061 \cdot x + 2.30753}{x \cdot \left(x \cdot 0.04481 + 0.99229\right) + 1.0}\]

Reproduce

herbie shell --seed 2019168 
(FPCore (x)
  :name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, B"
  (* 0.70711 (- (/ (+ 2.30753 (* x 0.27061)) (+ 1.0 (* x (+ 0.99229 (* x 0.04481))))) x)))