Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, A

Percentage Accurate: 99.9% → 99.9%
Time: 9.4s
Alternatives: 11
Speedup: 1.0×

Specification

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

\\
\left(\left(x \cdot \log y - y\right) - z\right) + \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 11 alternatives:

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

    \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
  2. Add Preprocessing
  3. Final simplification99.9%

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

Alternative 2: 90.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x - y\\ t_2 := \mathsf{fma}\left(\log y, x, \log t\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+172}:\\ \;\;\;\;t\_2 - y\\ \mathbf{elif}\;t\_1 \leq -5000:\\ \;\;\;\;\left(\log t - y\right) - z\\ \mathbf{else}:\\ \;\;\;\;t\_2 - z\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* (log y) x) y)) (t_2 (fma (log y) x (log t))))
   (if (<= t_1 -5e+172)
     (- t_2 y)
     (if (<= t_1 -5000.0) (- (- (log t) y) z) (- t_2 z)))))
double code(double x, double y, double z, double t) {
	double t_1 = (log(y) * x) - y;
	double t_2 = fma(log(y), x, log(t));
	double tmp;
	if (t_1 <= -5e+172) {
		tmp = t_2 - y;
	} else if (t_1 <= -5000.0) {
		tmp = (log(t) - y) - z;
	} else {
		tmp = t_2 - z;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(log(y) * x) - y)
	t_2 = fma(log(y), x, log(t))
	tmp = 0.0
	if (t_1 <= -5e+172)
		tmp = Float64(t_2 - y);
	elseif (t_1 <= -5000.0)
		tmp = Float64(Float64(log(t) - y) - z);
	else
		tmp = Float64(t_2 - z);
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[y], $MachinePrecision] * x + N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+172], N[(t$95$2 - y), $MachinePrecision], If[LessEqual[t$95$1, -5000.0], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], N[(t$95$2 - z), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \log y \cdot x - y\\
t_2 := \mathsf{fma}\left(\log y, x, \log t\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+172}:\\
\;\;\;\;t\_2 - y\\

\mathbf{elif}\;t\_1 \leq -5000:\\
\;\;\;\;\left(\log t - y\right) - z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (*.f64 x (log.f64 y)) y) < -5.0000000000000001e172

    1. Initial program 100.0%

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot \log y + \log t\right)} - y \]
      3. *-commutativeN/A

        \[\leadsto \left(\color{blue}{\log y \cdot x} + \log t\right) - y \]
      4. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right)} - y \]
      5. lower-log.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\log y}, x, \log t\right) - y \]
      6. lower-log.f6489.1

        \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\log t}\right) - y \]
    5. Applied rewrites89.1%

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

    if -5.0000000000000001e172 < (-.f64 (*.f64 x (log.f64 y)) y) < -5e3

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
      2. lower--.f64N/A

        \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
      3. lower--.f64N/A

        \[\leadsto \color{blue}{\left(\log t - y\right)} - z \]
      4. lower-log.f6487.4

        \[\leadsto \left(\color{blue}{\log t} - y\right) - z \]
    5. Applied rewrites87.4%

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

    if -5e3 < (-.f64 (*.f64 x (log.f64 y)) y)

    1. Initial program 99.9%

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot \log y + \log t\right)} - z \]
      3. *-commutativeN/A

        \[\leadsto \left(\color{blue}{\log y \cdot x} + \log t\right) - z \]
      4. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right)} - z \]
      5. lower-log.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\log y}, x, \log t\right) - z \]
      6. lower-log.f6499.5

        \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\log t}\right) - z \]
    5. Applied rewrites99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right) - z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification93.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\log y \cdot x - y \leq -5 \cdot 10^{+172}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right) - y\\ \mathbf{elif}\;\log y \cdot x - y \leq -5000:\\ \;\;\;\;\left(\log t - y\right) - z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right) - z\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 69.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := \left(\log y \cdot x - y\right) - z\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+29}:\\
\;\;\;\;\left(-y\right) - z\\

