Average Error: 1.5 → 0.1
Time: 32.1s
Precision: 64
Internal Precision: 576
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\begin{array}{l} \mathbf{if}\;\frac{x + 4}{y} - x \cdot \frac{z}{y} = -\infty:\\ \;\;\;\;\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\\ \mathbf{if}\;\frac{x + 4}{y} - x \cdot \frac{z}{y} \le 3.3293689962699967 \cdot 10^{+307}:\\ \;\;\;\;\left|\frac{x + 4}{y} - x \cdot \frac{z}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{x + 4}{y} - \left(\sqrt[3]{\frac{x}{y} \cdot z} \cdot \left(\sqrt[3]{\frac{x}{y}} \cdot \sqrt[3]{z}\right)\right) \cdot \sqrt[3]{\frac{x}{y} \cdot z}\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))) < -inf.0

    1. Initial program 0.1

      \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]

    if -inf.0 < (- (/ (+ x 4) y) (* x (/ z y))) < 3.3293689962699967e+307

    1. Initial program 1.6

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

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

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

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

    if 3.3293689962699967e+307 < (- (/ (+ 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 add-cube-cbrt0.7

      \[\leadsto \left|\frac{x + 4}{y} - \color{blue}{\left(\sqrt[3]{\frac{x}{y} \cdot z} \cdot \sqrt[3]{\frac{x}{y} \cdot z}\right) \cdot \sqrt[3]{\frac{x}{y} \cdot z}}\right|\]
    4. Using strategy rm
    5. Applied cbrt-prod0.6

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

Runtime

Time bar (total: 32.1s)Debug logProfile

herbie shell --seed '#(1071948828 1180510430 2986424009 997076509 406109801 420189285)' 
(FPCore (x y z)
  :name "fabs fraction 1"
  (fabs (- (/ (+ x 4) y) (* (/ x y) z))))