Statistics.Distribution.Beta:$cdensity from math-functions-0.1.5.2

Percentage Accurate: 89.4% → 99.8%
Time: 18.0s
Alternatives: 18
Speedup: 1.9×

Specification

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

\\
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\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 18 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: 89.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \left(x + -1\right) \cdot \log y - t\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (fma (+ z -1.0) (log1p (- y)) (- (* (+ x -1.0) (log y)) t)))
double code(double x, double y, double z, double t) {
	return fma((z + -1.0), log1p(-y), (((x + -1.0) * log(y)) - t));
}
function code(x, y, z, t)
	return fma(Float64(z + -1.0), log1p(Float64(-y)), Float64(Float64(Float64(x + -1.0) * log(y)) - t))
end
code[x_, y_, z_, t_] := N[(N[(z + -1.0), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision] + N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \left(x + -1\right) \cdot \log y - t\right)
\end{array}
Derivation
  1. Initial program 88.7%

    \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
  2. Step-by-step derivation
    1. +-commutative88.7%

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

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) + \left(\left(x - 1\right) \cdot \log y - t\right)} \]
    3. fma-def88.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z - 1, \log \left(1 - y\right), \left(x - 1\right) \cdot \log y - t\right)} \]
    4. sub-neg88.7%

      \[\leadsto \mathsf{fma}\left(z - 1, \log \color{blue}{\left(1 + \left(-y\right)\right)}, \left(x - 1\right) \cdot \log y - t\right) \]
    5. log1p-def99.8%

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \left(x - 1\right) \cdot \log y - t\right)} \]
  4. Final simplification99.8%

    \[\leadsto \mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \left(x + -1\right) \cdot \log y - t\right) \]

Alternative 2: 99.8% accurate, 1.0× speedup?

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

\\
\mathsf{log1p}\left(-y\right) \cdot \left(z + -1\right) + \left(\left(x + -1\right) \cdot \log y - t\right)
\end{array}
Derivation
  1. Initial program 88.7%

    \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
  2. Step-by-step derivation
    1. associate--l+88.7%

      \[\leadsto \color{blue}{\left(x - 1\right) \cdot \log y + \left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)} \]
    2. +-commutative88.7%

      \[\leadsto \color{blue}{\left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) + \left(x - 1\right) \cdot \log y} \]
    3. associate-+l-88.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right)} \]
    4. *-commutative88.7%

      \[\leadsto \color{blue}{\log \left(1 - y\right) \cdot \left(z - 1\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    5. *-commutative88.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    6. sub-neg88.7%

      \[\leadsto \color{blue}{\left(z + \left(-1\right)\right)} \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    7. metadata-eval88.7%

      \[\leadsto \left(z + \color{blue}{-1}\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    8. sub-neg88.7%

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

      \[\leadsto \left(z + -1\right) \cdot \color{blue}{\mathsf{log1p}\left(-y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    10. sub-neg99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(t + \left(-\left(x - 1\right) \cdot \log y\right)\right)} \]
    11. +-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
    12. *-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
    13. distribute-rgt-neg-in99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\color{blue}{\log y \cdot \left(-\left(x - 1\right)\right)} + t\right) \]
    14. fma-def99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\mathsf{fma}\left(\log y, -\left(x - 1\right), t\right)} \]
    15. neg-sub099.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
    16. associate--r-99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(0 - x\right) + 1}, t\right) \]
    17. neg-sub099.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(-x\right)} + 1, t\right) \]
    18. +-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 + \left(-x\right)}, t\right) \]
    19. unsub-neg99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 - x}, t\right) \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)} \]
  4. Taylor expanded in y around 0 99.8%

    \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\log y \cdot \left(1 - x\right) + t\right)} \]
  5. Final simplification99.8%

    \[\leadsto \mathsf{log1p}\left(-y\right) \cdot \left(z + -1\right) + \left(\left(x + -1\right) \cdot \log y - t\right) \]

