Average Error: 13.0 → 10.7
Time: 2.6m
Precision: 64
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\]
\[\frac{{\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{4}} \cdot {\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{4}}}{\sin B} \cdot F - \frac{x}{\tan B}\]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\frac{{\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{4}} \cdot {\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{4}}}{\sin B} \cdot F - \frac{x}{\tan B}
double f(double F, double B, double x) {
        double r10142208 = x;
        double r10142209 = 1.0;
        double r10142210 = B;
        double r10142211 = tan(r10142210);
        double r10142212 = r10142209 / r10142211;
        double r10142213 = r10142208 * r10142212;
        double r10142214 = -r10142213;
        double r10142215 = F;
        double r10142216 = sin(r10142210);
        double r10142217 = r10142215 / r10142216;
        double r10142218 = r10142215 * r10142215;
        double r10142219 = 2.0;
        double r10142220 = r10142218 + r10142219;
        double r10142221 = r10142219 * r10142208;
        double r10142222 = r10142220 + r10142221;
        double r10142223 = r10142209 / r10142219;
        double r10142224 = -r10142223;
        double r10142225 = pow(r10142222, r10142224);
        double r10142226 = r10142217 * r10142225;
        double r10142227 = r10142214 + r10142226;
        return r10142227;
}

double f(double F, double B, double x) {
        double r10142228 = 2.0;
        double r10142229 = x;
        double r10142230 = F;
        double r10142231 = fma(r10142230, r10142230, r10142228);
        double r10142232 = fma(r10142228, r10142229, r10142231);
        double r10142233 = -0.25;
        double r10142234 = pow(r10142232, r10142233);
        double r10142235 = r10142234 * r10142234;
        double r10142236 = B;
        double r10142237 = sin(r10142236);
        double r10142238 = r10142235 / r10142237;
        double r10142239 = r10142238 * r10142230;
        double r10142240 = tan(r10142236);
        double r10142241 = r10142229 / r10142240;
        double r10142242 = r10142239 - r10142241;
        return r10142242;
}

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Initial program 13.0

    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\]
  2. Simplified12.5

    \[\leadsto \color{blue}{\frac{{\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}}{\frac{\sin B}{F}} - \frac{x}{\tan B}}\]
  3. Using strategy rm
  4. Applied associate-/r/10.6

    \[\leadsto \color{blue}{\frac{{\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}}{\sin B} \cdot F} - \frac{x}{\tan B}\]
  5. Using strategy rm
  6. Applied sqr-pow10.7

    \[\leadsto \frac{\color{blue}{{\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}}{\sin B} \cdot F - \frac{x}{\tan B}\]
  7. Final simplification10.7

    \[\leadsto \frac{{\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{4}} \cdot {\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{4}}}{\sin B} \cdot F - \frac{x}{\tan B}\]

Reproduce

herbie shell --seed 2019104 +o rules:numerics
(FPCore (F B x)
  :name "VandenBroeck and Keller, Equation (23)"
  (+ (- (* x (/ 1 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2) (* 2 x)) (- (/ 1 2))))))