Average Error: 14.1 → 0.7
Time: 5.5s
Precision: 64
Internal Precision: 128
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} = -\infty:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -1.7193270926204133 \cdot 10^{-214}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 0.0:\\ \;\;\;\;\frac{1}{\frac{\frac{z}{x}}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 1.0461797982802124 \cdot 10^{+124}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \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) < -inf.0 or 1.0461797982802124e+124 < (/ y z)

    1. Initial program 35.3

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{z}}\]
    3. Taylor expanded around -inf 2.0

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

    if -inf.0 < (/ y z) < -1.7193270926204133e-214 or 0.0 < (/ y z) < 1.0461797982802124e+124

    1. Initial program 8.8

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

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

    if -1.7193270926204133e-214 < (/ y z) < 0.0

    1. Initial program 19.0

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}}\]
    4. Using strategy rm
    5. Applied clear-num1.0

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

      \[\leadsto \frac{1}{\color{blue}{\frac{\frac{z}{x}}{y}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} = -\infty:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -1.7193270926204133 \cdot 10^{-214}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 0.0:\\ \;\;\;\;\frac{1}{\frac{\frac{z}{x}}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 1.0461797982802124 \cdot 10^{+124}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array}\]

Reproduce

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