System.Random.MWC.Distributions:truncatedExp from mwc-random-0.13.3.2

Percentage Accurate: 61.9% → 98.5%
Time: 20.4s
Alternatives: 13
Speedup: 211.0×

Specification

?
\[\begin{array}{l} \\ x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (- x (/ (log (+ (- 1.0 y) (* y (exp z)))) t)))
double code(double x, double y, double z, double t) {
	return x - (log(((1.0 - y) + (y * exp(z)))) / t);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x - (log(((1.0d0 - y) + (y * exp(z)))) / t)
end function
public static double code(double x, double y, double z, double t) {
	return x - (Math.log(((1.0 - y) + (y * Math.exp(z)))) / t);
}
def code(x, y, z, t):
	return x - (math.log(((1.0 - y) + (y * math.exp(z)))) / t)
function code(x, y, z, t)
	return Float64(x - Float64(log(Float64(Float64(1.0 - y) + Float64(y * exp(z)))) / t))
end
function tmp = code(x, y, z, t)
	tmp = x - (log(((1.0 - y) + (y * exp(z)))) / t);
end
code[x_, y_, z_, t_] := N[(x - N[(N[Log[N[(N[(1.0 - y), $MachinePrecision] + N[(y * N[Exp[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}
\end{array}

Sampling outcomes in binary64 precision:

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 13 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.

Initial Program: 61.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (- x (/ (log (+ (- 1.0 y) (* y (exp z)))) t)))
double code(double x, double y, double z, double t) {
	return x - (log(((1.0 - y) + (y * exp(z)))) / t);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x - (log(((1.0d0 - y) + (y * exp(z)))) / t)
end function
public static double code(double x, double y, double z, double t) {
	return x - (Math.log(((1.0 - y) + (y * Math.exp(z)))) / t);
}
def code(x, y, z, t):
	return x - (math.log(((1.0 - y) + (y * math.exp(z)))) / t)
function code(x, y, z, t)
	return Float64(x - Float64(log(Float64(Float64(1.0 - y) + Float64(y * exp(z)))) / t))
end
function tmp = code(x, y, z, t)
	tmp = x - (log(((1.0 - y) + (y * exp(z)))) / t);
end
code[x_, y_, z_, t_] := N[(x - N[(N[Log[N[(N[(1.0 - y), $MachinePrecision] + N[(y * N[Exp[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}
\end{array}

Alternative 1: 98.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t} \end{array} \]
(FPCore (x y z t) :precision binary64 (- x (/ (log1p (* y (expm1 z))) t)))
double code(double x, double y, double z, double t) {
	return x - (log1p((y * expm1(z))) / t);
}
public static double code(double x, double y, double z, double t) {
	return x - (Math.log1p((y * Math.expm1(z))) / t);
}
def code(x, y, z, t):
	return x - (math.log1p((y * math.expm1(z))) / t)
function code(x, y, z, t)
	return Float64(x - Float64(log1p(Float64(y * expm1(z))) / t))
end
code[x_, y_, z_, t_] := N[(x - N[(N[Log[1 + N[(y * N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}
\end{array}
Derivation
  1. Initial program 61.7%

    \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
  2. Step-by-step derivation
    1. associate-+l-74.9%

      \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
    2. sub-neg74.9%

      \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
    3. log1p-def82.2%

      \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
    4. sub0-neg82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
    5. associate-+l-82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
    6. neg-sub082.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
    7. +-commutative82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
    8. neg-mul-182.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
    9. metadata-eval82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
    10. cancel-sign-sub-inv82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
    11. *-commutative82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
    12. distribute-lft-out--82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
    13. expm1-def98.8%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
  3. Simplified98.8%

    \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
  4. Final simplification98.8%

    \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t} \]

Alternative 2: 78.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{z} \leq 1:\\ \;\;\;\;x + \frac{-1}{t \cdot 0.5 + \frac{t}{y \cdot \left(e^{z} + -1\right)}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\mathsf{log1p}\left(y \cdot \left(z + 0.5 \cdot \left(z \cdot z\right)\right)\right)}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (exp z) 1.0)
   (+ x (/ -1.0 (+ (* t 0.5) (/ t (* y (+ (exp z) -1.0))))))
   (- x (/ (log1p (* y (+ z (* 0.5 (* z z))))) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (exp(z) <= 1.0) {
		tmp = x + (-1.0 / ((t * 0.5) + (t / (y * (exp(z) + -1.0)))));
	} else {
		tmp = x - (log1p((y * (z + (0.5 * (z * z))))) / t);
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (Math.exp(z) <= 1.0) {
		tmp = x + (-1.0 / ((t * 0.5) + (t / (y * (Math.exp(z) + -1.0)))));
	} else {
		tmp = x - (Math.log1p((y * (z + (0.5 * (z * z))))) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if math.exp(z) <= 1.0:
		tmp = x + (-1.0 / ((t * 0.5) + (t / (y * (math.exp(z) + -1.0)))))
	else:
		tmp = x - (math.log1p((y * (z + (0.5 * (z * z))))) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (exp(z) <= 1.0)
		tmp = Float64(x + Float64(-1.0 / Float64(Float64(t * 0.5) + Float64(t / Float64(y * Float64(exp(z) + -1.0))))));
	else
		tmp = Float64(x - Float64(log1p(Float64(y * Float64(z + Float64(0.5 * Float64(z * z))))) / t));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[N[Exp[z], $MachinePrecision], 1.0], N[(x + N[(-1.0 / N[(N[(t * 0.5), $MachinePrecision] + N[(t / N[(y * N[(N[Exp[z], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[Log[1 + N[(y * N[(z + N[(0.5 * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 1:\\
\;\;\;\;x + \frac{-1}{t \cdot 0.5 + \frac{t}{y \cdot \left(e^{z} + -1\right)}}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{\mathsf{log1p}\left(y \cdot \left(z + 0.5 \cdot \left(z \cdot z\right)\right)\right)}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (exp.f64 z) < 1

    1. Initial program 61.8%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-75.2%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg75.2%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def82.4%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg82.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-82.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub082.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative82.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-182.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval82.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv82.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative82.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--82.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def99.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified99.2%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Step-by-step derivation
      1. expm1-udef82.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      2. sub-neg82.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + \left(-1\right)\right)}\right)}{t} \]
      3. distribute-lft-in82.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + y \cdot \left(-1\right)}\right)}{t} \]
      4. *-commutative82.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right) \cdot y}\right)}{t} \]
      5. metadata-eval82.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1} \cdot y\right)}{t} \]
      6. neg-mul-182.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-y\right)}\right)}{t} \]
      7. sub-neg82.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
      8. clear-num82.4%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}}} \]
      9. inv-pow82.4%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{-1}} \]
      10. metadata-eval82.4%

        \[\leadsto x - {\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\color{blue}{\left(-1\right)}} \]
      11. sqr-pow64.5%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\left(\frac{-1}{2}\right)}} \]
    5. Applied egg-rr60.6%

      \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{-0.5} \cdot {\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{-0.5}} \]
    6. Step-by-step derivation
      1. pow-sqr99.1%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{\left(2 \cdot -0.5\right)}} \]
      2. metadata-eval99.1%

        \[\leadsto x - {\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{\color{blue}{-1}} \]
      3. unpow-199.1%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}}} \]
    7. Simplified99.1%

      \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}}} \]
    8. Taylor expanded in y around 0 78.6%

      \[\leadsto x - \frac{1}{\color{blue}{0.5 \cdot t + \frac{t}{y \cdot \left(e^{z} - 1\right)}}} \]

    if 1 < (exp.f64 z)

    1. Initial program 51.4%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-51.4%

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

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def68.4%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg68.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-68.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub068.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative68.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-168.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval68.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv68.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative68.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--68.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def75.6%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified75.6%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in z around 0 53.8%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(z + 0.5 \cdot {z}^{2}\right)}\right)}{t} \]
    5. Step-by-step derivation
      1. unpow253.8%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \left(z + 0.5 \cdot \color{blue}{\left(z \cdot z\right)}\right)\right)}{t} \]
    6. Simplified53.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{z} \leq 1:\\ \;\;\;\;x + \frac{-1}{t \cdot 0.5 + \frac{t}{y \cdot \left(e^{z} + -1\right)}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\mathsf{log1p}\left(y \cdot \left(z + 0.5 \cdot \left(z \cdot z\right)\right)\right)}{t}\\ \end{array} \]

Alternative 3: 92.5% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -0.9:\\ \;\;\;\;x + \frac{-1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - y}}}\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+67}:\\ \;\;\;\;x - \frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\mathsf{log1p}\left(y \cdot \left(z + 0.5 \cdot \left(z \cdot z\right)\right)\right)}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -0.9)
   (+ x (/ -1.0 (+ (/ t (* y z)) (* t (/ -0.5 (/ y (- 1.0 y)))))))
   (if (<= y 3.5e+67)
     (- x (/ y (/ t (expm1 z))))
     (- x (/ (log1p (* y (+ z (* 0.5 (* z z))))) t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -0.9) {
		tmp = x + (-1.0 / ((t / (y * z)) + (t * (-0.5 / (y / (1.0 - y))))));
	} else if (y <= 3.5e+67) {
		tmp = x - (y / (t / expm1(z)));
	} else {
		tmp = x - (log1p((y * (z + (0.5 * (z * z))))) / t);
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -0.9) {
		tmp = x + (-1.0 / ((t / (y * z)) + (t * (-0.5 / (y / (1.0 - y))))));
	} else if (y <= 3.5e+67) {
		tmp = x - (y / (t / Math.expm1(z)));
	} else {
		tmp = x - (Math.log1p((y * (z + (0.5 * (z * z))))) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -0.9:
		tmp = x + (-1.0 / ((t / (y * z)) + (t * (-0.5 / (y / (1.0 - y))))))
	elif y <= 3.5e+67:
		tmp = x - (y / (t / math.expm1(z)))
	else:
		tmp = x - (math.log1p((y * (z + (0.5 * (z * z))))) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -0.9)
		tmp = Float64(x + Float64(-1.0 / Float64(Float64(t / Float64(y * z)) + Float64(t * Float64(-0.5 / Float64(y / Float64(1.0 - y)))))));
	elseif (y <= 3.5e+67)
		tmp = Float64(x - Float64(y / Float64(t / expm1(z))));
	else
		tmp = Float64(x - Float64(log1p(Float64(y * Float64(z + Float64(0.5 * Float64(z * z))))) / t));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[y, -0.9], N[(x + N[(-1.0 / N[(N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * N[(-0.5 / N[(y / N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+67], N[(x - N[(y / N[(t / N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[Log[1 + N[(y * N[(z + N[(0.5 * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.9:\\
\;\;\;\;x + \frac{-1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - y}}}\\

\mathbf{elif}\;y \leq 3.5 \cdot 10^{+67}:\\
\;\;\;\;x - \frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{\mathsf{log1p}\left(y \cdot \left(z + 0.5 \cdot \left(z \cdot z\right)\right)\right)}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -0.900000000000000022

    1. Initial program 48.9%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-83.0%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg83.0%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def83.0%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub083.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-183.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def99.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Step-by-step derivation
      1. expm1-udef83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      2. sub-neg83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + \left(-1\right)\right)}\right)}{t} \]
      3. distribute-lft-in83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + y \cdot \left(-1\right)}\right)}{t} \]
      4. *-commutative83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right) \cdot y}\right)}{t} \]
      5. metadata-eval83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1} \cdot y\right)}{t} \]
      6. neg-mul-183.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-y\right)}\right)}{t} \]
      7. sub-neg83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
      8. clear-num82.9%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}}} \]
      9. inv-pow82.9%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{-1}} \]
      10. metadata-eval82.9%

        \[\leadsto x - {\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\color{blue}{\left(-1\right)}} \]
      11. sqr-pow53.4%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\left(\frac{-1}{2}\right)}} \]
    5. Applied egg-rr36.0%

      \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{-0.5} \cdot {\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{-0.5}} \]
    6. Step-by-step derivation
      1. pow-sqr99.8%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{\left(2 \cdot -0.5\right)}} \]
      2. metadata-eval99.8%

        \[\leadsto x - {\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{\color{blue}{-1}} \]
      3. unpow-199.8%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}}} \]
    7. Simplified99.8%

      \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}}} \]
    8. Taylor expanded in z around 0 40.0%

      \[\leadsto x - \frac{1}{\color{blue}{-0.5 \cdot \frac{t \cdot \left(y + -1 \cdot {y}^{2}\right)}{{y}^{2}} + \frac{t}{y \cdot z}}} \]
    9. Step-by-step derivation
      1. fma-def40.0%

        \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t \cdot \left(y + -1 \cdot {y}^{2}\right)}{{y}^{2}}, \frac{t}{y \cdot z}\right)}} \]
      2. associate-/l*43.1%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \color{blue}{\frac{t}{\frac{{y}^{2}}{y + -1 \cdot {y}^{2}}}}, \frac{t}{y \cdot z}\right)} \]
      3. unpow243.1%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{\color{blue}{y \cdot y}}{y + -1 \cdot {y}^{2}}}, \frac{t}{y \cdot z}\right)} \]
      4. mul-1-neg43.1%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \color{blue}{\left(-{y}^{2}\right)}}}, \frac{t}{y \cdot z}\right)} \]
      5. unpow243.1%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \left(-\color{blue}{y \cdot y}\right)}}, \frac{t}{y \cdot z}\right)} \]
    10. Simplified43.1%

      \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \left(-y \cdot y\right)}}, \frac{t}{y \cdot z}\right)}} \]
    11. Step-by-step derivation
      1. fma-udef43.1%

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

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

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

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

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

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + \color{blue}{\frac{t}{1} \cdot \frac{-0.5}{\frac{y \cdot y}{y + \left(-y \cdot y\right)}}}} \]
      7. /-rgt-identity43.1%

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

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\color{blue}{\frac{y}{\frac{y + \left(-y \cdot y\right)}{y}}}}} \]
      9. unsub-neg76.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{\frac{\color{blue}{y - y \cdot y}}{y}}}} \]
      10. div-sub76.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{\color{blue}{\frac{y}{y} - \frac{y \cdot y}{y}}}}} \]
      11. *-inverses76.4%

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

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\frac{-y \cdot y}{-y}}}}} \]
      13. neg-sub076.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{\color{blue}{0 - y \cdot y}}{-y}}}} \]
      14. metadata-eval76.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{\color{blue}{0 \cdot 0} - y \cdot y}{-y}}}} \]
      15. neg-sub076.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{0 \cdot 0 - y \cdot y}{\color{blue}{0 - y}}}}} \]
      16. flip-+80.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(0 + y\right)}}}} \]
      17. remove-double-neg80.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \color{blue}{\left(-\left(-y\right)\right)}\right)}}} \]
      18. neg-mul-180.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \left(-\color{blue}{-1 \cdot y}\right)\right)}}} \]
      19. distribute-lft-neg-in80.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \color{blue}{\left(--1\right) \cdot y}\right)}}} \]
      20. cancel-sign-sub-inv80.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(0 - -1 \cdot y\right)}}}} \]
      21. neg-mul-180.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 - \color{blue}{\left(-y\right)}\right)}}} \]
      22. neg-sub080.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(-\left(-y\right)\right)}}}} \]
      23. remove-double-neg80.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{y}}}} \]
    12. Applied egg-rr80.4%

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

    if -0.900000000000000022 < y < 3.5e67

    1. Initial program 76.8%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-77.9%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg77.9%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def89.3%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg89.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-89.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub089.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative89.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-189.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval89.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv89.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative89.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--89.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def98.8%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified98.8%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in y around 0 89.0%

      \[\leadsto x - \color{blue}{\frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
    5. Step-by-step derivation
      1. expm1-def98.5%

        \[\leadsto x - \frac{y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}}{t} \]
      2. associate-/l*99.6%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}} \]
    6. Simplified99.6%

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

    if 3.5e67 < y

    1. Initial program 4.8%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-41.4%

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

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def41.4%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg41.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-41.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub041.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative41.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-141.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval41.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv41.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative41.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--41.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def96.6%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified96.6%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in z around 0 94.3%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(z + 0.5 \cdot {z}^{2}\right)}\right)}{t} \]
    5. Step-by-step derivation
      1. unpow294.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \left(z + 0.5 \cdot \color{blue}{\left(z \cdot z\right)}\right)\right)}{t} \]
    6. Simplified94.3%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(z + 0.5 \cdot \left(z \cdot z\right)\right)}\right)}{t} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification94.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.9:\\ \;\;\;\;x + \frac{-1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - y}}}\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+67}:\\ \;\;\;\;x - \frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\mathsf{log1p}\left(y \cdot \left(z + 0.5 \cdot \left(z \cdot z\right)\right)\right)}{t}\\ \end{array} \]

