Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, B

Percentage Accurate: 86.6% → 99.6%
Time: 6.9s
Alternatives: 9
Speedup: 1.8×

Specification

?
\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t \]
(FPCore (x y z t)
  :precision binary64
  (- (+ (* x (log y)) (* z (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
	return ((x * log(y)) + (z * log((1.0 - y)))) - t;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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 9 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: 86.6% accurate, 1.0× speedup?

\[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t \]
(FPCore (x y z t)
  :precision binary64
  (- (+ (* x (log y)) (* z (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
	return ((x * log(y)) + (z * log((1.0 - y)))) - t;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

Alternative 1: 99.6% accurate, 1.6× speedup?

\[\left(\log y \cdot x + \left(\left(\left(-0.3333333333333333 \cdot y - 0.5\right) \cdot y\right) \cdot y - y\right) \cdot z\right) - t \]
(FPCore (x y z t)
  :precision binary64
  (-
 (+
  (* (log y) x)
  (* (- (* (* (- (* -0.3333333333333333 y) 0.5) y) y) y) z))
 t))
double code(double x, double y, double z, double t) {
	return ((log(y) * x) + ((((((-0.3333333333333333 * y) - 0.5) * y) * y) - y) * z)) - t;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((log(y) * x) + (((((((-0.3333333333333333d0) * y) - 0.5d0) * y) * y) - y) * z)) - t
end function
public static double code(double x, double y, double z, double t) {
	return ((Math.log(y) * x) + ((((((-0.3333333333333333 * y) - 0.5) * y) * y) - y) * z)) - t;
}
def code(x, y, z, t):
	return ((math.log(y) * x) + ((((((-0.3333333333333333 * y) - 0.5) * y) * y) - y) * z)) - t
function code(x, y, z, t)
	return Float64(Float64(Float64(log(y) * x) + Float64(Float64(Float64(Float64(Float64(Float64(-0.3333333333333333 * y) - 0.5) * y) * y) - y) * z)) - t)
end
function tmp = code(x, y, z, t)
	tmp = ((log(y) * x) + ((((((-0.3333333333333333 * y) - 0.5) * y) * y) - y) * z)) - t;
end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] + N[(N[(N[(N[(N[(N[(-0.3333333333333333 * y), $MachinePrecision] - 0.5), $MachinePrecision] * y), $MachinePrecision] * y), $MachinePrecision] - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\left(\log y \cdot x + \left(\left(\left(-0.3333333333333333 \cdot y - 0.5\right) \cdot y\right) \cdot y - y\right) \cdot z\right) - t
Derivation
  1. Initial program 86.6%

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

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

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

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

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

      \[\leadsto \left(x \cdot \log y + z \cdot \left(y \cdot \left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) - 1\right)\right)\right) - t \]
    5. lower-*.f6499.5%

      \[\leadsto \left(x \cdot \log y + z \cdot \left(y \cdot \left(y \cdot \left(-0.3333333333333333 \cdot y - 0.5\right) - 1\right)\right)\right) - t \]
  4. Applied rewrites99.5%

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

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

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

      \[\leadsto \left(x \cdot \log y + z \cdot \left(y \cdot \left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right)\right) - t \]
    4. metadata-evalN/A

      \[\leadsto \left(x \cdot \log y + z \cdot \left(y \cdot \left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) + -1\right)\right)\right) - t \]
    5. distribute-rgt-inN/A

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

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

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

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

      \[\leadsto \left(x \cdot \log y + z \cdot \left(\left(\left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) \cdot y\right) \cdot y + -1 \cdot y\right)\right) - t \]
    10. lower-*.f64N/A

      \[\leadsto \left(x \cdot \log y + z \cdot \left(\left(\left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) \cdot y\right) \cdot y + -1 \cdot y\right)\right) - t \]
    11. lower-*.f6499.6%

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

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

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

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

      \[\leadsto \left(\color{blue}{\log y \cdot x} + z \cdot \left(\left(\left(-0.3333333333333333 \cdot y - 0.5\right) \cdot y\right) \cdot y + -1 \cdot y\right)\right) - t \]
    4. lift-*.f64N/A

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

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

      \[\leadsto \left(\log y \cdot x + \color{blue}{\left(\left(\left(-0.3333333333333333 \cdot y - 0.5\right) \cdot y\right) \cdot y + -1 \cdot y\right) \cdot z}\right) - t \]
    7. lift-+.f64N/A

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

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

      \[\leadsto \left(\log y \cdot x + \left(\left(\left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) \cdot y\right) \cdot y + \left(\mathsf{neg}\left(y\right)\right)\right) \cdot z\right) - t \]
    10. sub-flip-reverseN/A

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

      \[\leadsto \left(\log y \cdot x + \left(\left(\left(-0.3333333333333333 \cdot y - 0.5\right) \cdot y\right) \cdot y - \color{blue}{y}\right) \cdot z\right) - t \]
  8. Applied rewrites99.6%

    \[\leadsto \color{blue}{\left(\log y \cdot x + \left(\left(\left(-0.3333333333333333 \cdot y - 0.5\right) \cdot y\right) \cdot y - y\right) \cdot z\right)} - t \]
  9. Add Preprocessing

Alternative 2: 99.5% accurate, 1.6× speedup?

\[\left(x \cdot \log y + z \cdot \left(y \cdot \left(y \cdot \left(-0.3333333333333333 \cdot y - 0.5\right) - 1\right)\right)\right) - t \]
(FPCore (x y z t)
  :precision binary64
  (-
 (+
  (* x (log y))
  (* z (* y (- (* y (- (* -0.3333333333333333 y) 0.5)) 1.0))))
 t))
double code(double x, double y, double z, double t) {
	return ((x * log(y)) + (z * (y * ((y * ((-0.3333333333333333 * y) - 0.5)) - 1.0)))) - t;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x * log(y)) + (z * (y * ((y * (((-0.3333333333333333d0) * y) - 0.5d0)) - 1.0d0)))) - t
end function
public static double code(double x, double y, double z, double t) {
	return ((x * Math.log(y)) + (z * (y * ((y * ((-0.3333333333333333 * y) - 0.5)) - 1.0)))) - t;
}
def code(x, y, z, t):
	return ((x * math.log(y)) + (z * (y * ((y * ((-0.3333333333333333 * y) - 0.5)) - 1.0)))) - t
function code(x, y, z, t)
	return Float64(Float64(Float64(x * log(y)) + Float64(z * Float64(y * Float64(Float64(y * Float64(Float64(-0.3333333333333333 * y) - 0.5)) - 1.0)))) - t)
end
function tmp = code(x, y, z, t)
	tmp = ((x * log(y)) + (z * (y * ((y * ((-0.3333333333333333 * y) - 0.5)) - 1.0)))) - t;
end
code[x_, y_, z_, t_] := N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[(y * N[(N[(y * N[(N[(-0.3333333333333333 * y), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\left(x \cdot \log y + z \cdot \left(y \cdot \left(y \cdot \left(-0.3333333333333333 \cdot y - 0.5\right) - 1\right)\right)\right) - t
Derivation
  1. Initial program 86.6%

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

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

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

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

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

      \[\leadsto \left(x \cdot \log y + z \cdot \left(y \cdot \left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) - 1\right)\right)\right) - t \]
    5. lower-*.f6499.5%

      \[\leadsto \left(x \cdot \log y + z \cdot \left(y \cdot \left(y \cdot \left(-0.3333333333333333 \cdot y - 0.5\right) - 1\right)\right)\right) - t \]
  4. Applied rewrites99.5%

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

Alternative 3: 99.4% accurate, 1.7× speedup?

\[\left(x \cdot \log y + z \cdot \left(y \cdot \left(-0.5 \cdot y - 1\right)\right)\right) - t \]
(FPCore (x y z t)
  :precision binary64
  (- (+ (* x (log y)) (* z (* y (- (* -0.5 y) 1.0)))) t))
double code(double x, double y, double z, double t) {
	return ((x * log(y)) + (z * (y * ((-0.5 * y) - 1.0)))) - t;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x * log(y)) + (z * (y * (((-0.5d0) * y) - 1.0d0)))) - t
end function
public static double code(double x, double y, double z, double t) {
	return ((x * Math.log(y)) + (z * (y * ((-0.5 * y) - 1.0)))) - t;
}
def code(x, y, z, t):
	return ((x * math.log(y)) + (z * (y * ((-0.5 * y) - 1.0)))) - t
function code(x, y, z, t)
	return Float64(Float64(Float64(x * log(y)) + Float64(z * Float64(y * Float64(Float64(-0.5 * y) - 1.0)))) - t)
end
function tmp = code(x, y, z, t)
	tmp = ((x * log(y)) + (z * (y * ((-0.5 * y) - 1.0)))) - t;
end
code[x_, y_, z_, t_] := N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[(y * N[(N[(-0.5 * y), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\left(x \cdot \log y + z \cdot \left(y \cdot \left(-0.5 \cdot y - 1\right)\right)\right) - t
Derivation
  1. Initial program 86.6%

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

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

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

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

      \[\leadsto \left(x \cdot \log y + z \cdot \left(y \cdot \left(-0.5 \cdot y - 1\right)\right)\right) - t \]
  4. Applied rewrites99.4%

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

Alternative 4: 99.1% accurate, 1.8× speedup?

\[\left(x \cdot \log y + z \cdot \left(-1 \cdot y\right)\right) - t \]
(FPCore (x y z t)
  :precision binary64
  (- (+ (* x (log y)) (* z (* -1.0 y))) t))
double code(double x, double y, double z, double t) {
	return ((x * log(y)) + (z * (-1.0 * y))) - t;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x * log(y)) + (z * ((-1.0d0) * y))) - t
end function
public static double code(double x, double y, double z, double t) {
	return ((x * Math.log(y)) + (z * (-1.0 * y))) - t;
}
def code(x, y, z, t):
	return ((x * math.log(y)) + (z * (-1.0 * y))) - t
function code(x, y, z, t)
	return Float64(Float64(Float64(x * log(y)) + Float64(z * Float64(-1.0 * y))) - t)
end
function tmp = code(x, y, z, t)
	tmp = ((x * log(y)) + (z * (-1.0 * y))) - t;
end
code[x_, y_, z_, t_] := N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[(-1.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\left(x \cdot \log y + z \cdot \left(-1 \cdot y\right)\right) - t
Derivation
  1. Initial program 86.6%

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

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

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

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

Alternative 5: 90.8% accurate, 1.8× speedup?

\[\begin{array}{l} t_1 := x \cdot \log y - t\\ \mathbf{if}\;x \leq -4.7 \cdot 10^{-48}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 6.6 \cdot 10^{-102}:\\ \;\;\;\;1 \cdot \left(\left(\left(-0.5 \cdot y\right) \cdot y + -1 \cdot y\right) \cdot z\right) - t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (x y z t)
  :precision binary64
  (let* ((t_1 (- (* x (log y)) t)))
  (if (<= x -4.7e-48)
    t_1
    (if (<= x 6.6e-102)
      (- (* 1.0 (* (+ (* (* -0.5 y) y) (* -1.0 y)) z)) t)
      t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * log(y)) - t;
	double tmp;
	if (x <= -4.7e-48) {
		tmp = t_1;
	} else if (x <= 6.6e-102) {
		tmp = (1.0 * ((((-0.5 * y) * y) + (-1.0 * y)) * z)) - t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.6999999999999998e-48 or 6.6e-102 < x

    1. Initial program 86.6%

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

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

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

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

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

        \[\leadsto \left(x \cdot \log y + z \cdot \left(y \cdot \left(y \cdot \left(\frac{-1}{3} \cdot y - \frac{1}{2}\right) - 1\right)\right)\right) - t \]
      5. lower-*.f6499.5%

        \[\leadsto \left(x \cdot \log y + z \cdot \left(y \cdot \left(y \cdot \left(-0.3333333333333333 \cdot y - 0.5\right) - 1\right)\right)\right) - t \]
    4. Applied rewrites99.5%

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

      \[\leadsto \color{blue}{x \cdot \log y - t} \]
    6. Step-by-step derivation
      1. lower--.f64N/A

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

        \[\leadsto x \cdot \log y - t \]
      3. lower-log.f6485.5%

        \[\leadsto x \cdot \log y - t \]
    7. Applied rewrites85.5%

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

    if -4.6999999999999998e-48 < x < 6.6e-102

    1. Initial program 86.6%

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

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

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

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

        \[\leadsto \left(x \cdot \log y + z \cdot \left(y \cdot \left(-0.5 \cdot y - 1\right)\right)\right) - t \]
    4. Applied rewrites99.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{1} \cdot \left(\left(\left(-0.5 \cdot y - 1\right) \cdot y\right) \cdot z\right) - t \]
    8. Step-by-step derivation
      1. Applied rewrites56.5%

        \[\leadsto \color{blue}{1} \cdot \left(\left(\left(-0.5 \cdot y - 1\right) \cdot y\right) \cdot z\right) - t \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

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

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

          \[\leadsto 1 \cdot \left(\left(y \cdot \left(\frac{-1}{2} \cdot y - \color{blue}{1}\right)\right) \cdot z\right) - t \]
        4. sub-flipN/A

          \[\leadsto 1 \cdot \left(\left(y \cdot \left(\frac{-1}{2} \cdot y + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \cdot z\right) - t \]
        5. metadata-evalN/A

          \[\leadsto 1 \cdot \left(\left(y \cdot \left(\frac{-1}{2} \cdot y + -1\right)\right) \cdot z\right) - t \]
        6. distribute-rgt-inN/A

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

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

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

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

        \[\leadsto 1 \cdot \left(\left(\left(-0.5 \cdot y\right) \cdot y + \color{blue}{-1 \cdot y}\right) \cdot z\right) - t \]
    9. Recombined 2 regimes into one program.
    10. Add Preprocessing

    Alternative 6: 56.5% accurate, 6.9× speedup?

    \[1 \cdot \left(\left(\left(-0.5 \cdot y\right) \cdot y + -1 \cdot y\right) \cdot z\right) - t \]
    (FPCore (x y z t)
      :precision binary64
      (- (* 1.0 (* (+ (* (* -0.5 y) y) (* -1.0 y)) z)) t))
    double code(double x, double y, double z, double t) {
    	return (1.0 * ((((-0.5 * y) * y) + (-1.0 * y)) * z)) - t;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y, z, t)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        code = (1.0d0 * (((((-0.5d0) * y) * y) + ((-1.0d0) * y)) * z)) - t
    end function
    
    public static double code(double x, double y, double z, double t) {
    	return (1.0 * ((((-0.5 * y) * y) + (-1.0 * y)) * z)) - t;
    }
    
    def code(x, y, z, t):
    	return (1.0 * ((((-0.5 * y) * y) + (-1.0 * y)) * z)) - t
    
    function code(x, y, z, t)
    	return Float64(Float64(1.0 * Float64(Float64(Float64(Float64(-0.5 * y) * y) + Float64(-1.0 * y)) * z)) - t)
    end
    
    function tmp = code(x, y, z, t)
    	tmp = (1.0 * ((((-0.5 * y) * y) + (-1.0 * y)) * z)) - t;
    end
    
    code[x_, y_, z_, t_] := N[(N[(1.0 * N[(N[(N[(N[(-0.5 * y), $MachinePrecision] * y), $MachinePrecision] + N[(-1.0 * y), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
    
    1 \cdot \left(\left(\left(-0.5 \cdot y\right) \cdot y + -1 \cdot y\right) \cdot z\right) - t
    
    Derivation
    1. Initial program 86.6%

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

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

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

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

        \[\leadsto \left(x \cdot \log y + z \cdot \left(y \cdot \left(-0.5 \cdot y - 1\right)\right)\right) - t \]
    4. Applied rewrites99.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{1} \cdot \left(\left(\left(-0.5 \cdot y - 1\right) \cdot y\right) \cdot z\right) - t \]
    8. Step-by-step derivation
      1. Applied rewrites56.5%

        \[\leadsto \color{blue}{1} \cdot \left(\left(\left(-0.5 \cdot y - 1\right) \cdot y\right) \cdot z\right) - t \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

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

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

          \[\leadsto 1 \cdot \left(\left(y \cdot \left(\frac{-1}{2} \cdot y - \color{blue}{1}\right)\right) \cdot z\right) - t \]
        4. sub-flipN/A

          \[\leadsto 1 \cdot \left(\left(y \cdot \left(\frac{-1}{2} \cdot y + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \cdot z\right) - t \]
        5. metadata-evalN/A

          \[\leadsto 1 \cdot \left(\left(y \cdot \left(\frac{-1}{2} \cdot y + -1\right)\right) \cdot z\right) - t \]
        6. distribute-rgt-inN/A

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

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

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

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

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

      Alternative 7: 56.5% accurate, 10.0× speedup?

      \[z \cdot \left(\left(-0.5 \cdot y - 1\right) \cdot y\right) - t \]
      (FPCore (x y z t)
        :precision binary64
        (- (* z (* (- (* -0.5 y) 1.0) y)) t))
      double code(double x, double y, double z, double t) {
      	return (z * (((-0.5 * y) - 1.0) * y)) - t;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, y, z, t)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          code = (z * ((((-0.5d0) * y) - 1.0d0) * y)) - t
      end function
      
      public static double code(double x, double y, double z, double t) {
      	return (z * (((-0.5 * y) - 1.0) * y)) - t;
      }
      
      def code(x, y, z, t):
      	return (z * (((-0.5 * y) - 1.0) * y)) - t
      
      function code(x, y, z, t)
      	return Float64(Float64(z * Float64(Float64(Float64(-0.5 * y) - 1.0) * y)) - t)
      end
      
      function tmp = code(x, y, z, t)
      	tmp = (z * (((-0.5 * y) - 1.0) * y)) - t;
      end
      
      code[x_, y_, z_, t_] := N[(N[(z * N[(N[(N[(-0.5 * y), $MachinePrecision] - 1.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
      
      z \cdot \left(\left(-0.5 \cdot y - 1\right) \cdot y\right) - t
      
      Derivation
      1. Initial program 86.6%

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

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

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

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

          \[\leadsto \left(x \cdot \log y + z \cdot \left(y \cdot \left(-0.5 \cdot y - 1\right)\right)\right) - t \]
      4. Applied rewrites99.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z} \cdot \left(\left(-0.5 \cdot y - 1\right) \cdot y\right) - t \]
      10. Step-by-step derivation
        1. Applied rewrites56.5%

          \[\leadsto \color{blue}{z} \cdot \left(\left(-0.5 \cdot y - 1\right) \cdot y\right) - t \]
        2. Add Preprocessing

        Alternative 8: 56.2% accurate, 11.6× speedup?

        \[1 \cdot \left(\left(-1 \cdot y\right) \cdot z\right) - t \]
        (FPCore (x y z t)
          :precision binary64
          (- (* 1.0 (* (* -1.0 y) z)) t))
        double code(double x, double y, double z, double t) {
        	return (1.0 * ((-1.0 * y) * z)) - t;
        }
        
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(x, y, z, t)
        use fmin_fmax_functions
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8), intent (in) :: t
            code = (1.0d0 * (((-1.0d0) * y) * z)) - t
        end function
        
        public static double code(double x, double y, double z, double t) {
        	return (1.0 * ((-1.0 * y) * z)) - t;
        }
        
        def code(x, y, z, t):
        	return (1.0 * ((-1.0 * y) * z)) - t
        
        function code(x, y, z, t)
        	return Float64(Float64(1.0 * Float64(Float64(-1.0 * y) * z)) - t)
        end
        
        function tmp = code(x, y, z, t)
        	tmp = (1.0 * ((-1.0 * y) * z)) - t;
        end
        
        code[x_, y_, z_, t_] := N[(N[(1.0 * N[(N[(-1.0 * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
        
        1 \cdot \left(\left(-1 \cdot y\right) \cdot z\right) - t
        
        Derivation
        1. Initial program 86.6%

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

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

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

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

            \[\leadsto \left(x \cdot \log y + z \cdot \left(y \cdot \left(-0.5 \cdot y - 1\right)\right)\right) - t \]
        4. Applied rewrites99.4%

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

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

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

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

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

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

          \[\leadsto \color{blue}{1} \cdot \left(\left(\left(-0.5 \cdot y - 1\right) \cdot y\right) \cdot z\right) - t \]
        8. Step-by-step derivation
          1. Applied rewrites56.5%

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

            \[\leadsto 1 \cdot \left(\left(-1 \cdot y\right) \cdot z\right) - t \]
          3. Step-by-step derivation
            1. Applied rewrites56.2%

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

            Alternative 9: 43.0% accurate, 73.3× speedup?

            \[-t \]
            (FPCore (x y z t)
              :precision binary64
              (- t))
            double code(double x, double y, double z, double t) {
            	return -t;
            }
            
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(x, y, z, t)
            use fmin_fmax_functions
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                code = -t
            end function
            
            public static double code(double x, double y, double z, double t) {
            	return -t;
            }
            
            def code(x, y, z, t):
            	return -t
            
            function code(x, y, z, t)
            	return Float64(-t)
            end
            
            function tmp = code(x, y, z, t)
            	tmp = -t;
            end
            
            code[x_, y_, z_, t_] := (-t)
            
            -t
            
            Derivation
            1. Initial program 86.6%

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

              \[\leadsto \color{blue}{-1 \cdot t} \]
            3. Step-by-step derivation
              1. lower-*.f6443.0%

                \[\leadsto -1 \cdot \color{blue}{t} \]
            4. Applied rewrites43.0%

              \[\leadsto \color{blue}{-1 \cdot t} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto -1 \cdot \color{blue}{t} \]
              2. mul-1-negN/A

                \[\leadsto \mathsf{neg}\left(t\right) \]
              3. lower-neg.f6443.0%

                \[\leadsto -t \]
            6. Applied rewrites43.0%

              \[\leadsto -t \]
            7. Add Preprocessing

            Reproduce

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