Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2

Percentage Accurate: 99.6% → 99.6%
Time: 15.1s
Alternatives: 14
Speedup: 1.0×

Specification

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

\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log 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 14 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: 99.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 1.0× speedup?

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

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

    \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
  2. Step-by-step derivation
    1. associate--l+N/A

      \[\leadsto \left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \color{blue}{\left(a - \frac{1}{2}\right)} \cdot \log t \]
    2. associate-+l+N/A

      \[\leadsto \log \left(x + y\right) + \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)} \]
    3. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\log \left(x + y\right), \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right) \]
    4. log-lowering-log.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(x + y\right)\right), \left(\color{blue}{\left(\log z - t\right)} + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
    5. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\left(\color{blue}{\log z} - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
    6. associate-+l-N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\log z - \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
    7. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\log z, \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
    8. log-lowering-log.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(\color{blue}{t} - \left(a - \frac{1}{2}\right) \cdot \log t\right)\right)\right) \]
    9. sub-negN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(t + \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
    10. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
    11. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\mathsf{neg}\left(\log t \cdot \left(a - \frac{1}{2}\right)\right)\right)\right)\right)\right) \]
    12. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\log t \cdot \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\log t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
    14. log-lowering-log.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right)\right) \]
    15. neg-sub0N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(0 - \color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right) \]
    16. associate--r-N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(0 - a\right) + \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
    17. neg-sub0N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(\mathsf{neg}\left(a\right)\right) + \frac{1}{2}\right)\right)\right)\right)\right) \]
    18. +-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right)\right)\right)\right)\right) \]
    19. unsub-negN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} - \color{blue}{a}\right)\right)\right)\right)\right) \]
    20. --lowering--.f6499.7%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{a}\right)\right)\right)\right)\right) \]
  3. Simplified99.7%

    \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right)} \]
  4. Add Preprocessing
  5. Final simplification99.7%

    \[\leadsto \log \left(x + y\right) + \left(\log z + \left(\log t \cdot \left(a - 0.5\right) - t\right)\right) \]
  6. Add Preprocessing

Alternative 2: 86.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\log z \leq 205:\\ \;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + \left(\log t \cdot \left(a + -0.5\right) - t\right)\\ \mathbf{else}:\\ \;\;\;\;\log t \cdot \left(a - 0.5\right) - t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= (log z) 205.0)
   (+ (log (* (+ x y) z)) (- (* (log t) (+ a -0.5)) t))
   (- (* (log t) (- a 0.5)) t)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (log(z) <= 205.0) {
		tmp = log(((x + y) * z)) + ((log(t) * (a + -0.5)) - t);
	} else {
		tmp = (log(t) * (a - 0.5)) - t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (log(z) <= 205.0d0) then
        tmp = log(((x + y) * z)) + ((log(t) * (a + (-0.5d0))) - t)
    else
        tmp = (log(t) * (a - 0.5d0)) - t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (Math.log(z) <= 205.0) {
		tmp = Math.log(((x + y) * z)) + ((Math.log(t) * (a + -0.5)) - t);
	} else {
		tmp = (Math.log(t) * (a - 0.5)) - t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if math.log(z) <= 205.0:
		tmp = math.log(((x + y) * z)) + ((math.log(t) * (a + -0.5)) - t)
	else:
		tmp = (math.log(t) * (a - 0.5)) - t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (log(z) <= 205.0)
		tmp = Float64(log(Float64(Float64(x + y) * z)) + Float64(Float64(log(t) * Float64(a + -0.5)) - t));
	else
		tmp = Float64(Float64(log(t) * Float64(a - 0.5)) - t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (log(z) <= 205.0)
		tmp = log(((x + y) * z)) + ((log(t) * (a + -0.5)) - t);
	else
		tmp = (log(t) * (a - 0.5)) - t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[Log[z], $MachinePrecision], 205.0], N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\log z \leq 205:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + \left(\log t \cdot \left(a + -0.5\right) - t\right)\\

\mathbf{else}:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) - t\\


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

    1. Initial program 99.7%

      \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-+l-N/A

        \[\leadsto \left(\log \left(x + y\right) + \log z\right) - \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)} \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\log \left(x + y\right) + \log z\right), \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right) \]
      3. sum-logN/A

        \[\leadsto \mathsf{\_.f64}\left(\log \left(\left(x + y\right) \cdot z\right), \left(\color{blue}{t} - \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      4. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\left(\left(x + y\right) \cdot z\right)\right), \left(\color{blue}{t} - \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(\left(x + y\right), z\right)\right), \left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, y\right), z\right)\right), \left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, y\right), z\right)\right), \mathsf{\_.f64}\left(t, \color{blue}{\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, y\right), z\right)\right), \mathsf{\_.f64}\left(t, \left(\log t \cdot \color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, y\right), z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(\log t, \color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right) \]
      10. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, y\right), z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\color{blue}{a} - \frac{1}{2}\right)\right)\right)\right) \]
      11. sub-negN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, y\right), z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(a + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, y\right), z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{+.f64}\left(a, \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right)\right) \]
      13. metadata-eval93.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(x, y\right), z\right)\right), \mathsf{\_.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{+.f64}\left(a, \frac{-1}{2}\right)\right)\right)\right) \]
    4. Applied egg-rr93.4%

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

    if 205 < (log.f64 z)

    1. Initial program 99.7%

      \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(-1 \cdot t\right)}, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(a, \frac{1}{2}\right), \mathsf{log.f64}\left(t\right)\right)\right) \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\mathsf{neg}\left(t\right)\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{\_.f64}\left(a, \frac{1}{2}\right)}, \mathsf{log.f64}\left(t\right)\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\left(0 - t\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{\_.f64}\left(a, \frac{1}{2}\right)}, \mathsf{log.f64}\left(t\right)\right)\right) \]
      3. --lowering--.f6476.5%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{\_.f64}\left(0, t\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{\_.f64}\left(a, \frac{1}{2}\right)}, \mathsf{log.f64}\left(t\right)\right)\right) \]
    5. Simplified76.5%

      \[\leadsto \color{blue}{\left(0 - t\right)} + \left(a - 0.5\right) \cdot \log t \]
  3. Recombined 2 regimes into one program.
  4. Final simplification87.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\log z \leq 205:\\ \;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + \left(\log t \cdot \left(a + -0.5\right) - t\right)\\ \mathbf{else}:\\ \;\;\;\;\log t \cdot \left(a - 0.5\right) - t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 66.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log t \cdot \left(a - 0.5\right) - t\\ \mathbf{if}\;\log z \leq 205:\\ \;\;\;\;\log \left(y \cdot z\right) + t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- (* (log t) (- a 0.5)) t)))
   (if (<= (log z) 205.0) (+ (log (* y z)) t_1) t_1)))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (log(t) * (a - 0.5)) - t;
	double tmp;
	if (log(z) <= 205.0) {
		tmp = log((y * z)) + t_1;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (log(t) * (a - 0.5d0)) - t
    if (log(z) <= 205.0d0) then
        tmp = log((y * z)) + t_1
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (Math.log(t) * (a - 0.5)) - t;
	double tmp;
	if (Math.log(z) <= 205.0) {
		tmp = Math.log((y * z)) + t_1;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (math.log(t) * (a - 0.5)) - t
	tmp = 0
	if math.log(z) <= 205.0:
		tmp = math.log((y * z)) + t_1
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(log(t) * Float64(a - 0.5)) - t)
	tmp = 0.0
	if (log(z) <= 205.0)
		tmp = Float64(log(Float64(y * z)) + t_1);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (log(t) * (a - 0.5)) - t;
	tmp = 0.0;
	if (log(z) <= 205.0)
		tmp = log((y * z)) + t_1;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[N[Log[z], $MachinePrecision], 205.0], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision], t$95$1]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \log t \cdot \left(a - 0.5\right) - t\\