Alternative 3: 99.5% accurate, 1.7× speedup?

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

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

    \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
  2. Step-by-step derivation
    1. associate--l+88.7%

      \[\leadsto \color{blue}{\left(x - 1\right) \cdot \log y + \left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)} \]
    2. +-commutative88.7%

      \[\leadsto \color{blue}{\left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) + \left(x - 1\right) \cdot \log y} \]
    3. associate-+l-88.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right)} \]
    4. *-commutative88.7%

      \[\leadsto \color{blue}{\log \left(1 - y\right) \cdot \left(z - 1\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    5. *-commutative88.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    6. sub-neg88.7%

      \[\leadsto \color{blue}{\left(z + \left(-1\right)\right)} \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    7. metadata-eval88.7%

      \[\leadsto \left(z + \color{blue}{-1}\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    8. sub-neg88.7%

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

      \[\leadsto \left(z + -1\right) \cdot \color{blue}{\mathsf{log1p}\left(-y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    10. sub-neg99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(t + \left(-\left(x - 1\right) \cdot \log y\right)\right)} \]
    11. +-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
    12. *-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
    13. distribute-rgt-neg-in99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\color{blue}{\log y \cdot \left(-\left(x - 1\right)\right)} + t\right) \]
    14. fma-def99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\mathsf{fma}\left(\log y, -\left(x - 1\right), t\right)} \]
    15. neg-sub099.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
    16. associate--r-99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(0 - x\right) + 1}, t\right) \]
    17. neg-sub099.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(-x\right)} + 1, t\right) \]
    18. +-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 + \left(-x\right)}, t\right) \]
    19. unsub-neg99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 - x}, t\right) \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)} \]
  4. Taylor expanded in y around 0 99.8%

    \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\log y \cdot \left(1 - x\right) + t\right)} \]
  5. Taylor expanded in y around 0 99.3%

    \[\leadsto \color{blue}{\left(-0.5 \cdot \left(\left(z - 1\right) \cdot {y}^{2}\right) + -1 \cdot \left(\left(z - 1\right) \cdot y\right)\right)} - \left(\log y \cdot \left(1 - x\right) + t\right) \]
  6. Step-by-step derivation
    1. mul-1-neg99.3%

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

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

      \[\leadsto \left(\color{blue}{\left(\left(z - 1\right) \cdot {y}^{2}\right) \cdot -0.5} - \left(z - 1\right) \cdot y\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
    4. *-commutative99.3%

      \[\leadsto \left(\color{blue}{\left({y}^{2} \cdot \left(z - 1\right)\right)} \cdot -0.5 - \left(z - 1\right) \cdot y\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
    5. associate-*l*99.3%

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

      \[\leadsto \left(\color{blue}{\left(y \cdot y\right)} \cdot \left(\left(z - 1\right) \cdot -0.5\right) - \left(z - 1\right) \cdot y\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
    7. sub-neg99.3%

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

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

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

      \[\leadsto \left(\left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot -0.5\right) - \color{blue}{y \cdot \left(z - 1\right)}\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
    11. sub-neg99.3%

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

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

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

    \[\leadsto \color{blue}{\left(\left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot -0.5\right) - y \cdot \left(-1 + z\right)\right)} - \left(\log y \cdot \left(1 - x\right) + t\right) \]
  8. Final simplification99.3%

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

Alternative 4: 99.5% accurate, 1.8× speedup?

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

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

    \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
  2. Step-by-step derivation
    1. associate--l+88.7%

      \[\leadsto \color{blue}{\left(x - 1\right) \cdot \log y + \left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)} \]
    2. +-commutative88.7%

      \[\leadsto \color{blue}{\left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) + \left(x - 1\right) \cdot \log y} \]
    3. associate-+l-88.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right)} \]
    4. *-commutative88.7%

      \[\leadsto \color{blue}{\log \left(1 - y\right) \cdot \left(z - 1\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    5. *-commutative88.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    6. sub-neg88.7%

      \[\leadsto \color{blue}{\left(z + \left(-1\right)\right)} \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    7. metadata-eval88.7%

      \[\leadsto \left(z + \color{blue}{-1}\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    8. sub-neg88.7%

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

      \[\leadsto \left(z + -1\right) \cdot \color{blue}{\mathsf{log1p}\left(-y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    10. sub-neg99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(t + \left(-\left(x - 1\right) \cdot \log y\right)\right)} \]
    11. +-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
    12. *-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
    13. distribute-rgt-neg-in99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\color{blue}{\log y \cdot \left(-\left(x - 1\right)\right)} + t\right) \]
    14. fma-def99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\mathsf{fma}\left(\log y, -\left(x - 1\right), t\right)} \]
    15. neg-sub099.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
    16. associate--r-99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(0 - x\right) + 1}, t\right) \]
    17. neg-sub099.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(-x\right)} + 1, t\right) \]
    18. +-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 + \left(-x\right)}, t\right) \]
    19. unsub-neg99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 - x}, t\right) \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)} \]
  4. Taylor expanded in y around 0 99.8%

    \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\log y \cdot \left(1 - x\right) + t\right)} \]
  5. Taylor expanded in y around 0 99.3%

    \[\leadsto \color{blue}{\left(-0.5 \cdot \left(\left(z - 1\right) \cdot {y}^{2}\right) + -1 \cdot \left(\left(z - 1\right) \cdot y\right)\right)} - \left(\log y \cdot \left(1 - x\right) + t\right) \]
  6. Step-by-step derivation
    1. mul-1-neg99.3%

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

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

      \[\leadsto \left(\color{blue}{\left(\left(z - 1\right) \cdot {y}^{2}\right) \cdot -0.5} - \left(z - 1\right) \cdot y\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
    4. *-commutative99.3%

      \[\leadsto \left(\color{blue}{\left({y}^{2} \cdot \left(z - 1\right)\right)} \cdot -0.5 - \left(z - 1\right) \cdot y\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
    5. associate-*l*99.3%

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

      \[\leadsto \left(\color{blue}{\left(y \cdot y\right)} \cdot \left(\left(z - 1\right) \cdot -0.5\right) - \left(z - 1\right) \cdot y\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
    7. sub-neg99.3%

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

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

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

      \[\leadsto \left(\left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot -0.5\right) - \color{blue}{y \cdot \left(z - 1\right)}\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
    11. sub-neg99.3%

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

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

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

    \[\leadsto \color{blue}{\left(\left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot -0.5\right) - y \cdot \left(-1 + z\right)\right)} - \left(\log y \cdot \left(1 - x\right) + t\right) \]
  8. Taylor expanded in z around inf 99.3%

    \[\leadsto \left(\color{blue}{-0.5 \cdot \left({y}^{2} \cdot z\right)} - y \cdot \left(-1 + z\right)\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
  9. Step-by-step derivation
    1. *-commutative99.3%

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

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

    \[\leadsto \left(\color{blue}{-0.5 \cdot \left(z \cdot \left(y \cdot y\right)\right)} - y \cdot \left(-1 + z\right)\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
  11. Final simplification99.3%

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

Alternative 5: 96.1% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x + -1 \leq -1.4 \lor \neg \left(x + -1 \leq -1\right):\\ \;\;\;\;\left(x + -1\right) \cdot \log y - t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(--1\right) - z\right) - \left(\log y + t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= (+ x -1.0) -1.4) (not (<= (+ x -1.0) -1.0)))
   (- (* (+ x -1.0) (log y)) t)
   (- (* y (- (- -1.0) z)) (+ (log y) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((x + -1.0) <= -1.4) || !((x + -1.0) <= -1.0)) {
		tmp = ((x + -1.0) * log(y)) - t;
	} else {
		tmp = (y * (-(-1.0) - z)) - (log(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 (((x + (-1.0d0)) <= (-1.4d0)) .or. (.not. ((x + (-1.0d0)) <= (-1.0d0)))) then
        tmp = ((x + (-1.0d0)) * log(y)) - t
    else
        tmp = (y * (-(-1.0d0) - z)) - (log(y) + t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (((x + -1.0) <= -1.4) || !((x + -1.0) <= -1.0)) {
		tmp = ((x + -1.0) * Math.log(y)) - t;
	} else {
		tmp = (y * (-(-1.0) - z)) - (Math.log(y) + t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if ((x + -1.0) <= -1.4) or not ((x + -1.0) <= -1.0):
		tmp = ((x + -1.0) * math.log(y)) - t
	else:
		tmp = (y * (-(-1.0) - z)) - (math.log(y) + t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((Float64(x + -1.0) <= -1.4) || !(Float64(x + -1.0) <= -1.0))
		tmp = Float64(Float64(Float64(x + -1.0) * log(y)) - t);
	else
		tmp = Float64(Float64(y * Float64(Float64(-(-1.0)) - z)) - Float64(log(y) + t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (((x + -1.0) <= -1.4) || ~(((x + -1.0) <= -1.0)))
		tmp = ((x + -1.0) * log(y)) - t;
	else
		tmp = (y * (-(-1.0) - z)) - (log(y) + t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x + -1.0), $MachinePrecision], -1.4], N[Not[LessEqual[N[(x + -1.0), $MachinePrecision], -1.0]], $MachinePrecision]], N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(y * N[((--1.0) - z), $MachinePrecision]), $MachinePrecision] - N[(N[Log[y], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x + -1 \leq -1.4 \lor \neg \left(x + -1 \leq -1\right):\\
\;\;\;\;\left(x + -1\right) \cdot \log y - t\\

\mathbf{else}:\\
\;\;\;\;y \cdot \left(\left(--1\right) - z\right) - \left(\log y + t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 x 1) < -1.3999999999999999 or -1 < (-.f64 x 1)

    1. Initial program 91.5%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Taylor expanded in y around 0 90.6%

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

    if -1.3999999999999999 < (-.f64 x 1) < -1

    1. Initial program 86.2%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Step-by-step derivation
      1. +-commutative86.2%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z - 1, \log \left(1 - y\right), \left(x - 1\right) \cdot \log y - t\right)} \]
      4. sub-neg86.2%

        \[\leadsto \mathsf{fma}\left(z - 1, \log \color{blue}{\left(1 + \left(-y\right)\right)}, \left(x - 1\right) \cdot \log y - t\right) \]
      5. log1p-def100.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \left(x - 1\right) \cdot \log y - t\right)} \]
    4. Taylor expanded in x around 0 100.0%

      \[\leadsto \mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \color{blue}{-1 \cdot \log y} - t\right) \]
    5. Step-by-step derivation
      1. mul-1-neg100.0%

        \[\leadsto \mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \color{blue}{\left(-\log y\right)} - t\right) \]
    6. Simplified100.0%

      \[\leadsto \mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \color{blue}{\left(-\log y\right)} - t\right) \]
    7. Taylor expanded in y around 0 98.4%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(z - 1\right) \cdot y\right) + -1 \cdot \left(t + \log y\right)} \]
    8. Step-by-step derivation
      1. distribute-lft-out98.4%

        \[\leadsto \color{blue}{-1 \cdot \left(\left(z - 1\right) \cdot y + \left(t + \log y\right)\right)} \]
      2. sub-neg98.4%

        \[\leadsto -1 \cdot \left(\color{blue}{\left(z + \left(-1\right)\right)} \cdot y + \left(t + \log y\right)\right) \]
      3. metadata-eval98.4%

        \[\leadsto -1 \cdot \left(\left(z + \color{blue}{-1}\right) \cdot y + \left(t + \log y\right)\right) \]
      4. *-commutative98.4%

        \[\leadsto -1 \cdot \left(\color{blue}{y \cdot \left(z + -1\right)} + \left(t + \log y\right)\right) \]
      5. +-commutative98.4%

        \[\leadsto -1 \cdot \left(y \cdot \color{blue}{\left(-1 + z\right)} + \left(t + \log y\right)\right) \]
      6. +-commutative98.4%

        \[\leadsto -1 \cdot \left(y \cdot \left(-1 + z\right) + \color{blue}{\left(\log y + t\right)}\right) \]
    9. Simplified98.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + -1 \leq -1.4 \lor \neg \left(x + -1 \leq -1\right):\\ \;\;\;\;\left(x + -1\right) \cdot \log y - t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(--1\right) - z\right) - \left(\log y + t\right)\\ \end{array} \]

Alternative 6: 99.2% accurate, 1.9× speedup?

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

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

    \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
  2. Step-by-step derivation
    1. associate--l+88.7%

      \[\leadsto \color{blue}{\left(x - 1\right) \cdot \log y + \left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)} \]
    2. +-commutative88.7%

      \[\leadsto \color{blue}{\left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) + \left(x - 1\right) \cdot \log y} \]
    3. associate-+l-88.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right)} \]
    4. *-commutative88.7%

      \[\leadsto \color{blue}{\log \left(1 - y\right) \cdot \left(z - 1\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    5. *-commutative88.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    6. sub-neg88.7%

      \[\leadsto \color{blue}{\left(z + \left(-1\right)\right)} \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    7. metadata-eval88.7%

      \[\leadsto \left(z + \color{blue}{-1}\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    8. sub-neg88.7%

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

      \[\leadsto \left(z + -1\right) \cdot \color{blue}{\mathsf{log1p}\left(-y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    10. sub-neg99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(t + \left(-\left(x - 1\right) \cdot \log y\right)\right)} \]
    11. +-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
    12. *-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
    13. distribute-rgt-neg-in99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\color{blue}{\log y \cdot \left(-\left(x - 1\right)\right)} + t\right) \]
    14. fma-def99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\mathsf{fma}\left(\log y, -\left(x - 1\right), t\right)} \]
    15. neg-sub099.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
    16. associate--r-99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(0 - x\right) + 1}, t\right) \]
    17. neg-sub099.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(-x\right)} + 1, t\right) \]
    18. +-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 + \left(-x\right)}, t\right) \]
    19. unsub-neg99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 - x}, t\right) \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)} \]
  4. Taylor expanded in y around 0 98.7%

    \[\leadsto \color{blue}{-1 \cdot \left(t + \log y \cdot \left(1 - x\right)\right) + -1 \cdot \left(\left(z - 1\right) \cdot y\right)} \]
  5. Simplified98.7%

    \[\leadsto \color{blue}{\left(\log y \cdot \left(x + -1\right) - y \cdot \left(-1 + z\right)\right) - t} \]
  6. Final simplification98.7%

    \[\leadsto \left(\left(x + -1\right) \cdot \log y - y \cdot \left(z + -1\right)\right) - t \]

