Average Error: 11.2 → 11.0
Time: 36.2s
Precision: 64
Internal Precision: 384
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
\[\begin{array}{l} \mathbf{if}\;a1 \le -5.9072306555862726 \cdot 10^{+113}:\\ \;\;\;\;\left(a1 \cdot a2\right) \cdot \frac{1}{b1 \cdot b2}\\ \mathbf{if}\;a1 \le -1.082614028386092 \cdot 10^{-152}:\\ \;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\ \mathbf{if}\;a1 \le 5.994603634720681 \cdot 10^{-289}:\\ \;\;\;\;\frac{\frac{a1}{\frac{b1}{a2}}}{b2}\\ \mathbf{if}\;a1 \le 2.683450364693028 \cdot 10^{+72}:\\ \;\;\;\;\frac{1}{b2 \cdot \frac{\frac{b1}{a1}}{a2}}\\ \mathbf{if}\;a1 \le 1.581041614064881 \cdot 10^{+201}:\\ \;\;\;\;\frac{\frac{a1}{\frac{b1}{a2}}}{b2}\\ \mathbf{else}:\\ \;\;\;\;\left(a1 \cdot a2\right) \cdot \frac{1}{b1 \cdot b2}\\ \end{array}\]

Error

Bits error versus a1

Bits error versus a2

Bits error versus b1

Bits error versus b2

Target

Original11.2
Target10.7
Herbie11.0
\[\frac{a1}{b1} \cdot \frac{a2}{b2}\]

Derivation

  1. Split input into 4 regimes
  2. if a1 < -5.9072306555862726e+113 or 1.581041614064881e+201 < a1

    1. Initial program 17.7

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

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

    if -5.9072306555862726e+113 < a1 < -1.082614028386092e-152

    1. Initial program 7.9

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

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

    if -1.082614028386092e-152 < a1 < 5.994603634720681e-289 or 2.683450364693028e+72 < a1 < 1.581041614064881e+201

    1. Initial program 11.5

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

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

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

    if 5.994603634720681e-289 < a1 < 2.683450364693028e+72

    1. Initial program 9.2

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

      \[\leadsto \color{blue}{\frac{\frac{a1 \cdot a2}{b1}}{b2}}\]
    4. Using strategy rm
    5. Applied clear-num9.1

      \[\leadsto \color{blue}{\frac{1}{\frac{b2}{\frac{a1 \cdot a2}{b1}}}}\]
    6. Using strategy rm
    7. Applied div-inv9.3

      \[\leadsto \frac{1}{\color{blue}{b2 \cdot \frac{1}{\frac{a1 \cdot a2}{b1}}}}\]
    8. Applied simplify8.8

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

Runtime

Time bar (total: 36.2s)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit
(FPCore (a1 a2 b1 b2)
  :name "Quotient of products"

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

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