Average Error: 11.0 → 2.2
Time: 36.1s
Precision: 64
Internal Precision: 576
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\frac{a2}{b1}}{b2} \le -2.6089023308796636 \cdot 10^{+306}:\\ \;\;\;\;\frac{\frac{a1 \cdot a2}{b1}}{b2}\\ \mathbf{if}\;\frac{\frac{a2}{b1}}{b2} \le -1.2180714020774775 \cdot 10^{-304}:\\ \;\;\;\;a1 \cdot \frac{\frac{a2}{b1}}{b2}\\ \mathbf{if}\;\frac{\frac{a2}{b1}}{b2} \le 8.746547490695171 \cdot 10^{-299}:\\ \;\;\;\;\frac{\left(a1 \cdot a2\right) \cdot \frac{1}{b2}}{b1}\\ \mathbf{if}\;\frac{\frac{a2}{b1}}{b2} \le 3.4733057543004296 \cdot 10^{+301}:\\ \;\;\;\;a1 \cdot \frac{\frac{a2}{b1}}{b2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(a1 \cdot a2\right) \cdot \frac{1}{b2}}{b1}\\ \end{array}\]

Error

Bits error versus a1

Bits error versus a2

Bits error versus b1

Bits error versus b2

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Split input into 3 regimes
  2. if (/ (/ a2 b1) b2) < -2.6089023308796636e+306

    1. Initial program 13.4

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

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

    if -2.6089023308796636e+306 < (/ (/ a2 b1) b2) < -1.2180714020774775e-304 or 8.746547490695171e-299 < (/ (/ a2 b1) b2) < 3.4733057543004296e+301

    1. Initial program 12.7

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

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

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

      \[\leadsto \color{blue}{a1 \cdot \left(\frac{1}{b1} \cdot \frac{a2}{b2}\right)}\]
    7. Applied simplify0.5

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

    if -1.2180714020774775e-304 < (/ (/ a2 b1) b2) < 8.746547490695171e-299 or 3.4733057543004296e+301 < (/ (/ a2 b1) b2)

    1. Initial program 7.3

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

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

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

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

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

Runtime

Time bar (total: 36.1s)Debug logProfile

herbie shell --seed 2018178 
(FPCore (a1 a2 b1 b2)
  :name "Quotient of products"

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

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