Average Error: 1.5 → 0.2
Time: 15.6s
Precision: 64
Internal Precision: 576
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\begin{array}{l} \mathbf{if}\;\left|\frac{4 + x}{y} - \frac{x}{y} \cdot z\right| \le 6.778791345051423 \cdot 10^{-98}:\\ \;\;\;\;\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{x}{y} \cdot z\right|\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if (fabs (- (/ (+ x 4) y) (* (/ x y) z))) < 6.778791345051423e-98

    1. Initial program 6.0

      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
    2. Using strategy rm
    3. Applied associate-*l/0.1

      \[\leadsto \left|\frac{x + 4}{y} - \color{blue}{\frac{x \cdot z}{y}}\right|\]
    4. Applied sub-div0.1

      \[\leadsto \left|\color{blue}{\frac{\left(x + 4\right) - x \cdot z}{y}}\right|\]

    if 6.778791345051423e-98 < (fabs (- (/ (+ x 4) y) (* (/ x y) z)))

    1. Initial program 0.2

      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left|\frac{4 + x}{y} - \frac{x}{y} \cdot z\right| \le 6.778791345051423 \cdot 10^{-98}:\\ \;\;\;\;\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{x}{y} \cdot z\right|\\ \end{array}\]

Runtime

Time bar (total: 15.6s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes1.50.20.01.589.1%
herbie shell --seed 2018263 
(FPCore (x y z)
  :name "fabs fraction 1"
  (fabs (- (/ (+ x 4) y) (* (/ x y) z))))