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

Percentage Accurate: 61.1% → 98.5%
Time: 15.1s
Alternatives: 11
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 11 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.1% 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 52.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 88.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := y \cdot \mathsf{expm1}\left(z\right)\\
\mathbf{if}\;y \leq -1.35 \cdot 10^{+235}:\\
\;\;\;\;\frac{-\mathsf{log1p}\left(t_1\right)}{t}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{-1}{t \cdot 0.5 + \frac{t}{t_1}}\\


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

    1. Initial program 47.5%

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(\left(-y\right) - \left(-y\right) \cdot e^{z}\right)}}{t} \]
      5. cancel-sign-sub65.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{\log \left(1 + y \cdot \left(e^{z} - 1\right)\right)}{t}} \]
    5. Step-by-step derivation
      1. associate-*r/37.9%

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

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

        \[\leadsto \frac{-1 \cdot \mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
      4. neg-mul-172.4%

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

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

    if -1.3499999999999999e235 < y

    1. Initial program 53.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 80.1%

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

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

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

      \[\leadsto x - \frac{1}{0.5 \cdot t + \frac{t}{y \cdot \color{blue}{\left(e^{z} + -1\right)}}} \]
    11. Step-by-step derivation
      1. metadata-eval80.1%

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

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

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

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

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

Alternative 3: 89.6% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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 77.0%

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

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

      \[\leadsto x - \frac{1}{0.5 \cdot t + \frac{t}{y \cdot \left(e^{z} + \color{blue}{-1}\right)}} \]
  10. Applied egg-rr77.0%

    \[\leadsto x - \frac{1}{0.5 \cdot t + \frac{t}{y \cdot \color{blue}{\left(e^{z} + -1\right)}}} \]
  11. Step-by-step derivation
    1. metadata-eval77.0%

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

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

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

    \[\leadsto x - \frac{1}{0.5 \cdot t + \frac{t}{y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}}} \]
  13. Final simplification89.6%

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

Alternative 4: 90.6% accurate, 1.9× speedup?

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

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

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

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


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

    1. Initial program 35.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      10. 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. clear-num99.8%

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

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

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

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

      \[\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 62.2%

      \[\leadsto x - \frac{1}{\color{blue}{0.5 \cdot t + \frac{t}{y \cdot \left(e^{z} - 1\right)}}} \]
    9. Taylor expanded in z around 0 74.8%

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

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

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

    if -2.3e10 < y < 7.0000000000000001e-15

    1. Initial program 73.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      10. 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 88.2%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{e^{z} - 1}}} \]
      2. expm1-def99.8%

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

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

    if 7.0000000000000001e-15 < y

    1. Initial program 3.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 60.3%

      \[\leadsto x - \frac{1}{\color{blue}{0.5 \cdot t + \frac{t}{y \cdot \left(e^{z} - 1\right)}}} \]
    9. Taylor expanded in z around 0 83.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -23000000000:\\ \;\;\;\;x + \frac{-1}{t \cdot 0.5 + \frac{t}{y \cdot z}}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-15}:\\ \;\;\;\;x - \frac{y}{\frac{t}{\mathsf{expm1}\left(z\right)}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{-1}{t \cdot 0.5 + \left(\left(\frac{t}{y \cdot z} + \frac{t}{y} \cdot -0.5\right) - z \cdot \left(-0.25 \cdot \frac{t}{y} + \frac{t}{y} \cdot 0.16666666666666666\right)\right)}\\ \end{array} \]

