Average Error: 11.2 → 5.0
Time: 21.5s
Precision: 64
Internal Precision: 384
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
\[\begin{array}{l} \mathbf{if}\;\frac{a2}{b2} \le -2.0446603464578543 \cdot 10^{+183}:\\ \;\;\;\;\frac{\frac{a1 \cdot a2}{b1}}{b2}\\ \mathbf{if}\;\frac{a2}{b2} \le -1.455983173523525 \cdot 10^{-187}:\\ \;\;\;\;\frac{a1 \cdot \frac{a2}{b2}}{b1}\\ \mathbf{if}\;\frac{a2}{b2} \le -9.751006886653452 \cdot 10^{-266}:\\ \;\;\;\;\frac{\frac{a2}{b2}}{\frac{b1}{a1}}\\ \mathbf{if}\;\frac{a2}{b2} \le 2.2319201805724936 \cdot 10^{-301}:\\ \;\;\;\;\frac{\frac{a1 \cdot a2}{b1}}{b2}\\ \mathbf{if}\;\frac{a2}{b2} \le 7.263676202070417 \cdot 10^{+214}:\\ \;\;\;\;\frac{\frac{a2}{b2}}{\frac{b1}{a1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{a1 \cdot a2}{b1}}{b2}\\ \end{array}\]

Error

Bits error versus a1

Bits error versus a2

Bits error versus b1

Bits error versus b2

Target

Original11.2
Target11.2
Herbie5.0
\[\frac{a1}{b1} \cdot \frac{a2}{b2}\]

Derivation

  1. Split input into 4 regimes
  2. if (/ a2 b2) < -2.0446603464578543e+183 or -9.751006886653452e-266 < (/ a2 b2) < 2.2319201805724936e-301

    1. Initial program 5.5

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied associate-/r*5.3

      \[\leadsto \color{blue}{\frac{\frac{a1 \cdot a2}{b1}}{b2}}\]

    if -2.0446603464578543e+183 < (/ a2 b2) < -1.455983173523525e-187

    1. Initial program 15.0

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied times-frac4.2

      \[\leadsto \color{blue}{\frac{a1}{b1} \cdot \frac{a2}{b2}}\]
    4. Using strategy rm
    5. Applied associate-*l/4.1

      \[\leadsto \color{blue}{\frac{a1 \cdot \frac{a2}{b2}}{b1}}\]

    if -1.455983173523525e-187 < (/ a2 b2) < -9.751006886653452e-266 or 2.2319201805724936e-301 < (/ a2 b2) < 7.263676202070417e+214

    1. Initial program 13.1

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied times-frac5.0

      \[\leadsto \color{blue}{\frac{a1}{b1} \cdot \frac{a2}{b2}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt5.7

      \[\leadsto \color{blue}{\left(\left(\sqrt[3]{\frac{a1}{b1}} \cdot \sqrt[3]{\frac{a1}{b1}}\right) \cdot \sqrt[3]{\frac{a1}{b1}}\right)} \cdot \frac{a2}{b2}\]
    6. Applied associate-*l*5.7

      \[\leadsto \color{blue}{\left(\sqrt[3]{\frac{a1}{b1}} \cdot \sqrt[3]{\frac{a1}{b1}}\right) \cdot \left(\sqrt[3]{\frac{a1}{b1}} \cdot \frac{a2}{b2}\right)}\]
    7. Taylor expanded around inf 51.1

      \[\leadsto \color{blue}{\frac{a2 \cdot e^{\log \left(\frac{1}{b1}\right) - \log \left(\frac{1}{a1}\right)}}{b2}}\]
    8. Applied simplify4.9

      \[\leadsto \color{blue}{\frac{\frac{a2}{b2}}{\frac{b1}{a1}}}\]

    if 7.263676202070417e+214 < (/ a2 b2)

    1. Initial program 5.2

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied associate-/r*8.4

      \[\leadsto \color{blue}{\frac{\frac{a1 \cdot a2}{b1}}{b2}}\]
  3. Recombined 4 regimes into one program.

Runtime

Time bar (total: 21.5s)Debug logProfile

herbie shell --seed '#(1070100504 930361288 1279167582 284574201 1450237281 2578255382)' 
(FPCore (a1 a2 b1 b2)
  :name "Quotient of products"

  :herbie-target
  (* (/ a1 b1) (/ a2 b2))

  (/ (* a1 a2) (* b1 b2)))