Average Error: 11.2 → 5.3
Time: 18.8s
Precision: 64
Internal Precision: 384
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
\[\begin{array}{l} \mathbf{if}\;\frac{a1}{b2} \le -9.189418894983145 \cdot 10^{+181}:\\ \;\;\;\;\frac{a1}{\frac{b1 \cdot b2}{a2}}\\ \mathbf{if}\;\frac{a1}{b2} \le -2.1133221206912938 \cdot 10^{-110}:\\ \;\;\;\;\frac{\frac{a1}{b2}}{\frac{b1}{a2}}\\ \mathbf{if}\;\frac{a1}{b2} \le -1.9824088485291243 \cdot 10^{-185}:\\ \;\;\;\;\sqrt[3]{\frac{a2 \cdot a1}{b1 \cdot b2}} \cdot \left(\sqrt[3]{\frac{a2 \cdot a1}{b1 \cdot b2}} \cdot \sqrt[3]{\frac{a2 \cdot a1}{b1 \cdot b2}}\right)\\ \mathbf{if}\;\frac{a1}{b2} \le -6.164111671813175 \cdot 10^{-251}:\\ \;\;\;\;\frac{\frac{a1}{b2}}{\frac{b1}{a2}}\\ \mathbf{if}\;\frac{a1}{b2} \le 1.782272217452307 \cdot 10^{-234}:\\ \;\;\;\;\frac{1}{b2} \cdot \left(\frac{a1}{b1} \cdot a2\right)\\ \mathbf{if}\;\frac{a1}{b2} \le 1.1477605412189007 \cdot 10^{-223}:\\ \;\;\;\;\sqrt[3]{\frac{a2 \cdot a1}{b1 \cdot b2}} \cdot \left(\sqrt[3]{\frac{a2 \cdot a1}{b1 \cdot b2}} \cdot \sqrt[3]{\frac{a2 \cdot a1}{b1 \cdot b2}}\right)\\ \mathbf{if}\;\frac{a1}{b2} \le 2.4949236125226686 \cdot 10^{+233}:\\ \;\;\;\;\frac{\frac{a1}{b2}}{\frac{b1}{a2}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\frac{a2 \cdot a1}{b1 \cdot b2}} \cdot \left(\sqrt[3]{\frac{a2 \cdot a1}{b1 \cdot b2}} \cdot \sqrt[3]{\frac{a2 \cdot a1}{b1 \cdot b2}}\right)\\ \end{array}\]

Error

Bits error versus a1

Bits error versus a2

Bits error versus b1

Bits error versus b2

Target

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

