Average Error: 1.5 → 1.0
Time: 9.1s
Precision: 64
Internal Precision: 576
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.8773929785352215 \cdot 10^{+142}:\\ \;\;\;\;\left|\frac{x}{y} \cdot \left(-z\right) + \frac{4 + x}{y}\right|\\ \mathbf{elif}\;x \le 4.431127015599397 \cdot 10^{-157}:\\ \;\;\;\;\left|\frac{\left(4 + x\right) - x \cdot z}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{x}{\frac{y}{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 3 regimes
  2. if x < -1.8773929785352215e+142

    1. Initial program 0.1

      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
    2. Using strategy rm
    3. Applied sub-neg0.1

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

    if -1.8773929785352215e+142 < x < 4.431127015599397e-157

    1. Initial program 1.9

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

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

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

    if 4.431127015599397e-157 < x

    1. Initial program 1.1

      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
    2. Initial simplification1.5

      \[\leadsto \left|\frac{4 + x}{y} - \frac{x}{\frac{y}{z}}\right|\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.0

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

Runtime

Time bar (total: 9.1s)Debug logProfile

herbie shell --seed 2018255 
(FPCore (x y z)
  :name "fabs fraction 1"
  (fabs (- (/ (+ x 4) y) (* (/ x y) z))))