\mathbf{if}\;\log z \leq 205:\\
\;\;\;\;\log \left(y \cdot z\right) + t\_1\\

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


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

    1. Initial program 99.7%

      \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
    2. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \color{blue}{\left(a - \frac{1}{2}\right)} \cdot \log t \]
      2. associate-+l+N/A

        \[\leadsto \log \left(x + y\right) + \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\log \left(x + y\right), \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right) \]
      4. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(x + y\right)\right), \left(\color{blue}{\left(\log z - t\right)} + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\left(\color{blue}{\log z} - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      6. associate-+l-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\log z - \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\log z, \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      8. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(\color{blue}{t} - \left(a - \frac{1}{2}\right) \cdot \log t\right)\right)\right) \]
      9. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(t + \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\mathsf{neg}\left(\log t \cdot \left(a - \frac{1}{2}\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\log t \cdot \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\log t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      14. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(0 - \color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right) \]
      16. associate--r-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(0 - a\right) + \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
      17. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(\mathsf{neg}\left(a\right)\right) + \frac{1}{2}\right)\right)\right)\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right)\right)\right)\right)\right) \]
      19. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} - \color{blue}{a}\right)\right)\right)\right)\right) \]
      20. --lowering--.f6499.7%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{a}\right)\right)\right)\right)\right) \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\log y}, \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, a\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. log-lowering-log.f6475.5%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(y\right), \mathsf{\_.f64}\left(\color{blue}{\mathsf{log.f64}\left(z\right)}, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, a\right)\right)\right)\right)\right) \]
    7. Simplified75.5%

      \[\leadsto \color{blue}{\log y} + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right) \]
    8. Step-by-step derivation
      1. associate-+r-N/A

        \[\leadsto \left(\log y + \log z\right) - \color{blue}{\left(t + \log t \cdot \left(\frac{1}{2} - a\right)\right)} \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\log y + \log z\right), \color{blue}{\left(t + \log t \cdot \left(\frac{1}{2} - a\right)\right)}\right) \]
      3. sum-logN/A

        \[\leadsto \mathsf{\_.f64}\left(\log \left(y \cdot z\right), \left(\color{blue}{t} + \log t \cdot \left(\frac{1}{2} - a\right)\right)\right) \]
      4. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\left(y \cdot z\right)\right), \left(\color{blue}{t} + \log t \cdot \left(\frac{1}{2} - a\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \left(t + \log t \cdot \left(\frac{1}{2} - a\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \mathsf{+.f64}\left(t, \color{blue}{\left(\log t \cdot \left(\frac{1}{2} - a\right)\right)}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\log t, \color{blue}{\left(\frac{1}{2} - a\right)}\right)\right)\right) \]
      8. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\color{blue}{\frac{1}{2}} - a\right)\right)\right)\right) \]
      9. --lowering--.f6463.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{a}\right)\right)\right)\right) \]
    9. Applied egg-rr63.9%

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

    if 205 < (log.f64 z)

    1. Initial program 99.7%

      \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(-1 \cdot t\right)}, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(a, \frac{1}{2}\right), \mathsf{log.f64}\left(t\right)\right)\right) \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\mathsf{neg}\left(t\right)\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{\_.f64}\left(a, \frac{1}{2}\right)}, \mathsf{log.f64}\left(t\right)\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\left(0 - t\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{\_.f64}\left(a, \frac{1}{2}\right)}, \mathsf{log.f64}\left(t\right)\right)\right) \]
      3. --lowering--.f6476.5%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{\_.f64}\left(0, t\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{\_.f64}\left(a, \frac{1}{2}\right)}, \mathsf{log.f64}\left(t\right)\right)\right) \]
    5. Simplified76.5%

      \[\leadsto \color{blue}{\left(0 - t\right)} + \left(a - 0.5\right) \cdot \log t \]
  3. Recombined 2 regimes into one program.
  4. Final simplification68.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\log z \leq 205:\\ \;\;\;\;\log \left(y \cdot z\right) + \left(\log t \cdot \left(a - 0.5\right) - t\right)\\ \mathbf{else}:\\ \;\;\;\;\log t \cdot \left(a - 0.5\right) - t\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 80.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 9.2 \cdot 10^{-5}:\\ \;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\log t \cdot a - t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= t 9.2e-5)
   (+ (log y) (+ (log z) (* (log t) (- a 0.5))))
   (- (* (log t) a) t)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= 9.2e-5) {
		tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
	} else {
		tmp = (log(t) * a) - t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (t <= 9.2d-5) then
        tmp = log(y) + (log(z) + (log(t) * (a - 0.5d0)))
    else
        tmp = (log(t) * a) - t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= 9.2e-5) {
		tmp = Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
	} else {
		tmp = (Math.log(t) * a) - t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if t <= 9.2e-5:
		tmp = math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5)))
	else:
		tmp = (math.log(t) * a) - t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (t <= 9.2e-5)
		tmp = Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5))));
	else
		tmp = Float64(Float64(log(t) * a) - t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (t <= 9.2e-5)
		tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
	else
		tmp = (log(t) * a) - t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 9.2e-5], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\log t \cdot a - t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 9.20000000000000001e-5

    1. Initial program 99.5%

      \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
    2. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \color{blue}{\left(a - \frac{1}{2}\right)} \cdot \log t \]
      2. associate-+l+N/A

        \[\leadsto \log \left(x + y\right) + \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\log \left(x + y\right), \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right) \]
      4. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(x + y\right)\right), \left(\color{blue}{\left(\log z - t\right)} + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\left(\color{blue}{\log z} - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      6. associate-+l-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\log z - \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\log z, \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      8. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(\color{blue}{t} - \left(a - \frac{1}{2}\right) \cdot \log t\right)\right)\right) \]
      9. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(t + \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\mathsf{neg}\left(\log t \cdot \left(a - \frac{1}{2}\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\log t \cdot \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\log t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      14. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(0 - \color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right) \]
      16. associate--r-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(0 - a\right) + \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
      17. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(\mathsf{neg}\left(a\right)\right) + \frac{1}{2}\right)\right)\right)\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right)\right)\right)\right)\right) \]
      19. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} - \color{blue}{a}\right)\right)\right)\right)\right) \]
      20. --lowering--.f6499.5%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{a}\right)\right)\right)\right)\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\log y}, \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, a\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. log-lowering-log.f6469.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(y\right), \mathsf{\_.f64}\left(\color{blue}{\mathsf{log.f64}\left(z\right)}, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, a\right)\right)\right)\right)\right) \]
    7. Simplified69.8%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(y\right), \color{blue}{\left(\log z - \log t \cdot \left(\frac{1}{2} - a\right)\right)}\right) \]
    9. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(y\right), \mathsf{\_.f64}\left(\log z, \color{blue}{\left(\log t \cdot \left(\frac{1}{2} - a\right)\right)}\right)\right) \]
      2. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(y\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(\color{blue}{\log t} \cdot \left(\frac{1}{2} - a\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(y\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{*.f64}\left(\log t, \color{blue}{\left(\frac{1}{2} - a\right)}\right)\right)\right) \]
      4. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(y\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\color{blue}{\frac{1}{2}} - a\right)\right)\right)\right) \]
      5. --lowering--.f6469.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(y\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{a}\right)\right)\right)\right) \]
    10. Simplified69.6%

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

    if 9.20000000000000001e-5 < t

    1. Initial program 99.9%

      \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
    2. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \color{blue}{\left(a - \frac{1}{2}\right)} \cdot \log t \]
      2. associate-+l+N/A

        \[\leadsto \log \left(x + y\right) + \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\log \left(x + y\right), \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right) \]
      4. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(x + y\right)\right), \left(\color{blue}{\left(\log z - t\right)} + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\left(\color{blue}{\log z} - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      6. associate-+l-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\log z - \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\log z, \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      8. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(\color{blue}{t} - \left(a - \frac{1}{2}\right) \cdot \log t\right)\right)\right) \]
      9. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(t + \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\mathsf{neg}\left(\log t \cdot \left(a - \frac{1}{2}\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\log t \cdot \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\log t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      14. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(0 - \color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right) \]
      16. associate--r-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(0 - a\right) + \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
      17. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(\mathsf{neg}\left(a\right)\right) + \frac{1}{2}\right)\right)\right)\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right)\right)\right)\right)\right) \]
      19. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} - \color{blue}{a}\right)\right)\right)\right)\right) \]
      20. --lowering--.f6499.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{a}\right)\right)\right)\right)\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\log y}, \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, a\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. log-lowering-log.f6478.1%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(y\right), \mathsf{\_.f64}\left(\color{blue}{\mathsf{log.f64}\left(z\right)}, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, a\right)\right)\right)\right)\right) \]
    7. Simplified78.1%

      \[\leadsto \color{blue}{\log y} + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right) \]
    8. Step-by-step derivation
      1. associate-+r-N/A

        \[\leadsto \left(\log y + \log z\right) - \color{blue}{\left(t + \log t \cdot \left(\frac{1}{2} - a\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \left(\log y + \log z\right) - \left(\log t \cdot \left(\frac{1}{2} - a\right) + \color{blue}{t}\right) \]
      3. associate--r+N/A

        \[\leadsto \left(\left(\log y + \log z\right) - \log t \cdot \left(\frac{1}{2} - a\right)\right) - \color{blue}{t} \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\left(\log y + \log z\right) - \log t \cdot \left(\frac{1}{2} - a\right)\right), \color{blue}{t}\right) \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\left(\log y + \log z\right), \left(\log t \cdot \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
      6. sum-logN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\log \left(y \cdot z\right), \left(\log t \cdot \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
      7. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(\left(y \cdot z\right)\right), \left(\log t \cdot \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \left(\log t \cdot \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(\log t, \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
      10. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
      11. --lowering--.f6461.1%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, a\right)\right)\right), t\right) \]
    9. Applied egg-rr61.1%

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(a \cdot \log t\right)}, t\right) \]
    11. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\log t \cdot a\right), t\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\log t, a\right), t\right) \]
      3. log-lowering-log.f6498.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), a\right), t\right) \]
    12. Simplified98.4%

      \[\leadsto \color{blue}{\log t \cdot a} - t \]
  3. Recombined 2 regimes into one program.
  4. Final simplification85.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 9.2 \cdot 10^{-5}:\\ \;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\log t \cdot a - t\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 69.5% accurate, 1.0× speedup?

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

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

    \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
  2. Step-by-step derivation
    1. associate--l+N/A

      \[\leadsto \left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \color{blue}{\left(a - \frac{1}{2}\right)} \cdot \log t \]
    2. associate-+l+N/A

      \[\leadsto \log \left(x + y\right) + \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)} \]
    3. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\log \left(x + y\right), \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right) \]
    4. log-lowering-log.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(x + y\right)\right), \left(\color{blue}{\left(\log z - t\right)} + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
    5. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\left(\color{blue}{\log z} - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
    6. associate-+l-N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\log z - \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
    7. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\log z, \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
    8. log-lowering-log.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(\color{blue}{t} - \left(a - \frac{1}{2}\right) \cdot \log t\right)\right)\right) \]
    9. sub-negN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(t + \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
    10. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
    11. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\mathsf{neg}\left(\log t \cdot \left(a - \frac{1}{2}\right)\right)\right)\right)\right)\right) \]
    12. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\log t \cdot \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\log t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
    14. log-lowering-log.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right)\right) \]
    15. neg-sub0N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(0 - \color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right) \]
    16. associate--r-N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(0 - a\right) + \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
    17. neg-sub0N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(\mathsf{neg}\left(a\right)\right) + \frac{1}{2}\right)\right)\right)\right)\right) \]
    18. +-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right)\right)\right)\right)\right) \]
    19. unsub-negN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} - \color{blue}{a}\right)\right)\right)\right)\right) \]
    20. --lowering--.f6499.7%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{a}\right)\right)\right)\right)\right) \]
  3. Simplified99.7%

    \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in x around 0

    \[\leadsto \mathsf{+.f64}\left(\color{blue}{\log y}, \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, a\right)\right)\right)\right)\right) \]
  6. Step-by-step derivation
    1. log-lowering-log.f6474.3%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(y\right), \mathsf{\_.f64}\left(\color{blue}{\mathsf{log.f64}\left(z\right)}, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, a\right)\right)\right)\right)\right) \]
  7. Simplified74.3%

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

    \[\leadsto \left(\log z + \left(\log t \cdot \left(a - 0.5\right) - t\right)\right) + \log y \]
  9. Add Preprocessing