Derivation

  1. Split input into 4 regimes
  2. if (/ a1 b2) < -9.189418894983145e+181

    1. Initial program 9.9

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

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

    if -9.189418894983145e+181 < (/ a1 b2) < -2.1133221206912938e-110 or -1.9824088485291243e-185 < (/ a1 b2) < -6.164111671813175e-251 or 1.1477605412189007e-223 < (/ a1 b2) < 2.4949236125226686e+233

    1. Initial program 14.5

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

      \[\leadsto \color{blue}{\frac{a1}{b1} \cdot \frac{a2}{b2}}\]
    4. Using strategy rm
    5. Applied div-inv14.3

      \[\leadsto \frac{a1}{b1} \cdot \color{blue}{\left(a2 \cdot \frac{1}{b2}\right)}\]
    6. Applied associate-*r*14.0

      \[\leadsto \color{blue}{\left(\frac{a1}{b1} \cdot a2\right) \cdot \frac{1}{b2}}\]
    7. Using strategy rm
    8. Applied pow114.0

      \[\leadsto \left(\frac{a1}{b1} \cdot a2\right) \cdot \color{blue}{{\left(\frac{1}{b2}\right)}^{1}}\]
    9. Applied pow114.0

      \[\leadsto \color{blue}{{\left(\frac{a1}{b1} \cdot a2\right)}^{1}} \cdot {\left(\frac{1}{b2}\right)}^{1}\]
    10. Applied pow-prod-down14.0

      \[\leadsto \color{blue}{{\left(\left(\frac{a1}{b1} \cdot a2\right) \cdot \frac{1}{b2}\right)}^{1}}\]
    11. Applied simplify4.3

      \[\leadsto {\color{blue}{\left(\frac{\frac{a1}{b2}}{\frac{b1}{a2}}\right)}}^{1}\]

    if -2.1133221206912938e-110 < (/ a1 b2) < -1.9824088485291243e-185 or 1.782272217452307e-234 < (/ a1 b2) < 1.1477605412189007e-223 or 2.4949236125226686e+233 < (/ a1 b2)

    1. Initial program 10.0

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt10.6

      \[\leadsto \color{blue}{\left(\sqrt[3]{\frac{a1 \cdot a2}{b1 \cdot b2}} \cdot \sqrt[3]{\frac{a1 \cdot a2}{b1 \cdot b2}}\right) \cdot \sqrt[3]{\frac{a1 \cdot a2}{b1 \cdot b2}}}\]

    if -6.164111671813175e-251 < (/ a1 b2) < 1.782272217452307e-234

    1. Initial program 3.9

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

      \[\leadsto \color{blue}{\frac{a1}{b1} \cdot \frac{a2}{b2}}\]
    4. Using strategy rm
    5. Applied div-inv3.9

      \[\leadsto \frac{a1}{b1} \cdot \color{blue}{\left(a2 \cdot \frac{1}{b2}\right)}\]
    6. Applied associate-*r*3.8

      \[\leadsto \color{blue}{\left(\frac{a1}{b1} \cdot a2\right) \cdot \frac{1}{b2}}\]
  3. Recombined 4 regimes into one program.
  4. Applied simplify5.3

    \[\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;\frac{a1}{b2} \le -9.189418894983145 \cdot 10^{+181}:\\ \;\;\;\;\frac{a1}{\frac{b1 \cdot b2}{a2}}\\ \mathbf{if}\;\frac{a1}{b2} \le -2.1133221206912938 \cdot 10^{-110}:\\ \;\;\;\;\frac{\frac{a1}{b2}}{\frac{b1}{a2}}\\ \mathbf{if}\;\frac{a1}{b2} \le -1.9824088485291243 \cdot 10^{-185}:\\ \;\;\;\;\sqrt[3]{\frac{a2 \cdot a1}{b1 \cdot b2}} \cdot \left(\sqrt[3]{\frac{a2 \cdot a1}{b1 \cdot b2}} \cdot \sqrt[3]{\frac{a2 \cdot a1}{b1 \cdot b2}}\right)\\ \mathbf{if}\;\frac{a1}{b2} \le -6.164111671813175 \cdot 10^{-251}:\\ \;\;\;\;\frac{\frac{a1}{b2}}{\frac{b1}{a2}}\\ \mathbf{if}\;\frac{a1}{b2} \le 1.782272217452307 \cdot 10^{-234}:\\ \;\;\;\;\frac{1}{b2} \cdot \left(\frac{a1}{b1} \cdot a2\right)\\ \mathbf{if}\;\frac{a1}{b2} \le 1.1477605412189007 \cdot 10^{-223}:\\ \;\;\;\;\sqrt[3]{\frac{a2 \cdot a1}{b1 \cdot b2}} \cdot \left(\sqrt[3]{\frac{a2 \cdot a1}{b1 \cdot b2}} \cdot \sqrt[3]{\frac{a2 \cdot a1}{b1 \cdot b2}}\right)\\ \mathbf{if}\;\frac{a1}{b2} \le 2.4949236125226686 \cdot 10^{+233}:\\ \;\;\;\;\frac{\frac{a1}{b2}}{\frac{b1}{a2}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\frac{a2 \cdot a1}{b1 \cdot b2}} \cdot \left(\sqrt[3]{\frac{a2 \cdot a1}{b1 \cdot b2}} \cdot \sqrt[3]{\frac{a2 \cdot a1}{b1 \cdot b2}}\right)\\ \end{array}}\]

Runtime

Time bar (total: 18.8s)Debug logProfile

herbie shell --seed '#(1064397287 3527694221 3797617954 1138343853 2854031332 1153838279)' +o rules:numerics
(FPCore (a1 a2 b1 b2)
  :name "Quotient of products"

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

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