Average Error: 12.8 → 0.2
Time: 16.6s
Precision: 64
\[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5\]
\[\left(\left(2 \cdot {r}^{-2} + 3\right) - \left(0.125 \cdot \left(3 - v \cdot 2\right)\right) \cdot \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}\right) - 4.5\]
\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5
\left(\left(2 \cdot {r}^{-2} + 3\right) - \left(0.125 \cdot \left(3 - v \cdot 2\right)\right) \cdot \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}\right) - 4.5
double f(double v, double w, double r) {
        double r25974 = 3.0;
        double r25975 = 2.0;
        double r25976 = r;
        double r25977 = r25976 * r25976;
        double r25978 = r25975 / r25977;
        double r25979 = r25974 + r25978;
        double r25980 = 0.125;
        double r25981 = v;
        double r25982 = r25975 * r25981;
        double r25983 = r25974 - r25982;
        double r25984 = r25980 * r25983;
        double r25985 = w;
        double r25986 = r25985 * r25985;
        double r25987 = r25986 * r25976;
        double r25988 = r25987 * r25976;
        double r25989 = r25984 * r25988;
        double r25990 = 1.0;
        double r25991 = r25990 - r25981;
        double r25992 = r25989 / r25991;
        double r25993 = r25979 - r25992;
        double r25994 = 4.5;
        double r25995 = r25993 - r25994;
        return r25995;
}

double f(double v, double w, double r) {
        double r25996 = 2.0;
        double r25997 = r;
        double r25998 = -2.0;
        double r25999 = pow(r25997, r25998);
        double r26000 = r25996 * r25999;
        double r26001 = 3.0;
        double r26002 = r26000 + r26001;
        double r26003 = 0.125;
        double r26004 = v;
        double r26005 = r26004 * r25996;
        double r26006 = r26001 - r26005;
        double r26007 = r26003 * r26006;
        double r26008 = w;
        double r26009 = r25997 * r26008;
        double r26010 = r26009 * r26009;
        double r26011 = 1.0;
        double r26012 = r26011 - r26004;
        double r26013 = r26010 / r26012;
        double r26014 = r26007 * r26013;
        double r26015 = r26002 - r26014;
        double r26016 = 4.5;
        double r26017 = r26015 - r26016;
        return r26017;
}

Error

Bits error versus v

Bits error versus w

Bits error versus r

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 12.8

    \[\left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(\left(w \cdot w\right) \cdot r\right) \cdot r\right)}{1 - v}\right) - 4.5\]
  2. Using strategy rm
  3. Applied associate-*l*7.7

    \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\color{blue}{\left(w \cdot \left(w \cdot r\right)\right)} \cdot r\right)}{1 - v}\right) - 4.5\]
  4. Using strategy rm
  5. Applied *-un-lft-identity7.7

    \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \frac{\left(0.125 \cdot \left(3 - 2 \cdot v\right)\right) \cdot \left(\left(w \cdot \left(w \cdot r\right)\right) \cdot r\right)}{\color{blue}{1 \cdot \left(1 - v\right)}}\right) - 4.5\]
  6. Applied times-frac2.3

    \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \color{blue}{\frac{0.125 \cdot \left(3 - 2 \cdot v\right)}{1} \cdot \frac{\left(w \cdot \left(w \cdot r\right)\right) \cdot r}{1 - v}}\right) - 4.5\]
  7. Simplified2.3

    \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \color{blue}{\left(0.125 \cdot \left(3 - v \cdot 2\right)\right)} \cdot \frac{\left(w \cdot \left(w \cdot r\right)\right) \cdot r}{1 - v}\right) - 4.5\]
  8. Simplified0.3

    \[\leadsto \left(\left(3 + \frac{2}{r \cdot r}\right) - \left(0.125 \cdot \left(3 - v \cdot 2\right)\right) \cdot \color{blue}{\frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}}\right) - 4.5\]
  9. Using strategy rm
  10. Applied div-inv0.3

    \[\leadsto \left(\left(3 + \color{blue}{2 \cdot \frac{1}{r \cdot r}}\right) - \left(0.125 \cdot \left(3 - v \cdot 2\right)\right) \cdot \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}\right) - 4.5\]
  11. Simplified0.3

    \[\leadsto \left(\left(3 + 2 \cdot \color{blue}{\frac{\frac{1}{r}}{r}}\right) - \left(0.125 \cdot \left(3 - v \cdot 2\right)\right) \cdot \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}\right) - 4.5\]
  12. Using strategy rm
  13. Applied pow10.3

    \[\leadsto \left(\left(3 + 2 \cdot \frac{\frac{1}{r}}{\color{blue}{{r}^{1}}}\right) - \left(0.125 \cdot \left(3 - v \cdot 2\right)\right) \cdot \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}\right) - 4.5\]
  14. Applied inv-pow0.3

    \[\leadsto \left(\left(3 + 2 \cdot \frac{\color{blue}{{r}^{-1}}}{{r}^{1}}\right) - \left(0.125 \cdot \left(3 - v \cdot 2\right)\right) \cdot \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}\right) - 4.5\]
  15. Applied pow-div0.2

    \[\leadsto \left(\left(3 + 2 \cdot \color{blue}{{r}^{\left(-1 - 1\right)}}\right) - \left(0.125 \cdot \left(3 - v \cdot 2\right)\right) \cdot \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}\right) - 4.5\]
  16. Simplified0.2

    \[\leadsto \left(\left(3 + 2 \cdot {r}^{\color{blue}{-2}}\right) - \left(0.125 \cdot \left(3 - v \cdot 2\right)\right) \cdot \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}\right) - 4.5\]
  17. Final simplification0.2

    \[\leadsto \left(\left(2 \cdot {r}^{-2} + 3\right) - \left(0.125 \cdot \left(3 - v \cdot 2\right)\right) \cdot \frac{\left(r \cdot w\right) \cdot \left(r \cdot w\right)}{1 - v}\right) - 4.5\]

Reproduce

herbie shell --seed 2019195 +o rules:numerics
(FPCore (v w r)
  :name "Rosa's TurbineBenchmark"
  (- (- (+ 3.0 (/ 2.0 (* r r))) (/ (* (* 0.125 (- 3.0 (* 2.0 v))) (* (* (* w w) r) r)) (- 1.0 v))) 4.5))