Alternative 4: 92.4% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -0.2:\\ \;\;\;\;x + \frac{-1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - y}}}\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{+66}:\\ \;\;\;\;x - \frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\mathsf{log1p}\left(y \cdot z\right)}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -0.2)
   (+ x (/ -1.0 (+ (/ t (* y z)) (* t (/ -0.5 (/ y (- 1.0 y)))))))
   (if (<= y 9.5e+66)
     (- x (/ y (/ t (expm1 z))))
     (- x (/ (log1p (* y z)) t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -0.2) {
		tmp = x + (-1.0 / ((t / (y * z)) + (t * (-0.5 / (y / (1.0 - y))))));
	} else if (y <= 9.5e+66) {
		tmp = x - (y / (t / expm1(z)));
	} else {
		tmp = x - (log1p((y * z)) / t);
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -0.2) {
		tmp = x + (-1.0 / ((t / (y * z)) + (t * (-0.5 / (y / (1.0 - y))))));
	} else if (y <= 9.5e+66) {
		tmp = x - (y / (t / Math.expm1(z)));
	} else {
		tmp = x - (Math.log1p((y * z)) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -0.2:
		tmp = x + (-1.0 / ((t / (y * z)) + (t * (-0.5 / (y / (1.0 - y))))))
	elif y <= 9.5e+66:
		tmp = x - (y / (t / math.expm1(z)))
	else:
		tmp = x - (math.log1p((y * z)) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -0.2)
		tmp = Float64(x + Float64(-1.0 / Float64(Float64(t / Float64(y * z)) + Float64(t * Float64(-0.5 / Float64(y / Float64(1.0 - y)))))));
	elseif (y <= 9.5e+66)
		tmp = Float64(x - Float64(y / Float64(t / expm1(z))));
	else
		tmp = Float64(x - Float64(log1p(Float64(y * z)) / t));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[y, -0.2], N[(x + N[(-1.0 / N[(N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * N[(-0.5 / N[(y / N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e+66], N[(x - N[(y / N[(t / N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[Log[1 + N[(y * z), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.2:\\
\;\;\;\;x + \frac{-1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - y}}}\\

\mathbf{elif}\;y \leq 9.5 \cdot 10^{+66}:\\
\;\;\;\;x - \frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{\mathsf{log1p}\left(y \cdot z\right)}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -0.20000000000000001

    1. Initial program 48.9%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-83.0%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg83.0%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def83.0%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub083.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-183.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def99.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Step-by-step derivation
      1. expm1-udef83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      2. sub-neg83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + \left(-1\right)\right)}\right)}{t} \]
      3. distribute-lft-in83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + y \cdot \left(-1\right)}\right)}{t} \]
      4. *-commutative83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right) \cdot y}\right)}{t} \]
      5. metadata-eval83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1} \cdot y\right)}{t} \]
      6. neg-mul-183.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-y\right)}\right)}{t} \]
      7. sub-neg83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
      8. clear-num82.9%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}}} \]
      9. inv-pow82.9%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{-1}} \]
      10. metadata-eval82.9%

        \[\leadsto x - {\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\color{blue}{\left(-1\right)}} \]
      11. sqr-pow53.4%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\left(\frac{-1}{2}\right)}} \]
    5. Applied egg-rr36.0%

      \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{-0.5} \cdot {\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{-0.5}} \]
    6. Step-by-step derivation
      1. pow-sqr99.8%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{\left(2 \cdot -0.5\right)}} \]
      2. metadata-eval99.8%

        \[\leadsto x - {\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{\color{blue}{-1}} \]
      3. unpow-199.8%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}}} \]
    7. Simplified99.8%

      \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}}} \]
    8. Taylor expanded in z around 0 40.0%

      \[\leadsto x - \frac{1}{\color{blue}{-0.5 \cdot \frac{t \cdot \left(y + -1 \cdot {y}^{2}\right)}{{y}^{2}} + \frac{t}{y \cdot z}}} \]
    9. Step-by-step derivation
      1. fma-def40.0%

        \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t \cdot \left(y + -1 \cdot {y}^{2}\right)}{{y}^{2}}, \frac{t}{y \cdot z}\right)}} \]
      2. associate-/l*43.1%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \color{blue}{\frac{t}{\frac{{y}^{2}}{y + -1 \cdot {y}^{2}}}}, \frac{t}{y \cdot z}\right)} \]
      3. unpow243.1%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{\color{blue}{y \cdot y}}{y + -1 \cdot {y}^{2}}}, \frac{t}{y \cdot z}\right)} \]
      4. mul-1-neg43.1%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \color{blue}{\left(-{y}^{2}\right)}}}, \frac{t}{y \cdot z}\right)} \]
      5. unpow243.1%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \left(-\color{blue}{y \cdot y}\right)}}, \frac{t}{y \cdot z}\right)} \]
    10. Simplified43.1%

      \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \left(-y \cdot y\right)}}, \frac{t}{y \cdot z}\right)}} \]
    11. Step-by-step derivation
      1. fma-udef43.1%

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

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

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

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

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

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + \color{blue}{\frac{t}{1} \cdot \frac{-0.5}{\frac{y \cdot y}{y + \left(-y \cdot y\right)}}}} \]
      7. /-rgt-identity43.1%

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

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\color{blue}{\frac{y}{\frac{y + \left(-y \cdot y\right)}{y}}}}} \]
      9. unsub-neg76.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{\frac{\color{blue}{y - y \cdot y}}{y}}}} \]
      10. div-sub76.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{\color{blue}{\frac{y}{y} - \frac{y \cdot y}{y}}}}} \]
      11. *-inverses76.4%

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

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\frac{-y \cdot y}{-y}}}}} \]
      13. neg-sub076.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{\color{blue}{0 - y \cdot y}}{-y}}}} \]
      14. metadata-eval76.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{\color{blue}{0 \cdot 0} - y \cdot y}{-y}}}} \]
      15. neg-sub076.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{0 \cdot 0 - y \cdot y}{\color{blue}{0 - y}}}}} \]
      16. flip-+80.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(0 + y\right)}}}} \]
      17. remove-double-neg80.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \color{blue}{\left(-\left(-y\right)\right)}\right)}}} \]
      18. neg-mul-180.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \left(-\color{blue}{-1 \cdot y}\right)\right)}}} \]
      19. distribute-lft-neg-in80.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \color{blue}{\left(--1\right) \cdot y}\right)}}} \]
      20. cancel-sign-sub-inv80.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(0 - -1 \cdot y\right)}}}} \]
      21. neg-mul-180.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 - \color{blue}{\left(-y\right)}\right)}}} \]
      22. neg-sub080.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(-\left(-y\right)\right)}}}} \]
      23. remove-double-neg80.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{y}}}} \]
    12. Applied egg-rr80.4%

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

    if -0.20000000000000001 < y < 9.50000000000000051e66

    1. Initial program 76.8%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-77.9%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg77.9%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def89.3%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg89.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-89.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub089.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative89.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-189.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval89.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv89.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative89.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--89.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def98.8%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified98.8%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in y around 0 89.0%

      \[\leadsto x - \color{blue}{\frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
    5. Step-by-step derivation
      1. expm1-def98.5%

        \[\leadsto x - \frac{y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}}{t} \]
      2. associate-/l*99.6%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}} \]
    6. Simplified99.6%

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

    if 9.50000000000000051e66 < y

    1. Initial program 4.8%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-41.4%

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

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def41.4%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg41.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-41.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub041.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative41.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-141.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval41.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv41.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative41.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--41.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def96.6%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified96.6%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in z around 0 94.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.2:\\ \;\;\;\;x + \frac{-1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - y}}}\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{+66}:\\ \;\;\;\;x - \frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\mathsf{log1p}\left(y \cdot z\right)}{t}\\ \end{array} \]