Alternative 7: 89.4% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z + -1 \leq -1 \cdot 10^{+186}:\\
\;\;\;\;\mathsf{log1p}\left(-y\right) \cdot \left(z + -1\right) - t\\

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


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

    1. Initial program 42.9%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Step-by-step derivation
      1. associate--l+42.9%

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

        \[\leadsto \color{blue}{\left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) + \left(x - 1\right) \cdot \log y} \]
      3. associate-+l-42.9%

        \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right)} \]
      4. *-commutative42.9%

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

        \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      6. sub-neg42.9%

        \[\leadsto \color{blue}{\left(z + \left(-1\right)\right)} \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      7. metadata-eval42.9%

        \[\leadsto \left(z + \color{blue}{-1}\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      8. sub-neg42.9%

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

        \[\leadsto \left(z + -1\right) \cdot \color{blue}{\mathsf{log1p}\left(-y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      10. sub-neg99.7%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(t + \left(-\left(x - 1\right) \cdot \log y\right)\right)} \]
      11. +-commutative99.7%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
      12. *-commutative99.7%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
      13. distribute-rgt-neg-in99.7%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\color{blue}{\log y \cdot \left(-\left(x - 1\right)\right)} + t\right) \]
      14. fma-def99.7%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\mathsf{fma}\left(\log y, -\left(x - 1\right), t\right)} \]
      15. neg-sub099.7%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
      16. associate--r-99.7%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(0 - x\right) + 1}, t\right) \]
      17. neg-sub099.7%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(-x\right)} + 1, t\right) \]
      18. +-commutative99.7%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 + \left(-x\right)}, t\right) \]
      19. unsub-neg99.7%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 - x}, t\right) \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{\left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)} \]
    4. Taylor expanded in t around inf 75.8%

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

    if -9.9999999999999998e185 < (-.f64 z 1)

    1. Initial program 93.6%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Taylor expanded in y around 0 92.3%

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

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

Alternative 8: 89.3% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 42.9%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Step-by-step derivation
      1. associate--l+42.9%

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

        \[\leadsto \color{blue}{\left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) + \left(x - 1\right) \cdot \log y} \]
      3. associate-+l-42.9%

        \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right)} \]
      4. *-commutative42.9%

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

        \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      6. sub-neg42.9%

        \[\leadsto \color{blue}{\left(z + \left(-1\right)\right)} \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      7. metadata-eval42.9%

        \[\leadsto \left(z + \color{blue}{-1}\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      8. sub-neg42.9%

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

        \[\leadsto \left(z + -1\right) \cdot \color{blue}{\mathsf{log1p}\left(-y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      10. sub-neg99.7%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(t + \left(-\left(x - 1\right) \cdot \log y\right)\right)} \]
      11. +-commutative99.7%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
      12. *-commutative99.7%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
      13. distribute-rgt-neg-in99.7%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\color{blue}{\log y \cdot \left(-\left(x - 1\right)\right)} + t\right) \]
      14. fma-def99.7%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\mathsf{fma}\left(\log y, -\left(x - 1\right), t\right)} \]
      15. neg-sub099.7%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
      16. associate--r-99.7%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(0 - x\right) + 1}, t\right) \]
      17. neg-sub099.7%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(-x\right)} + 1, t\right) \]
      18. +-commutative99.7%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 + \left(-x\right)}, t\right) \]
      19. unsub-neg99.7%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 - x}, t\right) \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{\left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)} \]
    4. Taylor expanded in y around 0 99.7%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\log y \cdot \left(1 - x\right) + t\right)} \]
    5. Taylor expanded in y around 0 98.3%

      \[\leadsto \color{blue}{\left(-0.5 \cdot \left(\left(z - 1\right) \cdot {y}^{2}\right) + -1 \cdot \left(\left(z - 1\right) \cdot y\right)\right)} - \left(\log y \cdot \left(1 - x\right) + t\right) \]
    6. Step-by-step derivation
      1. mul-1-neg98.3%

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

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

        \[\leadsto \left(\color{blue}{\left(\left(z - 1\right) \cdot {y}^{2}\right) \cdot -0.5} - \left(z - 1\right) \cdot y\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
      4. *-commutative98.3%

        \[\leadsto \left(\color{blue}{\left({y}^{2} \cdot \left(z - 1\right)\right)} \cdot -0.5 - \left(z - 1\right) \cdot y\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
      5. associate-*l*98.3%

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

        \[\leadsto \left(\color{blue}{\left(y \cdot y\right)} \cdot \left(\left(z - 1\right) \cdot -0.5\right) - \left(z - 1\right) \cdot y\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
      7. sub-neg98.3%

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

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

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

        \[\leadsto \left(\left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot -0.5\right) - \color{blue}{y \cdot \left(z - 1\right)}\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
      11. sub-neg98.3%

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

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

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

      \[\leadsto \color{blue}{\left(\left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot -0.5\right) - y \cdot \left(-1 + z\right)\right)} - \left(\log y \cdot \left(1 - x\right) + t\right) \]
    8. Taylor expanded in z around inf 98.3%

      \[\leadsto \left(\color{blue}{-0.5 \cdot \left({y}^{2} \cdot z\right)} - y \cdot \left(-1 + z\right)\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
    9. Step-by-step derivation
      1. *-commutative98.3%

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

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

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

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

    if -9.9999999999999998e185 < (-.f64 z 1)

    1. Initial program 93.6%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Taylor expanded in y around 0 92.3%

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

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

Alternative 9: 72.4% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;x \leq -1.75 \cdot 10^{+26}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-120}:\\ \;\;\;\;\left(-\log y\right) - t\\ \mathbf{elif}\;x \leq 1.14 \cdot 10^{+173}:\\ \;\;\;\;\left(\left(y \cdot y\right) \cdot \left(0.5 + z \cdot -0.5\right) - y \cdot \left(z + -1\right)\right) - t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (log y))))
   (if (<= x -1.75e+26)
     t_1
     (if (<= x 3.5e-120)
       (- (- (log y)) t)
       (if (<= x 1.14e+173)
         (- (- (* (* y y) (+ 0.5 (* z -0.5))) (* y (+ z -1.0))) t)
         t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = x * log(y);
	double tmp;
	if (x <= -1.75e+26) {
		tmp = t_1;
	} else if (x <= 3.5e-120) {
		tmp = -log(y) - t;
	} else if (x <= 1.14e+173) {
		tmp = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t;
	} else {
		tmp = t_1;
	}
	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 = x * log(y)
    if (x <= (-1.75d+26)) then
        tmp = t_1
    else if (x <= 3.5d-120) then
        tmp = -log(y) - t
    else if (x <= 1.14d+173) then
        tmp = (((y * y) * (0.5d0 + (z * (-0.5d0)))) - (y * (z + (-1.0d0)))) - t
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * Math.log(y);
	double tmp;
	if (x <= -1.75e+26) {
		tmp = t_1;
	} else if (x <= 3.5e-120) {
		tmp = -Math.log(y) - t;
	} else if (x <= 1.14e+173) {
		tmp = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * math.log(y)
	tmp = 0
	if x <= -1.75e+26:
		tmp = t_1
	elif x <= 3.5e-120:
		tmp = -math.log(y) - t
	elif x <= 1.14e+173:
		tmp = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * log(y))
	tmp = 0.0
	if (x <= -1.75e+26)
		tmp = t_1;
	elseif (x <= 3.5e-120)
		tmp = Float64(Float64(-log(y)) - t);
	elseif (x <= 1.14e+173)
		tmp = Float64(Float64(Float64(Float64(y * y) * Float64(0.5 + Float64(z * -0.5))) - Float64(y * Float64(z + -1.0))) - t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * log(y);
	tmp = 0.0;
	if (x <= -1.75e+26)
		tmp = t_1;
	elseif (x <= 3.5e-120)
		tmp = -log(y) - t;
	elseif (x <= 1.14e+173)
		tmp = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.75e+26], t$95$1, If[LessEqual[x, 3.5e-120], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], If[LessEqual[x, 1.14e+173], N[(N[(N[(N[(y * y), $MachinePrecision] * N[(0.5 + N[(z * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -1.75 \cdot 10^{+26}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 3.5 \cdot 10^{-120}:\\
\;\;\;\;\left(-\log y\right) - t\\

\mathbf{elif}\;x \leq 1.14 \cdot 10^{+173}:\\
\;\;\;\;\left(\left(y \cdot y\right) \cdot \left(0.5 + z \cdot -0.5\right) - y \cdot \left(z + -1\right)\right) - t\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.75e26 or 1.14e173 < x

    1. Initial program 91.6%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Step-by-step derivation
      1. associate--l+91.6%

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

        \[\leadsto \color{blue}{\left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) + \left(x - 1\right) \cdot \log y} \]
      3. associate-+l-91.6%

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

        \[\leadsto \color{blue}{\log \left(1 - y\right) \cdot \left(z - 1\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      5. *-commutative91.6%

        \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      6. sub-neg91.6%

        \[\leadsto \color{blue}{\left(z + \left(-1\right)\right)} \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      7. metadata-eval91.6%

        \[\leadsto \left(z + \color{blue}{-1}\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      8. sub-neg91.6%

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

        \[\leadsto \left(z + -1\right) \cdot \color{blue}{\mathsf{log1p}\left(-y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      10. sub-neg99.6%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(t + \left(-\left(x - 1\right) \cdot \log y\right)\right)} \]
      11. +-commutative99.6%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
      12. *-commutative99.6%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
      13. distribute-rgt-neg-in99.6%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\color{blue}{\log y \cdot \left(-\left(x - 1\right)\right)} + t\right) \]
      14. fma-def99.6%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\mathsf{fma}\left(\log y, -\left(x - 1\right), t\right)} \]
      15. neg-sub099.6%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
      16. associate--r-99.6%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(0 - x\right) + 1}, t\right) \]
      17. neg-sub099.6%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(-x\right)} + 1, t\right) \]
      18. +-commutative99.6%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 + \left(-x\right)}, t\right) \]
      19. unsub-neg99.6%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 - x}, t\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)} \]
    4. Taylor expanded in x around inf 79.0%

      \[\leadsto \color{blue}{\log y \cdot x} \]

    if -1.75e26 < x < 3.5e-120

    1. Initial program 87.6%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Step-by-step derivation
      1. +-commutative87.6%

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

        \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) + \left(\left(x - 1\right) \cdot \log y - t\right)} \]
      3. fma-def87.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(z - 1, \log \left(1 - y\right), \left(x - 1\right) \cdot \log y - t\right)} \]
      4. sub-neg87.6%

        \[\leadsto \mathsf{fma}\left(z - 1, \log \color{blue}{\left(1 + \left(-y\right)\right)}, \left(x - 1\right) \cdot \log y - t\right) \]
      5. log1p-def99.9%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \left(x - 1\right) \cdot \log y - t\right)} \]
    4. Taylor expanded in x around 0 98.5%

      \[\leadsto \mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \color{blue}{-1 \cdot \log y} - t\right) \]
    5. Step-by-step derivation
      1. mul-1-neg98.5%

        \[\leadsto \mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \color{blue}{\left(-\log y\right)} - t\right) \]
    6. Simplified98.5%

      \[\leadsto \mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \color{blue}{\left(-\log y\right)} - t\right) \]
    7. Taylor expanded in y around 0 84.1%

      \[\leadsto \color{blue}{-1 \cdot \left(t + \log y\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg84.1%

        \[\leadsto \color{blue}{-\left(t + \log y\right)} \]
      2. +-commutative84.1%

        \[\leadsto -\color{blue}{\left(\log y + t\right)} \]
      3. distribute-neg-in84.1%

        \[\leadsto \color{blue}{\left(-\log y\right) + \left(-t\right)} \]
      4. log-rec84.1%

        \[\leadsto \color{blue}{\log \left(\frac{1}{y}\right)} + \left(-t\right) \]
      5. unsub-neg84.1%

        \[\leadsto \color{blue}{\log \left(\frac{1}{y}\right) - t} \]
      6. log-rec84.1%

        \[\leadsto \color{blue}{\left(-\log y\right)} - t \]
    9. Simplified84.1%

      \[\leadsto \color{blue}{\left(-\log y\right) - t} \]

    if 3.5e-120 < x < 1.14e173

    1. Initial program 85.5%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Step-by-step derivation
      1. associate--l+85.5%

        \[\leadsto \color{blue}{\left(x - 1\right) \cdot \log y + \left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)} \]
      2. +-commutative85.5%

        \[\leadsto \color{blue}{\left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) + \left(x - 1\right) \cdot \log y} \]
      3. associate-+l-85.5%

        \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right)} \]
      4. *-commutative85.5%

        \[\leadsto \color{blue}{\log \left(1 - y\right) \cdot \left(z - 1\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      5. *-commutative85.5%

        \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      6. sub-neg85.5%

        \[\leadsto \color{blue}{\left(z + \left(-1\right)\right)} \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      7. metadata-eval85.5%

        \[\leadsto \left(z + \color{blue}{-1}\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      8. sub-neg85.5%

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

        \[\leadsto \left(z + -1\right) \cdot \color{blue}{\mathsf{log1p}\left(-y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      10. sub-neg99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(t + \left(-\left(x - 1\right) \cdot \log y\right)\right)} \]
      11. +-commutative99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
      12. *-commutative99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
      13. distribute-rgt-neg-in99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\color{blue}{\log y \cdot \left(-\left(x - 1\right)\right)} + t\right) \]
      14. fma-def99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\mathsf{fma}\left(\log y, -\left(x - 1\right), t\right)} \]
      15. neg-sub099.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
      16. associate--r-99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(0 - x\right) + 1}, t\right) \]
      17. neg-sub099.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(-x\right)} + 1, t\right) \]
      18. +-commutative99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 + \left(-x\right)}, t\right) \]
      19. unsub-neg99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 - x}, t\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)} \]
    4. Taylor expanded in t around inf 73.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{t} \]
    5. Taylor expanded in y around 0 73.8%

      \[\leadsto \color{blue}{-1 \cdot t + \left(-1 \cdot \left(\left(z - 1\right) \cdot y\right) + -0.5 \cdot \left(\left(z - 1\right) \cdot {y}^{2}\right)\right)} \]
    6. Step-by-step derivation
      1. neg-mul-173.8%

        \[\leadsto \color{blue}{\left(-t\right)} + \left(-1 \cdot \left(\left(z - 1\right) \cdot y\right) + -0.5 \cdot \left(\left(z - 1\right) \cdot {y}^{2}\right)\right) \]
      2. +-commutative73.8%

        \[\leadsto \color{blue}{\left(-1 \cdot \left(\left(z - 1\right) \cdot y\right) + -0.5 \cdot \left(\left(z - 1\right) \cdot {y}^{2}\right)\right) + \left(-t\right)} \]
      3. unsub-neg73.8%

        \[\leadsto \color{blue}{\left(-1 \cdot \left(\left(z - 1\right) \cdot y\right) + -0.5 \cdot \left(\left(z - 1\right) \cdot {y}^{2}\right)\right) - t} \]
    7. Simplified73.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.75 \cdot 10^{+26}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-120}:\\ \;\;\;\;\left(-\log y\right) - t\\ \mathbf{elif}\;x \leq 1.14 \cdot 10^{+173}:\\ \;\;\;\;\left(\left(y \cdot y\right) \cdot \left(0.5 + z \cdot -0.5\right) - y \cdot \left(z + -1\right)\right) - t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y\\ \end{array} \]