Alternative 6: 74.4% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log t \cdot \left(a - 0.5\right) - t\\ \mathbf{if}\;a \leq -9.5 \cdot 10^{-19}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 10^{-104}:\\ \;\;\;\;\log \left(y \cdot z\right) - \left(t + \log t \cdot 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- (* (log t) (- a 0.5)) t)))
   (if (<= a -9.5e-19)
     t_1
     (if (<= a 1e-104) (- (log (* y z)) (+ t (* (log t) 0.5))) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (log(t) * (a - 0.5)) - t;
	double tmp;
	if (a <= -9.5e-19) {
		tmp = t_1;
	} else if (a <= 1e-104) {
		tmp = log((y * z)) - (t + (log(t) * 0.5));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (log(t) * (a - 0.5d0)) - t
    if (a <= (-9.5d-19)) then
        tmp = t_1
    else if (a <= 1d-104) then
        tmp = log((y * z)) - (t + (log(t) * 0.5d0))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (Math.log(t) * (a - 0.5)) - t;
	double tmp;
	if (a <= -9.5e-19) {
		tmp = t_1;
	} else if (a <= 1e-104) {
		tmp = Math.log((y * z)) - (t + (Math.log(t) * 0.5));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (math.log(t) * (a - 0.5)) - t
	tmp = 0
	if a <= -9.5e-19:
		tmp = t_1
	elif a <= 1e-104:
		tmp = math.log((y * z)) - (t + (math.log(t) * 0.5))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(log(t) * Float64(a - 0.5)) - t)
	tmp = 0.0
	if (a <= -9.5e-19)
		tmp = t_1;
	elseif (a <= 1e-104)
		tmp = Float64(log(Float64(y * z)) - Float64(t + Float64(log(t) * 0.5)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (log(t) * (a - 0.5)) - t;
	tmp = 0.0;
	if (a <= -9.5e-19)
		tmp = t_1;
	elseif (a <= 1e-104)
		tmp = log((y * z)) - (t + (log(t) * 0.5));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -9.5e-19], t$95$1, If[LessEqual[a, 1e-104], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] - N[(t + N[(N[Log[t], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \log t \cdot \left(a - 0.5\right) - t\\
\mathbf{if}\;a \leq -9.5 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 10^{-104}:\\
\;\;\;\;\log \left(y \cdot z\right) - \left(t + \log t \cdot 0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -9.4999999999999995e-19 or 9.99999999999999927e-105 < a

    1. Initial program 99.7%

      \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(-1 \cdot t\right)}, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(a, \frac{1}{2}\right), \mathsf{log.f64}\left(t\right)\right)\right) \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\mathsf{neg}\left(t\right)\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{\_.f64}\left(a, \frac{1}{2}\right)}, \mathsf{log.f64}\left(t\right)\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\left(0 - t\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{\_.f64}\left(a, \frac{1}{2}\right)}, \mathsf{log.f64}\left(t\right)\right)\right) \]
      3. --lowering--.f6495.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{\_.f64}\left(0, t\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{\_.f64}\left(a, \frac{1}{2}\right)}, \mathsf{log.f64}\left(t\right)\right)\right) \]
    5. Simplified95.4%

      \[\leadsto \color{blue}{\left(0 - t\right)} + \left(a - 0.5\right) \cdot \log t \]

    if -9.4999999999999995e-19 < a < 9.99999999999999927e-105

    1. Initial program 99.6%

      \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
    2. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \color{blue}{\left(a - \frac{1}{2}\right)} \cdot \log t \]
      2. associate-+l+N/A

        \[\leadsto \log \left(x + y\right) + \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\log \left(x + y\right), \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right) \]
      4. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(x + y\right)\right), \left(\color{blue}{\left(\log z - t\right)} + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\left(\color{blue}{\log z} - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      6. associate-+l-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\log z - \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\log z, \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      8. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(\color{blue}{t} - \left(a - \frac{1}{2}\right) \cdot \log t\right)\right)\right) \]
      9. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(t + \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\mathsf{neg}\left(\log t \cdot \left(a - \frac{1}{2}\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\log t \cdot \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\log t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      14. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(0 - \color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right) \]
      16. associate--r-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(0 - a\right) + \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
      17. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(\mathsf{neg}\left(a\right)\right) + \frac{1}{2}\right)\right)\right)\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right)\right)\right)\right)\right) \]
      19. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} - \color{blue}{a}\right)\right)\right)\right)\right) \]
      20. --lowering--.f6499.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{a}\right)\right)\right)\right)\right) \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\log y}, \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, a\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. log-lowering-log.f6469.3%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(y\right), \mathsf{\_.f64}\left(\color{blue}{\mathsf{log.f64}\left(z\right)}, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, a\right)\right)\right)\right)\right) \]
    7. Simplified69.3%

      \[\leadsto \color{blue}{\log y} + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right) \]
    8. Step-by-step derivation
      1. associate-+r-N/A

        \[\leadsto \left(\log y + \log z\right) - \color{blue}{\left(t + \log t \cdot \left(\frac{1}{2} - a\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \left(\log y + \log z\right) - \left(\log t \cdot \left(\frac{1}{2} - a\right) + \color{blue}{t}\right) \]
      3. associate--r+N/A

        \[\leadsto \left(\left(\log y + \log z\right) - \log t \cdot \left(\frac{1}{2} - a\right)\right) - \color{blue}{t} \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\left(\log y + \log z\right) - \log t \cdot \left(\frac{1}{2} - a\right)\right), \color{blue}{t}\right) \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\left(\log y + \log z\right), \left(\log t \cdot \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
      6. sum-logN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\log \left(y \cdot z\right), \left(\log t \cdot \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
      7. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(\left(y \cdot z\right)\right), \left(\log t \cdot \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \left(\log t \cdot \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(\log t, \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
      10. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
      11. --lowering--.f6451.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, a\right)\right)\right), t\right) \]
    9. Applied egg-rr51.8%

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

      \[\leadsto \color{blue}{\log \left(y \cdot z\right) - \left(t + \frac{1}{2} \cdot \log t\right)} \]
    11. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\log \left(y \cdot z\right), \color{blue}{\left(t + \frac{1}{2} \cdot \log t\right)}\right) \]
      2. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\left(y \cdot z\right)\right), \left(\color{blue}{t} + \frac{1}{2} \cdot \log t\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\left(z \cdot y\right)\right), \left(t + \frac{1}{2} \cdot \log t\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(z, y\right)\right), \left(t + \frac{1}{2} \cdot \log t\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(z, y\right)\right), \mathsf{+.f64}\left(t, \color{blue}{\left(\frac{1}{2} \cdot \log t\right)}\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(z, y\right)\right), \mathsf{+.f64}\left(t, \left(\log t \cdot \color{blue}{\frac{1}{2}}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(z, y\right)\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\log t, \color{blue}{\frac{1}{2}}\right)\right)\right) \]
      8. log-lowering-log.f6451.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(z, y\right)\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \frac{1}{2}\right)\right)\right) \]
    12. Simplified51.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9.5 \cdot 10^{-19}:\\ \;\;\;\;\log t \cdot \left(a - 0.5\right) - t\\ \mathbf{elif}\;a \leq 10^{-104}:\\ \;\;\;\;\log \left(y \cdot z\right) - \left(t + \log t \cdot 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\log t \cdot \left(a - 0.5\right) - t\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 73.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log t \cdot \left(a - 0.5\right)\\ \mathbf{if}\;t \leq 1.42 \cdot 10^{-8}:\\ \;\;\;\;\log \left(y \cdot z\right) + t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_1 - t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (log t) (- a 0.5))))
   (if (<= t 1.42e-8) (+ (log (* y z)) t_1) (- t_1 t))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = log(t) * (a - 0.5);
	double tmp;
	if (t <= 1.42e-8) {
		tmp = log((y * z)) + t_1;
	} else {
		tmp = t_1 - t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = log(t) * (a - 0.5d0)
    if (t <= 1.42d-8) then
        tmp = log((y * z)) + t_1
    else
        tmp = t_1 - t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = Math.log(t) * (a - 0.5);
	double tmp;
	if (t <= 1.42e-8) {
		tmp = Math.log((y * z)) + t_1;
	} else {
		tmp = t_1 - t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = math.log(t) * (a - 0.5)
	tmp = 0
	if t <= 1.42e-8:
		tmp = math.log((y * z)) + t_1
	else:
		tmp = t_1 - t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(log(t) * Float64(a - 0.5))
	tmp = 0.0
	if (t <= 1.42e-8)
		tmp = Float64(log(Float64(y * z)) + t_1);
	else
		tmp = Float64(t_1 - t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = log(t) * (a - 0.5);
	tmp = 0.0;
	if (t <= 1.42e-8)
		tmp = log((y * z)) + t_1;
	else
		tmp = t_1 - t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 1.42e-8], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 - t), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \log t \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t \leq 1.42 \cdot 10^{-8}:\\
\;\;\;\;\log \left(y \cdot z\right) + t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.41999999999999998e-8

    1. Initial program 99.5%

      \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
    2. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \color{blue}{\left(a - \frac{1}{2}\right)} \cdot \log t \]
      2. associate-+l+N/A

        \[\leadsto \log \left(x + y\right) + \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\log \left(x + y\right), \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right) \]
      4. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(x + y\right)\right), \left(\color{blue}{\left(\log z - t\right)} + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\left(\color{blue}{\log z} - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      6. associate-+l-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\log z - \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\log z, \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      8. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(\color{blue}{t} - \left(a - \frac{1}{2}\right) \cdot \log t\right)\right)\right) \]
      9. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(t + \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\mathsf{neg}\left(\log t \cdot \left(a - \frac{1}{2}\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\log t \cdot \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\log t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      14. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(0 - \color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right) \]
      16. associate--r-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(0 - a\right) + \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
      17. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(\mathsf{neg}\left(a\right)\right) + \frac{1}{2}\right)\right)\right)\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right)\right)\right)\right)\right) \]
      19. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} - \color{blue}{a}\right)\right)\right)\right)\right) \]
      20. --lowering--.f6499.5%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{a}\right)\right)\right)\right)\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\log y}, \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, a\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. log-lowering-log.f6470.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(y\right), \mathsf{\_.f64}\left(\color{blue}{\mathsf{log.f64}\left(z\right)}, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, a\right)\right)\right)\right)\right) \]
    7. Simplified70.4%

      \[\leadsto \color{blue}{\log y} + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right) \]
    8. Step-by-step derivation
      1. associate-+r-N/A

        \[\leadsto \left(\log y + \log z\right) - \color{blue}{\left(t + \log t \cdot \left(\frac{1}{2} - a\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \left(\log y + \log z\right) - \left(\log t \cdot \left(\frac{1}{2} - a\right) + \color{blue}{t}\right) \]
      3. associate--r+N/A

        \[\leadsto \left(\left(\log y + \log z\right) - \log t \cdot \left(\frac{1}{2} - a\right)\right) - \color{blue}{t} \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\left(\log y + \log z\right) - \log t \cdot \left(\frac{1}{2} - a\right)\right), \color{blue}{t}\right) \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\left(\log y + \log z\right), \left(\log t \cdot \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
      6. sum-logN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\log \left(y \cdot z\right), \left(\log t \cdot \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
      7. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(\left(y \cdot z\right)\right), \left(\log t \cdot \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \left(\log t \cdot \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(\log t, \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
      10. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
      11. --lowering--.f6450.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, a\right)\right)\right), t\right) \]
    9. Applied egg-rr50.0%

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

      \[\leadsto \color{blue}{\log \left(y \cdot z\right) - \log t \cdot \left(\frac{1}{2} - a\right)} \]
    11. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\log \left(y \cdot z\right), \color{blue}{\left(\log t \cdot \left(\frac{1}{2} - a\right)\right)}\right) \]
      2. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\left(y \cdot z\right)\right), \left(\color{blue}{\log t} \cdot \left(\frac{1}{2} - a\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\left(z \cdot y\right)\right), \left(\log \color{blue}{t} \cdot \left(\frac{1}{2} - a\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(z, y\right)\right), \left(\log \color{blue}{t} \cdot \left(\frac{1}{2} - a\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(z, y\right)\right), \mathsf{*.f64}\left(\log t, \color{blue}{\left(\frac{1}{2} - a\right)}\right)\right) \]
      6. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(z, y\right)\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\color{blue}{\frac{1}{2}} - a\right)\right)\right) \]
      7. --lowering--.f6449.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(z, y\right)\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{a}\right)\right)\right) \]
    12. Simplified49.7%

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

    if 1.41999999999999998e-8 < t

    1. Initial program 99.9%

      \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(-1 \cdot t\right)}, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(a, \frac{1}{2}\right), \mathsf{log.f64}\left(t\right)\right)\right) \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\mathsf{neg}\left(t\right)\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{\_.f64}\left(a, \frac{1}{2}\right)}, \mathsf{log.f64}\left(t\right)\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\left(0 - t\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{\_.f64}\left(a, \frac{1}{2}\right)}, \mathsf{log.f64}\left(t\right)\right)\right) \]
      3. --lowering--.f6497.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{\_.f64}\left(0, t\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{\_.f64}\left(a, \frac{1}{2}\right)}, \mathsf{log.f64}\left(t\right)\right)\right) \]
    5. Simplified97.8%

      \[\leadsto \color{blue}{\left(0 - t\right)} + \left(a - 0.5\right) \cdot \log t \]
  3. Recombined 2 regimes into one program.
  4. Final simplification76.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.42 \cdot 10^{-8}:\\ \;\;\;\;\log \left(y \cdot z\right) + \log t \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\log t \cdot \left(a - 0.5\right) - t\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 62.1% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 2.3 \cdot 10^{+33}:\\ \;\;\;\;\log t \cdot a\\ \mathbf{else}:\\ \;\;\;\;0 - t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= t 2.3e+33) (* (log t) a) (- 0.0 t)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= 2.3e+33) {
		tmp = log(t) * a;
	} else {
		tmp = 0.0 - t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (t <= 2.3d+33) then
        tmp = log(t) * a
    else
        tmp = 0.0d0 - t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= 2.3e+33) {
		tmp = Math.log(t) * a;
	} else {
		tmp = 0.0 - t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if t <= 2.3e+33:
		tmp = math.log(t) * a
	else:
		tmp = 0.0 - t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (t <= 2.3e+33)
		tmp = Float64(log(t) * a);
	else
		tmp = Float64(0.0 - t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (t <= 2.3e+33)
		tmp = log(t) * a;
	else
		tmp = 0.0 - t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 2.3e+33], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(0.0 - t), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.3 \cdot 10^{+33}:\\
\;\;\;\;\log t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 2.30000000000000011e33

    1. Initial program 99.5%

      \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
    2. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \color{blue}{\left(a - \frac{1}{2}\right)} \cdot \log t \]
      2. associate-+l+N/A

        \[\leadsto \log \left(x + y\right) + \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\log \left(x + y\right), \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right) \]
      4. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(x + y\right)\right), \left(\color{blue}{\left(\log z - t\right)} + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\left(\color{blue}{\log z} - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      6. associate-+l-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\log z - \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\log z, \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      8. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(\color{blue}{t} - \left(a - \frac{1}{2}\right) \cdot \log t\right)\right)\right) \]
      9. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(t + \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\mathsf{neg}\left(\log t \cdot \left(a - \frac{1}{2}\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\log t \cdot \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\log t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      14. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(0 - \color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right) \]
      16. associate--r-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(0 - a\right) + \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
      17. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(\mathsf{neg}\left(a\right)\right) + \frac{1}{2}\right)\right)\right)\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right)\right)\right)\right)\right) \]
      19. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} - \color{blue}{a}\right)\right)\right)\right)\right) \]
      20. --lowering--.f6499.5%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{a}\right)\right)\right)\right)\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \log t} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \log t \cdot \color{blue}{a} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\log t, \color{blue}{a}\right) \]
      3. log-lowering-log.f6456.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), a\right) \]
    7. Simplified56.7%

      \[\leadsto \color{blue}{\log t \cdot a} \]

    if 2.30000000000000011e33 < t

    1. Initial program 99.9%

      \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
    2. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \color{blue}{\left(a - \frac{1}{2}\right)} \cdot \log t \]
      2. associate-+l+N/A

        \[\leadsto \log \left(x + y\right) + \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\log \left(x + y\right), \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right) \]
      4. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(x + y\right)\right), \left(\color{blue}{\left(\log z - t\right)} + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\left(\color{blue}{\log z} - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      6. associate-+l-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\log z - \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\log z, \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      8. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(\color{blue}{t} - \left(a - \frac{1}{2}\right) \cdot \log t\right)\right)\right) \]
      9. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(t + \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\mathsf{neg}\left(\log t \cdot \left(a - \frac{1}{2}\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\log t \cdot \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\log t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      14. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(0 - \color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right) \]
      16. associate--r-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(0 - a\right) + \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
      17. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(\mathsf{neg}\left(a\right)\right) + \frac{1}{2}\right)\right)\right)\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right)\right)\right)\right)\right) \]
      19. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} - \color{blue}{a}\right)\right)\right)\right)\right) \]
      20. --lowering--.f6499.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{a}\right)\right)\right)\right)\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf

      \[\leadsto \color{blue}{-1 \cdot t} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(t\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{t} \]
      3. --lowering--.f6480.8%

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{t}\right) \]
    7. Simplified80.8%

      \[\leadsto \color{blue}{0 - t} \]
    8. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{neg}\left(t\right) \]
      2. neg-lowering-neg.f6480.8%

        \[\leadsto \mathsf{neg.f64}\left(t\right) \]
    9. Applied egg-rr80.8%

      \[\leadsto \color{blue}{-t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification68.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 2.3 \cdot 10^{+33}:\\ \;\;\;\;\log t \cdot a\\ \mathbf{else}:\\ \;\;\;\;0 - t\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 40.5% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 9 \cdot 10^{-14}:\\ \;\;\;\;\log \left(x + y\right)\\ \mathbf{else}:\\ \;\;\;\;0 - t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= t 9e-14) (log (+ x y)) (- 0.0 t)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= 9e-14) {
		tmp = log((x + y));
	} else {
		tmp = 0.0 - t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (t <= 9d-14) then
        tmp = log((x + y))
    else
        tmp = 0.0d0 - t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= 9e-14) {
		tmp = Math.log((x + y));
	} else {
		tmp = 0.0 - t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if t <= 9e-14:
		tmp = math.log((x + y))
	else:
		tmp = 0.0 - t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (t <= 9e-14)
		tmp = log(Float64(x + y));
	else
		tmp = Float64(0.0 - t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (t <= 9e-14)
		tmp = log((x + y));
	else
		tmp = 0.0 - t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 9e-14], N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision], N[(0.0 - t), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq 9 \cdot 10^{-14}:\\
\;\;\;\;\log \left(x + y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 8.9999999999999995e-14

    1. Initial program 99.5%

      \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
    2. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \color{blue}{\left(a - \frac{1}{2}\right)} \cdot \log t \]
      2. associate-+l+N/A

        \[\leadsto \log \left(x + y\right) + \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\log \left(x + y\right), \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right) \]
      4. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(x + y\right)\right), \left(\color{blue}{\left(\log z - t\right)} + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\left(\color{blue}{\log z} - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      6. associate-+l-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\log z - \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\log z, \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      8. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(\color{blue}{t} - \left(a - \frac{1}{2}\right) \cdot \log t\right)\right)\right) \]
      9. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(t + \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\mathsf{neg}\left(\log t \cdot \left(a - \frac{1}{2}\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\log t \cdot \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\log t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      14. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(0 - \color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right) \]
      16. associate--r-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(0 - a\right) + \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
      17. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(\mathsf{neg}\left(a\right)\right) + \frac{1}{2}\right)\right)\right)\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right)\right)\right)\right)\right) \]
      19. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} - \color{blue}{a}\right)\right)\right)\right)\right) \]
      20. --lowering--.f6499.5%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{a}\right)\right)\right)\right)\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \color{blue}{\left(a \cdot \log t\right)}\right) \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\log t \cdot \color{blue}{a}\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{*.f64}\left(\log t, \color{blue}{a}\right)\right) \]
      3. log-lowering-log.f6462.1%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), a\right)\right) \]
    7. Simplified62.1%

      \[\leadsto \log \left(x + y\right) + \color{blue}{\log t \cdot a} \]
    8. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\log \left(x + y\right)} \]
    9. Step-by-step derivation
      1. log-lowering-log.f64N/A

        \[\leadsto \mathsf{log.f64}\left(\left(x + y\right)\right) \]
      2. +-lowering-+.f649.1%

        \[\leadsto \mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right) \]
    10. Simplified9.1%

      \[\leadsto \color{blue}{\log \left(x + y\right)} \]

    if 8.9999999999999995e-14 < t

    1. Initial program 99.8%

      \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
    2. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \color{blue}{\left(a - \frac{1}{2}\right)} \cdot \log t \]
      2. associate-+l+N/A

        \[\leadsto \log \left(x + y\right) + \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\log \left(x + y\right), \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right) \]
      4. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(x + y\right)\right), \left(\color{blue}{\left(\log z - t\right)} + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\left(\color{blue}{\log z} - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      6. associate-+l-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\log z - \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\log z, \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      8. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(\color{blue}{t} - \left(a - \frac{1}{2}\right) \cdot \log t\right)\right)\right) \]
      9. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(t + \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\mathsf{neg}\left(\log t \cdot \left(a - \frac{1}{2}\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\log t \cdot \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\log t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      14. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(0 - \color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right) \]
      16. associate--r-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(0 - a\right) + \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
      17. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(\mathsf{neg}\left(a\right)\right) + \frac{1}{2}\right)\right)\right)\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right)\right)\right)\right)\right) \]
      19. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} - \color{blue}{a}\right)\right)\right)\right)\right) \]
      20. --lowering--.f6499.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{a}\right)\right)\right)\right)\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf

      \[\leadsto \color{blue}{-1 \cdot t} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(t\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{t} \]
      3. --lowering--.f6472.0%

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{t}\right) \]
    7. Simplified72.0%

      \[\leadsto \color{blue}{0 - t} \]
    8. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{neg}\left(t\right) \]
      2. neg-lowering-neg.f6472.0%

        \[\leadsto \mathsf{neg.f64}\left(t\right) \]
    9. Applied egg-rr72.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 9 \cdot 10^{-14}:\\ \;\;\;\;\log \left(x + y\right)\\ \mathbf{else}:\\ \;\;\;\;0 - t\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 76.8% accurate, 2.9× speedup?

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