Alternative 5: 89.0% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.05:\\ \;\;\;\;x + \frac{-1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - y}}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -1.05)
   (+ x (/ -1.0 (+ (/ t (* y z)) (* t (/ -0.5 (/ y (- 1.0 y)))))))
   (- x (/ y (/ t (expm1 z))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.05) {
		tmp = x + (-1.0 / ((t / (y * z)) + (t * (-0.5 / (y / (1.0 - y))))));
	} else {
		tmp = x - (y / (t / expm1(z)));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.05) {
		tmp = x + (-1.0 / ((t / (y * z)) + (t * (-0.5 / (y / (1.0 - y))))));
	} else {
		tmp = x - (y / (t / Math.expm1(z)));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -1.05:
		tmp = x + (-1.0 / ((t / (y * z)) + (t * (-0.5 / (y / (1.0 - y))))))
	else:
		tmp = x - (y / (t / math.expm1(z)))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -1.05)
		tmp = Float64(x + Float64(-1.0 / Float64(Float64(t / Float64(y * z)) + Float64(t * Float64(-0.5 / Float64(y / Float64(1.0 - y)))))));
	else
		tmp = Float64(x - Float64(y / Float64(t / expm1(z))));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.05], N[(x + N[(-1.0 / N[(N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * N[(-0.5 / N[(y / N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(t / N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05:\\
\;\;\;\;x + \frac{-1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - y}}}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.05000000000000004

    1. Initial program 48.9%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-83.0%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg83.0%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def83.0%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub083.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-183.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def99.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Step-by-step derivation
      1. expm1-udef83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      2. sub-neg83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + \left(-1\right)\right)}\right)}{t} \]
      3. distribute-lft-in83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + y \cdot \left(-1\right)}\right)}{t} \]
      4. *-commutative83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right) \cdot y}\right)}{t} \]
      5. metadata-eval83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1} \cdot y\right)}{t} \]
      6. neg-mul-183.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-y\right)}\right)}{t} \]
      7. sub-neg83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
      8. clear-num82.9%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}}} \]
      9. inv-pow82.9%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{-1}} \]
      10. metadata-eval82.9%

        \[\leadsto x - {\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\color{blue}{\left(-1\right)}} \]
      11. sqr-pow53.4%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\left(\frac{-1}{2}\right)}} \]
    5. Applied egg-rr36.0%

      \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{-0.5} \cdot {\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{-0.5}} \]
    6. Step-by-step derivation
      1. pow-sqr99.8%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{\left(2 \cdot -0.5\right)}} \]
      2. metadata-eval99.8%

        \[\leadsto x - {\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{\color{blue}{-1}} \]
      3. unpow-199.8%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}}} \]
    7. Simplified99.8%

      \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}}} \]
    8. Taylor expanded in z around 0 40.0%

      \[\leadsto x - \frac{1}{\color{blue}{-0.5 \cdot \frac{t \cdot \left(y + -1 \cdot {y}^{2}\right)}{{y}^{2}} + \frac{t}{y \cdot z}}} \]
    9. Step-by-step derivation
      1. fma-def40.0%

        \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t \cdot \left(y + -1 \cdot {y}^{2}\right)}{{y}^{2}}, \frac{t}{y \cdot z}\right)}} \]
      2. associate-/l*43.1%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \color{blue}{\frac{t}{\frac{{y}^{2}}{y + -1 \cdot {y}^{2}}}}, \frac{t}{y \cdot z}\right)} \]
      3. unpow243.1%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{\color{blue}{y \cdot y}}{y + -1 \cdot {y}^{2}}}, \frac{t}{y \cdot z}\right)} \]
      4. mul-1-neg43.1%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \color{blue}{\left(-{y}^{2}\right)}}}, \frac{t}{y \cdot z}\right)} \]
      5. unpow243.1%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \left(-\color{blue}{y \cdot y}\right)}}, \frac{t}{y \cdot z}\right)} \]
    10. Simplified43.1%

      \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \left(-y \cdot y\right)}}, \frac{t}{y \cdot z}\right)}} \]
    11. Step-by-step derivation
      1. fma-udef43.1%

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

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

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

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

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

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + \color{blue}{\frac{t}{1} \cdot \frac{-0.5}{\frac{y \cdot y}{y + \left(-y \cdot y\right)}}}} \]
      7. /-rgt-identity43.1%

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

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\color{blue}{\frac{y}{\frac{y + \left(-y \cdot y\right)}{y}}}}} \]
      9. unsub-neg76.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{\frac{\color{blue}{y - y \cdot y}}{y}}}} \]
      10. div-sub76.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{\color{blue}{\frac{y}{y} - \frac{y \cdot y}{y}}}}} \]
      11. *-inverses76.4%

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

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\frac{-y \cdot y}{-y}}}}} \]
      13. neg-sub076.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{\color{blue}{0 - y \cdot y}}{-y}}}} \]
      14. metadata-eval76.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{\color{blue}{0 \cdot 0} - y \cdot y}{-y}}}} \]
      15. neg-sub076.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{0 \cdot 0 - y \cdot y}{\color{blue}{0 - y}}}}} \]
      16. flip-+80.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(0 + y\right)}}}} \]
      17. remove-double-neg80.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \color{blue}{\left(-\left(-y\right)\right)}\right)}}} \]
      18. neg-mul-180.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \left(-\color{blue}{-1 \cdot y}\right)\right)}}} \]
      19. distribute-lft-neg-in80.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \color{blue}{\left(--1\right) \cdot y}\right)}}} \]
      20. cancel-sign-sub-inv80.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(0 - -1 \cdot y\right)}}}} \]
      21. neg-mul-180.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 - \color{blue}{\left(-y\right)}\right)}}} \]
      22. neg-sub080.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(-\left(-y\right)\right)}}}} \]
      23. remove-double-neg80.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{y}}}} \]
    12. Applied egg-rr80.4%

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

    if -1.05000000000000004 < y

    1. Initial program 65.7%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-72.3%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg72.3%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def82.0%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg82.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-82.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub082.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative82.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-182.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval82.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv82.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative82.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--81.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def98.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified98.4%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in y around 0 81.2%

      \[\leadsto x - \color{blue}{\frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
    5. Step-by-step derivation
      1. expm1-def93.3%

        \[\leadsto x - \frac{y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}}{t} \]
      2. associate-/l*94.5%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}} \]
    6. Simplified94.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.05:\\ \;\;\;\;x + \frac{-1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - y}}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}\\ \end{array} \]

