Average Error: 12.3 → 0
Time: 12.8s
Precision: 64
$\left(-\frac{vz}{vx} \cdot \left(ax - dx\right)\right) - \left(\left(az - dz\right) - \frac{vz}{vx} \cdot \left(ax - dx\right)\right)$
$dz - az$
\left(-\frac{vz}{vx} \cdot \left(ax - dx\right)\right) - \left(\left(az - dz\right) - \frac{vz}{vx} \cdot \left(ax - dx\right)\right)
dz - az
double f(double vz, double vx, double ax, double dx, double az, double dz) {
double r2409316 = vz;
double r2409317 = vx;
double r2409318 = r2409316 / r2409317;
double r2409319 = ax;
double r2409320 = dx;
double r2409321 = r2409319 - r2409320;
double r2409322 = r2409318 * r2409321;
double r2409323 = -r2409322;
double r2409324 = az;
double r2409325 = dz;
double r2409326 = r2409324 - r2409325;
double r2409327 = r2409326 - r2409322;
double r2409328 = r2409323 - r2409327;
return r2409328;
}


double f(double __attribute__((unused)) vz, double __attribute__((unused)) vx, double __attribute__((unused)) ax, double __attribute__((unused)) dx, double az, double dz) {
double r2409329 = dz;
double r2409330 = az;
double r2409331 = r2409329 - r2409330;
return r2409331;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 12.3

$\left(-\frac{vz}{vx} \cdot \left(ax - dx\right)\right) - \left(\left(az - dz\right) - \frac{vz}{vx} \cdot \left(ax - dx\right)\right)$
2. Simplified0

$\leadsto \color{blue}{dz - az}$
3. Final simplification0

$\leadsto dz - az$

# Reproduce

herbie shell --seed 1
(FPCore (vz vx ax dx az dz)
:name "-((vz/vx) * (ax - dx))-((az - dz) - (vz/vx) * (ax - dx))"
:precision binary32
(- (- (* (/ vz vx) (- ax dx))) (- (- az dz) (* (/ vz vx) (- ax dx)))))