\\
\log t \cdot \left(a - 0.5\right) - t
\end{array}
Derivation
  1. Initial program 99.7%

    \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
  2. Add Preprocessing
  3. Taylor expanded in t around inf

    \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(-1 \cdot t\right)}, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(a, \frac{1}{2}\right), \mathsf{log.f64}\left(t\right)\right)\right) \]
  4. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{+.f64}\left(\left(\mathsf{neg}\left(t\right)\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{\_.f64}\left(a, \frac{1}{2}\right)}, \mathsf{log.f64}\left(t\right)\right)\right) \]
    2. neg-sub0N/A

      \[\leadsto \mathsf{+.f64}\left(\left(0 - t\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{\_.f64}\left(a, \frac{1}{2}\right)}, \mathsf{log.f64}\left(t\right)\right)\right) \]
    3. --lowering--.f6480.7%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{\_.f64}\left(0, t\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{\_.f64}\left(a, \frac{1}{2}\right)}, \mathsf{log.f64}\left(t\right)\right)\right) \]
  5. Simplified80.7%

    \[\leadsto \color{blue}{\left(0 - t\right)} + \left(a - 0.5\right) \cdot \log t \]
  6. Final simplification80.7%

    \[\leadsto \log t \cdot \left(a - 0.5\right) - t \]
  7. Add Preprocessing