Alternative 6: 83.9% accurate, 10.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -0.114:\\ \;\;\;\;x + \frac{-1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - y}}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{t \cdot -0.5 + \frac{t}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -0.114)
   (+ x (/ -1.0 (+ (/ t (* y z)) (* t (/ -0.5 (/ y (- 1.0 y)))))))
   (- x (/ y (+ (* t -0.5) (/ t z))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -0.114) {
		tmp = x + (-1.0 / ((t / (y * z)) + (t * (-0.5 / (y / (1.0 - y))))));
	} else {
		tmp = x - (y / ((t * -0.5) + (t / z)));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-0.114d0)) then
        tmp = x + ((-1.0d0) / ((t / (y * z)) + (t * ((-0.5d0) / (y / (1.0d0 - y))))))
    else
        tmp = x - (y / ((t * (-0.5d0)) + (t / z)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -0.114) {
		tmp = x + (-1.0 / ((t / (y * z)) + (t * (-0.5 / (y / (1.0 - y))))));
	} else {
		tmp = x - (y / ((t * -0.5) + (t / z)));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -0.114:
		tmp = x + (-1.0 / ((t / (y * z)) + (t * (-0.5 / (y / (1.0 - y))))))
	else:
		tmp = x - (y / ((t * -0.5) + (t / z)))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -0.114)
		tmp = Float64(x + Float64(-1.0 / Float64(Float64(t / Float64(y * z)) + Float64(t * Float64(-0.5 / Float64(y / Float64(1.0 - y)))))));
	else
		tmp = Float64(x - Float64(y / Float64(Float64(t * -0.5) + Float64(t / z))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -0.114)
		tmp = x + (-1.0 / ((t / (y * z)) + (t * (-0.5 / (y / (1.0 - y))))));
	else
		tmp = x - (y / ((t * -0.5) + (t / z)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -0.114], N[(x + N[(-1.0 / N[(N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * N[(-0.5 / N[(y / N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(t * -0.5), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.114:\\
\;\;\;\;x + \frac{-1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - y}}}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{y}{t \cdot -0.5 + \frac{t}{z}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -0.114000000000000004

    1. Initial program 48.9%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-83.0%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg83.0%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def83.0%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub083.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-183.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def99.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Step-by-step derivation
      1. expm1-udef83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      2. sub-neg83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + \left(-1\right)\right)}\right)}{t} \]
      3. distribute-lft-in83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + y \cdot \left(-1\right)}\right)}{t} \]
      4. *-commutative83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right) \cdot y}\right)}{t} \]
      5. metadata-eval83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1} \cdot y\right)}{t} \]
      6. neg-mul-183.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-y\right)}\right)}{t} \]
      7. sub-neg83.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
      8. clear-num82.9%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}}} \]
      9. inv-pow82.9%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{-1}} \]
      10. metadata-eval82.9%

        \[\leadsto x - {\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\color{blue}{\left(-1\right)}} \]
      11. sqr-pow53.4%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\left(\frac{-1}{2}\right)}} \]
    5. Applied egg-rr36.0%

      \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{-0.5} \cdot {\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{-0.5}} \]
    6. Step-by-step derivation
      1. pow-sqr99.8%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{\left(2 \cdot -0.5\right)}} \]
      2. metadata-eval99.8%

        \[\leadsto x - {\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{\color{blue}{-1}} \]
      3. unpow-199.8%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}}} \]
    7. Simplified99.8%

      \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}}} \]
    8. Taylor expanded in z around 0 40.0%

      \[\leadsto x - \frac{1}{\color{blue}{-0.5 \cdot \frac{t \cdot \left(y + -1 \cdot {y}^{2}\right)}{{y}^{2}} + \frac{t}{y \cdot z}}} \]
    9. Step-by-step derivation
      1. fma-def40.0%

        \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t \cdot \left(y + -1 \cdot {y}^{2}\right)}{{y}^{2}}, \frac{t}{y \cdot z}\right)}} \]
      2. associate-/l*43.1%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \color{blue}{\frac{t}{\frac{{y}^{2}}{y + -1 \cdot {y}^{2}}}}, \frac{t}{y \cdot z}\right)} \]
      3. unpow243.1%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{\color{blue}{y \cdot y}}{y + -1 \cdot {y}^{2}}}, \frac{t}{y \cdot z}\right)} \]
      4. mul-1-neg43.1%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \color{blue}{\left(-{y}^{2}\right)}}}, \frac{t}{y \cdot z}\right)} \]
      5. unpow243.1%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \left(-\color{blue}{y \cdot y}\right)}}, \frac{t}{y \cdot z}\right)} \]
    10. Simplified43.1%

      \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \left(-y \cdot y\right)}}, \frac{t}{y \cdot z}\right)}} \]
    11. Step-by-step derivation
      1. fma-udef43.1%

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

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

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

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

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

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + \color{blue}{\frac{t}{1} \cdot \frac{-0.5}{\frac{y \cdot y}{y + \left(-y \cdot y\right)}}}} \]
      7. /-rgt-identity43.1%

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

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\color{blue}{\frac{y}{\frac{y + \left(-y \cdot y\right)}{y}}}}} \]
      9. unsub-neg76.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{\frac{\color{blue}{y - y \cdot y}}{y}}}} \]
      10. div-sub76.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{\color{blue}{\frac{y}{y} - \frac{y \cdot y}{y}}}}} \]
      11. *-inverses76.4%

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

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\frac{-y \cdot y}{-y}}}}} \]
      13. neg-sub076.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{\color{blue}{0 - y \cdot y}}{-y}}}} \]
      14. metadata-eval76.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{\color{blue}{0 \cdot 0} - y \cdot y}{-y}}}} \]
      15. neg-sub076.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{0 \cdot 0 - y \cdot y}{\color{blue}{0 - y}}}}} \]
      16. flip-+80.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(0 + y\right)}}}} \]
      17. remove-double-neg80.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \color{blue}{\left(-\left(-y\right)\right)}\right)}}} \]
      18. neg-mul-180.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \left(-\color{blue}{-1 \cdot y}\right)\right)}}} \]
      19. distribute-lft-neg-in80.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \color{blue}{\left(--1\right) \cdot y}\right)}}} \]
      20. cancel-sign-sub-inv80.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(0 - -1 \cdot y\right)}}}} \]
      21. neg-mul-180.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 - \color{blue}{\left(-y\right)}\right)}}} \]
      22. neg-sub080.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(-\left(-y\right)\right)}}}} \]
      23. remove-double-neg80.4%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{y}}}} \]
    12. Applied egg-rr80.4%

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

    if -0.114000000000000004 < y

    1. Initial program 65.7%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-72.3%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg72.3%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def82.0%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg82.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-82.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub082.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative82.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-182.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval82.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv82.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative82.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--81.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def98.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified98.4%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in y around 0 81.2%

      \[\leadsto x - \color{blue}{\frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
    5. Step-by-step derivation
      1. expm1-def93.3%

        \[\leadsto x - \frac{y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}}{t} \]
      2. associate-/l*94.5%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}} \]
    6. Simplified94.5%

      \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}} \]
    7. Taylor expanded in z around 0 86.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.114:\\ \;\;\;\;x + \frac{-1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - y}}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{t \cdot -0.5 + \frac{t}{z}}\\ \end{array} \]

Alternative 7: 83.9% accurate, 11.1× speedup?