Alternative 10: 64.7% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{+45} \lor \neg \left(x \leq 6.3 \cdot 10^{+171}\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;\left(\left(y \cdot y\right) \cdot \left(0.5 + z \cdot -0.5\right) - y \cdot \left(z + -1\right)\right) - t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= x -4.2e+45) (not (<= x 6.3e+171)))
   (* x (log y))
   (- (- (* (* y y) (+ 0.5 (* z -0.5))) (* y (+ z -1.0))) t)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -4.2e+45) || !(x <= 6.3e+171)) {
		tmp = x * log(y);
	} else {
		tmp = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - 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 ((x <= (-4.2d+45)) .or. (.not. (x <= 6.3d+171))) then
        tmp = x * log(y)
    else
        tmp = (((y * y) * (0.5d0 + (z * (-0.5d0)))) - (y * (z + (-1.0d0)))) - t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -4.2e+45) || !(x <= 6.3e+171)) {
		tmp = x * Math.log(y);
	} else {
		tmp = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -4.2e+45) or not (x <= 6.3e+171):
		tmp = x * math.log(y)
	else:
		tmp = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((x <= -4.2e+45) || !(x <= 6.3e+171))
		tmp = Float64(x * log(y));
	else
		tmp = Float64(Float64(Float64(Float64(y * y) * Float64(0.5 + Float64(z * -0.5))) - Float64(y * Float64(z + -1.0))) - t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x <= -4.2e+45) || ~((x <= 6.3e+171)))
		tmp = x * log(y);
	else
		tmp = (((y * y) * (0.5 + (z * -0.5))) - (y * (z + -1.0))) - t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.2e+45], N[Not[LessEqual[x, 6.3e+171]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y * y), $MachinePrecision] * N[(0.5 + N[(z * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{+45} \lor \neg \left(x \leq 6.3 \cdot 10^{+171}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.1999999999999999e45 or 6.3000000000000004e171 < x

    1. Initial program 92.5%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Step-by-step derivation
      1. associate--l+92.5%

        \[\leadsto \color{blue}{\left(x - 1\right) \cdot \log y + \left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)} \]
      2. +-commutative92.5%

        \[\leadsto \color{blue}{\left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) + \left(x - 1\right) \cdot \log y} \]
      3. associate-+l-92.5%

        \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right)} \]
      4. *-commutative92.5%

        \[\leadsto \color{blue}{\log \left(1 - y\right) \cdot \left(z - 1\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      5. *-commutative92.5%

        \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      6. sub-neg92.5%

        \[\leadsto \color{blue}{\left(z + \left(-1\right)\right)} \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      7. metadata-eval92.5%

        \[\leadsto \left(z + \color{blue}{-1}\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      8. sub-neg92.5%

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

        \[\leadsto \left(z + -1\right) \cdot \color{blue}{\mathsf{log1p}\left(-y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      10. sub-neg99.6%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(t + \left(-\left(x - 1\right) \cdot \log y\right)\right)} \]
      11. +-commutative99.6%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
      12. *-commutative99.6%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
      13. distribute-rgt-neg-in99.6%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\color{blue}{\log y \cdot \left(-\left(x - 1\right)\right)} + t\right) \]
      14. fma-def99.6%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\mathsf{fma}\left(\log y, -\left(x - 1\right), t\right)} \]
      15. neg-sub099.6%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
      16. associate--r-99.6%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(0 - x\right) + 1}, t\right) \]
      17. neg-sub099.6%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(-x\right)} + 1, t\right) \]
      18. +-commutative99.6%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 + \left(-x\right)}, t\right) \]
      19. unsub-neg99.6%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 - x}, t\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)} \]
    4. Taylor expanded in x around inf 79.6%

      \[\leadsto \color{blue}{\log y \cdot x} \]

    if -4.1999999999999999e45 < x < 6.3000000000000004e171

    1. Initial program 86.6%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Step-by-step derivation
      1. associate--l+86.6%

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

        \[\leadsto \color{blue}{\left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) + \left(x - 1\right) \cdot \log y} \]
      3. associate-+l-86.6%

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

        \[\leadsto \color{blue}{\log \left(1 - y\right) \cdot \left(z - 1\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      5. *-commutative86.6%

        \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      6. sub-neg86.6%

        \[\leadsto \color{blue}{\left(z + \left(-1\right)\right)} \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      7. metadata-eval86.6%

        \[\leadsto \left(z + \color{blue}{-1}\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      8. sub-neg86.6%

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

        \[\leadsto \left(z + -1\right) \cdot \color{blue}{\mathsf{log1p}\left(-y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      10. sub-neg99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(t + \left(-\left(x - 1\right) \cdot \log y\right)\right)} \]
      11. +-commutative99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
      12. *-commutative99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
      13. distribute-rgt-neg-in99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\color{blue}{\log y \cdot \left(-\left(x - 1\right)\right)} + t\right) \]
      14. fma-def99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\mathsf{fma}\left(\log y, -\left(x - 1\right), t\right)} \]
      15. neg-sub099.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
      16. associate--r-99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(0 - x\right) + 1}, t\right) \]
      17. neg-sub099.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(-x\right)} + 1, t\right) \]
      18. +-commutative99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 + \left(-x\right)}, t\right) \]
      19. unsub-neg99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 - x}, t\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)} \]
    4. Taylor expanded in t around inf 65.2%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{t} \]
    5. Taylor expanded in y around 0 65.1%

      \[\leadsto \color{blue}{-1 \cdot t + \left(-1 \cdot \left(\left(z - 1\right) \cdot y\right) + -0.5 \cdot \left(\left(z - 1\right) \cdot {y}^{2}\right)\right)} \]
    6. Step-by-step derivation
      1. neg-mul-165.1%

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

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

        \[\leadsto \color{blue}{\left(-1 \cdot \left(\left(z - 1\right) \cdot y\right) + -0.5 \cdot \left(\left(z - 1\right) \cdot {y}^{2}\right)\right) - t} \]
    7. Simplified65.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{+45} \lor \neg \left(x \leq 6.3 \cdot 10^{+171}\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;\left(\left(y \cdot y\right) \cdot \left(0.5 + z \cdot -0.5\right) - y \cdot \left(z + -1\right)\right) - t\\ \end{array} \]