Alternative 11: 38.9% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 9 \cdot 10^{-14}:\\ \;\;\;\;\log y\\ \mathbf{else}:\\ \;\;\;\;0 - t\\ \end{array} \end{array} \]
(FPCore (x y z t a) :precision binary64 (if (<= t 9e-14) (log y) (- 0.0 t)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= 9e-14) {
		tmp = log(y);
	} else {
		tmp = 0.0 - t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (t <= 9d-14) then
        tmp = log(y)
    else
        tmp = 0.0d0 - t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= 9e-14) {
		tmp = Math.log(y);
	} else {
		tmp = 0.0 - t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if t <= 9e-14:
		tmp = math.log(y)
	else:
		tmp = 0.0 - t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (t <= 9e-14)
		tmp = log(y);
	else
		tmp = Float64(0.0 - t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (t <= 9e-14)
		tmp = log(y);
	else
		tmp = 0.0 - t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 9e-14], N[Log[y], $MachinePrecision], N[(0.0 - t), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq 9 \cdot 10^{-14}:\\
\;\;\;\;\log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 8.9999999999999995e-14

    1. Initial program 99.5%

      \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
    2. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \color{blue}{\left(a - \frac{1}{2}\right)} \cdot \log t \]
      2. associate-+l+N/A

        \[\leadsto \log \left(x + y\right) + \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\log \left(x + y\right), \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right) \]
      4. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(x + y\right)\right), \left(\color{blue}{\left(\log z - t\right)} + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\left(\color{blue}{\log z} - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      6. associate-+l-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\log z - \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\log z, \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      8. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(\color{blue}{t} - \left(a - \frac{1}{2}\right) \cdot \log t\right)\right)\right) \]
      9. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(t + \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\mathsf{neg}\left(\log t \cdot \left(a - \frac{1}{2}\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\log t \cdot \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\log t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      14. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(0 - \color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right) \]
      16. associate--r-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(0 - a\right) + \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
      17. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(\mathsf{neg}\left(a\right)\right) + \frac{1}{2}\right)\right)\right)\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right)\right)\right)\right)\right) \]
      19. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} - \color{blue}{a}\right)\right)\right)\right)\right) \]
      20. --lowering--.f6499.5%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{a}\right)\right)\right)\right)\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\log y}, \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, a\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. log-lowering-log.f6470.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(y\right), \mathsf{\_.f64}\left(\color{blue}{\mathsf{log.f64}\left(z\right)}, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, a\right)\right)\right)\right)\right) \]
    7. Simplified70.4%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(y\right), \color{blue}{\left(-1 \cdot t\right)}\right) \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(y\right), \left(\mathsf{neg}\left(t\right)\right)\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(y\right), \left(0 - \color{blue}{t}\right)\right) \]
      3. --lowering--.f646.5%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(y\right), \mathsf{\_.f64}\left(0, \color{blue}{t}\right)\right) \]
    10. Simplified6.5%

      \[\leadsto \log y + \color{blue}{\left(0 - t\right)} \]
    11. Taylor expanded in t around 0

      \[\leadsto \color{blue}{\log y} \]
    12. Step-by-step derivation
      1. log-lowering-log.f646.5%

        \[\leadsto \mathsf{log.f64}\left(y\right) \]
    13. Simplified6.5%

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

    if 8.9999999999999995e-14 < t

    1. Initial program 99.8%

      \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
    2. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \color{blue}{\left(a - \frac{1}{2}\right)} \cdot \log t \]
      2. associate-+l+N/A

        \[\leadsto \log \left(x + y\right) + \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\log \left(x + y\right), \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right) \]
      4. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(x + y\right)\right), \left(\color{blue}{\left(\log z - t\right)} + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\left(\color{blue}{\log z} - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
      6. associate-+l-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\log z - \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\log z, \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
      8. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(\color{blue}{t} - \left(a - \frac{1}{2}\right) \cdot \log t\right)\right)\right) \]
      9. sub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(t + \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\mathsf{neg}\left(\log t \cdot \left(a - \frac{1}{2}\right)\right)\right)\right)\right)\right) \]
      12. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\log t \cdot \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\log t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
      14. log-lowering-log.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(0 - \color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right) \]
      16. associate--r-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(0 - a\right) + \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
      17. neg-sub0N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(\mathsf{neg}\left(a\right)\right) + \frac{1}{2}\right)\right)\right)\right)\right) \]
      18. +-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right)\right)\right)\right)\right) \]
      19. unsub-negN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} - \color{blue}{a}\right)\right)\right)\right)\right) \]
      20. --lowering--.f6499.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{a}\right)\right)\right)\right)\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf

      \[\leadsto \color{blue}{-1 \cdot t} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(t\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{t} \]
      3. --lowering--.f6472.0%

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{t}\right) \]
    7. Simplified72.0%

      \[\leadsto \color{blue}{0 - t} \]
    8. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{neg}\left(t\right) \]
      2. neg-lowering-neg.f6472.0%

        \[\leadsto \mathsf{neg.f64}\left(t\right) \]
    9. Applied egg-rr72.0%

      \[\leadsto \color{blue}{-t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification43.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 9 \cdot 10^{-14}:\\ \;\;\;\;\log y\\ \mathbf{else}:\\ \;\;\;\;0 - t\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 74.2% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \log t \cdot a - t \end{array} \]
(FPCore (x y z t a) :precision binary64 (- (* (log t) a) t))
double code(double x, double y, double z, double t, double a) {
	return (log(t) * a) - t;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = (log(t) * a) - t
end function
public static double code(double x, double y, double z, double t, double a) {
	return (Math.log(t) * a) - t;
}
def code(x, y, z, t, a):
	return (math.log(t) * a) - t
function code(x, y, z, t, a)
	return Float64(Float64(log(t) * a) - t)
end
function tmp = code(x, y, z, t, a)
	tmp = (log(t) * a) - t;
end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}

\\
\log t \cdot a - t
\end{array}
Derivation
  1. Initial program 99.7%

    \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
  2. Step-by-step derivation
    1. associate--l+N/A

      \[\leadsto \left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \color{blue}{\left(a - \frac{1}{2}\right)} \cdot \log t \]
    2. associate-+l+N/A

      \[\leadsto \log \left(x + y\right) + \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)} \]
    3. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\log \left(x + y\right), \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right) \]
    4. log-lowering-log.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(x + y\right)\right), \left(\color{blue}{\left(\log z - t\right)} + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
    5. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\left(\color{blue}{\log z} - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
    6. associate-+l-N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\log z - \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
    7. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\log z, \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
    8. log-lowering-log.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(\color{blue}{t} - \left(a - \frac{1}{2}\right) \cdot \log t\right)\right)\right) \]
    9. sub-negN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(t + \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
    10. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
    11. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\mathsf{neg}\left(\log t \cdot \left(a - \frac{1}{2}\right)\right)\right)\right)\right)\right) \]
    12. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\log t \cdot \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\log t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
    14. log-lowering-log.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right)\right) \]
    15. neg-sub0N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(0 - \color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right) \]
    16. associate--r-N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(0 - a\right) + \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
    17. neg-sub0N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(\mathsf{neg}\left(a\right)\right) + \frac{1}{2}\right)\right)\right)\right)\right) \]
    18. +-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right)\right)\right)\right)\right) \]
    19. unsub-negN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} - \color{blue}{a}\right)\right)\right)\right)\right) \]
    20. --lowering--.f6499.7%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{a}\right)\right)\right)\right)\right) \]
  3. Simplified99.7%

    \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in x around 0

    \[\leadsto \mathsf{+.f64}\left(\color{blue}{\log y}, \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, a\right)\right)\right)\right)\right) \]
  6. Step-by-step derivation
    1. log-lowering-log.f6474.3%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(y\right), \mathsf{\_.f64}\left(\color{blue}{\mathsf{log.f64}\left(z\right)}, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, a\right)\right)\right)\right)\right) \]
  7. Simplified74.3%

    \[\leadsto \color{blue}{\log y} + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right) \]
  8. Step-by-step derivation
    1. associate-+r-N/A

      \[\leadsto \left(\log y + \log z\right) - \color{blue}{\left(t + \log t \cdot \left(\frac{1}{2} - a\right)\right)} \]
    2. +-commutativeN/A

      \[\leadsto \left(\log y + \log z\right) - \left(\log t \cdot \left(\frac{1}{2} - a\right) + \color{blue}{t}\right) \]
    3. associate--r+N/A

      \[\leadsto \left(\left(\log y + \log z\right) - \log t \cdot \left(\frac{1}{2} - a\right)\right) - \color{blue}{t} \]
    4. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\left(\left(\log y + \log z\right) - \log t \cdot \left(\frac{1}{2} - a\right)\right), \color{blue}{t}\right) \]
    5. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\left(\log y + \log z\right), \left(\log t \cdot \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
    6. sum-logN/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\log \left(y \cdot z\right), \left(\log t \cdot \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
    7. log-lowering-log.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(\left(y \cdot z\right)\right), \left(\log t \cdot \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \left(\log t \cdot \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(\log t, \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
    10. log-lowering-log.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} - a\right)\right)\right), t\right) \]
    11. --lowering--.f6455.8%

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, a\right)\right)\right), t\right) \]
  9. Applied egg-rr55.8%

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

    \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(a \cdot \log t\right)}, t\right) \]
  11. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{\_.f64}\left(\left(\log t \cdot a\right), t\right) \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\log t, a\right), t\right) \]
    3. log-lowering-log.f6478.7%

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), a\right), t\right) \]
  12. Simplified78.7%

    \[\leadsto \color{blue}{\log t \cdot a} - t \]
  13. Add Preprocessing

