Average Error: 26.2 → 6.3
Time: 48.7s
Precision: 64
Internal precision: 128
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le -7.346288643304349 \cdot 10^{-35}:\\ \;\;\;\;x + {\left(\frac{\sqrt[3]{y - z} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z}}\right)}^{3}\\ \mathbf{if}\;a \le 2.4800667194058456 \cdot 10^{-134}:\\ \;\;\;\;t - \frac{y}{z} \cdot \left(t - x\right)\\ \mathbf{if}\;a \le 9.581782060813449 \cdot 10^{-54}:\\ \;\;\;\;x + {\left(\frac{\sqrt[3]{y - z} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z}}\right)}^{3}\\ \mathbf{if}\;a \le 2.9697010902129357 \cdot 10^{-33}:\\ \;\;\;\;t - \frac{y}{z} \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + {\left(\frac{\sqrt[3]{y - z} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z}}\right)}^3\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Target

Original26.2
Comparison13.7
Herbie6.3
\[ \begin{array}{l} \mathbf{if}\;z \lt -1.2536131056095036 \cdot 10^{+188}:\\ \;\;\;\;t - \frac{y}{z} \cdot \left(t - x\right)\\ \mathbf{if}\;z \lt 4.446702369113811 \cdot 10^{+64}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{y}{z} \cdot \left(t - x\right)\\ \end{array} \]

Derivation

  1. Split input into 3 regimes.
  2. if a < -7.346288643304349e-35 or 2.4800667194058456e-134 < a < 9.581782060813449e-54

    1. Initial program 21.6

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt 22.0

      \[\leadsto x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{\color{blue}{{\left(\sqrt[3]{a - z}\right)}^3}}\]
    4. Applied add-cube-cbrt 22.1

      \[\leadsto x + \frac{\left(y - z\right) \cdot \color{blue}{{\left(\sqrt[3]{t - x}\right)}^3}}{{\left(\sqrt[3]{a - z}\right)}^3}\]
    5. Applied add-cube-cbrt 22.1

      \[\leadsto x + \frac{\color{blue}{{\left(\sqrt[3]{y - z}\right)}^3} \cdot {\left(\sqrt[3]{t - x}\right)}^3}{{\left(\sqrt[3]{a - z}\right)}^3}\]
    6. Applied cube-unprod 22.1

      \[\leadsto x + \frac{\color{blue}{{\left(\sqrt[3]{y - z} \cdot \sqrt[3]{t - x}\right)}^3}}{{\left(\sqrt[3]{a - z}\right)}^3}\]
    7. Applied cube-undiv 9.0

      \[\leadsto x + \color{blue}{{\left(\frac{\sqrt[3]{y - z} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z}}\right)}^3}\]
    8. Using strategy rm
    9. Applied pow3 9.0

      \[\leadsto x + \color{blue}{{\left(\frac{\sqrt[3]{y - z} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z}}\right)}^{3}}\]

    if -7.346288643304349e-35 < a < 2.4800667194058456e-134 or 9.581782060813449e-54 < a < 2.9697010902129357e-33

    1. Initial program 35.3

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
    2. Applied taylor 6.1

      \[\leadsto \left(\frac{y \cdot x}{z} + t\right) - \frac{y \cdot t}{z}\]
    3. Taylor expanded around inf 6.1

      \[\leadsto \color{blue}{\left(\frac{y \cdot x}{z} + t\right) - \frac{y \cdot t}{z}}\]
    4. Applied simplify 2.2

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

    if 2.9697010902129357e-33 < a

    1. Initial program 22.0

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt 22.3

      \[\leadsto x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{\color{blue}{{\left(\sqrt[3]{a - z}\right)}^3}}\]
    4. Applied add-cube-cbrt 22.4

      \[\leadsto x + \frac{\left(y - z\right) \cdot \color{blue}{{\left(\sqrt[3]{t - x}\right)}^3}}{{\left(\sqrt[3]{a - z}\right)}^3}\]
    5. Applied add-cube-cbrt 22.4

      \[\leadsto x + \frac{\color{blue}{{\left(\sqrt[3]{y - z}\right)}^3} \cdot {\left(\sqrt[3]{t - x}\right)}^3}{{\left(\sqrt[3]{a - z}\right)}^3}\]
    6. Applied cube-unprod 22.5

      \[\leadsto x + \frac{\color{blue}{{\left(\sqrt[3]{y - z} \cdot \sqrt[3]{t - x}\right)}^3}}{{\left(\sqrt[3]{a - z}\right)}^3}\]
    7. Applied cube-undiv 7.5

      \[\leadsto x + \color{blue}{{\left(\frac{\sqrt[3]{y - z} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z}}\right)}^3}\]
  3. Recombined 3 regimes into one program.
  4. Removed slow pow expressions

Runtime

Time bar (total: 48.7s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(3013361385 4222758914 4233191741 1247429076 1610804319 685820325)'
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"

  :target
  (if (< z -1.2536131056095036e+188) (- t (* (/ y z) (- t x))) (if (< z 4.446702369113811e+64) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x)))))

  (+ x (/ (* (- y z) (- t x)) (- a z))))