Average Error: 7.8 → 1.5
Time: 17.0s
Precision: 64
\[\left(-\left(\left(bz - az\right) - \frac{vz}{vx} \cdot \left(bx - ax\right)\right)\right) \cdot f\]
\[\begin{array}{l} \mathbf{if}\;\frac{vz}{vx} \cdot \left(bx - ax\right) \le -6.534329892198412367174567604828581117696 \cdot 10^{307} \lor \neg \left(\frac{vz}{vx} \cdot \left(bx - ax\right) \le 5.415534368769562168836350781765917425125 \cdot 10^{299}\right):\\ \;\;\;\;\left(az \cdot f + \frac{bx \cdot \left(vz \cdot f\right)}{vx}\right) - \frac{vz \cdot \left(f \cdot ax\right)}{vx}\\ \mathbf{else}:\\ \;\;\;\;\left(-\left(\left(bz - az\right) - \left(\frac{vz}{vx} \cdot bx + \left(-ax\right) \cdot \frac{vz}{vx}\right)\right)\right) \cdot f\\ \end{array}\]
\left(-\left(\left(bz - az\right) - \frac{vz}{vx} \cdot \left(bx - ax\right)\right)\right) \cdot f
\begin{array}{l}
\mathbf{if}\;\frac{vz}{vx} \cdot \left(bx - ax\right) \le -6.534329892198412367174567604828581117696 \cdot 10^{307} \lor \neg \left(\frac{vz}{vx} \cdot \left(bx - ax\right) \le 5.415534368769562168836350781765917425125 \cdot 10^{299}\right):\\
\;\;\;\;\left(az \cdot f + \frac{bx \cdot \left(vz \cdot f\right)}{vx}\right) - \frac{vz \cdot \left(f \cdot ax\right)}{vx}\\

\mathbf{else}:\\
\;\;\;\;\left(-\left(\left(bz - az\right) - \left(\frac{vz}{vx} \cdot bx + \left(-ax\right) \cdot \frac{vz}{vx}\right)\right)\right) \cdot f\\

\end{array}
double f(double bz, double az, double vz, double vx, double bx, double ax, double f) {
        double r2407287 = bz;
        double r2407288 = az;
        double r2407289 = r2407287 - r2407288;
        double r2407290 = vz;
        double r2407291 = vx;
        double r2407292 = r2407290 / r2407291;
        double r2407293 = bx;
        double r2407294 = ax;
        double r2407295 = r2407293 - r2407294;
        double r2407296 = r2407292 * r2407295;
        double r2407297 = r2407289 - r2407296;
        double r2407298 = -r2407297;
        double r2407299 = f;
        double r2407300 = r2407298 * r2407299;
        return r2407300;
}

double f(double bz, double az, double vz, double vx, double bx, double ax, double f) {
        double r2407301 = vz;
        double r2407302 = vx;
        double r2407303 = r2407301 / r2407302;
        double r2407304 = bx;
        double r2407305 = ax;
        double r2407306 = r2407304 - r2407305;
        double r2407307 = r2407303 * r2407306;
        double r2407308 = -6.534329892198412e+307;
        bool r2407309 = r2407307 <= r2407308;
        double r2407310 = 5.415534368769562e+299;
        bool r2407311 = r2407307 <= r2407310;
        double r2407312 = !r2407311;
        bool r2407313 = r2407309 || r2407312;
        double r2407314 = az;
        double r2407315 = f;
        double r2407316 = r2407314 * r2407315;
        double r2407317 = r2407301 * r2407315;
        double r2407318 = r2407304 * r2407317;
        double r2407319 = r2407318 / r2407302;
        double r2407320 = r2407316 + r2407319;
        double r2407321 = r2407315 * r2407305;
        double r2407322 = r2407301 * r2407321;
        double r2407323 = r2407322 / r2407302;
        double r2407324 = r2407320 - r2407323;
        double r2407325 = bz;
        double r2407326 = r2407325 - r2407314;
        double r2407327 = r2407303 * r2407304;
        double r2407328 = -r2407305;
        double r2407329 = r2407328 * r2407303;
        double r2407330 = r2407327 + r2407329;
        double r2407331 = r2407326 - r2407330;
        double r2407332 = -r2407331;
        double r2407333 = r2407332 * r2407315;
        double r2407334 = r2407313 ? r2407324 : r2407333;
        return r2407334;
}

Error

Bits error versus bz

Bits error versus az

Bits error versus vz

Bits error versus vx

Bits error versus bx

Bits error versus ax

Bits error versus f

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if (* (/ vz vx) (- bx ax)) < -6.534329892198412e+307 or 5.415534368769562e+299 < (* (/ vz vx) (- bx ax))

    1. Initial program 61.9

      \[\left(-\left(\left(bz - az\right) - \frac{vz}{vx} \cdot \left(bx - ax\right)\right)\right) \cdot f\]
    2. Taylor expanded around inf 10.0

      \[\leadsto \color{blue}{\left(az \cdot f + \frac{bx \cdot \left(vz \cdot f\right)}{vx}\right) - \frac{vz \cdot \left(f \cdot ax\right)}{vx}}\]

    if -6.534329892198412e+307 < (* (/ vz vx) (- bx ax)) < 5.415534368769562e+299

    1. Initial program 0.4

      \[\left(-\left(\left(bz - az\right) - \frac{vz}{vx} \cdot \left(bx - ax\right)\right)\right) \cdot f\]
    2. Using strategy rm
    3. Applied sub-neg0.4

      \[\leadsto \left(-\left(\left(bz - az\right) - \frac{vz}{vx} \cdot \color{blue}{\left(bx + \left(-ax\right)\right)}\right)\right) \cdot f\]
    4. Applied distribute-lft-in0.4

      \[\leadsto \left(-\left(\left(bz - az\right) - \color{blue}{\left(\frac{vz}{vx} \cdot bx + \frac{vz}{vx} \cdot \left(-ax\right)\right)}\right)\right) \cdot f\]
    5. Simplified0.4

      \[\leadsto \left(-\left(\left(bz - az\right) - \left(\frac{vz}{vx} \cdot bx + \color{blue}{\left(-ax\right) \cdot \frac{vz}{vx}}\right)\right)\right) \cdot f\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{vz}{vx} \cdot \left(bx - ax\right) \le -6.534329892198412367174567604828581117696 \cdot 10^{307} \lor \neg \left(\frac{vz}{vx} \cdot \left(bx - ax\right) \le 5.415534368769562168836350781765917425125 \cdot 10^{299}\right):\\ \;\;\;\;\left(az \cdot f + \frac{bx \cdot \left(vz \cdot f\right)}{vx}\right) - \frac{vz \cdot \left(f \cdot ax\right)}{vx}\\ \mathbf{else}:\\ \;\;\;\;\left(-\left(\left(bz - az\right) - \left(\frac{vz}{vx} \cdot bx + \left(-ax\right) \cdot \frac{vz}{vx}\right)\right)\right) \cdot f\\ \end{array}\]

Reproduce

herbie shell --seed 1 
(FPCore (bz az vz vx bx ax f)
  :name "-((bz - az) - ((vz/vx) * (bx - ax)))*f"
  :precision binary64
  (* (- (- (- bz az) (* (/ vz vx) (- bx ax)))) f))