Alternative 5: 83.8% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;z \leq -130000000000:\\
\;\;\;\;\frac{-y}{\frac{t}{\mathsf{expm1}\left(z\right)}}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{-1}{t \cdot 0.5 + t_1}\\


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

    1. Initial program 75.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      10. 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. clear-num99.7%

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

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

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

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

      \[\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 79.5%

      \[\leadsto x - \frac{1}{\color{blue}{0.5 \cdot t + \frac{t}{y \cdot \left(e^{z} - 1\right)}}} \]
    9. Taylor expanded in z around 0 58.4%

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

    if -6.2000000000000004e37 < z < -1.3e11

    1. Initial program 3.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      10. 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 y around 0 100.0%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
    8. Step-by-step derivation
      1. mul-1-neg100.0%

        \[\leadsto \color{blue}{-\frac{y \cdot \left(e^{z} - 1\right)}{t}} \]
      2. associate-/l*100.0%

        \[\leadsto -\color{blue}{\frac{y}{\frac{t}{e^{z} - 1}}} \]
      3. expm1-def100.0%

        \[\leadsto -\frac{y}{\frac{t}{\color{blue}{\mathsf{expm1}\left(z\right)}}} \]
      4. distribute-frac-neg100.0%

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

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

    if -1.3e11 < z

    1. Initial program 47.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}}} \]
    7. Applied egg-rr98.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 75.8%

      \[\leadsto x - \frac{1}{\color{blue}{0.5 \cdot t + \frac{t}{y \cdot \left(e^{z} - 1\right)}}} \]
    9. Taylor expanded in z around 0 91.0%

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

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

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

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

Alternative 6: 81.7% accurate, 10.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t}{y \cdot z}\\ \mathbf{if}\;y \leq 7.5 \cdot 10^{-230}:\\ \;\;\;\;x + \frac{-1}{t \cdot 0.5 + t_1}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{-1}{t \cdot 0.5 + \left(t_1 + \frac{t}{y} \cdot -0.5\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ t (* y z))))
   (if (<= y 7.5e-230)
     (+ x (/ -1.0 (+ (* t 0.5) t_1)))
     (+ x (/ -1.0 (+ (* t 0.5) (+ t_1 (* (/ t y) -0.5))))))))