Alternative 11: 54.2% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{-35} \lor \neg \left(t \leq 6.5 \cdot 10^{-64}\right):\\ \;\;\;\;\left(-0.5 \cdot \left(z \cdot \left(y \cdot y\right)\right) - y \cdot \left(z + -1\right)\right) - t\\ \mathbf{else}:\\ \;\;\;\;-\log y\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= t -4.3e-35) (not (<= t 6.5e-64)))
   (- (- (* -0.5 (* z (* y y))) (* y (+ z -1.0))) t)
   (- (log y))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -4.3e-35) || !(t <= 6.5e-64)) {
		tmp = ((-0.5 * (z * (y * y))) - (y * (z + -1.0))) - t;
	} else {
		tmp = -log(y);
	}
	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 ((t <= (-4.3d-35)) .or. (.not. (t <= 6.5d-64))) then
        tmp = (((-0.5d0) * (z * (y * y))) - (y * (z + (-1.0d0)))) - t
    else
        tmp = -log(y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -4.3e-35) || !(t <= 6.5e-64)) {
		tmp = ((-0.5 * (z * (y * y))) - (y * (z + -1.0))) - t;
	} else {
		tmp = -Math.log(y);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (t <= -4.3e-35) or not (t <= 6.5e-64):
		tmp = ((-0.5 * (z * (y * y))) - (y * (z + -1.0))) - t
	else:
		tmp = -math.log(y)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((t <= -4.3e-35) || !(t <= 6.5e-64))
		tmp = Float64(Float64(Float64(-0.5 * Float64(z * Float64(y * y))) - Float64(y * Float64(z + -1.0))) - t);
	else
		tmp = Float64(-log(y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((t <= -4.3e-35) || ~((t <= 6.5e-64)))
		tmp = ((-0.5 * (z * (y * y))) - (y * (z + -1.0))) - t;
	else
		tmp = -log(y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.3e-35], N[Not[LessEqual[t, 6.5e-64]], $MachinePrecision]], N[(N[(N[(-0.5 * N[(z * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], (-N[Log[y], $MachinePrecision])]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.3 \cdot 10^{-35} \lor \neg \left(t \leq 6.5 \cdot 10^{-64}\right):\\
\;\;\;\;\left(-0.5 \cdot \left(z \cdot \left(y \cdot y\right)\right) - y \cdot \left(z + -1\right)\right) - t\\

\mathbf{else}:\\
\;\;\;\;-\log y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.3000000000000002e-35 or 6.5000000000000004e-64 < t

    1. Initial program 89.9%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Step-by-step derivation
      1. associate--l+89.9%

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

        \[\leadsto \color{blue}{\left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) + \left(x - 1\right) \cdot \log y} \]
      3. associate-+l-89.9%

        \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right)} \]
      4. *-commutative89.9%

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

        \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      6. sub-neg89.9%

        \[\leadsto \color{blue}{\left(z + \left(-1\right)\right)} \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      7. metadata-eval89.9%

        \[\leadsto \left(z + \color{blue}{-1}\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      8. sub-neg89.9%

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

        \[\leadsto \left(z + -1\right) \cdot \color{blue}{\mathsf{log1p}\left(-y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      10. sub-neg99.8%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(t + \left(-\left(x - 1\right) \cdot \log y\right)\right)} \]
      11. +-commutative99.8%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
      12. *-commutative99.8%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
      13. distribute-rgt-neg-in99.8%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\color{blue}{\log y \cdot \left(-\left(x - 1\right)\right)} + t\right) \]
      14. fma-def99.8%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\mathsf{fma}\left(\log y, -\left(x - 1\right), t\right)} \]
      15. neg-sub099.8%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
      16. associate--r-99.8%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(0 - x\right) + 1}, t\right) \]
      17. neg-sub099.8%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(-x\right)} + 1, t\right) \]
      18. +-commutative99.8%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 + \left(-x\right)}, t\right) \]
      19. unsub-neg99.8%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 - x}, t\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)} \]
    4. Taylor expanded in y around 0 99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\log y \cdot \left(1 - x\right) + t\right)} \]
    5. Taylor expanded in y around 0 99.5%

      \[\leadsto \color{blue}{\left(-0.5 \cdot \left(\left(z - 1\right) \cdot {y}^{2}\right) + -1 \cdot \left(\left(z - 1\right) \cdot y\right)\right)} - \left(\log y \cdot \left(1 - x\right) + t\right) \]
    6. Step-by-step derivation
      1. mul-1-neg99.5%

        \[\leadsto \left(-0.5 \cdot \left(\left(z - 1\right) \cdot {y}^{2}\right) + \color{blue}{\left(-\left(z - 1\right) \cdot y\right)}\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
      2. unsub-neg99.5%

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

        \[\leadsto \left(\color{blue}{\left(\left(z - 1\right) \cdot {y}^{2}\right) \cdot -0.5} - \left(z - 1\right) \cdot y\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
      4. *-commutative99.5%

        \[\leadsto \left(\color{blue}{\left({y}^{2} \cdot \left(z - 1\right)\right)} \cdot -0.5 - \left(z - 1\right) \cdot y\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
      5. associate-*l*99.5%

        \[\leadsto \left(\color{blue}{{y}^{2} \cdot \left(\left(z - 1\right) \cdot -0.5\right)} - \left(z - 1\right) \cdot y\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
      6. unpow299.5%

        \[\leadsto \left(\color{blue}{\left(y \cdot y\right)} \cdot \left(\left(z - 1\right) \cdot -0.5\right) - \left(z - 1\right) \cdot y\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
      7. sub-neg99.5%

        \[\leadsto \left(\left(y \cdot y\right) \cdot \left(\color{blue}{\left(z + \left(-1\right)\right)} \cdot -0.5\right) - \left(z - 1\right) \cdot y\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
      8. metadata-eval99.5%

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

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

        \[\leadsto \left(\left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot -0.5\right) - \color{blue}{y \cdot \left(z - 1\right)}\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
      11. sub-neg99.5%

        \[\leadsto \left(\left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot -0.5\right) - y \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
      12. metadata-eval99.5%

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

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

      \[\leadsto \color{blue}{\left(\left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot -0.5\right) - y \cdot \left(-1 + z\right)\right)} - \left(\log y \cdot \left(1 - x\right) + t\right) \]
    8. Taylor expanded in z around inf 99.5%

      \[\leadsto \left(\color{blue}{-0.5 \cdot \left({y}^{2} \cdot z\right)} - y \cdot \left(-1 + z\right)\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
    9. Step-by-step derivation
      1. *-commutative99.5%

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

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

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

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

    if -4.3000000000000002e-35 < t < 6.5000000000000004e-64

    1. Initial program 86.9%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Step-by-step derivation
      1. +-commutative86.9%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z - 1, \log \left(1 - y\right), \left(x - 1\right) \cdot \log y - t\right)} \]
      4. sub-neg86.9%

        \[\leadsto \mathsf{fma}\left(z - 1, \log \color{blue}{\left(1 + \left(-y\right)\right)}, \left(x - 1\right) \cdot \log y - t\right) \]
      5. log1p-def99.8%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \left(x - 1\right) \cdot \log y - t\right)} \]
    4. Taylor expanded in x around 0 56.1%

      \[\leadsto \mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \color{blue}{-1 \cdot \log y} - t\right) \]
    5. Step-by-step derivation
      1. mul-1-neg56.1%

        \[\leadsto \mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \color{blue}{\left(-\log y\right)} - t\right) \]
    6. Simplified56.1%

      \[\leadsto \mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \color{blue}{\left(-\log y\right)} - t\right) \]
    7. Taylor expanded in t around 0 43.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) - \log y} \]
    8. Step-by-step derivation
      1. sub-neg43.7%

        \[\leadsto \color{blue}{\left(z + \left(-1\right)\right)} \cdot \log \left(1 - y\right) - \log y \]
      2. metadata-eval43.7%

        \[\leadsto \left(z + \color{blue}{-1}\right) \cdot \log \left(1 - y\right) - \log y \]
      3. *-commutative43.7%

        \[\leadsto \color{blue}{\log \left(1 - y\right) \cdot \left(z + -1\right)} - \log y \]
      4. sub-neg43.7%

        \[\leadsto \log \color{blue}{\left(1 + \left(-y\right)\right)} \cdot \left(z + -1\right) - \log y \]
      5. log1p-def56.1%

        \[\leadsto \color{blue}{\mathsf{log1p}\left(-y\right)} \cdot \left(z + -1\right) - \log y \]
      6. +-commutative56.1%

        \[\leadsto \mathsf{log1p}\left(-y\right) \cdot \color{blue}{\left(-1 + z\right)} - \log y \]
    9. Simplified56.1%

      \[\leadsto \color{blue}{\mathsf{log1p}\left(-y\right) \cdot \left(-1 + z\right) - \log y} \]
    10. Taylor expanded in y around 0 41.9%

      \[\leadsto \color{blue}{-1 \cdot \log y} \]
    11. Step-by-step derivation
      1. neg-mul-141.9%

        \[\leadsto \color{blue}{-\log y} \]
    12. Simplified41.9%

      \[\leadsto \color{blue}{-\log y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{-35} \lor \neg \left(t \leq 6.5 \cdot 10^{-64}\right):\\ \;\;\;\;\left(-0.5 \cdot \left(z \cdot \left(y \cdot y\right)\right) - y \cdot \left(z + -1\right)\right) - t\\ \mathbf{else}:\\ \;\;\;\;-\log y\\ \end{array} \]

Alternative 12: 45.9% accurate, 12.6× speedup?

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

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

    \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
  2. Step-by-step derivation
    1. associate--l+88.7%

      \[\leadsto \color{blue}{\left(x - 1\right) \cdot \log y + \left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)} \]
    2. +-commutative88.7%

      \[\leadsto \color{blue}{\left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) + \left(x - 1\right) \cdot \log y} \]
    3. associate-+l-88.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right)} \]
    4. *-commutative88.7%

      \[\leadsto \color{blue}{\log \left(1 - y\right) \cdot \left(z - 1\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    5. *-commutative88.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    6. sub-neg88.7%

      \[\leadsto \color{blue}{\left(z + \left(-1\right)\right)} \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    7. metadata-eval88.7%

      \[\leadsto \left(z + \color{blue}{-1}\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    8. sub-neg88.7%

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

      \[\leadsto \left(z + -1\right) \cdot \color{blue}{\mathsf{log1p}\left(-y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    10. sub-neg99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(t + \left(-\left(x - 1\right) \cdot \log y\right)\right)} \]
    11. +-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
    12. *-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
    13. distribute-rgt-neg-in99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\color{blue}{\log y \cdot \left(-\left(x - 1\right)\right)} + t\right) \]
    14. fma-def99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\mathsf{fma}\left(\log y, -\left(x - 1\right), t\right)} \]
    15. neg-sub099.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
    16. associate--r-99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(0 - x\right) + 1}, t\right) \]
    17. neg-sub099.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(-x\right)} + 1, t\right) \]
    18. +-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 + \left(-x\right)}, t\right) \]
    19. unsub-neg99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 - x}, t\right) \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)} \]
  4. Taylor expanded in t around inf 48.7%

    \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{t} \]
  5. Taylor expanded in y around 0 48.7%

    \[\leadsto \color{blue}{-1 \cdot t + \left(-1 \cdot \left(\left(z - 1\right) \cdot y\right) + -0.5 \cdot \left(\left(z - 1\right) \cdot {y}^{2}\right)\right)} \]
  6. Step-by-step derivation
    1. neg-mul-148.7%

      \[\leadsto \color{blue}{\left(-t\right)} + \left(-1 \cdot \left(\left(z - 1\right) \cdot y\right) + -0.5 \cdot \left(\left(z - 1\right) \cdot {y}^{2}\right)\right) \]
    2. +-commutative48.7%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(\left(z - 1\right) \cdot y\right) + -0.5 \cdot \left(\left(z - 1\right) \cdot {y}^{2}\right)\right) + \left(-t\right)} \]
    3. unsub-neg48.7%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(\left(z - 1\right) \cdot y\right) + -0.5 \cdot \left(\left(z - 1\right) \cdot {y}^{2}\right)\right) - t} \]
  7. Simplified48.7%

    \[\leadsto \color{blue}{\left(\left(0.5 + z \cdot -0.5\right) \cdot \left(y \cdot y\right) - y \cdot \left(-1 + z\right)\right) - t} \]
  8. Final simplification48.7%

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

