Average Error: 11.0 → 10.9
Time: 26.5s
Precision: 64
Internal Precision: 384
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
\[\begin{array}{l} \mathbf{if}\;a2 \le -1.338280974594955 \cdot 10^{-60}:\\ \;\;\;\;\frac{1}{\frac{b1 \cdot b2}{a1 \cdot a2}}\\ \mathbf{if}\;a2 \le 1.196555386697209 \cdot 10^{-255}:\\ \;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\ \mathbf{if}\;a2 \le 2.4020301758630992 \cdot 10^{-111}:\\ \;\;\;\;\frac{\frac{a1 \cdot a2}{b1}}{b2}\\ \mathbf{if}\;a2 \le 1.503214291414168 \cdot 10^{-24}:\\ \;\;\;\;{\left(\frac{a1}{b2} \cdot \frac{a2}{b1}\right)}^{1}\\ \mathbf{if}\;a2 \le 1.079801262456853 \cdot 10^{+83}:\\ \;\;\;\;\frac{a1}{\frac{b1 \cdot b2}{a2}}\\ \mathbf{if}\;a2 \le 2.4095681903393743 \cdot 10^{+212}:\\ \;\;\;\;{\left(\frac{a1}{b2} \cdot \frac{a2}{b1}\right)}^{1}\\ \mathbf{if}\;a2 \le 1.2890961211188752 \cdot 10^{+295}:\\ \;\;\;\;\frac{a1}{\frac{b1 \cdot b2}{a2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\ \end{array}\]

Error

Bits error versus a1

Bits error versus a2

Bits error versus b1

Bits error versus b2

Target

Original11.0
Target11.1
Herbie10.9
\[\frac{a1}{b1} \cdot \frac{a2}{b2}\]

Derivation

  1. Split input into 5 regimes
  2. if a2 < -1.338280974594955e-60

    1. Initial program 11.8

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied clear-num12.1

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

    if -1.338280974594955e-60 < a2 < 1.196555386697209e-255 or 1.2890961211188752e+295 < a2

    1. Initial program 10.4

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

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

    if 1.196555386697209e-255 < a2 < 2.4020301758630992e-111

    1. Initial program 10.0

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

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

    if 2.4020301758630992e-111 < a2 < 1.503214291414168e-24 or 1.079801262456853e+83 < a2 < 2.4095681903393743e+212

    1. Initial program 10.7

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

      \[\leadsto \color{blue}{\left(a1 \cdot a2\right) \cdot \frac{1}{b1 \cdot b2}}\]
    4. Using strategy rm
    5. Applied pow110.9

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

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

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

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

    if 1.503214291414168e-24 < a2 < 1.079801262456853e+83 or 2.4095681903393743e+212 < a2 < 1.2890961211188752e+295

    1. Initial program 12.1

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

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

Runtime

Time bar (total: 26.5s)Debug logProfile

herbie shell --seed '#(1063282112 2455465480 4141627379 3773598652 1647277307 776739644)' 
(FPCore (a1 a2 b1 b2)
  :name "Quotient of products"

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

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