Average Error: 14.5 → 2.0
Time: 5.3s
Precision: 64
Internal Precision: 128
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -4.797387267666247 \cdot 10^{+150}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -7.487562556206706 \cdot 10^{-288}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 4.719430647062333 \cdot 10^{-166}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Split input into 4 regimes
  2. if (/ y z) < -4.797387267666247e+150

    1. Initial program 32.0

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified17.0

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}}\]
    4. Using strategy rm
    5. Applied associate-/l*15.9

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}}\]
    6. Using strategy rm
    7. Applied associate-/r/1.9

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

    if -4.797387267666247e+150 < (/ y z) < -7.487562556206706e-288

    1. Initial program 8.1

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}}\]
    4. Using strategy rm
    5. Applied associate-/l*0.2

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

    if -7.487562556206706e-288 < (/ y z) < 4.719430647062333e-166

    1. Initial program 18.7

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

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

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

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{1}{z}}\]

    if 4.719430647062333e-166 < (/ y z)

    1. Initial program 13.1

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified4.6

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification2.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -4.797387267666247 \cdot 10^{+150}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -7.487562556206706 \cdot 10^{-288}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 4.719430647062333 \cdot 10^{-166}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array}\]

Reproduce

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