Alternative 13: 37.2% accurate, 104.3× speedup?

\[\begin{array}{l} \\ 0 - t \end{array} \]
(FPCore (x y z t a) :precision binary64 (- 0.0 t))
double code(double x, double y, double z, double t, double a) {
	return 0.0 - t;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = 0.0d0 - t
end function
public static double code(double x, double y, double z, double t, double a) {
	return 0.0 - t;
}
def code(x, y, z, t, a):
	return 0.0 - t
function code(x, y, z, t, a)
	return Float64(0.0 - t)
end
function tmp = code(x, y, z, t, a)
	tmp = 0.0 - t;
end
code[x_, y_, z_, t_, a_] := N[(0.0 - t), $MachinePrecision]
\begin{array}{l}

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

    \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
  2. Step-by-step derivation
    1. associate--l+N/A

      \[\leadsto \left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \color{blue}{\left(a - \frac{1}{2}\right)} \cdot \log t \]
    2. associate-+l+N/A

      \[\leadsto \log \left(x + y\right) + \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)} \]
    3. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\log \left(x + y\right), \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right) \]
    4. log-lowering-log.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(x + y\right)\right), \left(\color{blue}{\left(\log z - t\right)} + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
    5. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\left(\color{blue}{\log z} - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
    6. associate-+l-N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\log z - \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
    7. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\log z, \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
    8. log-lowering-log.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(\color{blue}{t} - \left(a - \frac{1}{2}\right) \cdot \log t\right)\right)\right) \]
    9. sub-negN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(t + \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
    10. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
    11. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\mathsf{neg}\left(\log t \cdot \left(a - \frac{1}{2}\right)\right)\right)\right)\right)\right) \]
    12. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\log t \cdot \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\log t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
    14. log-lowering-log.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right)\right) \]
    15. neg-sub0N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(0 - \color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right) \]
    16. associate--r-N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(0 - a\right) + \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
    17. neg-sub0N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(\mathsf{neg}\left(a\right)\right) + \frac{1}{2}\right)\right)\right)\right)\right) \]
    18. +-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right)\right)\right)\right)\right) \]
    19. unsub-negN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} - \color{blue}{a}\right)\right)\right)\right)\right) \]
    20. --lowering--.f6499.7%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{a}\right)\right)\right)\right)\right) \]
  3. Simplified99.7%

    \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in t around inf

    \[\leadsto \color{blue}{-1 \cdot t} \]
  6. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{neg}\left(t\right) \]
    2. neg-sub0N/A

      \[\leadsto 0 - \color{blue}{t} \]
    3. --lowering--.f6441.7%

      \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{t}\right) \]
  7. Simplified41.7%

    \[\leadsto \color{blue}{0 - t} \]
  8. Step-by-step derivation
    1. sub0-negN/A

      \[\leadsto \mathsf{neg}\left(t\right) \]
    2. neg-lowering-neg.f6441.7%

      \[\leadsto \mathsf{neg.f64}\left(t\right) \]
  9. Applied egg-rr41.7%

    \[\leadsto \color{blue}{-t} \]
  10. Final simplification41.7%

    \[\leadsto 0 - t \]
  11. Add Preprocessing