Alternative 13: 45.9% accurate, 14.3× speedup?

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

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

    \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
  2. Step-by-step derivation
    1. associate--l+88.7%

      \[\leadsto \color{blue}{\left(x - 1\right) \cdot \log y + \left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)} \]
    2. +-commutative88.7%

      \[\leadsto \color{blue}{\left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) + \left(x - 1\right) \cdot \log y} \]
    3. associate-+l-88.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right)} \]
    4. *-commutative88.7%

      \[\leadsto \color{blue}{\log \left(1 - y\right) \cdot \left(z - 1\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    5. *-commutative88.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    6. sub-neg88.7%

      \[\leadsto \color{blue}{\left(z + \left(-1\right)\right)} \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    7. metadata-eval88.7%

      \[\leadsto \left(z + \color{blue}{-1}\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    8. sub-neg88.7%

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

      \[\leadsto \left(z + -1\right) \cdot \color{blue}{\mathsf{log1p}\left(-y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    10. sub-neg99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(t + \left(-\left(x - 1\right) \cdot \log y\right)\right)} \]
    11. +-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
    12. *-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
    13. distribute-rgt-neg-in99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\color{blue}{\log y \cdot \left(-\left(x - 1\right)\right)} + t\right) \]
    14. fma-def99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\mathsf{fma}\left(\log y, -\left(x - 1\right), t\right)} \]
    15. neg-sub099.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
    16. associate--r-99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(0 - x\right) + 1}, t\right) \]
    17. neg-sub099.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(-x\right)} + 1, t\right) \]
    18. +-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 + \left(-x\right)}, t\right) \]
    19. unsub-neg99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 - x}, t\right) \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)} \]
  4. Taylor expanded in y around 0 99.8%

    \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\log y \cdot \left(1 - x\right) + t\right)} \]
  5. Taylor expanded in y around 0 99.3%

    \[\leadsto \color{blue}{\left(-0.5 \cdot \left(\left(z - 1\right) \cdot {y}^{2}\right) + -1 \cdot \left(\left(z - 1\right) \cdot y\right)\right)} - \left(\log y \cdot \left(1 - x\right) + t\right) \]
  6. Step-by-step derivation
    1. mul-1-neg99.3%

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

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

      \[\leadsto \left(\color{blue}{\left(\left(z - 1\right) \cdot {y}^{2}\right) \cdot -0.5} - \left(z - 1\right) \cdot y\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
    4. *-commutative99.3%

      \[\leadsto \left(\color{blue}{\left({y}^{2} \cdot \left(z - 1\right)\right)} \cdot -0.5 - \left(z - 1\right) \cdot y\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
    5. associate-*l*99.3%

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

      \[\leadsto \left(\color{blue}{\left(y \cdot y\right)} \cdot \left(\left(z - 1\right) \cdot -0.5\right) - \left(z - 1\right) \cdot y\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
    7. sub-neg99.3%

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

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

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

      \[\leadsto \left(\left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot -0.5\right) - \color{blue}{y \cdot \left(z - 1\right)}\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
    11. sub-neg99.3%

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

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

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

    \[\leadsto \color{blue}{\left(\left(y \cdot y\right) \cdot \left(\left(-1 + z\right) \cdot -0.5\right) - y \cdot \left(-1 + z\right)\right)} - \left(\log y \cdot \left(1 - x\right) + t\right) \]
  8. Taylor expanded in z around inf 99.3%

    \[\leadsto \left(\color{blue}{-0.5 \cdot \left({y}^{2} \cdot z\right)} - y \cdot \left(-1 + z\right)\right) - \left(\log y \cdot \left(1 - x\right) + t\right) \]
  9. Step-by-step derivation
    1. *-commutative99.3%

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

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

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

    \[\leadsto \left(-0.5 \cdot \left(z \cdot \left(y \cdot y\right)\right) - y \cdot \left(-1 + z\right)\right) - \color{blue}{t} \]
  12. Final simplification48.7%

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

Alternative 14: 42.4% accurate, 26.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -0.17:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 12000000000000:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -0.17) (- t) (if (<= t 12000000000000.0) (* z (- y)) (- t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -0.17) {
		tmp = -t;
	} else if (t <= 12000000000000.0) {
		tmp = z * -y;
	} else {
		tmp = -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 (t <= (-0.17d0)) then
        tmp = -t
    else if (t <= 12000000000000.0d0) then
        tmp = z * -y
    else
        tmp = -t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -0.17) {
		tmp = -t;
	} else if (t <= 12000000000000.0) {
		tmp = z * -y;
	} else {
		tmp = -t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -0.17:
		tmp = -t
	elif t <= 12000000000000.0:
		tmp = z * -y
	else:
		tmp = -t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -0.17)
		tmp = Float64(-t);
	elseif (t <= 12000000000000.0)
		tmp = Float64(z * Float64(-y));
	else
		tmp = Float64(-t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -0.17)
		tmp = -t;
	elseif (t <= 12000000000000.0)
		tmp = z * -y;
	else
		tmp = -t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -0.17], (-t), If[LessEqual[t, 12000000000000.0], N[(z * (-y)), $MachinePrecision], (-t)]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.17:\\
\;\;\;\;-t\\

\mathbf{elif}\;t \leq 12000000000000:\\
\;\;\;\;z \cdot \left(-y\right)\\

\mathbf{else}:\\
\;\;\;\;-t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.170000000000000012 or 1.2e13 < t

    1. Initial program 95.2%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Step-by-step derivation
      1. associate--l+95.2%

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

        \[\leadsto \color{blue}{\left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) + \left(x - 1\right) \cdot \log y} \]
      3. associate-+l-95.2%

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

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

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

        \[\leadsto \color{blue}{\left(z + \left(-1\right)\right)} \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      7. metadata-eval95.2%

        \[\leadsto \left(z + \color{blue}{-1}\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      8. sub-neg95.2%

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

        \[\leadsto \left(z + -1\right) \cdot \color{blue}{\mathsf{log1p}\left(-y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
      10. sub-neg99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(t + \left(-\left(x - 1\right) \cdot \log y\right)\right)} \]
      11. +-commutative99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
      12. *-commutative99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
      13. distribute-rgt-neg-in99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\color{blue}{\log y \cdot \left(-\left(x - 1\right)\right)} + t\right) \]
      14. fma-def99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\mathsf{fma}\left(\log y, -\left(x - 1\right), t\right)} \]
      15. neg-sub099.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
      16. associate--r-99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(0 - x\right) + 1}, t\right) \]
      17. neg-sub099.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(-x\right)} + 1, t\right) \]
      18. +-commutative99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 + \left(-x\right)}, t\right) \]
      19. unsub-neg99.9%

        \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 - x}, t\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)} \]
    4. Taylor expanded in t around inf 72.1%

      \[\leadsto \color{blue}{-1 \cdot t} \]
    5. Step-by-step derivation
      1. neg-mul-172.1%

        \[\leadsto \color{blue}{-t} \]
    6. Simplified72.1%

      \[\leadsto \color{blue}{-t} \]

    if -0.170000000000000012 < t < 1.2e13

    1. Initial program 82.6%

      \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
    2. Step-by-step derivation
      1. +-commutative82.6%

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

        \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) + \left(\left(x - 1\right) \cdot \log y - t\right)} \]
      3. fma-def82.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(z - 1, \log \left(1 - y\right), \left(x - 1\right) \cdot \log y - t\right)} \]
      4. sub-neg82.6%

        \[\leadsto \mathsf{fma}\left(z - 1, \log \color{blue}{\left(1 + \left(-y\right)\right)}, \left(x - 1\right) \cdot \log y - t\right) \]
      5. log1p-def99.7%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \left(x - 1\right) \cdot \log y - t\right)} \]
    4. Taylor expanded in x around 0 55.5%

      \[\leadsto \mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \color{blue}{-1 \cdot \log y} - t\right) \]
    5. Step-by-step derivation
      1. mul-1-neg55.5%

        \[\leadsto \mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \color{blue}{\left(-\log y\right)} - t\right) \]
    6. Simplified55.5%

      \[\leadsto \mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \color{blue}{\left(-\log y\right)} - t\right) \]
    7. Taylor expanded in y around 0 54.0%

      \[\leadsto \color{blue}{-1 \cdot \left(\left(z - 1\right) \cdot y\right) + -1 \cdot \left(t + \log y\right)} \]
    8. Step-by-step derivation
      1. distribute-lft-out54.0%

        \[\leadsto \color{blue}{-1 \cdot \left(\left(z - 1\right) \cdot y + \left(t + \log y\right)\right)} \]
      2. sub-neg54.0%

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

        \[\leadsto -1 \cdot \left(\left(z + \color{blue}{-1}\right) \cdot y + \left(t + \log y\right)\right) \]
      4. *-commutative54.0%

        \[\leadsto -1 \cdot \left(\color{blue}{y \cdot \left(z + -1\right)} + \left(t + \log y\right)\right) \]
      5. +-commutative54.0%

        \[\leadsto -1 \cdot \left(y \cdot \color{blue}{\left(-1 + z\right)} + \left(t + \log y\right)\right) \]
      6. +-commutative54.0%

        \[\leadsto -1 \cdot \left(y \cdot \left(-1 + z\right) + \color{blue}{\left(\log y + t\right)}\right) \]
    9. Simplified54.0%

      \[\leadsto \color{blue}{-1 \cdot \left(y \cdot \left(-1 + z\right) + \left(\log y + t\right)\right)} \]
    10. Taylor expanded in z around inf 19.9%

      \[\leadsto -1 \cdot \color{blue}{\left(y \cdot z\right)} \]
    11. Step-by-step derivation
      1. *-commutative19.9%

        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot y\right)} \]
    12. Simplified19.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.17:\\ \;\;\;\;-t\\ \mathbf{elif}\;t \leq 12000000000000:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;-t\\ \end{array} \]