\[\begin{array}{l} \\ x - \frac{\frac{-1}{t}}{\frac{0.5 \cdot \left(1 - y\right)}{y} + \frac{-1}{y \cdot z}} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (- x (/ (/ -1.0 t) (+ (/ (* 0.5 (- 1.0 y)) y) (/ -1.0 (* y z))))))
double code(double x, double y, double z, double t) {
	return x - ((-1.0 / t) / (((0.5 * (1.0 - y)) / y) + (-1.0 / (y * z))));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x - (((-1.0d0) / t) / (((0.5d0 * (1.0d0 - y)) / y) + ((-1.0d0) / (y * z))))
end function
public static double code(double x, double y, double z, double t) {
	return x - ((-1.0 / t) / (((0.5 * (1.0 - y)) / y) + (-1.0 / (y * z))));
}
def code(x, y, z, t):
	return x - ((-1.0 / t) / (((0.5 * (1.0 - y)) / y) + (-1.0 / (y * z))))
function code(x, y, z, t)
	return Float64(x - Float64(Float64(-1.0 / t) / Float64(Float64(Float64(0.5 * Float64(1.0 - y)) / y) + Float64(-1.0 / Float64(y * z)))))
end
function tmp = code(x, y, z, t)
	tmp = x - ((-1.0 / t) / (((0.5 * (1.0 - y)) / y) + (-1.0 / (y * z))));
end
code[x_, y_, z_, t_] := N[(x - N[(N[(-1.0 / t), $MachinePrecision] / N[(N[(N[(0.5 * N[(1.0 - y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] + N[(-1.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - \frac{\frac{-1}{t}}{\frac{0.5 \cdot \left(1 - y\right)}{y} + \frac{-1}{y \cdot z}}
\end{array}
Derivation
  1. Initial program 61.7%

    \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
  2. Step-by-step derivation
    1. associate-+l-74.9%

      \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
    2. sub-neg74.9%

      \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
    3. log1p-def82.2%

      \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
    4. sub0-neg82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
    5. associate-+l-82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
    6. neg-sub082.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
    7. +-commutative82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
    8. neg-mul-182.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
    9. metadata-eval82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
    10. cancel-sign-sub-inv82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
    11. *-commutative82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
    12. distribute-lft-out--82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
    13. expm1-def98.8%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
  3. Simplified98.8%

    \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
  4. Step-by-step derivation
    1. expm1-udef82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
    2. sub-neg82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + \left(-1\right)\right)}\right)}{t} \]
    3. distribute-lft-in82.2%

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

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right) \cdot y}\right)}{t} \]
    5. metadata-eval82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1} \cdot y\right)}{t} \]
    6. neg-mul-182.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-y\right)}\right)}{t} \]
    7. sub-neg82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
    8. clear-num82.2%

      \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}}} \]
    9. inv-pow82.2%

      \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{-1}} \]
    10. metadata-eval82.2%

      \[\leadsto x - {\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\color{blue}{\left(-1\right)}} \]
    11. sqr-pow63.5%

      \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\left(\frac{-1}{2}\right)}} \]
  5. Applied egg-rr59.7%

    \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{-0.5} \cdot {\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{-0.5}} \]
  6. Step-by-step derivation
    1. pow-sqr98.7%

      \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{\left(2 \cdot -0.5\right)}} \]
    2. metadata-eval98.7%

      \[\leadsto x - {\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{\color{blue}{-1}} \]
    3. unpow-198.7%

      \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}}} \]
  7. Simplified98.7%

    \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}}} \]
  8. Taylor expanded in z around 0 54.7%

    \[\leadsto x - \frac{1}{\color{blue}{-0.5 \cdot \frac{t \cdot \left(y + -1 \cdot {y}^{2}\right)}{{y}^{2}} + \frac{t}{y \cdot z}}} \]
  9. Step-by-step derivation
    1. fma-def54.7%

      \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t \cdot \left(y + -1 \cdot {y}^{2}\right)}{{y}^{2}}, \frac{t}{y \cdot z}\right)}} \]
    2. associate-/l*62.9%

      \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \color{blue}{\frac{t}{\frac{{y}^{2}}{y + -1 \cdot {y}^{2}}}}, \frac{t}{y \cdot z}\right)} \]
    3. unpow262.9%

      \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{\color{blue}{y \cdot y}}{y + -1 \cdot {y}^{2}}}, \frac{t}{y \cdot z}\right)} \]
    4. mul-1-neg62.9%

      \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \color{blue}{\left(-{y}^{2}\right)}}}, \frac{t}{y \cdot z}\right)} \]
    5. unpow262.9%

      \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \left(-\color{blue}{y \cdot y}\right)}}, \frac{t}{y \cdot z}\right)} \]
  10. Simplified62.9%

    \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \left(-y \cdot y\right)}}, \frac{t}{y \cdot z}\right)}} \]
  11. Step-by-step derivation
    1. fma-udef62.9%

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

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

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

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

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

      \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + \color{blue}{\frac{t}{1} \cdot \frac{-0.5}{\frac{y \cdot y}{y + \left(-y \cdot y\right)}}}} \]
    7. /-rgt-identity62.9%

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

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

      \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{\frac{\color{blue}{y - y \cdot y}}{y}}}} \]
    10. div-sub78.7%

      \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{\color{blue}{\frac{y}{y} - \frac{y \cdot y}{y}}}}} \]
    11. *-inverses78.7%

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

      \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\frac{-y \cdot y}{-y}}}}} \]
    13. neg-sub078.7%

      \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{\color{blue}{0 - y \cdot y}}{-y}}}} \]
    14. metadata-eval78.7%

      \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{\color{blue}{0 \cdot 0} - y \cdot y}{-y}}}} \]
    15. neg-sub078.7%

      \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{0 \cdot 0 - y \cdot y}{\color{blue}{0 - y}}}}} \]
    16. flip-+81.1%

      \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(0 + y\right)}}}} \]
    17. remove-double-neg81.1%

      \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \color{blue}{\left(-\left(-y\right)\right)}\right)}}} \]
    18. neg-mul-181.1%

      \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \left(-\color{blue}{-1 \cdot y}\right)\right)}}} \]
    19. distribute-lft-neg-in81.1%

      \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \color{blue}{\left(--1\right) \cdot y}\right)}}} \]
    20. cancel-sign-sub-inv81.1%

      \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(0 - -1 \cdot y\right)}}}} \]
    21. neg-mul-181.1%

      \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 - \color{blue}{\left(-y\right)}\right)}}} \]
    22. neg-sub081.1%

      \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(-\left(-y\right)\right)}}}} \]
    23. remove-double-neg81.1%

      \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{y}}}} \]
  12. Applied egg-rr81.1%

    \[\leadsto x - \frac{1}{\color{blue}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - y}}}} \]
  13. Step-by-step derivation
    1. +-commutative81.1%

      \[\leadsto x - \frac{1}{\color{blue}{t \cdot \frac{-0.5}{\frac{y}{1 - y}} + \frac{t}{y \cdot z}}} \]
    2. fma-def85.0%

      \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(t, \frac{-0.5}{\frac{y}{1 - y}}, \frac{t}{y \cdot z}\right)}} \]
    3. associate-/r/85.0%

      \[\leadsto x - \frac{1}{\mathsf{fma}\left(t, \color{blue}{\frac{-0.5}{y} \cdot \left(1 - y\right)}, \frac{t}{y \cdot z}\right)} \]
  14. Simplified85.0%

    \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(t, \frac{-0.5}{y} \cdot \left(1 - y\right), \frac{t}{y \cdot z}\right)}} \]
  15. Taylor expanded in t around -inf 85.0%

    \[\leadsto x - \color{blue}{\frac{-1}{t \cdot \left(0.5 \cdot \frac{1 - y}{y} - \frac{1}{y \cdot z}\right)}} \]
  16. Step-by-step derivation
    1. associate-/r*85.0%

      \[\leadsto x - \color{blue}{\frac{\frac{-1}{t}}{0.5 \cdot \frac{1 - y}{y} - \frac{1}{y \cdot z}}} \]
    2. associate-*r/85.0%

      \[\leadsto x - \frac{\frac{-1}{t}}{\color{blue}{\frac{0.5 \cdot \left(1 - y\right)}{y}} - \frac{1}{y \cdot z}} \]
    3. *-commutative85.0%

      \[\leadsto x - \frac{\frac{-1}{t}}{\frac{\color{blue}{\left(1 - y\right) \cdot 0.5}}{y} - \frac{1}{y \cdot z}} \]
  17. Simplified85.0%

    \[\leadsto x - \color{blue}{\frac{\frac{-1}{t}}{\frac{\left(1 - y\right) \cdot 0.5}{y} - \frac{1}{y \cdot z}}} \]
  18. Final simplification85.0%

    \[\leadsto x - \frac{\frac{-1}{t}}{\frac{0.5 \cdot \left(1 - y\right)}{y} + \frac{-1}{y \cdot z}} \]