\mathbf{elif}\;t\_1 \leq 500000000000:\\
\;\;\;\;\log t - y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -5.0000000000000001e29

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
      2. lower--.f64N/A

        \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
      3. lower--.f64N/A

        \[\leadsto \color{blue}{\left(\log t - y\right)} - z \]
      4. lower-log.f6478.5

        \[\leadsto \left(\color{blue}{\log t} - y\right) - z \]
    5. Applied rewrites78.5%

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

      \[\leadsto -1 \cdot y - z \]
    7. Step-by-step derivation
      1. Applied rewrites78.5%

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

      if -5.0000000000000001e29 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 5e11

      1. Initial program 99.9%

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

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

          \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
        2. lower--.f64N/A

          \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
        3. lower--.f64N/A

          \[\leadsto \color{blue}{\left(\log t - y\right)} - z \]
        4. lower-log.f6490.8

          \[\leadsto \left(\color{blue}{\log t} - y\right) - z \]
      5. Applied rewrites90.8%

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

        \[\leadsto \log t - \color{blue}{y} \]
      7. Step-by-step derivation
        1. Applied rewrites86.7%

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

        if 5e11 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z)

        1. Initial program 99.8%

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

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

            \[\leadsto \color{blue}{\mathsf{neg}\left(z\right)} \]
          2. lower-neg.f6458.7

            \[\leadsto \color{blue}{-z} \]
        5. Applied rewrites58.7%

          \[\leadsto \color{blue}{-z} \]
      8. Recombined 3 regimes into one program.
      9. Final simplification74.8%

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

      Alternative 4: 79.1% accurate, 0.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ t_2 := t\_1 - y\\ \mathbf{if}\;t\_2 \leq -5000:\\ \;\;\;\;\left(-y\right) - z\\ \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+103}:\\ \;\;\;\;\log t - z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* (log y) x)) (t_2 (- t_1 y)))
         (if (<= t_2 -5000.0) (- (- y) z) (if (<= t_2 4e+103) (- (log t) z) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = log(y) * x;
      	double t_2 = t_1 - y;
      	double tmp;
      	if (t_2 <= -5000.0) {
      		tmp = -y - z;
      	} else if (t_2 <= 4e+103) {
      		tmp = log(t) - z;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8) :: t_1
          real(8) :: t_2
          real(8) :: tmp
          t_1 = log(y) * x
          t_2 = t_1 - y
          if (t_2 <= (-5000.0d0)) then
              tmp = -y - z
          else if (t_2 <= 4d+103) then
              tmp = log(t) - z
          else
              tmp = t_1
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t) {
      	double t_1 = Math.log(y) * x;
      	double t_2 = t_1 - y;
      	double tmp;
      	if (t_2 <= -5000.0) {
      		tmp = -y - z;
      	} else if (t_2 <= 4e+103) {
      		tmp = Math.log(t) - z;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	t_1 = math.log(y) * x
      	t_2 = t_1 - y
      	tmp = 0
      	if t_2 <= -5000.0:
      		tmp = -y - z
      	elif t_2 <= 4e+103:
      		tmp = math.log(t) - z
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t)
      	t_1 = Float64(log(y) * x)
      	t_2 = Float64(t_1 - y)
      	tmp = 0.0
      	if (t_2 <= -5000.0)
      		tmp = Float64(Float64(-y) - z);
      	elseif (t_2 <= 4e+103)
      		tmp = Float64(log(t) - z);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	t_1 = log(y) * x;
      	t_2 = t_1 - y;
      	tmp = 0.0;
      	if (t_2 <= -5000.0)
      		tmp = -y - z;
      	elseif (t_2 <= 4e+103)
      		tmp = log(t) - z;
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -5000.0], N[((-y) - z), $MachinePrecision], If[LessEqual[t$95$2, 4e+103], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \log y \cdot x\\
      t_2 := t\_1 - y\\
      \mathbf{if}\;t\_2 \leq -5000:\\
      \;\;\;\;\left(-y\right) - z\\
      
      \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+103}:\\
      \;\;\;\;\log t - z\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (-.f64 (*.f64 x (log.f64 y)) y) < -5e3

        1. Initial program 100.0%

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

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

            \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
          2. lower--.f64N/A

            \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
          3. lower--.f64N/A

            \[\leadsto \color{blue}{\left(\log t - y\right)} - z \]
          4. lower-log.f6478.1

            \[\leadsto \left(\color{blue}{\log t} - y\right) - z \]
        5. Applied rewrites78.1%

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

          \[\leadsto -1 \cdot y - z \]
        7. Step-by-step derivation
          1. Applied rewrites76.7%

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

          if -5e3 < (-.f64 (*.f64 x (log.f64 y)) y) < 4e103

          1. Initial program 100.0%

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

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

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

              \[\leadsto \color{blue}{\left(x \cdot \log y + \log t\right)} - z \]
            3. *-commutativeN/A

              \[\leadsto \left(\color{blue}{\log y \cdot x} + \log t\right) - z \]
            4. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right)} - z \]
            5. lower-log.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\log y}, x, \log t\right) - z \]
            6. lower-log.f6499.7

              \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\log t}\right) - z \]
          5. Applied rewrites99.7%

            \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right) - z} \]
          6. Taylor expanded in x around 0

            \[\leadsto \log t - z \]
          7. Step-by-step derivation
            1. Applied rewrites94.3%

              \[\leadsto \log t - z \]

            if 4e103 < (-.f64 (*.f64 x (log.f64 y)) y)

            1. Initial program 99.7%

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

              \[\leadsto \color{blue}{x \cdot \log y} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{\log y \cdot x} \]
              2. lower-*.f64N/A

                \[\leadsto \color{blue}{\log y \cdot x} \]
              3. lower-log.f6476.6

                \[\leadsto \color{blue}{\log y} \cdot x \]
            5. Applied rewrites76.6%

              \[\leadsto \color{blue}{\log y \cdot x} \]
          8. Recombined 3 regimes into one program.
          9. Final simplification82.2%

            \[\leadsto \begin{array}{l} \mathbf{if}\;\log y \cdot x - y \leq -5000:\\ \;\;\;\;\left(-y\right) - z\\ \mathbf{elif}\;\log y \cdot x - y \leq 4 \cdot 10^{+103}:\\ \;\;\;\;\log t - z\\ \mathbf{else}:\\ \;\;\;\;\log y \cdot x\\ \end{array} \]
          10. Add Preprocessing

          Alternative 5: 70.6% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\log y \cdot x - y \leq -5000:\\ \;\;\;\;\left(-y\right) - z\\ \mathbf{else}:\\ \;\;\;\;\log t - z\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (if (<= (- (* (log y) x) y) -5000.0) (- (- y) z) (- (log t) z)))
          double code(double x, double y, double z, double t) {
          	double tmp;
          	if (((log(y) * x) - y) <= -5000.0) {
          		tmp = -y - z;
          	} else {
          		tmp = log(t) - z;
          	}
          	return tmp;
          }
          
          real(8) function code(x, y, z, t)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: t
              real(8) :: tmp
              if (((log(y) * x) - y) <= (-5000.0d0)) then
                  tmp = -y - z
              else
                  tmp = log(t) - z
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t) {
          	double tmp;
          	if (((Math.log(y) * x) - y) <= -5000.0) {
          		tmp = -y - z;
          	} else {
          		tmp = Math.log(t) - z;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t):
          	tmp = 0
          	if ((math.log(y) * x) - y) <= -5000.0:
          		tmp = -y - z
          	else:
          		tmp = math.log(t) - z
          	return tmp
          
          function code(x, y, z, t)
          	tmp = 0.0
          	if (Float64(Float64(log(y) * x) - y) <= -5000.0)
          		tmp = Float64(Float64(-y) - z);
          	else
          		tmp = Float64(log(t) - z);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t)
          	tmp = 0.0;
          	if (((log(y) * x) - y) <= -5000.0)
          		tmp = -y - z;
          	else
          		tmp = log(t) - z;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_] := If[LessEqual[N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - y), $MachinePrecision], -5000.0], N[((-y) - z), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;\log y \cdot x - y \leq -5000:\\
          \;\;\;\;\left(-y\right) - z\\
          
          \mathbf{else}:\\
          \;\;\;\;\log t - z\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (-.f64 (*.f64 x (log.f64 y)) y) < -5e3

            1. Initial program 100.0%

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

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

                \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
              2. lower--.f64N/A

                \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
              3. lower--.f64N/A

                \[\leadsto \color{blue}{\left(\log t - y\right)} - z \]
              4. lower-log.f6478.1

                \[\leadsto \left(\color{blue}{\log t} - y\right) - z \]
            5. Applied rewrites78.1%

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

              \[\leadsto -1 \cdot y - z \]
            7. Step-by-step derivation
              1. Applied rewrites76.7%

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

              if -5e3 < (-.f64 (*.f64 x (log.f64 y)) y)

              1. Initial program 99.9%

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

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

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

                  \[\leadsto \color{blue}{\left(x \cdot \log y + \log t\right)} - z \]
                3. *-commutativeN/A

                  \[\leadsto \left(\color{blue}{\log y \cdot x} + \log t\right) - z \]
                4. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right)} - z \]
                5. lower-log.f64N/A

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\log y}, x, \log t\right) - z \]
                6. lower-log.f6499.5

                  \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\log t}\right) - z \]
              5. Applied rewrites99.5%

                \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right) - z} \]
              6. Taylor expanded in x around 0

                \[\leadsto \log t - z \]
              7. Step-by-step derivation
                1. Applied rewrites72.1%

                  \[\leadsto \log t - z \]
              8. Recombined 2 regimes into one program.
              9. Final simplification74.7%

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

              Alternative 6: 87.5% accurate, 1.0× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.85 \cdot 10^{+147}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right) - y\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{+127}:\\ \;\;\;\;\left(\log t - y\right) - z\\ \mathbf{else}:\\ \;\;\;\;\log y \cdot x - z\\ \end{array} \end{array} \]
              (FPCore (x y z t)
               :precision binary64
               (if (<= x -2.85e+147)
                 (- (fma (log y) x (log t)) y)
                 (if (<= x 1.8e+127) (- (- (log t) y) z) (- (* (log y) x) z))))
              double code(double x, double y, double z, double t) {
              	double tmp;
              	if (x <= -2.85e+147) {
              		tmp = fma(log(y), x, log(t)) - y;
              	} else if (x <= 1.8e+127) {
              		tmp = (log(t) - y) - z;
              	} else {
              		tmp = (log(y) * x) - z;
              	}
              	return tmp;
              }
              
              function code(x, y, z, t)
              	tmp = 0.0
              	if (x <= -2.85e+147)
              		tmp = Float64(fma(log(y), x, log(t)) - y);
              	elseif (x <= 1.8e+127)
              		tmp = Float64(Float64(log(t) - y) - z);
              	else
              		tmp = Float64(Float64(log(y) * x) - z);
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_] := If[LessEqual[x, -2.85e+147], N[(N[(N[Log[y], $MachinePrecision] * x + N[Log[t], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 1.8e+127], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - z), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;x \leq -2.85 \cdot 10^{+147}:\\
              \;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right) - y\\
              
              \mathbf{elif}\;x \leq 1.8 \cdot 10^{+127}:\\
              \;\;\;\;\left(\log t - y\right) - z\\
              
              \mathbf{else}:\\
              \;\;\;\;\log y \cdot x - z\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if x < -2.84999999999999996e147

                1. Initial program 99.9%

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

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

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

                    \[\leadsto \color{blue}{\left(x \cdot \log y + \log t\right)} - y \]
                  3. *-commutativeN/A

                    \[\leadsto \left(\color{blue}{\log y \cdot x} + \log t\right) - y \]
                  4. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right)} - y \]
                  5. lower-log.f64N/A

                    \[\leadsto \mathsf{fma}\left(\color{blue}{\log y}, x, \log t\right) - y \]
                  6. lower-log.f6484.8

                    \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\log t}\right) - y \]
                5. Applied rewrites84.8%

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

                if -2.84999999999999996e147 < x < 1.79999999999999989e127

                1. Initial program 100.0%

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

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

                    \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
                  2. lower--.f64N/A

                    \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
                  3. lower--.f64N/A

                    \[\leadsto \color{blue}{\left(\log t - y\right)} - z \]
                  4. lower-log.f6493.9

                    \[\leadsto \left(\color{blue}{\log t} - y\right) - z \]
                5. Applied rewrites93.9%

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

                if 1.79999999999999989e127 < x

                1. Initial program 99.8%

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

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

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

                    \[\leadsto \color{blue}{\left(x \cdot \log y + \log t\right)} - z \]
                  3. *-commutativeN/A

                    \[\leadsto \left(\color{blue}{\log y \cdot x} + \log t\right) - z \]
                  4. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right)} - z \]
                  5. lower-log.f64N/A

                    \[\leadsto \mathsf{fma}\left(\color{blue}{\log y}, x, \log t\right) - z \]
                  6. lower-log.f6491.5

                    \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\log t}\right) - z \]
                5. Applied rewrites91.5%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right) - z} \]
                6. Taylor expanded in x around inf

                  \[\leadsto x \cdot \log y - z \]
                7. Step-by-step derivation
                  1. Applied rewrites91.5%

                    \[\leadsto \log y \cdot x - z \]
                8. Recombined 3 regimes into one program.
                9. Add Preprocessing

                Alternative 7: 85.7% accurate, 1.8× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x - z\\ \mathbf{if}\;x \leq -9.2 \cdot 10^{+206}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{+127}:\\ \;\;\;\;\left(\log t - y\right) - z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                (FPCore (x y z t)
                 :precision binary64
                 (let* ((t_1 (- (* (log y) x) z)))
                   (if (<= x -9.2e+206) t_1 (if (<= x 1.8e+127) (- (- (log t) y) z) t_1))))
                double code(double x, double y, double z, double t) {
                	double t_1 = (log(y) * x) - z;
                	double tmp;
                	if (x <= -9.2e+206) {
                		tmp = t_1;
                	} else if (x <= 1.8e+127) {
                		tmp = (log(t) - y) - z;
                	} else {
                		tmp = t_1;
                	}
                	return tmp;
                }
                
                real(8) function code(x, y, z, t)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8), intent (in) :: t
                    real(8) :: t_1
                    real(8) :: tmp
                    t_1 = (log(y) * x) - z
                    if (x <= (-9.2d+206)) then
                        tmp = t_1
                    else if (x <= 1.8d+127) then
                        tmp = (log(t) - y) - z
                    else
                        tmp = t_1
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z, double t) {
                	double t_1 = (Math.log(y) * x) - z;
                	double tmp;
                	if (x <= -9.2e+206) {
                		tmp = t_1;
                	} else if (x <= 1.8e+127) {
                		tmp = (Math.log(t) - y) - z;
                	} else {
                		tmp = t_1;
                	}
                	return tmp;
                }
                
                def code(x, y, z, t):
                	t_1 = (math.log(y) * x) - z
                	tmp = 0
                	if x <= -9.2e+206:
                		tmp = t_1
                	elif x <= 1.8e+127:
                		tmp = (math.log(t) - y) - z
                	else:
                		tmp = t_1
                	return tmp
                
                function code(x, y, z, t)
                	t_1 = Float64(Float64(log(y) * x) - z)
                	tmp = 0.0
                	if (x <= -9.2e+206)
                		tmp = t_1;
                	elseif (x <= 1.8e+127)
                		tmp = Float64(Float64(log(t) - y) - z);
                	else
                		tmp = t_1;
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z, t)
                	t_1 = (log(y) * x) - z;
                	tmp = 0.0;
                	if (x <= -9.2e+206)
                		tmp = t_1;
                	elseif (x <= 1.8e+127)
                		tmp = (log(t) - y) - z;
                	else
                		tmp = t_1;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[x, -9.2e+206], t$95$1, If[LessEqual[x, 1.8e+127], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], t$95$1]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_1 := \log y \cdot x - z\\
                \mathbf{if}\;x \leq -9.2 \cdot 10^{+206}:\\
                \;\;\;\;t\_1\\
                
                \mathbf{elif}\;x \leq 1.8 \cdot 10^{+127}:\\
                \;\;\;\;\left(\log t - y\right) - z\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_1\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if x < -9.20000000000000064e206 or 1.79999999999999989e127 < x

                  1. Initial program 99.8%

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

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

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

                      \[\leadsto \color{blue}{\left(x \cdot \log y + \log t\right)} - z \]
                    3. *-commutativeN/A

                      \[\leadsto \left(\color{blue}{\log y \cdot x} + \log t\right) - z \]
                    4. lower-fma.f64N/A

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right)} - z \]
                    5. lower-log.f64N/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\log y}, x, \log t\right) - z \]
                    6. lower-log.f6491.8

                      \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\log t}\right) - z \]
                  5. Applied rewrites91.8%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right) - z} \]
                  6. Taylor expanded in x around inf

                    \[\leadsto x \cdot \log y - z \]
                  7. Step-by-step derivation
                    1. Applied rewrites91.8%

                      \[\leadsto \log y \cdot x - z \]

                    if -9.20000000000000064e206 < x < 1.79999999999999989e127

                    1. Initial program 100.0%

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

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

                        \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
                      2. lower--.f64N/A

                        \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
                      3. lower--.f64N/A

                        \[\leadsto \color{blue}{\left(\log t - y\right)} - z \]
                      4. lower-log.f6492.3

                        \[\leadsto \left(\color{blue}{\log t} - y\right) - z \]
                    5. Applied rewrites92.3%

                      \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
                  8. Recombined 2 regimes into one program.
                  9. Add Preprocessing

                  Alternative 8: 81.9% accurate, 1.8× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ \mathbf{if}\;x \leq -3.4 \cdot 10^{+229}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 7 \cdot 10^{+134}:\\ \;\;\;\;\left(\log t - y\right) - z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                  (FPCore (x y z t)
                   :precision binary64
                   (let* ((t_1 (* (log y) x)))
                     (if (<= x -3.4e+229) t_1 (if (<= x 7e+134) (- (- (log t) y) z) t_1))))
                  double code(double x, double y, double z, double t) {
                  	double t_1 = log(y) * x;
                  	double tmp;
                  	if (x <= -3.4e+229) {
                  		tmp = t_1;
                  	} else if (x <= 7e+134) {
                  		tmp = (log(t) - y) - z;
                  	} else {
                  		tmp = t_1;
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(x, y, z, t)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8), intent (in) :: t
                      real(8) :: t_1
                      real(8) :: tmp
                      t_1 = log(y) * x
                      if (x <= (-3.4d+229)) then
                          tmp = t_1
                      else if (x <= 7d+134) then
                          tmp = (log(t) - y) - z
                      else
                          tmp = t_1
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z, double t) {
                  	double t_1 = Math.log(y) * x;
                  	double tmp;
                  	if (x <= -3.4e+229) {
                  		tmp = t_1;
                  	} else if (x <= 7e+134) {
                  		tmp = (Math.log(t) - y) - z;
                  	} else {
                  		tmp = t_1;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t):
                  	t_1 = math.log(y) * x
                  	tmp = 0
                  	if x <= -3.4e+229:
                  		tmp = t_1
                  	elif x <= 7e+134:
                  		tmp = (math.log(t) - y) - z
                  	else:
                  		tmp = t_1
                  	return tmp
                  
                  function code(x, y, z, t)
                  	t_1 = Float64(log(y) * x)
                  	tmp = 0.0
                  	if (x <= -3.4e+229)
                  		tmp = t_1;
                  	elseif (x <= 7e+134)
                  		tmp = Float64(Float64(log(t) - y) - z);
                  	else
                  		tmp = t_1;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t)
                  	t_1 = log(y) * x;
                  	tmp = 0.0;
                  	if (x <= -3.4e+229)
                  		tmp = t_1;
                  	elseif (x <= 7e+134)
                  		tmp = (log(t) - y) - z;
                  	else
                  		tmp = t_1;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -3.4e+229], t$95$1, If[LessEqual[x, 7e+134], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], t$95$1]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_1 := \log y \cdot x\\
                  \mathbf{if}\;x \leq -3.4 \cdot 10^{+229}:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{elif}\;x \leq 7 \cdot 10^{+134}:\\
                  \;\;\;\;\left(\log t - y\right) - z\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_1\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if x < -3.4000000000000001e229 or 7.00000000000000006e134 < x

                    1. Initial program 99.8%

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

                      \[\leadsto \color{blue}{x \cdot \log y} \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto \color{blue}{\log y \cdot x} \]
                      2. lower-*.f64N/A

                        \[\leadsto \color{blue}{\log y \cdot x} \]
                      3. lower-log.f6479.7

                        \[\leadsto \color{blue}{\log y} \cdot x \]
                    5. Applied rewrites79.7%

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

                    if -3.4000000000000001e229 < x < 7.00000000000000006e134

                    1. Initial program 100.0%

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

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

                        \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
                      2. lower--.f64N/A

                        \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
                      3. lower--.f64N/A

                        \[\leadsto \color{blue}{\left(\log t - y\right)} - z \]
                      4. lower-log.f6491.4

                        \[\leadsto \left(\color{blue}{\log t} - y\right) - z \]
                    5. Applied rewrites91.4%

                      \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
                  3. Recombined 2 regimes into one program.
                  4. Add Preprocessing

                  Alternative 9: 47.3% accurate, 14.3× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+139}:\\ \;\;\;\;-z\\ \mathbf{elif}\;z \leq 19000000000000:\\ \;\;\;\;-y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \end{array} \]
                  (FPCore (x y z t)
                   :precision binary64
                   (if (<= z -4e+139) (- z) (if (<= z 19000000000000.0) (- y) (- z))))
                  double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if (z <= -4e+139) {
                  		tmp = -z;
                  	} else if (z <= 19000000000000.0) {
                  		tmp = -y;
                  	} else {
                  		tmp = -z;
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(x, y, z, t)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8), intent (in) :: t
                      real(8) :: tmp
                      if (z <= (-4d+139)) then
                          tmp = -z
                      else if (z <= 19000000000000.0d0) then
                          tmp = -y
                      else
                          tmp = -z
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if (z <= -4e+139) {
                  		tmp = -z;
                  	} else if (z <= 19000000000000.0) {
                  		tmp = -y;
                  	} else {
                  		tmp = -z;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t):
                  	tmp = 0
                  	if z <= -4e+139:
                  		tmp = -z
                  	elif z <= 19000000000000.0:
                  		tmp = -y
                  	else:
                  		tmp = -z
                  	return tmp
                  
                  function code(x, y, z, t)
                  	tmp = 0.0
                  	if (z <= -4e+139)
                  		tmp = Float64(-z);
                  	elseif (z <= 19000000000000.0)
                  		tmp = Float64(-y);
                  	else
                  		tmp = Float64(-z);
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t)
                  	tmp = 0.0;
                  	if (z <= -4e+139)
                  		tmp = -z;
                  	elseif (z <= 19000000000000.0)
                  		tmp = -y;
                  	else
                  		tmp = -z;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_] := If[LessEqual[z, -4e+139], (-z), If[LessEqual[z, 19000000000000.0], (-y), (-z)]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;z \leq -4 \cdot 10^{+139}:\\
                  \;\;\;\;-z\\
                  
                  \mathbf{elif}\;z \leq 19000000000000:\\
                  \;\;\;\;-y\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;-z\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if z < -4.00000000000000013e139 or 1.9e13 < z

                    1. Initial program 99.9%

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

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

                        \[\leadsto \color{blue}{\mathsf{neg}\left(z\right)} \]
                      2. lower-neg.f6470.4

                        \[\leadsto \color{blue}{-z} \]
                    5. Applied rewrites70.4%

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

                    if -4.00000000000000013e139 < z < 1.9e13

                    1. Initial program 99.9%

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

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

                        \[\leadsto \color{blue}{\mathsf{neg}\left(y\right)} \]
                      2. lower-neg.f6442.6

                        \[\leadsto \color{blue}{-y} \]
                    5. Applied rewrites42.6%

                      \[\leadsto \color{blue}{-y} \]
                  3. Recombined 2 regimes into one program.
                  4. Add Preprocessing

                  Alternative 10: 58.3% accurate, 35.8× speedup?

                  \[\begin{array}{l} \\ \left(-y\right) - z \end{array} \]
                  (FPCore (x y z t) :precision binary64 (- (- y) z))
                  double code(double x, double y, double z, double t) {
                  	return -y - z;
                  }
                  
                  real(8) function code(x, y, z, t)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8), intent (in) :: t
                      code = -y - z
                  end function
                  
                  public static double code(double x, double y, double z, double t) {
                  	return -y - z;
                  }
                  
                  def code(x, y, z, t):
                  	return -y - z
                  
                  function code(x, y, z, t)
                  	return Float64(Float64(-y) - z)
                  end
                  
                  function tmp = code(x, y, z, t)
                  	tmp = -y - z;
                  end
                  
                  code[x_, y_, z_, t_] := N[((-y) - z), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  \left(-y\right) - z
                  \end{array}
                  
                  Derivation
                  1. Initial program 99.9%

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

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

                      \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
                    2. lower--.f64N/A

                      \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
                    3. lower--.f64N/A

                      \[\leadsto \color{blue}{\left(\log t - y\right)} - z \]
                    4. lower-log.f6475.4

                      \[\leadsto \left(\color{blue}{\log t} - y\right) - z \]
                  5. Applied rewrites75.4%

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

                    \[\leadsto -1 \cdot y - z \]
                  7. Step-by-step derivation
                    1. Applied rewrites61.7%

                      \[\leadsto \left(-y\right) - z \]
                    2. Add Preprocessing

                    Alternative 11: 31.0% accurate, 71.7× speedup?

                    \[\begin{array}{l} \\ -y \end{array} \]
                    (FPCore (x y z t) :precision binary64 (- y))
                    double code(double x, double y, double z, double t) {
                    	return -y;
                    }
                    
                    real(8) function code(x, y, z, t)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8), intent (in) :: z
                        real(8), intent (in) :: t
                        code = -y
                    end function
                    
                    public static double code(double x, double y, double z, double t) {
                    	return -y;
                    }
                    
                    def code(x, y, z, t):
                    	return -y
                    
                    function code(x, y, z, t)
                    	return Float64(-y)
                    end
                    
                    function tmp = code(x, y, z, t)
                    	tmp = -y;
                    end
                    
                    code[x_, y_, z_, t_] := (-y)
                    
                    \begin{array}{l}
                    
                    \\
                    -y
                    \end{array}
                    
                    Derivation
                    1. Initial program 99.9%

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

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

                        \[\leadsto \color{blue}{\mathsf{neg}\left(y\right)} \]
                      2. lower-neg.f6430.2

                        \[\leadsto \color{blue}{-y} \]
                    5. Applied rewrites30.2%

                      \[\leadsto \color{blue}{-y} \]
                    6. Add Preprocessing

                    Reproduce

                    ?
                    herbie shell --seed 2024243 
                    (FPCore (x y z t)
                      :name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, A"
                      :precision binary64
                      (+ (- (- (* x (log y)) y) z) (log t)))