Alternative 15: 45.6% accurate, 30.7× speedup?

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

\\
y \cdot \left(1 - z\right) - t
\end{array}
Derivation
  1. Initial program 88.7%

    \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
  2. Step-by-step derivation
    1. associate--l+88.7%

      \[\leadsto \color{blue}{\left(x - 1\right) \cdot \log y + \left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)} \]
    2. +-commutative88.7%

      \[\leadsto \color{blue}{\left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) + \left(x - 1\right) \cdot \log y} \]
    3. associate-+l-88.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right)} \]
    4. *-commutative88.7%

      \[\leadsto \color{blue}{\log \left(1 - y\right) \cdot \left(z - 1\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    5. *-commutative88.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    6. sub-neg88.7%

      \[\leadsto \color{blue}{\left(z + \left(-1\right)\right)} \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    7. metadata-eval88.7%

      \[\leadsto \left(z + \color{blue}{-1}\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    8. sub-neg88.7%

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

      \[\leadsto \left(z + -1\right) \cdot \color{blue}{\mathsf{log1p}\left(-y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    10. sub-neg99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(t + \left(-\left(x - 1\right) \cdot \log y\right)\right)} \]
    11. +-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
    12. *-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
    13. distribute-rgt-neg-in99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\color{blue}{\log y \cdot \left(-\left(x - 1\right)\right)} + t\right) \]
    14. fma-def99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\mathsf{fma}\left(\log y, -\left(x - 1\right), t\right)} \]
    15. neg-sub099.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
    16. associate--r-99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(0 - x\right) + 1}, t\right) \]
    17. neg-sub099.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(-x\right)} + 1, t\right) \]
    18. +-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 + \left(-x\right)}, t\right) \]
    19. unsub-neg99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 - x}, t\right) \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)} \]
  4. Taylor expanded in t around inf 48.7%

    \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{t} \]
  5. Taylor expanded in y around 0 48.2%

    \[\leadsto \color{blue}{-1 \cdot \left(\left(z - 1\right) \cdot y\right)} - t \]
  6. Step-by-step derivation
    1. mul-1-neg48.2%

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

      \[\leadsto \left(-\color{blue}{y \cdot \left(z - 1\right)}\right) - t \]
    3. distribute-rgt-neg-in48.2%

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \left(z - 1\right)\right)} - t \]
    5. sub-neg48.2%

      \[\leadsto y \cdot \left(-1 \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right) - t \]
    6. metadata-eval48.2%

      \[\leadsto y \cdot \left(-1 \cdot \left(z + \color{blue}{-1}\right)\right) - t \]
    7. +-commutative48.2%

      \[\leadsto y \cdot \left(-1 \cdot \color{blue}{\left(-1 + z\right)}\right) - t \]
    8. distribute-lft-in48.2%

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot -1 + -1 \cdot z\right)} - t \]
    9. metadata-eval48.2%

      \[\leadsto y \cdot \left(\color{blue}{1} + -1 \cdot z\right) - t \]
    10. neg-mul-148.2%

      \[\leadsto y \cdot \left(1 + \color{blue}{\left(-z\right)}\right) - t \]
  7. Simplified48.2%

    \[\leadsto \color{blue}{y \cdot \left(1 + \left(-z\right)\right)} - t \]
  8. Final simplification48.2%

    \[\leadsto y \cdot \left(1 - z\right) - t \]

Alternative 16: 45.4% accurate, 35.8× speedup?

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