Alternative 8: 82.9% accurate, 12.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.55:\\ \;\;\;\;x - \frac{y \cdot -2}{t \cdot \left(1 - y\right)}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{t \cdot \left(\left(z \cdot 0.08333333333333333 + \frac{1}{z}\right) - 0.5\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -0.55)
   (- x (/ (* y -2.0) (* t (- 1.0 y))))
   (- x (/ y (* t (- (+ (* z 0.08333333333333333) (/ 1.0 z)) 0.5))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -0.55) {
		tmp = x - ((y * -2.0) / (t * (1.0 - y)));
	} else {
		tmp = x - (y / (t * (((z * 0.08333333333333333) + (1.0 / z)) - 0.5)));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-0.55d0)) then
        tmp = x - ((y * (-2.0d0)) / (t * (1.0d0 - y)))
    else
        tmp = x - (y / (t * (((z * 0.08333333333333333d0) + (1.0d0 / z)) - 0.5d0)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -0.55) {
		tmp = x - ((y * -2.0) / (t * (1.0 - y)));
	} else {
		tmp = x - (y / (t * (((z * 0.08333333333333333) + (1.0 / z)) - 0.5)));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -0.55:
		tmp = x - ((y * -2.0) / (t * (1.0 - y)))
	else:
		tmp = x - (y / (t * (((z * 0.08333333333333333) + (1.0 / z)) - 0.5)))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -0.55)
		tmp = Float64(x - Float64(Float64(y * -2.0) / Float64(t * Float64(1.0 - y))));
	else
		tmp = Float64(x - Float64(y / Float64(t * Float64(Float64(Float64(z * 0.08333333333333333) + Float64(1.0 / z)) - 0.5))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -0.55)
		tmp = x - ((y * -2.0) / (t * (1.0 - y)));
	else
		tmp = x - (y / (t * (((z * 0.08333333333333333) + (1.0 / z)) - 0.5)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -0.55], N[(x - N[(N[(y * -2.0), $MachinePrecision] / N[(t * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(t * N[(N[(N[(z * 0.08333333333333333), $MachinePrecision] + N[(1.0 / z), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.55:\\
\;\;\;\;x - \frac{y \cdot -2}{t \cdot \left(1 - y\right)}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{y}{t \cdot \left(\left(z \cdot 0.08333333333333333 + \frac{1}{z}\right) - 0.5\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.55000000000000004

    1. Initial program 79.3%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-79.3%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg79.3%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def100.0%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub0100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-1100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Step-by-step derivation
      1. expm1-udef100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      2. sub-neg100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + \left(-1\right)\right)}\right)}{t} \]
      3. distribute-lft-in100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + y \cdot \left(-1\right)}\right)}{t} \]
      4. *-commutative100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right) \cdot y}\right)}{t} \]
      5. metadata-eval100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1} \cdot y\right)}{t} \]
      6. neg-mul-1100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-y\right)}\right)}{t} \]
      7. sub-neg100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
      8. clear-num99.9%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}}} \]
      9. inv-pow99.9%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{-1}} \]
      10. metadata-eval99.9%

        \[\leadsto x - {\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\color{blue}{\left(-1\right)}} \]
      11. sqr-pow46.9%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\left(\frac{-1}{2}\right)}} \]
    5. Applied egg-rr46.9%

      \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{-0.5} \cdot {\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{-0.5}} \]
    6. Step-by-step derivation
      1. pow-sqr99.9%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{\left(2 \cdot -0.5\right)}} \]
      2. metadata-eval99.9%

        \[\leadsto x - {\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{\color{blue}{-1}} \]
      3. unpow-199.9%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}}} \]
    7. Simplified99.9%

      \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}}} \]
    8. Taylor expanded in z around 0 46.0%

      \[\leadsto x - \frac{1}{\color{blue}{-0.5 \cdot \frac{t \cdot \left(y + -1 \cdot {y}^{2}\right)}{{y}^{2}} + \frac{t}{y \cdot z}}} \]
    9. Step-by-step derivation
      1. fma-def46.0%

        \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t \cdot \left(y + -1 \cdot {y}^{2}\right)}{{y}^{2}}, \frac{t}{y \cdot z}\right)}} \]
      2. associate-/l*54.3%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \color{blue}{\frac{t}{\frac{{y}^{2}}{y + -1 \cdot {y}^{2}}}}, \frac{t}{y \cdot z}\right)} \]
      3. unpow254.3%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{\color{blue}{y \cdot y}}{y + -1 \cdot {y}^{2}}}, \frac{t}{y \cdot z}\right)} \]
      4. mul-1-neg54.3%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \color{blue}{\left(-{y}^{2}\right)}}}, \frac{t}{y \cdot z}\right)} \]
      5. unpow254.3%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \left(-\color{blue}{y \cdot y}\right)}}, \frac{t}{y \cdot z}\right)} \]
    10. Simplified54.3%

      \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \left(-y \cdot y\right)}}, \frac{t}{y \cdot z}\right)}} \]
    11. Step-by-step derivation
      1. fma-udef54.3%

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

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

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

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + \color{blue}{\frac{-0.5 \cdot t}{1 \cdot \frac{y \cdot y}{y + \left(-y \cdot y\right)}}}} \]
      5. *-commutative54.3%

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

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + \color{blue}{\frac{t}{1} \cdot \frac{-0.5}{\frac{y \cdot y}{y + \left(-y \cdot y\right)}}}} \]
      7. /-rgt-identity54.3%

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

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

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{\frac{\color{blue}{y - y \cdot y}}{y}}}} \]
      10. div-sub69.7%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{\color{blue}{\frac{y}{y} - \frac{y \cdot y}{y}}}}} \]
      11. *-inverses69.7%

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

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\frac{-y \cdot y}{-y}}}}} \]
      13. neg-sub069.7%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{\color{blue}{0 - y \cdot y}}{-y}}}} \]
      14. metadata-eval69.7%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{\color{blue}{0 \cdot 0} - y \cdot y}{-y}}}} \]
      15. neg-sub069.7%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{0 \cdot 0 - y \cdot y}{\color{blue}{0 - y}}}}} \]
      16. flip-+70.3%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(0 + y\right)}}}} \]
      17. remove-double-neg70.3%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \color{blue}{\left(-\left(-y\right)\right)}\right)}}} \]
      18. neg-mul-170.3%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \left(-\color{blue}{-1 \cdot y}\right)\right)}}} \]
      19. distribute-lft-neg-in70.3%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \color{blue}{\left(--1\right) \cdot y}\right)}}} \]
      20. cancel-sign-sub-inv70.3%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(0 - -1 \cdot y\right)}}}} \]
      21. neg-mul-170.3%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 - \color{blue}{\left(-y\right)}\right)}}} \]
      22. neg-sub070.3%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(-\left(-y\right)\right)}}}} \]
      23. remove-double-neg70.3%

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

      \[\leadsto x - \frac{1}{\color{blue}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - y}}}} \]
    13. Step-by-step derivation
      1. +-commutative70.3%

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

        \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(t, \frac{-0.5}{\frac{y}{1 - y}}, \frac{t}{y \cdot z}\right)}} \]
      3. associate-/r/70.3%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(t, \color{blue}{\frac{-0.5}{y} \cdot \left(1 - y\right)}, \frac{t}{y \cdot z}\right)} \]
    14. Simplified70.3%

      \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(t, \frac{-0.5}{y} \cdot \left(1 - y\right), \frac{t}{y \cdot z}\right)}} \]
    15. Taylor expanded in z around inf 70.3%

      \[\leadsto x - \color{blue}{-2 \cdot \frac{y}{t \cdot \left(1 - y\right)}} \]
    16. Step-by-step derivation
      1. associate-*r/70.3%

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

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

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

    if -0.55000000000000004 < z

    1. Initial program 53.2%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-72.7%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg72.7%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def73.7%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg73.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-73.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub073.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative73.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-173.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval73.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv73.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative73.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--73.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def98.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified98.2%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in y around 0 73.1%

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

        \[\leadsto x - \frac{y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}}{t} \]
      2. associate-/l*91.5%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}} \]
    6. Simplified91.5%

      \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}} \]
    7. Taylor expanded in z around 0 91.1%

      \[\leadsto x - \frac{y}{\color{blue}{-1 \cdot \left(z \cdot \left(-0.25 \cdot t + 0.16666666666666666 \cdot t\right)\right) + \left(-0.5 \cdot t + \frac{t}{z}\right)}} \]
    8. Taylor expanded in t around 0 91.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.55:\\ \;\;\;\;x - \frac{y \cdot -2}{t \cdot \left(1 - y\right)}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{t \cdot \left(\left(z \cdot 0.08333333333333333 + \frac{1}{z}\right) - 0.5\right)}\\ \end{array} \]