double code(double x, double y, double z, double t) {
	double t_1 = t / (y * z);
	double tmp;
	if (y <= 7.5e-230) {
		tmp = x + (-1.0 / ((t * 0.5) + t_1));
	} else {
		tmp = x + (-1.0 / ((t * 0.5) + (t_1 + ((t / y) * -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) :: t_1
    real(8) :: tmp
    t_1 = t / (y * z)
    if (y <= 7.5d-230) then
        tmp = x + ((-1.0d0) / ((t * 0.5d0) + t_1))
    else
        tmp = x + ((-1.0d0) / ((t * 0.5d0) + (t_1 + ((t / y) * (-0.5d0)))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = t / (y * z);
	double tmp;
	if (y <= 7.5e-230) {
		tmp = x + (-1.0 / ((t * 0.5) + t_1));
	} else {
		tmp = x + (-1.0 / ((t * 0.5) + (t_1 + ((t / y) * -0.5))));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t / (y * z)
	tmp = 0
	if y <= 7.5e-230:
		tmp = x + (-1.0 / ((t * 0.5) + t_1))
	else:
		tmp = x + (-1.0 / ((t * 0.5) + (t_1 + ((t / y) * -0.5))))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t / Float64(y * z))
	tmp = 0.0
	if (y <= 7.5e-230)
		tmp = Float64(x + Float64(-1.0 / Float64(Float64(t * 0.5) + t_1)));
	else
		tmp = Float64(x + Float64(-1.0 / Float64(Float64(t * 0.5) + Float64(t_1 + Float64(Float64(t / y) * -0.5)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t / (y * z);
	tmp = 0.0;
	if (y <= 7.5e-230)
		tmp = x + (-1.0 / ((t * 0.5) + t_1));
	else
		tmp = x + (-1.0 / ((t * 0.5) + (t_1 + ((t / y) * -0.5))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 7.5e-230], N[(x + N[(-1.0 / N[(N[(t * 0.5), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(-1.0 / N[(N[(t * 0.5), $MachinePrecision] + N[(t$95$1 + N[(N[(t / y), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{t}{y \cdot z}\\
\mathbf{if}\;y \leq 7.5 \cdot 10^{-230}:\\
\;\;\;\;x + \frac{-1}{t \cdot 0.5 + t_1}\\

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


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

    1. Initial program 62.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 80.0%

      \[\leadsto x - \frac{1}{\color{blue}{0.5 \cdot t + \frac{t}{y \cdot \left(e^{z} - 1\right)}}} \]
    9. Taylor expanded in z around 0 82.5%

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

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

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

    if 7.50000000000000006e-230 < y

    1. Initial program 32.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 70.8%

      \[\leadsto x - \frac{1}{\color{blue}{0.5 \cdot t + \frac{t}{y \cdot \left(e^{z} - 1\right)}}} \]
    9. Taylor expanded in z around 0 81.3%

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

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

Alternative 7: 81.6% accurate, 16.2× speedup?

\[\begin{array}{l} \\ x + \frac{-1}{t \cdot 0.5 + \frac{t}{y \cdot z}} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ x (/ -1.0 (+ (* t 0.5) (/ t (* y z))))))
double code(double x, double y, double z, double t) {
	return x + (-1.0 / ((t * 0.5) + (t / (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) + (t / (y * z))))
end function
public static double code(double x, double y, double z, double t) {
	return x + (-1.0 / ((t * 0.5) + (t / (y * z))));
}
def code(x, y, z, t):
	return x + (-1.0 / ((t * 0.5) + (t / (y * z))))
function code(x, y, z, t)
	return Float64(x + Float64(-1.0 / Float64(Float64(t * 0.5) + Float64(t / Float64(y * z)))))
end
function tmp = code(x, y, z, t)
	tmp = x + (-1.0 / ((t * 0.5) + (t / (y * z))));
end
code[x_, y_, z_, t_] := N[(x + N[(-1.0 / N[(N[(t * 0.5), $MachinePrecision] + N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{-1}{t \cdot 0.5 + \frac{t}{y \cdot z}}
\end{array}
Derivation
  1. Initial program 52.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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 77.0%

    \[\leadsto x - \frac{1}{\color{blue}{0.5 \cdot t + \frac{t}{y \cdot \left(e^{z} - 1\right)}}} \]
  9. Taylor expanded in z around 0 80.3%

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

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

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

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

Alternative 8: 70.9% accurate, 20.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -7.5 \cdot 10^{-196}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{-229}:\\ \;\;\;\;\frac{y}{\frac{t}{-z}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x -7.5e-196) x (if (<= x 2.4e-229) (/ y (/ t (- z))) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -7.5e-196) {
		tmp = x;
	} else if (x <= 2.4e-229) {
		tmp = y / (t / -z);
	} else {
		tmp = x;
	}
	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 (x <= (-7.5d-196)) then
        tmp = x
    else if (x <= 2.4d-229) then
        tmp = y / (t / -z)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -7.5e-196) {
		tmp = x;
	} else if (x <= 2.4e-229) {
		tmp = y / (t / -z);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if x <= -7.5e-196:
		tmp = x
	elif x <= 2.4e-229:
		tmp = y / (t / -z)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (x <= -7.5e-196)
		tmp = x;
	elseif (x <= 2.4e-229)
		tmp = Float64(y / Float64(t / Float64(-z)));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (x <= -7.5e-196)
		tmp = x;
	elseif (x <= 2.4e-229)
		tmp = y / (t / -z);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[x, -7.5e-196], x, If[LessEqual[x, 2.4e-229], N[(y / N[(t / (-z)), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{-196}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 2.4 \cdot 10^{-229}:\\
\;\;\;\;\frac{y}{\frac{t}{-z}}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.5e-196 or 2.4e-229 < x

    1. Initial program 57.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      10. 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. Taylor expanded in x around inf 77.9%

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

    if -7.5e-196 < x < 2.4e-229

    1. Initial program 29.7%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x - \color{blue}{\frac{y \cdot z}{t}} \]
    5. Step-by-step derivation
      1. associate-/l*57.4%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
      2. associate-/r/55.2%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t}} \]
    8. Step-by-step derivation
      1. mul-1-neg38.4%

        \[\leadsto \color{blue}{-\frac{y \cdot z}{t}} \]
      2. *-commutative38.4%

        \[\leadsto -\frac{\color{blue}{z \cdot y}}{t} \]
      3. associate-*r/38.4%

        \[\leadsto -\color{blue}{z \cdot \frac{y}{t}} \]
      4. distribute-lft-neg-in38.4%

        \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{y}{t}} \]
    9. Simplified38.4%

      \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{y}{t}} \]
    10. Taylor expanded in z around 0 38.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{t}} \]
    11. Step-by-step derivation
      1. associate-*r/38.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(y \cdot z\right)}{t}} \]
      2. neg-mul-138.4%

        \[\leadsto \frac{\color{blue}{-y \cdot z}}{t} \]
      3. distribute-rgt-neg-in38.4%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{-z}}} \]
    12. Simplified40.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.5 \cdot 10^{-196}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{-229}:\\ \;\;\;\;\frac{y}{\frac{t}{-z}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 9: 78.8% accurate, 23.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{-41}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot \frac{y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -2.4e-41) x (- x (* z (/ y t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -2.4e-41) {
		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 <= (-2.4d-41)) 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 <= -2.4e-41) {
		tmp = x;
	} else {
		tmp = x - (z * (y / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -2.4e-41:
		tmp = x
	else:
		tmp = x - (z * (y / t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -2.4e-41)
		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 <= -2.4e-41)
		tmp = x;
	else
		tmp = x - (z * (y / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.4e-41], x, N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-41}:\\
\;\;\;\;x\\

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


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

    1. Initial program 69.1%

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(\left(-y\right) - \left(-y\right) \cdot e^{z}\right)}}{t} \]
      5. cancel-sign-sub98.6%

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
      8. *-rgt-identity98.6%

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      10. 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. Taylor expanded in x around inf 55.9%

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

    if -2.40000000000000022e-41 < z

    1. Initial program 46.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified98.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 87.4%

      \[\leadsto x - \color{blue}{\frac{y \cdot z}{t}} \]
    5. Step-by-step derivation
      1. associate-/l*88.8%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
      2. associate-/r/84.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{-41}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot \frac{y}{t}\\ \end{array} \]

Alternative 10: 82.1% accurate, 23.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{-41}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{t}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -3.1e-41) x (- x (/ y (/ t z)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -3.1e-41) {
		tmp = x;
	} else {
		tmp = x - (y / (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 <= (-3.1d-41)) then
        tmp = x
    else
        tmp = x - (y / (t / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -3.1e-41) {
		tmp = x;
	} else {
		tmp = x - (y / (t / z));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -3.1e-41:
		tmp = x
	else:
		tmp = x - (y / (t / z))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -3.1e-41)
		tmp = x;
	else
		tmp = Float64(x - Float64(y / Float64(t / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -3.1e-41)
		tmp = x;
	else
		tmp = x - (y / (t / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.1e-41], x, N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{-41}:\\
\;\;\;\;x\\

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


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

    1. Initial program 69.1%

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(\left(-y\right) - \left(-y\right) \cdot e^{z}\right)}}{t} \]
      5. cancel-sign-sub98.6%

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
      8. *-rgt-identity98.6%

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      10. 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. Taylor expanded in x around inf 55.9%

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

    if -3.10000000000000001e-41 < z

    1. Initial program 46.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
    8. Simplified88.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{-41}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{t}{z}}\\ \end{array} \]

Alternative 11: 71.3% 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 52.6%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification68.2%

    \[\leadsto x \]

Developer target: 74.3% 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 2023271 
(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)))