\\
z \cdot \left(-y\right) - t
\end{array}
Derivation
  1. Initial program 88.7%

    \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
  2. Step-by-step derivation
    1. associate--l+88.7%

      \[\leadsto \color{blue}{\left(x - 1\right) \cdot \log y + \left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)} \]
    2. +-commutative88.7%

      \[\leadsto \color{blue}{\left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) + \left(x - 1\right) \cdot \log y} \]
    3. associate-+l-88.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right)} \]
    4. *-commutative88.7%

      \[\leadsto \color{blue}{\log \left(1 - y\right) \cdot \left(z - 1\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    5. *-commutative88.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    6. sub-neg88.7%

      \[\leadsto \color{blue}{\left(z + \left(-1\right)\right)} \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    7. metadata-eval88.7%

      \[\leadsto \left(z + \color{blue}{-1}\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    8. sub-neg88.7%

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

      \[\leadsto \left(z + -1\right) \cdot \color{blue}{\mathsf{log1p}\left(-y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    10. sub-neg99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(t + \left(-\left(x - 1\right) \cdot \log y\right)\right)} \]
    11. +-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
    12. *-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
    13. distribute-rgt-neg-in99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\color{blue}{\log y \cdot \left(-\left(x - 1\right)\right)} + t\right) \]
    14. fma-def99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\mathsf{fma}\left(\log y, -\left(x - 1\right), t\right)} \]
    15. neg-sub099.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
    16. associate--r-99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(0 - x\right) + 1}, t\right) \]
    17. neg-sub099.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(-x\right)} + 1, t\right) \]
    18. +-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 + \left(-x\right)}, t\right) \]
    19. unsub-neg99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 - x}, t\right) \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)} \]
  4. Taylor expanded in t around inf 48.7%

    \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{t} \]
  5. Taylor expanded in y around 0 48.2%

    \[\leadsto \color{blue}{-1 \cdot \left(\left(z - 1\right) \cdot y\right)} - t \]
  6. Step-by-step derivation
    1. mul-1-neg48.2%

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

      \[\leadsto \left(-\color{blue}{y \cdot \left(z - 1\right)}\right) - t \]
    3. distribute-rgt-neg-in48.2%

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \left(z - 1\right)\right)} - t \]
    5. sub-neg48.2%

      \[\leadsto y \cdot \left(-1 \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right) - t \]
    6. metadata-eval48.2%

      \[\leadsto y \cdot \left(-1 \cdot \left(z + \color{blue}{-1}\right)\right) - t \]
    7. +-commutative48.2%

      \[\leadsto y \cdot \left(-1 \cdot \color{blue}{\left(-1 + z\right)}\right) - t \]
    8. distribute-lft-in48.2%

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot -1 + -1 \cdot z\right)} - t \]
    9. metadata-eval48.2%

      \[\leadsto y \cdot \left(\color{blue}{1} + -1 \cdot z\right) - t \]
    10. neg-mul-148.2%

      \[\leadsto y \cdot \left(1 + \color{blue}{\left(-z\right)}\right) - t \]
  7. Simplified48.2%

    \[\leadsto \color{blue}{y \cdot \left(1 + \left(-z\right)\right)} - t \]
  8. Taylor expanded in z around inf 47.9%

    \[\leadsto \color{blue}{-1 \cdot \left(y \cdot z\right)} - t \]
  9. Step-by-step derivation
    1. mul-1-neg47.9%

      \[\leadsto \color{blue}{\left(-y \cdot z\right)} - t \]
    2. *-commutative47.9%

      \[\leadsto \left(-\color{blue}{z \cdot y}\right) - t \]
    3. distribute-rgt-neg-in47.9%

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

    \[\leadsto \color{blue}{z \cdot \left(-y\right)} - t \]
  11. Final simplification47.9%

    \[\leadsto z \cdot \left(-y\right) - t \]

Alternative 17: 35.5% accurate, 71.7× speedup?

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

\\
y - t
\end{array}
Derivation
  1. Initial program 88.7%

    \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
  2. Step-by-step derivation
    1. associate--l+88.7%

      \[\leadsto \color{blue}{\left(x - 1\right) \cdot \log y + \left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)} \]
    2. +-commutative88.7%

      \[\leadsto \color{blue}{\left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) + \left(x - 1\right) \cdot \log y} \]
    3. associate-+l-88.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right)} \]
    4. *-commutative88.7%

      \[\leadsto \color{blue}{\log \left(1 - y\right) \cdot \left(z - 1\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    5. *-commutative88.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    6. sub-neg88.7%

      \[\leadsto \color{blue}{\left(z + \left(-1\right)\right)} \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    7. metadata-eval88.7%

      \[\leadsto \left(z + \color{blue}{-1}\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    8. sub-neg88.7%

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

      \[\leadsto \left(z + -1\right) \cdot \color{blue}{\mathsf{log1p}\left(-y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    10. sub-neg99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(t + \left(-\left(x - 1\right) \cdot \log y\right)\right)} \]
    11. +-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
    12. *-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
    13. distribute-rgt-neg-in99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\color{blue}{\log y \cdot \left(-\left(x - 1\right)\right)} + t\right) \]
    14. fma-def99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\mathsf{fma}\left(\log y, -\left(x - 1\right), t\right)} \]
    15. neg-sub099.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
    16. associate--r-99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(0 - x\right) + 1}, t\right) \]
    17. neg-sub099.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(-x\right)} + 1, t\right) \]
    18. +-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 + \left(-x\right)}, t\right) \]
    19. unsub-neg99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 - x}, t\right) \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)} \]
  4. Taylor expanded in t around inf 48.7%

    \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{t} \]
  5. Taylor expanded in y around 0 48.2%

    \[\leadsto \color{blue}{-1 \cdot \left(\left(z - 1\right) \cdot y\right)} - t \]
  6. Step-by-step derivation
    1. mul-1-neg48.2%

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

      \[\leadsto \left(-\color{blue}{y \cdot \left(z - 1\right)}\right) - t \]
    3. distribute-rgt-neg-in48.2%

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \left(z - 1\right)\right)} - t \]
    5. sub-neg48.2%

      \[\leadsto y \cdot \left(-1 \cdot \color{blue}{\left(z + \left(-1\right)\right)}\right) - t \]
    6. metadata-eval48.2%

      \[\leadsto y \cdot \left(-1 \cdot \left(z + \color{blue}{-1}\right)\right) - t \]
    7. +-commutative48.2%

      \[\leadsto y \cdot \left(-1 \cdot \color{blue}{\left(-1 + z\right)}\right) - t \]
    8. distribute-lft-in48.2%

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot -1 + -1 \cdot z\right)} - t \]
    9. metadata-eval48.2%

      \[\leadsto y \cdot \left(\color{blue}{1} + -1 \cdot z\right) - t \]
    10. neg-mul-148.2%

      \[\leadsto y \cdot \left(1 + \color{blue}{\left(-z\right)}\right) - t \]
  7. Simplified48.2%

    \[\leadsto \color{blue}{y \cdot \left(1 + \left(-z\right)\right)} - t \]
  8. Taylor expanded in z around 0 36.8%

    \[\leadsto \color{blue}{y} - t \]
  9. Final simplification36.8%

    \[\leadsto y - t \]

Alternative 18: 35.3% accurate, 107.5× speedup?

\[\begin{array}{l} \\ -t \end{array} \]
(FPCore (x y z t) :precision binary64 (- t))
double code(double x, double y, double z, double t) {
	return -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 = -t
end function
public static double code(double x, double y, double z, double t) {
	return -t;
}
def code(x, y, z, t):
	return -t
function code(x, y, z, t)
	return Float64(-t)
end
function tmp = code(x, y, z, t)
	tmp = -t;
end
code[x_, y_, z_, t_] := (-t)
\begin{array}{l}

\\
-t
\end{array}
Derivation
  1. Initial program 88.7%

    \[\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t \]
  2. Step-by-step derivation
    1. associate--l+88.7%

      \[\leadsto \color{blue}{\left(x - 1\right) \cdot \log y + \left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right)} \]
    2. +-commutative88.7%

      \[\leadsto \color{blue}{\left(\left(z - 1\right) \cdot \log \left(1 - y\right) - t\right) + \left(x - 1\right) \cdot \log y} \]
    3. associate-+l-88.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right)} \]
    4. *-commutative88.7%

      \[\leadsto \color{blue}{\log \left(1 - y\right) \cdot \left(z - 1\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    5. *-commutative88.7%

      \[\leadsto \color{blue}{\left(z - 1\right) \cdot \log \left(1 - y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    6. sub-neg88.7%

      \[\leadsto \color{blue}{\left(z + \left(-1\right)\right)} \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    7. metadata-eval88.7%

      \[\leadsto \left(z + \color{blue}{-1}\right) \cdot \log \left(1 - y\right) - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    8. sub-neg88.7%

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

      \[\leadsto \left(z + -1\right) \cdot \color{blue}{\mathsf{log1p}\left(-y\right)} - \left(t - \left(x - 1\right) \cdot \log y\right) \]
    10. sub-neg99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(t + \left(-\left(x - 1\right) \cdot \log y\right)\right)} \]
    11. +-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\left(\left(-\left(x - 1\right) \cdot \log y\right) + t\right)} \]
    12. *-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\left(-\color{blue}{\log y \cdot \left(x - 1\right)}\right) + t\right) \]
    13. distribute-rgt-neg-in99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \left(\color{blue}{\log y \cdot \left(-\left(x - 1\right)\right)} + t\right) \]
    14. fma-def99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \color{blue}{\mathsf{fma}\left(\log y, -\left(x - 1\right), t\right)} \]
    15. neg-sub099.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{0 - \left(x - 1\right)}, t\right) \]
    16. associate--r-99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(0 - x\right) + 1}, t\right) \]
    17. neg-sub099.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{\left(-x\right)} + 1, t\right) \]
    18. +-commutative99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 + \left(-x\right)}, t\right) \]
    19. unsub-neg99.8%

      \[\leadsto \left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, \color{blue}{1 - x}, t\right) \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{\left(z + -1\right) \cdot \mathsf{log1p}\left(-y\right) - \mathsf{fma}\left(\log y, 1 - x, t\right)} \]
  4. Taylor expanded in t around inf 36.5%

    \[\leadsto \color{blue}{-1 \cdot t} \]
  5. Step-by-step derivation
    1. neg-mul-136.5%

      \[\leadsto \color{blue}{-t} \]
  6. Simplified36.5%

    \[\leadsto \color{blue}{-t} \]
  7. Final simplification36.5%

    \[\leadsto -t \]

Reproduce

?
herbie shell --seed 2023199 
(FPCore (x y z t)
  :name "Statistics.Distribution.Beta:$cdensity from math-functions-0.1.5.2"
  :precision binary64
  (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))