Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A

Percentage Accurate: 89.5% → 96.4%
Time: 9.2s
Alternatives: 9
Speedup: TODO×

Specification

?
\[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]

Your Program's Arguments

Results

Enter valid numbers for all inputs

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 9 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Target

Original89.5%
Target99.5%
Herbie96.4%
\[\frac{x + \left(\frac{y}{t - \frac{x}{z}} - \frac{x}{t \cdot z - x}\right)}{x + 1} \]

Alternative 1?

\[\begin{array}{l} t_1 := z \cdot t - x\\ t_2 := \frac{x - \frac{x - y \cdot z}{t_1}}{x + 1}\\ \mathbf{if}\;t_2 \leq -0.005:\\ \;\;\;\;\frac{y}{x + 1} \cdot \frac{z}{t_1}\\ \mathbf{elif}\;t_2 \leq 10^{+266}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \end{array} \]
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -0.0050000000000000001

    1. Initial program 76.6%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative76.6%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified76.6%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in y around inf 76.4%

      \[\leadsto \color{blue}{\frac{y \cdot z}{\left(t \cdot z - x\right) \cdot \left(1 + x\right)}} \]
    5. Step-by-step derivation
      1. *-commutative76.4%

        \[\leadsto \frac{y \cdot z}{\color{blue}{\left(1 + x\right) \cdot \left(t \cdot z - x\right)}} \]
      2. *-commutative76.4%

        \[\leadsto \frac{y \cdot z}{\left(1 + x\right) \cdot \left(\color{blue}{z \cdot t} - x\right)} \]
      3. times-frac94.9%

        \[\leadsto \color{blue}{\frac{y}{1 + x} \cdot \frac{z}{z \cdot t - x}} \]
      4. +-commutative94.9%

        \[\leadsto \frac{y}{\color{blue}{x + 1}} \cdot \frac{z}{z \cdot t - x} \]
      5. *-commutative94.9%

        \[\leadsto \frac{y}{x + 1} \cdot \frac{z}{\color{blue}{t \cdot z} - x} \]
    6. Simplified94.9%

      \[\leadsto \color{blue}{\frac{y}{x + 1} \cdot \frac{z}{t \cdot z - x}} \]

    if -0.0050000000000000001 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 1e266

    1. Initial program 97.9%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]

    if 1e266 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1))

    1. Initial program 18.6%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative18.6%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified18.6%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in z around inf 81.3%

      \[\leadsto \frac{\color{blue}{\frac{y}{t} + x}}{x + 1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - \frac{x - y \cdot z}{z \cdot t - x}}{x + 1} \leq -0.005:\\ \;\;\;\;\frac{y}{x + 1} \cdot \frac{z}{z \cdot t - x}\\ \mathbf{elif}\;\frac{x - \frac{x - y \cdot z}{z \cdot t - x}}{x + 1} \leq 10^{+266}:\\ \;\;\;\;\frac{x - \frac{x - y \cdot z}{z \cdot t - x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \end{array} \]

Alternative 2?

\[\begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{-39}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-95}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{-75}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-20}:\\ \;\;\;\;z \cdot \frac{y}{z \cdot t - x}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Derivation
  1. Split input into 3 regimes
  2. if x < -1.25e-39 or 1.05e-95 < x < 2.6e-75 or 1.79999999999999987e-20 < x

    1. Initial program 89.5%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative89.5%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified89.5%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in z around inf 66.8%

      \[\leadsto \frac{\color{blue}{\frac{y}{t} + x}}{x + 1} \]
    5. Taylor expanded in x around inf 84.2%

      \[\leadsto \color{blue}{1} \]

    if -1.25e-39 < x < 1.05e-95

    1. Initial program 88.0%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative88.0%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified88.0%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in z around inf 77.9%

      \[\leadsto \frac{\color{blue}{\frac{y}{t} + x}}{x + 1} \]
    5. Taylor expanded in x around 0 64.2%

      \[\leadsto \color{blue}{\frac{y}{t}} \]

    if 2.6e-75 < x < 1.79999999999999987e-20

    1. Initial program 83.5%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative83.5%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified83.5%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in y around inf 67.4%

      \[\leadsto \color{blue}{\frac{y \cdot z}{\left(t \cdot z - x\right) \cdot \left(1 + x\right)}} \]
    5. Step-by-step derivation
      1. times-frac67.7%

        \[\leadsto \color{blue}{\frac{y}{t \cdot z - x} \cdot \frac{z}{1 + x}} \]
      2. +-commutative67.7%

        \[\leadsto \frac{y}{t \cdot z - x} \cdot \frac{z}{\color{blue}{x + 1}} \]
    6. Simplified67.7%

      \[\leadsto \color{blue}{\frac{y}{t \cdot z - x} \cdot \frac{z}{x + 1}} \]
    7. Taylor expanded in x around 0 67.7%

      \[\leadsto \frac{y}{t \cdot z - x} \cdot \color{blue}{z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification75.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{-39}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-95}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{-75}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-20}:\\ \;\;\;\;z \cdot \frac{y}{z \cdot t - x}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 3?

\[\begin{array}{l} \mathbf{if}\;t \leq -9.3 \cdot 10^{-138} \lor \neg \left(t \leq 7 \cdot 10^{-98}\right):\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{t - y}{\frac{x \cdot \left(-x\right)}{-z}}\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if t < -9.30000000000000052e-138 or 7.0000000000000004e-98 < t

    1. Initial program 87.1%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative87.1%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified87.1%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in z around inf 84.3%

      \[\leadsto \frac{\color{blue}{\frac{y}{t} + x}}{x + 1} \]

    if -9.30000000000000052e-138 < t < 7.0000000000000004e-98

    1. Initial program 92.3%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative92.3%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified92.3%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in x around -inf 62.6%

      \[\leadsto \color{blue}{1 + -1 \cdot \frac{y \cdot z - t \cdot z}{{x}^{2}}} \]
    5. Step-by-step derivation
      1. mul-1-neg62.6%

        \[\leadsto 1 + \color{blue}{\left(-\frac{y \cdot z - t \cdot z}{{x}^{2}}\right)} \]
      2. unsub-neg62.6%

        \[\leadsto \color{blue}{1 - \frac{y \cdot z - t \cdot z}{{x}^{2}}} \]
      3. distribute-rgt-out--62.6%

        \[\leadsto 1 - \frac{\color{blue}{z \cdot \left(y - t\right)}}{{x}^{2}} \]
      4. unpow262.6%

        \[\leadsto 1 - \frac{z \cdot \left(y - t\right)}{\color{blue}{x \cdot x}} \]
      5. times-frac70.1%

        \[\leadsto 1 - \color{blue}{\frac{z}{x} \cdot \frac{y - t}{x}} \]
    6. Simplified70.1%

      \[\leadsto \color{blue}{1 - \frac{z}{x} \cdot \frac{y - t}{x}} \]
    7. Step-by-step derivation
      1. *-commutative70.1%

        \[\leadsto 1 - \color{blue}{\frac{y - t}{x} \cdot \frac{z}{x}} \]
      2. clear-num70.2%

        \[\leadsto 1 - \color{blue}{\frac{1}{\frac{x}{y - t}}} \cdot \frac{z}{x} \]
      3. frac-2neg70.2%

        \[\leadsto 1 - \frac{1}{\frac{x}{y - t}} \cdot \color{blue}{\frac{-z}{-x}} \]
      4. frac-times70.2%

        \[\leadsto 1 - \color{blue}{\frac{1 \cdot \left(-z\right)}{\frac{x}{y - t} \cdot \left(-x\right)}} \]
      5. *-un-lft-identity70.2%

        \[\leadsto 1 - \frac{\color{blue}{-z}}{\frac{x}{y - t} \cdot \left(-x\right)} \]
    8. Applied egg-rr70.2%

      \[\leadsto 1 - \color{blue}{\frac{-z}{\frac{x}{y - t} \cdot \left(-x\right)}} \]
    9. Step-by-step derivation
      1. *-commutative70.2%

        \[\leadsto 1 - \frac{-z}{\color{blue}{\left(-x\right) \cdot \frac{x}{y - t}}} \]
      2. associate-*r/70.2%

        \[\leadsto 1 - \frac{-z}{\color{blue}{\frac{\left(-x\right) \cdot x}{y - t}}} \]
      3. associate-/l*62.6%

        \[\leadsto 1 - \color{blue}{\frac{\left(-z\right) \cdot \left(y - t\right)}{\left(-x\right) \cdot x}} \]
      4. *-commutative62.6%

        \[\leadsto 1 - \frac{\color{blue}{\left(y - t\right) \cdot \left(-z\right)}}{\left(-x\right) \cdot x} \]
      5. associate-/l*70.2%

        \[\leadsto 1 - \color{blue}{\frac{y - t}{\frac{\left(-x\right) \cdot x}{-z}}} \]
      6. *-commutative70.2%

        \[\leadsto 1 - \frac{y - t}{\frac{\color{blue}{x \cdot \left(-x\right)}}{-z}} \]
    10. Simplified70.2%

      \[\leadsto 1 - \color{blue}{\frac{y - t}{\frac{x \cdot \left(-x\right)}{-z}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification80.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9.3 \cdot 10^{-138} \lor \neg \left(t \leq 7 \cdot 10^{-98}\right):\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{t - y}{\frac{x \cdot \left(-x\right)}{-z}}\\ \end{array} \]

Alternative 4?

\[\begin{array}{l} \mathbf{if}\;t \leq -6.2 \cdot 10^{-105} \lor \neg \left(t \leq 8 \cdot 10^{-101}\right):\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + \left(x - \frac{y}{\frac{x}{z}}\right)}{x + 1}\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if t < -6.20000000000000029e-105 or 8.00000000000000041e-101 < t

    1. Initial program 86.8%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative86.8%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified86.8%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in z around inf 84.0%

      \[\leadsto \frac{\color{blue}{\frac{y}{t} + x}}{x + 1} \]

    if -6.20000000000000029e-105 < t < 8.00000000000000041e-101

    1. Initial program 92.7%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative92.7%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified92.7%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in t around 0 81.7%

      \[\leadsto \color{blue}{\frac{1 + \left(-1 \cdot \frac{y \cdot z}{x} + x\right)}{1 + x}} \]
    5. Step-by-step derivation
      1. +-commutative81.7%

        \[\leadsto \frac{1 + \color{blue}{\left(x + -1 \cdot \frac{y \cdot z}{x}\right)}}{1 + x} \]
      2. mul-1-neg81.7%

        \[\leadsto \frac{1 + \left(x + \color{blue}{\left(-\frac{y \cdot z}{x}\right)}\right)}{1 + x} \]
      3. unsub-neg81.7%

        \[\leadsto \frac{1 + \color{blue}{\left(x - \frac{y \cdot z}{x}\right)}}{1 + x} \]
      4. associate-/l*85.3%

        \[\leadsto \frac{1 + \left(x - \color{blue}{\frac{y}{\frac{x}{z}}}\right)}{1 + x} \]
      5. +-commutative85.3%

        \[\leadsto \frac{1 + \left(x - \frac{y}{\frac{x}{z}}\right)}{\color{blue}{x + 1}} \]
    6. Simplified85.3%

      \[\leadsto \color{blue}{\frac{1 + \left(x - \frac{y}{\frac{x}{z}}\right)}{x + 1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification84.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.2 \cdot 10^{-105} \lor \neg \left(t \leq 8 \cdot 10^{-101}\right):\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + \left(x - \frac{y}{\frac{x}{z}}\right)}{x + 1}\\ \end{array} \]

Alternative 5?

\[\begin{array}{l} \mathbf{if}\;t \leq -1.3 \cdot 10^{-135} \lor \neg \left(t \leq 9.2 \cdot 10^{-98}\right):\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{t - y}{x \cdot \frac{x}{z}}\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if t < -1.30000000000000002e-135 or 9.20000000000000002e-98 < t

    1. Initial program 87.1%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative87.1%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified87.1%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in z around inf 84.3%

      \[\leadsto \frac{\color{blue}{\frac{y}{t} + x}}{x + 1} \]

    if -1.30000000000000002e-135 < t < 9.20000000000000002e-98

    1. Initial program 92.3%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative92.3%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified92.3%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in x around -inf 62.6%

      \[\leadsto \color{blue}{1 + -1 \cdot \frac{y \cdot z - t \cdot z}{{x}^{2}}} \]
    5. Step-by-step derivation
      1. mul-1-neg62.6%

        \[\leadsto 1 + \color{blue}{\left(-\frac{y \cdot z - t \cdot z}{{x}^{2}}\right)} \]
      2. unsub-neg62.6%

        \[\leadsto \color{blue}{1 - \frac{y \cdot z - t \cdot z}{{x}^{2}}} \]
      3. distribute-rgt-out--62.6%

        \[\leadsto 1 - \frac{\color{blue}{z \cdot \left(y - t\right)}}{{x}^{2}} \]
      4. unpow262.6%

        \[\leadsto 1 - \frac{z \cdot \left(y - t\right)}{\color{blue}{x \cdot x}} \]
      5. times-frac70.1%

        \[\leadsto 1 - \color{blue}{\frac{z}{x} \cdot \frac{y - t}{x}} \]
    6. Simplified70.1%

      \[\leadsto \color{blue}{1 - \frac{z}{x} \cdot \frac{y - t}{x}} \]
    7. Step-by-step derivation
      1. clear-num70.2%

        \[\leadsto 1 - \color{blue}{\frac{1}{\frac{x}{z}}} \cdot \frac{y - t}{x} \]
      2. frac-times70.2%

        \[\leadsto 1 - \color{blue}{\frac{1 \cdot \left(y - t\right)}{\frac{x}{z} \cdot x}} \]
      3. *-un-lft-identity70.2%

        \[\leadsto 1 - \frac{\color{blue}{y - t}}{\frac{x}{z} \cdot x} \]
    8. Applied egg-rr70.2%

      \[\leadsto 1 - \color{blue}{\frac{y - t}{\frac{x}{z} \cdot x}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification80.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.3 \cdot 10^{-135} \lor \neg \left(t \leq 9.2 \cdot 10^{-98}\right):\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{t - y}{x \cdot \frac{x}{z}}\\ \end{array} \]

Alternative 6?

\[\begin{array}{l} \mathbf{if}\;t \leq -1.85 \cdot 10^{-139} \lor \neg \left(t \leq 5 \cdot 10^{-97}\right):\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{y}{\frac{x \cdot x}{z}}\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if t < -1.85000000000000003e-139 or 4.9999999999999995e-97 < t

    1. Initial program 87.1%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative87.1%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified87.1%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in z around inf 84.3%

      \[\leadsto \frac{\color{blue}{\frac{y}{t} + x}}{x + 1} \]

    if -1.85000000000000003e-139 < t < 4.9999999999999995e-97

    1. Initial program 92.3%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative92.3%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified92.3%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in x around -inf 62.6%

      \[\leadsto \color{blue}{1 + -1 \cdot \frac{y \cdot z - t \cdot z}{{x}^{2}}} \]
    5. Step-by-step derivation
      1. mul-1-neg62.6%

        \[\leadsto 1 + \color{blue}{\left(-\frac{y \cdot z - t \cdot z}{{x}^{2}}\right)} \]
      2. unsub-neg62.6%

        \[\leadsto \color{blue}{1 - \frac{y \cdot z - t \cdot z}{{x}^{2}}} \]
      3. distribute-rgt-out--62.6%

        \[\leadsto 1 - \frac{\color{blue}{z \cdot \left(y - t\right)}}{{x}^{2}} \]
      4. unpow262.6%

        \[\leadsto 1 - \frac{z \cdot \left(y - t\right)}{\color{blue}{x \cdot x}} \]
      5. times-frac70.1%

        \[\leadsto 1 - \color{blue}{\frac{z}{x} \cdot \frac{y - t}{x}} \]
    6. Simplified70.1%

      \[\leadsto \color{blue}{1 - \frac{z}{x} \cdot \frac{y - t}{x}} \]
    7. Taylor expanded in y around inf 70.1%

      \[\leadsto 1 - \frac{z}{x} \cdot \color{blue}{\frac{y}{x}} \]
    8. Taylor expanded in z around 0 62.6%

      \[\leadsto 1 - \color{blue}{\frac{y \cdot z}{{x}^{2}}} \]
    9. Step-by-step derivation
      1. *-commutative62.6%

        \[\leadsto 1 - \frac{\color{blue}{z \cdot y}}{{x}^{2}} \]
      2. unpow262.6%

        \[\leadsto 1 - \frac{z \cdot y}{\color{blue}{x \cdot x}} \]
      3. associate-*l/70.2%

        \[\leadsto 1 - \color{blue}{\frac{z}{x \cdot x} \cdot y} \]
      4. *-commutative70.2%

        \[\leadsto 1 - \color{blue}{y \cdot \frac{z}{x \cdot x}} \]
    10. Simplified70.2%

      \[\leadsto 1 - \color{blue}{y \cdot \frac{z}{x \cdot x}} \]
    11. Step-by-step derivation
      1. clear-num70.2%

        \[\leadsto 1 - y \cdot \color{blue}{\frac{1}{\frac{x \cdot x}{z}}} \]
      2. un-div-inv70.2%

        \[\leadsto 1 - \color{blue}{\frac{y}{\frac{x \cdot x}{z}}} \]
    12. Applied egg-rr70.2%

      \[\leadsto 1 - \color{blue}{\frac{y}{\frac{x \cdot x}{z}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification80.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.85 \cdot 10^{-139} \lor \neg \left(t \leq 5 \cdot 10^{-97}\right):\\ \;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{y}{\frac{x \cdot x}{z}}\\ \end{array} \]

Alternative 7?

\[\begin{array}{l} \mathbf{if}\;x \leq -1.05 \cdot 10^{-39}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 9 \cdot 10^{-103}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 2.45 \cdot 10^{-83}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-21}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if x < -1.04999999999999997e-39 or 9e-103 < x < 2.45e-83 or 4.49999999999999968e-21 < x

    1. Initial program 89.5%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative89.5%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified89.5%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in z around inf 66.8%

      \[\leadsto \frac{\color{blue}{\frac{y}{t} + x}}{x + 1} \]
    5. Taylor expanded in x around inf 84.2%

      \[\leadsto \color{blue}{1} \]

    if -1.04999999999999997e-39 < x < 9e-103 or 2.45e-83 < x < 4.49999999999999968e-21

    1. Initial program 87.5%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative87.5%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified87.5%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in z around inf 74.9%

      \[\leadsto \frac{\color{blue}{\frac{y}{t} + x}}{x + 1} \]
    5. Taylor expanded in x around 0 62.7%

      \[\leadsto \color{blue}{\frac{y}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification75.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.05 \cdot 10^{-39}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 9 \cdot 10^{-103}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{elif}\;x \leq 2.45 \cdot 10^{-83}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-21}:\\ \;\;\;\;\frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 8?

\[\begin{array}{l} \mathbf{if}\;x \leq -4.5 \cdot 10^{-138}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-97}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if x < -4.50000000000000008e-138 or 6.20000000000000004e-97 < x

    1. Initial program 88.9%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative88.9%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified88.9%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in z around inf 65.4%

      \[\leadsto \frac{\color{blue}{\frac{y}{t} + x}}{x + 1} \]
    5. Taylor expanded in x around inf 69.9%

      \[\leadsto \color{blue}{1} \]

    if -4.50000000000000008e-138 < x < 6.20000000000000004e-97

    1. Initial program 88.0%

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
    2. Step-by-step derivation
      1. *-commutative88.0%

        \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
    3. Simplified88.0%

      \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
    4. Taylor expanded in t around inf 18.7%

      \[\leadsto \color{blue}{\frac{x}{1 + x}} \]
    5. Step-by-step derivation
      1. +-commutative18.7%

        \[\leadsto \frac{x}{\color{blue}{x + 1}} \]
    6. Simplified18.7%

      \[\leadsto \color{blue}{\frac{x}{x + 1}} \]
    7. Taylor expanded in x around 0 18.7%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.5 \cdot 10^{-138}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-97}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 9?

\[1 \]
Derivation
  1. Initial program 88.6%

    \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \]
  2. Step-by-step derivation
    1. *-commutative88.6%

      \[\leadsto \frac{x + \frac{y \cdot z - x}{\color{blue}{z \cdot t} - x}}{x + 1} \]
  3. Simplified88.6%

    \[\leadsto \color{blue}{\frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}} \]
  4. Taylor expanded in z around inf 70.3%

    \[\leadsto \frac{\color{blue}{\frac{y}{t} + x}}{x + 1} \]
  5. Taylor expanded in x around inf 51.1%

    \[\leadsto \color{blue}{1} \]
  6. Final simplification51.1%

    \[\leadsto 1 \]

Reproduce

?
herbie shell --seed 2023166 
(FPCore (x y z t)
  :name "Diagrams.Trail:splitAtParam  from diagrams-lib-1.3.0.3, A"
  :precision binary64

  :herbie-target
  (/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))

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