Alternative 14: 2.5% accurate, 313.0× speedup?

\[\begin{array}{l} \\ t \end{array} \]
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
	return t;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = t
end function
public static double code(double x, double y, double z, double t, double a) {
	return t;
}
def code(x, y, z, t, a):
	return t
function code(x, y, z, t, a)
	return t
end
function tmp = code(x, y, z, t, a)
	tmp = t;
end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}

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

    \[\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t \]
  2. Step-by-step derivation
    1. associate--l+N/A

      \[\leadsto \left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \color{blue}{\left(a - \frac{1}{2}\right)} \cdot \log t \]
    2. associate-+l+N/A

      \[\leadsto \log \left(x + y\right) + \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)} \]
    3. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\log \left(x + y\right), \color{blue}{\left(\left(\log z - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right) \]
    4. log-lowering-log.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\left(x + y\right)\right), \left(\color{blue}{\left(\log z - t\right)} + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
    5. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\left(\color{blue}{\log z} - t\right) + \left(a - \frac{1}{2}\right) \cdot \log t\right)\right) \]
    6. associate-+l-N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \left(\log z - \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
    7. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\log z, \color{blue}{\left(t - \left(a - \frac{1}{2}\right) \cdot \log t\right)}\right)\right) \]
    8. log-lowering-log.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(\color{blue}{t} - \left(a - \frac{1}{2}\right) \cdot \log t\right)\right)\right) \]
    9. sub-negN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \left(t + \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
    10. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right) \cdot \log t\right)\right)}\right)\right)\right) \]
    11. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\mathsf{neg}\left(\log t \cdot \left(a - \frac{1}{2}\right)\right)\right)\right)\right)\right) \]
    12. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \left(\log t \cdot \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\log t, \color{blue}{\left(\mathsf{neg}\left(\left(a - \frac{1}{2}\right)\right)\right)}\right)\right)\right)\right) \]
    14. log-lowering-log.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\mathsf{neg}\left(\color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right)\right) \]
    15. neg-sub0N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(0 - \color{blue}{\left(a - \frac{1}{2}\right)}\right)\right)\right)\right)\right) \]
    16. associate--r-N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(0 - a\right) + \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
    17. neg-sub0N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\left(\mathsf{neg}\left(a\right)\right) + \frac{1}{2}\right)\right)\right)\right)\right) \]
    18. +-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right)\right)\right)\right)\right) \]
    19. unsub-negN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \left(\frac{1}{2} - \color{blue}{a}\right)\right)\right)\right)\right) \]
    20. --lowering--.f6499.7%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(\mathsf{log.f64}\left(z\right), \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{a}\right)\right)\right)\right)\right) \]
  3. Simplified99.7%

    \[\leadsto \color{blue}{\log \left(x + y\right) + \left(\log z - \left(t + \log t \cdot \left(0.5 - a\right)\right)\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in t around inf

    \[\leadsto \color{blue}{-1 \cdot t} \]
  6. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{neg}\left(t\right) \]
    2. neg-sub0N/A

      \[\leadsto 0 - \color{blue}{t} \]
    3. --lowering--.f6441.7%

      \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{t}\right) \]
  7. Simplified41.7%

    \[\leadsto \color{blue}{0 - t} \]
  8. Step-by-step derivation
    1. sub0-negN/A

      \[\leadsto \mathsf{neg}\left(t\right) \]
    2. neg-lowering-neg.f6441.7%

      \[\leadsto \mathsf{neg.f64}\left(t\right) \]
  9. Applied egg-rr41.7%

    \[\leadsto \color{blue}{-t} \]
  10. Step-by-step derivation
    1. neg-sub0N/A

      \[\leadsto 0 - \color{blue}{t} \]
    2. flip3--N/A

      \[\leadsto \frac{{0}^{3} - {t}^{3}}{\color{blue}{0 \cdot 0 + \left(t \cdot t + 0 \cdot t\right)}} \]
    3. metadata-evalN/A

      \[\leadsto \frac{0 - {t}^{3}}{\color{blue}{0} \cdot 0 + \left(t \cdot t + 0 \cdot t\right)} \]
    4. sub0-negN/A

      \[\leadsto \frac{\mathsf{neg}\left({t}^{3}\right)}{\color{blue}{0 \cdot 0} + \left(t \cdot t + 0 \cdot t\right)} \]
    5. cube-negN/A

      \[\leadsto \frac{{\left(\mathsf{neg}\left(t\right)\right)}^{3}}{\color{blue}{0 \cdot 0} + \left(t \cdot t + 0 \cdot t\right)} \]
    6. sqr-powN/A

      \[\leadsto \frac{{\left(\mathsf{neg}\left(t\right)\right)}^{\left(\frac{3}{2}\right)} \cdot {\left(\mathsf{neg}\left(t\right)\right)}^{\left(\frac{3}{2}\right)}}{\color{blue}{0 \cdot 0} + \left(t \cdot t + 0 \cdot t\right)} \]
    7. pow-prod-downN/A

      \[\leadsto \frac{{\left(\left(\mathsf{neg}\left(t\right)\right) \cdot \left(\mathsf{neg}\left(t\right)\right)\right)}^{\left(\frac{3}{2}\right)}}{\color{blue}{0 \cdot 0} + \left(t \cdot t + 0 \cdot t\right)} \]
    8. sqr-negN/A

      \[\leadsto \frac{{\left(t \cdot t\right)}^{\left(\frac{3}{2}\right)}}{\color{blue}{0} \cdot 0 + \left(t \cdot t + 0 \cdot t\right)} \]
    9. pow-prod-downN/A

      \[\leadsto \frac{{t}^{\left(\frac{3}{2}\right)} \cdot {t}^{\left(\frac{3}{2}\right)}}{\color{blue}{0 \cdot 0} + \left(t \cdot t + 0 \cdot t\right)} \]
    10. sqr-powN/A

      \[\leadsto \frac{{t}^{3}}{\color{blue}{0 \cdot 0} + \left(t \cdot t + 0 \cdot t\right)} \]
    11. metadata-evalN/A

      \[\leadsto \frac{{t}^{3}}{0 + \left(\color{blue}{t \cdot t} + 0 \cdot t\right)} \]
    12. +-lft-identityN/A

      \[\leadsto \frac{{t}^{3}}{t \cdot t + \color{blue}{0 \cdot t}} \]
    13. distribute-rgt-outN/A

      \[\leadsto \frac{{t}^{3}}{t \cdot \color{blue}{\left(t + 0\right)}} \]
    14. +-commutativeN/A

      \[\leadsto \frac{{t}^{3}}{t \cdot \left(0 + \color{blue}{t}\right)} \]
    15. +-lft-identityN/A

      \[\leadsto \frac{{t}^{3}}{t \cdot t} \]
    16. pow2N/A

      \[\leadsto \frac{{t}^{3}}{{t}^{\color{blue}{2}}} \]
    17. pow-divN/A

      \[\leadsto {t}^{\color{blue}{\left(3 - 2\right)}} \]
    18. metadata-evalN/A

      \[\leadsto {t}^{1} \]
    19. metadata-evalN/A

      \[\leadsto {t}^{\left(\mathsf{neg}\left(-1\right)\right)} \]
    20. pow-flipN/A

      \[\leadsto \frac{1}{\color{blue}{{t}^{-1}}} \]
    21. inv-powN/A

      \[\leadsto \frac{1}{\frac{1}{\color{blue}{t}}} \]
    22. clear-numN/A

      \[\leadsto \frac{t}{\color{blue}{1}} \]
    23. /-rgt-identity2.3%

      \[\leadsto t \]
  11. Applied egg-rr2.3%

    \[\leadsto \color{blue}{t} \]
  12. Add Preprocessing

Developer Target 1: 99.6% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2024140 
(FPCore (x y z t a)
  :name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
  :precision binary64

  :alt
  (! :herbie-platform default (+ (log (+ x y)) (+ (- (log z) t) (* (- a 1/2) (log t)))))

  (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))