Average Error: 10.5 → 3.0
Time: 43.8s
Precision: 64
Internal Precision: 576
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
\[\begin{array}{l} \mathbf{if}\;\left(\sqrt[3]{\frac{a1}{b1} \cdot \frac{a2}{b2}} \cdot \sqrt[3]{\frac{a1}{b1} \cdot \frac{a2}{b2}}\right) \cdot \sqrt[3]{\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)} \le -1.0704377314425847 \cdot 10^{+304}:\\ \;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\ \mathbf{if}\;\left(\sqrt[3]{\frac{a1}{b1} \cdot \frac{a2}{b2}} \cdot \sqrt[3]{\frac{a1}{b1} \cdot \frac{a2}{b2}}\right) \cdot \sqrt[3]{\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)} \le -6.1980387051091 \cdot 10^{-318}:\\ \;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\ \mathbf{if}\;\left(\sqrt[3]{\frac{a1}{b1} \cdot \frac{a2}{b2}} \cdot \sqrt[3]{\frac{a1}{b1} \cdot \frac{a2}{b2}}\right) \cdot \sqrt[3]{\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)} \le 2.5475085141972532 \cdot 10^{-297}:\\ \;\;\;\;\frac{a1}{\frac{b1 \cdot b2}{a2}}\\ \mathbf{if}\;\left(\sqrt[3]{\frac{a1}{b1} \cdot \frac{a2}{b2}} \cdot \sqrt[3]{\frac{a1}{b1} \cdot \frac{a2}{b2}}\right) \cdot \sqrt[3]{\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)} \le 4.0521763659347775 \cdot 10^{+294}:\\ \;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\ \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

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original10.5
Target10.3
Herbie3.0
\[\frac{a1}{b1} \cdot \frac{a2}{b2}\]

Derivation

  1. Split input into 4 regimes
  2. if (* (* (cbrt (* (/ a1 b1) (/ a2 b2))) (cbrt (* (/ a1 b1) (/ a2 b2)))) (cbrt (* (* (cbrt (/ a1 b1)) (cbrt (/ a1 b1))) (* (cbrt (/ a1 b1)) (/ a2 b2))))) < -1.0704377314425847e+304

    1. Initial program 9.9

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]

    if -1.0704377314425847e+304 < (* (* (cbrt (* (/ a1 b1) (/ a2 b2))) (cbrt (* (/ a1 b1) (/ a2 b2)))) (cbrt (* (* (cbrt (/ a1 b1)) (cbrt (/ a1 b1))) (* (cbrt (/ a1 b1)) (/ a2 b2))))) < -6.1980387051091e-318 or 2.5475085141972532e-297 < (* (* (cbrt (* (/ a1 b1) (/ a2 b2))) (cbrt (* (/ a1 b1) (/ a2 b2)))) (cbrt (* (* (cbrt (/ a1 b1)) (cbrt (/ a1 b1))) (* (cbrt (/ a1 b1)) (/ a2 b2))))) < 4.0521763659347775e+294

    1. Initial program 15.5

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

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

    if -6.1980387051091e-318 < (* (* (cbrt (* (/ a1 b1) (/ a2 b2))) (cbrt (* (/ a1 b1) (/ a2 b2)))) (cbrt (* (* (cbrt (/ a1 b1)) (cbrt (/ a1 b1))) (* (cbrt (/ a1 b1)) (/ a2 b2))))) < 2.5475085141972532e-297

    1. Initial program 2.4

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

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

    if 4.0521763659347775e+294 < (* (* (cbrt (* (/ a1 b1) (/ a2 b2))) (cbrt (* (/ a1 b1) (/ a2 b2)))) (cbrt (* (* (cbrt (/ a1 b1)) (cbrt (/ a1 b1))) (* (cbrt (/ a1 b1)) (/ a2 b2)))))

    1. Initial program 6.0

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

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

Runtime

Time bar (total: 43.8s)Debug logProfile

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

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

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