Alternative 9: 81.9% accurate, 16.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.9 \cdot 10^{+194}:\\ \;\;\;\;x - \frac{2}{t}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{t \cdot -0.5 + \frac{t}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -1.9e+194) (- x (/ 2.0 t)) (- x (/ y (+ (* t -0.5) (/ t z))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.9e+194) {
		tmp = x - (2.0 / t);
	} else {
		tmp = x - (y / ((t * -0.5) + (t / z)));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-1.9d+194)) then
        tmp = x - (2.0d0 / t)
    else
        tmp = x - (y / ((t * (-0.5d0)) + (t / z)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.9e+194) {
		tmp = x - (2.0 / t);
	} else {
		tmp = x - (y / ((t * -0.5) + (t / z)));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -1.9e+194:
		tmp = x - (2.0 / t)
	else:
		tmp = x - (y / ((t * -0.5) + (t / z)))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -1.9e+194)
		tmp = Float64(x - Float64(2.0 / t));
	else
		tmp = Float64(x - Float64(y / Float64(Float64(t * -0.5) + Float64(t / z))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -1.9e+194)
		tmp = x - (2.0 / t);
	else
		tmp = x - (y / ((t * -0.5) + (t / z)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.9e+194], N[(x - N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(t * -0.5), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+194}:\\
\;\;\;\;x - \frac{2}{t}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{y}{t \cdot -0.5 + \frac{t}{z}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.8999999999999999e194

    1. Initial program 77.0%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-100.0%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg100.0%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def100.0%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub0100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-1100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Step-by-step derivation
      1. expm1-udef100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      2. sub-neg100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + \left(-1\right)\right)}\right)}{t} \]
      3. distribute-lft-in100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + y \cdot \left(-1\right)}\right)}{t} \]
      4. *-commutative100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right) \cdot y}\right)}{t} \]
      5. metadata-eval100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1} \cdot y\right)}{t} \]
      6. neg-mul-1100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-y\right)}\right)}{t} \]
      7. sub-neg100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
      8. clear-num100.0%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}}} \]
      9. inv-pow100.0%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{-1}} \]
      10. metadata-eval100.0%

        \[\leadsto x - {\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\color{blue}{\left(-1\right)}} \]
      11. sqr-pow52.9%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\left(\frac{-1}{2}\right)}} \]
    5. Applied egg-rr35.3%

      \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{-0.5} \cdot {\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{-0.5}} \]
    6. Step-by-step derivation
      1. pow-sqr100.0%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{\left(2 \cdot -0.5\right)}} \]
      2. metadata-eval100.0%

        \[\leadsto x - {\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{\color{blue}{-1}} \]
      3. unpow-1100.0%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}}} \]
    7. Simplified100.0%

      \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}}} \]
    8. Taylor expanded in z around 0 0.0%

      \[\leadsto x - \frac{1}{\color{blue}{-0.5 \cdot \frac{t \cdot \left(y + -1 \cdot {y}^{2}\right)}{{y}^{2}} + \frac{t}{y \cdot z}}} \]
    9. Step-by-step derivation
      1. fma-def0.0%

        \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t \cdot \left(y + -1 \cdot {y}^{2}\right)}{{y}^{2}}, \frac{t}{y \cdot z}\right)}} \]
      2. associate-/l*0.0%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \color{blue}{\frac{t}{\frac{{y}^{2}}{y + -1 \cdot {y}^{2}}}}, \frac{t}{y \cdot z}\right)} \]
      3. unpow20.0%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{\color{blue}{y \cdot y}}{y + -1 \cdot {y}^{2}}}, \frac{t}{y \cdot z}\right)} \]
      4. mul-1-neg0.0%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \color{blue}{\left(-{y}^{2}\right)}}}, \frac{t}{y \cdot z}\right)} \]
      5. unpow20.0%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \left(-\color{blue}{y \cdot y}\right)}}, \frac{t}{y \cdot z}\right)} \]
    10. Simplified0.0%

      \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \left(-y \cdot y\right)}}, \frac{t}{y \cdot z}\right)}} \]
    11. Taylor expanded in y around inf 89.9%

      \[\leadsto x - \color{blue}{\frac{2}{t}} \]

    if -1.8999999999999999e194 < y

    1. Initial program 60.6%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-73.1%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg73.1%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def80.9%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg80.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-80.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub080.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative80.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-180.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval80.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv80.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative80.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--80.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def98.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified98.7%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in y around 0 75.2%

      \[\leadsto x - \color{blue}{\frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
    5. Step-by-step derivation
      1. expm1-def88.2%

        \[\leadsto x - \frac{y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}}{t} \]
      2. associate-/l*88.9%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}} \]
    6. Simplified88.9%

      \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}} \]
    7. Taylor expanded in z around 0 82.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.9 \cdot 10^{+194}:\\ \;\;\;\;x - \frac{2}{t}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{t \cdot -0.5 + \frac{t}{z}}\\ \end{array} \]

Alternative 10: 82.8% accurate, 16.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.35:\\ \;\;\;\;x - \frac{y \cdot -2}{t \cdot \left(1 - y\right)}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{t \cdot -0.5 + \frac{t}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -0.35)
   (- x (/ (* y -2.0) (* t (- 1.0 y))))
   (- x (/ y (+ (* t -0.5) (/ t z))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -0.35) {
		tmp = x - ((y * -2.0) / (t * (1.0 - y)));
	} else {
		tmp = x - (y / ((t * -0.5) + (t / z)));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-0.35d0)) then
        tmp = x - ((y * (-2.0d0)) / (t * (1.0d0 - y)))
    else
        tmp = x - (y / ((t * (-0.5d0)) + (t / z)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -0.35) {
		tmp = x - ((y * -2.0) / (t * (1.0 - y)));
	} else {
		tmp = x - (y / ((t * -0.5) + (t / z)));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -0.35:
		tmp = x - ((y * -2.0) / (t * (1.0 - y)))
	else:
		tmp = x - (y / ((t * -0.5) + (t / z)))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -0.35)
		tmp = Float64(x - Float64(Float64(y * -2.0) / Float64(t * Float64(1.0 - y))));
	else
		tmp = Float64(x - Float64(y / Float64(Float64(t * -0.5) + Float64(t / z))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -0.35)
		tmp = x - ((y * -2.0) / (t * (1.0 - y)));
	else
		tmp = x - (y / ((t * -0.5) + (t / z)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -0.35], N[(x - N[(N[(y * -2.0), $MachinePrecision] / N[(t * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(t * -0.5), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.35:\\
\;\;\;\;x - \frac{y \cdot -2}{t \cdot \left(1 - y\right)}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{y}{t \cdot -0.5 + \frac{t}{z}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.34999999999999998

    1. Initial program 79.3%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-79.3%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg79.3%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def100.0%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub0100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-1100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Step-by-step derivation
      1. expm1-udef100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      2. sub-neg100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + \left(-1\right)\right)}\right)}{t} \]
      3. distribute-lft-in100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + y \cdot \left(-1\right)}\right)}{t} \]
      4. *-commutative100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right) \cdot y}\right)}{t} \]
      5. metadata-eval100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1} \cdot y\right)}{t} \]
      6. neg-mul-1100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-y\right)}\right)}{t} \]
      7. sub-neg100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
      8. clear-num99.9%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}}} \]
      9. inv-pow99.9%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{-1}} \]
      10. metadata-eval99.9%

        \[\leadsto x - {\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\color{blue}{\left(-1\right)}} \]
      11. sqr-pow46.9%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{t}{\mathsf{log1p}\left(y \cdot e^{z} - y\right)}\right)}^{\left(\frac{-1}{2}\right)}} \]
    5. Applied egg-rr46.9%

      \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{-0.5} \cdot {\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{-0.5}} \]
    6. Step-by-step derivation
      1. pow-sqr99.9%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{\left(2 \cdot -0.5\right)}} \]
      2. metadata-eval99.9%

        \[\leadsto x - {\left(\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}\right)}^{\color{blue}{-1}} \]
      3. unpow-199.9%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}}} \]
    7. Simplified99.9%

      \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}}} \]
    8. Taylor expanded in z around 0 46.0%

      \[\leadsto x - \frac{1}{\color{blue}{-0.5 \cdot \frac{t \cdot \left(y + -1 \cdot {y}^{2}\right)}{{y}^{2}} + \frac{t}{y \cdot z}}} \]
    9. Step-by-step derivation
      1. fma-def46.0%

        \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t \cdot \left(y + -1 \cdot {y}^{2}\right)}{{y}^{2}}, \frac{t}{y \cdot z}\right)}} \]
      2. associate-/l*54.3%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \color{blue}{\frac{t}{\frac{{y}^{2}}{y + -1 \cdot {y}^{2}}}}, \frac{t}{y \cdot z}\right)} \]
      3. unpow254.3%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{\color{blue}{y \cdot y}}{y + -1 \cdot {y}^{2}}}, \frac{t}{y \cdot z}\right)} \]
      4. mul-1-neg54.3%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \color{blue}{\left(-{y}^{2}\right)}}}, \frac{t}{y \cdot z}\right)} \]
      5. unpow254.3%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \left(-\color{blue}{y \cdot y}\right)}}, \frac{t}{y \cdot z}\right)} \]
    10. Simplified54.3%

      \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t}{\frac{y \cdot y}{y + \left(-y \cdot y\right)}}, \frac{t}{y \cdot z}\right)}} \]
    11. Step-by-step derivation
      1. fma-udef54.3%

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

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

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

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + \color{blue}{\frac{-0.5 \cdot t}{1 \cdot \frac{y \cdot y}{y + \left(-y \cdot y\right)}}}} \]
      5. *-commutative54.3%

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

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + \color{blue}{\frac{t}{1} \cdot \frac{-0.5}{\frac{y \cdot y}{y + \left(-y \cdot y\right)}}}} \]
      7. /-rgt-identity54.3%

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

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

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{\frac{\color{blue}{y - y \cdot y}}{y}}}} \]
      10. div-sub69.7%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{\color{blue}{\frac{y}{y} - \frac{y \cdot y}{y}}}}} \]
      11. *-inverses69.7%

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

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\frac{-y \cdot y}{-y}}}}} \]
      13. neg-sub069.7%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{\color{blue}{0 - y \cdot y}}{-y}}}} \]
      14. metadata-eval69.7%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{\color{blue}{0 \cdot 0} - y \cdot y}{-y}}}} \]
      15. neg-sub069.7%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \frac{0 \cdot 0 - y \cdot y}{\color{blue}{0 - y}}}}} \]
      16. flip-+70.3%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(0 + y\right)}}}} \]
      17. remove-double-neg70.3%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \color{blue}{\left(-\left(-y\right)\right)}\right)}}} \]
      18. neg-mul-170.3%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \left(-\color{blue}{-1 \cdot y}\right)\right)}}} \]
      19. distribute-lft-neg-in70.3%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 + \color{blue}{\left(--1\right) \cdot y}\right)}}} \]
      20. cancel-sign-sub-inv70.3%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(0 - -1 \cdot y\right)}}}} \]
      21. neg-mul-170.3%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \left(0 - \color{blue}{\left(-y\right)}\right)}}} \]
      22. neg-sub070.3%

        \[\leadsto x - \frac{1}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - \color{blue}{\left(-\left(-y\right)\right)}}}} \]
      23. remove-double-neg70.3%

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

      \[\leadsto x - \frac{1}{\color{blue}{\frac{t}{y \cdot z} + t \cdot \frac{-0.5}{\frac{y}{1 - y}}}} \]
    13. Step-by-step derivation
      1. +-commutative70.3%

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

        \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(t, \frac{-0.5}{\frac{y}{1 - y}}, \frac{t}{y \cdot z}\right)}} \]
      3. associate-/r/70.3%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(t, \color{blue}{\frac{-0.5}{y} \cdot \left(1 - y\right)}, \frac{t}{y \cdot z}\right)} \]
    14. Simplified70.3%

      \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(t, \frac{-0.5}{y} \cdot \left(1 - y\right), \frac{t}{y \cdot z}\right)}} \]
    15. Taylor expanded in z around inf 70.3%

      \[\leadsto x - \color{blue}{-2 \cdot \frac{y}{t \cdot \left(1 - y\right)}} \]
    16. Step-by-step derivation
      1. associate-*r/70.3%

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

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

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

    if -0.34999999999999998 < z

    1. Initial program 53.2%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-72.7%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg72.7%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def73.7%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg73.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-73.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub073.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative73.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-173.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval73.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv73.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative73.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--73.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def98.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified98.2%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in y around 0 73.1%

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

        \[\leadsto x - \frac{y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}}{t} \]
      2. associate-/l*91.5%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}} \]
    6. Simplified91.5%

      \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}} \]
    7. Taylor expanded in z around 0 90.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.35:\\ \;\;\;\;x - \frac{y \cdot -2}{t \cdot \left(1 - y\right)}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{t \cdot -0.5 + \frac{t}{z}}\\ \end{array} \]

