Average Error: 14.1 → 1.9
Time: 12.4s
Precision: 64
Internal Precision: 128
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -2.0582081373525886 \cdot 10^{-266}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 2.975739674819211 \cdot 10^{-193}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 2.9135451819351904 \cdot 10^{+171}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z} \cdot \left(x \cdot y\right)\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if (/ y z) < -2.0582081373525886e-266 or 2.975739674819211e-193 < (/ y z) < 2.9135451819351904e+171

    1. Initial program 10.6

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified2.5

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]

    if -2.0582081373525886e-266 < (/ y z) < 2.975739674819211e-193

    1. Initial program 18.1

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified12.4

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]
    3. Taylor expanded around 0 0.3

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}}\]

    if 2.9135451819351904e+171 < (/ y z)

    1. Initial program 33.3

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified19.4

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]
    3. Using strategy rm
    4. Applied div-inv19.5

      \[\leadsto x \cdot \color{blue}{\left(y \cdot \frac{1}{z}\right)}\]
    5. Applied associate-*r*2.1

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{1}{z}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -2.0582081373525886 \cdot 10^{-266}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 2.975739674819211 \cdot 10^{-193}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 2.9135451819351904 \cdot 10^{+171}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z} \cdot \left(x \cdot y\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019050 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1"
  (* x (/ (* (/ y z) t) t)))