Average Error: 1.6 → 0.1
Time: 38.9s
Precision: 64
Internal Precision: 576
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\begin{array}{l} \mathbf{if}\;\frac{4 + x}{y} - \frac{z \cdot x}{y} \le -3.5436162303669186 \cdot 10^{+152}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}\right|\\ \mathbf{if}\;\frac{4 + x}{y} - \frac{z \cdot x}{y} \le 2.5551213972670103 \cdot 10^{+294}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{z \cdot x}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|(\left(4 + x\right) \cdot \left(\frac{1}{y}\right) + \left(\frac{x}{y} \cdot \left(-z\right)\right))_*\right|\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Split input into 3 regimes
  2. if (- (/ (+ x 4) y) (/ (* x z) y)) < -3.5436162303669186e+152

    1. Initial program 0.1

      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
    2. Using strategy rm
    3. Applied add-cube-cbrt0.8

      \[\leadsto \left|\color{blue}{\left(\sqrt[3]{\frac{x + 4}{y}} \cdot \sqrt[3]{\frac{x + 4}{y}}\right) \cdot \sqrt[3]{\frac{x + 4}{y}}} - \frac{x}{y} \cdot z\right|\]
    4. Applied prod-diff0.8

      \[\leadsto \left|\color{blue}{(\left(\sqrt[3]{\frac{x + 4}{y}} \cdot \sqrt[3]{\frac{x + 4}{y}}\right) \cdot \left(\sqrt[3]{\frac{x + 4}{y}}\right) + \left(-z \cdot \frac{x}{y}\right))_* + (\left(-z\right) \cdot \left(\frac{x}{y}\right) + \left(z \cdot \frac{x}{y}\right))_*}\right|\]
    5. Applied simplify0.1

      \[\leadsto \left|\color{blue}{\left(\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}\right)} + (\left(-z\right) \cdot \left(\frac{x}{y}\right) + \left(z \cdot \frac{x}{y}\right))_*\right|\]
    6. Applied simplify0.1

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

    if -3.5436162303669186e+152 < (- (/ (+ x 4) y) (/ (* x z) y)) < 2.5551213972670103e+294

    1. Initial program 2.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|\]

    if 2.5551213972670103e+294 < (- (/ (+ x 4) y) (/ (* x z) y))

    1. Initial program 0.2

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

      \[\leadsto \left|\color{blue}{\left(x + 4\right) \cdot \frac{1}{y}} - \frac{x}{y} \cdot z\right|\]
    4. Applied fma-neg0.2

      \[\leadsto \left|\color{blue}{(\left(x + 4\right) \cdot \left(\frac{1}{y}\right) + \left(-\frac{x}{y} \cdot z\right))_*}\right|\]
  3. Recombined 3 regimes into one program.
  4. Applied simplify0.1

    \[\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;\frac{4 + x}{y} - \frac{z \cdot x}{y} \le -3.5436162303669186 \cdot 10^{+152}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{z}{\frac{y}{x}}\right|\\ \mathbf{if}\;\frac{4 + x}{y} - \frac{z \cdot x}{y} \le 2.5551213972670103 \cdot 10^{+294}:\\ \;\;\;\;\left|\frac{4 + x}{y} - \frac{z \cdot x}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|(\left(4 + x\right) \cdot \left(\frac{1}{y}\right) + \left(\frac{x}{y} \cdot \left(-z\right)\right))_*\right|\\ \end{array}}\]

Runtime

Time bar (total: 38.9s)Debug logProfile

herbie shell --seed '#(1071373924 2949776965 1885069702 3247780810 90874544 2263903749)' +o rules:numerics
(FPCore (x y z)
  :name "fabs fraction 1"
  (fabs (- (/ (+ x 4) y) (* (/ x y) z))))