Alternative 11: 78.7% accurate, 23.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1784000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot \frac{y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -1784000000.0) x (- x (* z (/ y t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1784000000.0) {
		tmp = x;
	} else {
		tmp = x - (z * (y / t));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-1784000000.0d0)) then
        tmp = x
    else
        tmp = x - (z * (y / t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1784000000.0) {
		tmp = x;
	} else {
		tmp = x - (z * (y / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -1784000000.0:
		tmp = x
	else:
		tmp = x - (z * (y / t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -1784000000.0)
		tmp = x;
	else
		tmp = Float64(x - Float64(z * Float64(y / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -1784000000.0)
		tmp = x;
	else
		tmp = x - (z * (y / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -1784000000.0], x, N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1784000000:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.784e9

    1. Initial program 79.2%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-79.2%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg79.2%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def100.0%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub0100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-1100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in z around 0 34.2%

      \[\leadsto x - \color{blue}{\frac{y \cdot z}{t}} \]
    5. Step-by-step derivation
      1. associate-/l*31.8%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
    6. Simplified31.8%

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

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

    if -1.784e9 < z

    1. Initial program 54.0%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-72.9%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg72.9%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def74.4%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg74.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-74.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub074.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative74.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-174.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval74.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv74.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative74.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--74.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def98.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified98.3%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in z around 0 88.4%

      \[\leadsto x - \color{blue}{\frac{y \cdot z}{t}} \]
    5. Step-by-step derivation
      1. associate-/l*89.4%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
    6. Simplified89.4%

      \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
    7. Step-by-step derivation
      1. associate-/r/86.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1784000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot \frac{y}{t}\\ \end{array} \]

Alternative 12: 81.5% accurate, 23.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1784000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{z}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -1784000000.0) x (- x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1784000000.0) {
		tmp = x;
	} else {
		tmp = x - (y * (z / t));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-1784000000.0d0)) then
        tmp = x
    else
        tmp = x - (y * (z / t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1784000000.0) {
		tmp = x;
	} else {
		tmp = x - (y * (z / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -1784000000.0:
		tmp = x
	else:
		tmp = x - (y * (z / t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -1784000000.0)
		tmp = x;
	else
		tmp = Float64(x - Float64(y * Float64(z / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -1784000000.0)
		tmp = x;
	else
		tmp = x - (y * (z / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -1784000000.0], x, N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1784000000:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.784e9

    1. Initial program 79.2%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-79.2%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg79.2%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def100.0%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub0100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-1100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in z around 0 34.2%

      \[\leadsto x - \color{blue}{\frac{y \cdot z}{t}} \]
    5. Step-by-step derivation
      1. associate-/l*31.8%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
    6. Simplified31.8%

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

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

    if -1.784e9 < z

    1. Initial program 54.0%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-72.9%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg72.9%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
      3. log1p-def74.4%

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. sub0-neg74.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-74.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub074.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. +-commutative74.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
      8. neg-mul-174.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
      9. metadata-eval74.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
      10. cancel-sign-sub-inv74.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
      11. *-commutative74.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      12. distribute-lft-out--74.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def98.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified98.3%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in z around 0 88.4%

      \[\leadsto x - \color{blue}{\frac{y \cdot z}{t}} \]
    5. Step-by-step derivation
      1. associate-/l*89.4%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
    6. Simplified89.4%

      \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
    7. Step-by-step derivation
      1. associate-/l*88.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1784000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{z}{t}\\ \end{array} \]

Alternative 13: 71.5% accurate, 211.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
	return x;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x
end function
public static double code(double x, double y, double z, double t) {
	return x;
}
def code(x, y, z, t):
	return x
function code(x, y, z, t)
	return x
end
function tmp = code(x, y, z, t)
	tmp = x;
end
code[x_, y_, z_, t_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 61.7%

    \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
  2. Step-by-step derivation
    1. associate-+l-74.9%

      \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
    2. sub-neg74.9%

      \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(-\left(y - y \cdot e^{z}\right)\right)\right)}}{t} \]
    3. log1p-def82.2%

      \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
    4. sub0-neg82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
    5. associate-+l-82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
    6. neg-sub082.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
    7. +-commutative82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} + \left(-y\right)}\right)}{t} \]
    8. neg-mul-182.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{-1 \cdot y}\right)}{t} \]
    9. metadata-eval82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} + \color{blue}{\left(-1\right)} \cdot y\right)}{t} \]
    10. cancel-sign-sub-inv82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - 1 \cdot y}\right)}{t} \]
    11. *-commutative82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
    12. distribute-lft-out--82.2%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
    13. expm1-def98.8%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
  3. Simplified98.8%

    \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
  4. Taylor expanded in z around 0 71.9%

    \[\leadsto x - \color{blue}{\frac{y \cdot z}{t}} \]
  5. Step-by-step derivation
    1. associate-/l*71.9%

      \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
  6. Simplified71.9%

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

    \[\leadsto \color{blue}{x} \]
  8. Final simplification69.9%

    \[\leadsto x \]

Developer target: 75.0% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-0.5}{y \cdot t}\\ \mathbf{if}\;z < -2.8874623088207947 \cdot 10^{+119}:\\ \;\;\;\;\left(x - \frac{t_1}{z \cdot z}\right) - t_1 \cdot \frac{\frac{2}{z}}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\log \left(1 + z \cdot y\right)}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (- 0.5) (* y t))))
   (if (< z -2.8874623088207947e+119)
     (- (- x (/ t_1 (* z z))) (* t_1 (/ (/ 2.0 z) (* z z))))
     (- x (/ (log (+ 1.0 (* z y))) t)))))
double code(double x, double y, double z, double t) {
	double t_1 = -0.5 / (y * t);
	double tmp;
	if (z < -2.8874623088207947e+119) {
		tmp = (x - (t_1 / (z * z))) - (t_1 * ((2.0 / z) / (z * z)));
	} else {
		tmp = x - (log((1.0 + (z * y))) / t);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = -0.5d0 / (y * t)
    if (z < (-2.8874623088207947d+119)) then
        tmp = (x - (t_1 / (z * z))) - (t_1 * ((2.0d0 / z) / (z * z)))
    else
        tmp = x - (log((1.0d0 + (z * y))) / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = -0.5 / (y * t);
	double tmp;
	if (z < -2.8874623088207947e+119) {
		tmp = (x - (t_1 / (z * z))) - (t_1 * ((2.0 / z) / (z * z)));
	} else {
		tmp = x - (Math.log((1.0 + (z * y))) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = -0.5 / (y * t)
	tmp = 0
	if z < -2.8874623088207947e+119:
		tmp = (x - (t_1 / (z * z))) - (t_1 * ((2.0 / z) / (z * z)))
	else:
		tmp = x - (math.log((1.0 + (z * y))) / t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(-0.5) / Float64(y * t))
	tmp = 0.0
	if (z < -2.8874623088207947e+119)
		tmp = Float64(Float64(x - Float64(t_1 / Float64(z * z))) - Float64(t_1 * Float64(Float64(2.0 / z) / Float64(z * z))));
	else
		tmp = Float64(x - Float64(log(Float64(1.0 + Float64(z * y))) / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = -0.5 / (y * t);
	tmp = 0.0;
	if (z < -2.8874623088207947e+119)
		tmp = (x - (t_1 / (z * z))) - (t_1 * ((2.0 / z) / (z * z)));
	else
		tmp = x - (log((1.0 + (z * y))) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-0.5) / N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -2.8874623088207947e+119], N[(N[(x - N[(t$95$1 / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(N[(2.0 / z), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[Log[N[(1.0 + N[(z * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{-0.5}{y \cdot t}\\
\mathbf{if}\;z < -2.8874623088207947 \cdot 10^{+119}:\\
\;\;\;\;\left(x - \frac{t_1}{z \cdot z}\right) - t_1 \cdot \frac{\frac{2}{z}}{z \cdot z}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{\log \left(1 + z \cdot y\right)}{t}\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023297 
(FPCore (x y z t)
  :name "System.Random.MWC.Distributions:truncatedExp from mwc-random-0.13.3.2"
  :precision binary64

  :herbie-target
  (if (< z -2.8874623088207947e+119) (- (- x (/ (/ (- 0.5) (* y t)) (* z z))) (* (/ (- 0.5) (* y t)) (/ (/ 2.0 z) (* z z)))) (- x (/ (log (+ 1.0 (* z y))) t)))

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