(- (log (- (* -4 z0) -1)))

Percentage Accurate: 38.2% → 99.6%
Time: 2.4s
Alternatives: 5
Speedup: 18.5×

Specification

?
\[-\log \left(-4 \cdot z0 - -1\right) \]
(FPCore (z0)
  :precision binary64
  (- (log (- (* -4.0 z0) -1.0))))
double code(double z0) {
	return -log(((-4.0 * z0) - -1.0));
}
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(z0)
use fmin_fmax_functions
    real(8), intent (in) :: z0
    code = -log((((-4.0d0) * z0) - (-1.0d0)))
end function
public static double code(double z0) {
	return -Math.log(((-4.0 * z0) - -1.0));
}
def code(z0):
	return -math.log(((-4.0 * z0) - -1.0))
function code(z0)
	return Float64(-log(Float64(Float64(-4.0 * z0) - -1.0)))
end
function tmp = code(z0)
	tmp = -log(((-4.0 * z0) - -1.0));
end
code[z0_] := (-N[Log[N[(N[(-4.0 * z0), $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision])
-\log \left(-4 \cdot z0 - -1\right)

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

\[-\log \left(-4 \cdot z0 - -1\right) \]
(FPCore (z0)
  :precision binary64
  (- (log (- (* -4.0 z0) -1.0))))
double code(double z0) {
	return -log(((-4.0 * z0) - -1.0));
}
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(z0)
use fmin_fmax_functions
    real(8), intent (in) :: z0
    code = -log((((-4.0d0) * z0) - (-1.0d0)))
end function
public static double code(double z0) {
	return -Math.log(((-4.0 * z0) - -1.0));
}
def code(z0):
	return -math.log(((-4.0 * z0) - -1.0))
function code(z0)
	return Float64(-log(Float64(Float64(-4.0 * z0) - -1.0)))
end
function tmp = code(z0)
	tmp = -log(((-4.0 * z0) - -1.0));
end
code[z0_] := (-N[Log[N[(N[(-4.0 * z0), $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision])
-\log \left(-4 \cdot z0 - -1\right)

Alternative 1: 99.6% accurate, 0.9× speedup?

\[\begin{array}{l} \mathbf{if}\;z0 \leq -1.35 \cdot 10^{-9}:\\ \;\;\;\;\log \left(\frac{1}{z0 \cdot -4 - -1}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(8 \cdot z0 - -4\right) \cdot z0 + \left(\left(\left(64 \cdot z0 - -21.333333333333332\right) \cdot z0\right) \cdot z0\right) \cdot z0\\ \end{array} \]
(FPCore (z0)
  :precision binary64
  (if (<= z0 -1.35e-9)
  (log (/ 1.0 (- (* z0 -4.0) -1.0)))
  (+
   (* (- (* 8.0 z0) -4.0) z0)
   (* (* (* (- (* 64.0 z0) -21.333333333333332) z0) z0) z0))))
double code(double z0) {
	double tmp;
	if (z0 <= -1.35e-9) {
		tmp = log((1.0 / ((z0 * -4.0) - -1.0)));
	} else {
		tmp = (((8.0 * z0) - -4.0) * z0) + (((((64.0 * z0) - -21.333333333333332) * z0) * z0) * z0);
	}
	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(z0)
use fmin_fmax_functions
    real(8), intent (in) :: z0
    real(8) :: tmp
    if (z0 <= (-1.35d-9)) then
        tmp = log((1.0d0 / ((z0 * (-4.0d0)) - (-1.0d0))))
    else
        tmp = (((8.0d0 * z0) - (-4.0d0)) * z0) + (((((64.0d0 * z0) - (-21.333333333333332d0)) * z0) * z0) * z0)
    end if
    code = tmp
end function
public static double code(double z0) {
	double tmp;
	if (z0 <= -1.35e-9) {
		tmp = Math.log((1.0 / ((z0 * -4.0) - -1.0)));
	} else {
		tmp = (((8.0 * z0) - -4.0) * z0) + (((((64.0 * z0) - -21.333333333333332) * z0) * z0) * z0);
	}
	return tmp;
}
def code(z0):
	tmp = 0
	if z0 <= -1.35e-9:
		tmp = math.log((1.0 / ((z0 * -4.0) - -1.0)))
	else:
		tmp = (((8.0 * z0) - -4.0) * z0) + (((((64.0 * z0) - -21.333333333333332) * z0) * z0) * z0)
	return tmp
function code(z0)
	tmp = 0.0
	if (z0 <= -1.35e-9)
		tmp = log(Float64(1.0 / Float64(Float64(z0 * -4.0) - -1.0)));
	else
		tmp = Float64(Float64(Float64(Float64(8.0 * z0) - -4.0) * z0) + Float64(Float64(Float64(Float64(Float64(64.0 * z0) - -21.333333333333332) * z0) * z0) * z0));
	end
	return tmp
end
function tmp_2 = code(z0)
	tmp = 0.0;
	if (z0 <= -1.35e-9)
		tmp = log((1.0 / ((z0 * -4.0) - -1.0)));
	else
		tmp = (((8.0 * z0) - -4.0) * z0) + (((((64.0 * z0) - -21.333333333333332) * z0) * z0) * z0);
	end
	tmp_2 = tmp;
end
code[z0_] := If[LessEqual[z0, -1.35e-9], N[Log[N[(1.0 / N[(N[(z0 * -4.0), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(N[(8.0 * z0), $MachinePrecision] - -4.0), $MachinePrecision] * z0), $MachinePrecision] + N[(N[(N[(N[(N[(64.0 * z0), $MachinePrecision] - -21.333333333333332), $MachinePrecision] * z0), $MachinePrecision] * z0), $MachinePrecision] * z0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z0 \leq -1.35 \cdot 10^{-9}:\\
\;\;\;\;\log \left(\frac{1}{z0 \cdot -4 - -1}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(8 \cdot z0 - -4\right) \cdot z0 + \left(\left(\left(64 \cdot z0 - -21.333333333333332\right) \cdot z0\right) \cdot z0\right) \cdot z0\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z0 < -1.3500000000000001e-9

    1. Initial program 38.2%

      \[-\log \left(-4 \cdot z0 - -1\right) \]
    2. Step-by-step derivation
      1. lift-neg.f64N/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\log \left(-4 \cdot z0 - -1\right)\right)} \]
      2. lift-log.f64N/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{\log \left(-4 \cdot z0 - -1\right)}\right) \]
      3. neg-logN/A

        \[\leadsto \color{blue}{\log \left(\frac{1}{-4 \cdot z0 - -1}\right)} \]
      4. lower-log.f64N/A

        \[\leadsto \color{blue}{\log \left(\frac{1}{-4 \cdot z0 - -1}\right)} \]
      5. lower-/.f6438.2%

        \[\leadsto \log \color{blue}{\left(\frac{1}{-4 \cdot z0 - -1}\right)} \]
      6. lift-*.f64N/A

        \[\leadsto \log \left(\frac{1}{\color{blue}{-4 \cdot z0} - -1}\right) \]
      7. *-commutativeN/A

        \[\leadsto \log \left(\frac{1}{\color{blue}{z0 \cdot -4} - -1}\right) \]
      8. lower-*.f6438.2%

        \[\leadsto \log \left(\frac{1}{\color{blue}{z0 \cdot -4} - -1}\right) \]
    3. Applied rewrites38.2%

      \[\leadsto \color{blue}{\log \left(\frac{1}{z0 \cdot -4 - -1}\right)} \]

    if -1.3500000000000001e-9 < z0

    1. Initial program 38.2%

      \[-\log \left(-4 \cdot z0 - -1\right) \]
    2. Taylor expanded in z0 around 0

      \[\leadsto \color{blue}{z0 \cdot \left(4 + z0 \cdot \left(8 + z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto z0 \cdot \color{blue}{\left(4 + z0 \cdot \left(8 + z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto z0 \cdot \left(4 + \color{blue}{z0 \cdot \left(8 + z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto z0 \cdot \left(4 + z0 \cdot \color{blue}{\left(8 + z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right)}\right) \]
      4. lower-+.f64N/A

        \[\leadsto z0 \cdot \left(4 + z0 \cdot \left(8 + \color{blue}{z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)}\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto z0 \cdot \left(4 + z0 \cdot \left(8 + z0 \cdot \color{blue}{\left(\frac{64}{3} + 64 \cdot z0\right)}\right)\right) \]
      6. lower-+.f64N/A

        \[\leadsto z0 \cdot \left(4 + z0 \cdot \left(8 + z0 \cdot \left(\frac{64}{3} + \color{blue}{64 \cdot z0}\right)\right)\right) \]
      7. lower-*.f6467.3%

        \[\leadsto z0 \cdot \left(4 + z0 \cdot \left(8 + z0 \cdot \left(21.333333333333332 + 64 \cdot \color{blue}{z0}\right)\right)\right) \]
    4. Applied rewrites67.3%

      \[\leadsto \color{blue}{z0 \cdot \left(4 + z0 \cdot \left(8 + z0 \cdot \left(21.333333333333332 + 64 \cdot z0\right)\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto z0 \cdot \color{blue}{\left(4 + z0 \cdot \left(8 + z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right)\right)} \]
      2. lift-+.f64N/A

        \[\leadsto z0 \cdot \left(4 + \color{blue}{z0 \cdot \left(8 + z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right)}\right) \]
      3. lift-*.f64N/A

        \[\leadsto z0 \cdot \left(4 + z0 \cdot \color{blue}{\left(8 + z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right)}\right) \]
      4. lift-+.f64N/A

        \[\leadsto z0 \cdot \left(4 + z0 \cdot \left(8 + \color{blue}{z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)}\right)\right) \]
      5. distribute-rgt-inN/A

        \[\leadsto z0 \cdot \left(4 + \left(8 \cdot z0 + \color{blue}{\left(z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right) \cdot z0}\right)\right) \]
      6. lift-*.f64N/A

        \[\leadsto z0 \cdot \left(4 + \left(8 \cdot z0 + \color{blue}{\left(z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right)} \cdot z0\right)\right) \]
      7. associate-+r+N/A

        \[\leadsto z0 \cdot \left(\left(4 + 8 \cdot z0\right) + \color{blue}{\left(z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right) \cdot z0}\right) \]
      8. lift-+.f64N/A

        \[\leadsto z0 \cdot \left(\left(4 + 8 \cdot z0\right) + \color{blue}{\left(z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right)} \cdot z0\right) \]
      9. distribute-rgt-inN/A

        \[\leadsto \left(4 + 8 \cdot z0\right) \cdot z0 + \color{blue}{\left(\left(z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right) \cdot z0\right) \cdot z0} \]
      10. *-commutativeN/A

        \[\leadsto z0 \cdot \left(4 + 8 \cdot z0\right) + \color{blue}{\left(\left(z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right) \cdot z0\right)} \cdot z0 \]
      11. lift-*.f64N/A

        \[\leadsto z0 \cdot \left(4 + 8 \cdot z0\right) + \color{blue}{\left(\left(z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right) \cdot z0\right)} \cdot z0 \]
      12. lower-+.f64N/A

        \[\leadsto z0 \cdot \left(4 + 8 \cdot z0\right) + \color{blue}{\left(\left(z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right) \cdot z0\right) \cdot z0} \]
    6. Applied rewrites67.3%

      \[\leadsto \left(8 \cdot z0 - -4\right) \cdot z0 + \color{blue}{\left(\left(\left(64 \cdot z0 - -21.333333333333332\right) \cdot z0\right) \cdot z0\right) \cdot z0} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 99.6% accurate, 0.9× speedup?

\[\begin{array}{l} \mathbf{if}\;z0 \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;-\log \left(-4 \cdot z0 - -1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(8 \cdot z0 - -4\right) \cdot z0 + \left(\left(\left(64 \cdot z0 - -21.333333333333332\right) \cdot z0\right) \cdot z0\right) \cdot z0\\ \end{array} \]
(FPCore (z0)
  :precision binary64
  (if (<= z0 -6.5e-9)
  (- (log (- (* -4.0 z0) -1.0)))
  (+
   (* (- (* 8.0 z0) -4.0) z0)
   (* (* (* (- (* 64.0 z0) -21.333333333333332) z0) z0) z0))))
double code(double z0) {
	double tmp;
	if (z0 <= -6.5e-9) {
		tmp = -log(((-4.0 * z0) - -1.0));
	} else {
		tmp = (((8.0 * z0) - -4.0) * z0) + (((((64.0 * z0) - -21.333333333333332) * z0) * z0) * z0);
	}
	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(z0)
use fmin_fmax_functions
    real(8), intent (in) :: z0
    real(8) :: tmp
    if (z0 <= (-6.5d-9)) then
        tmp = -log((((-4.0d0) * z0) - (-1.0d0)))
    else
        tmp = (((8.0d0 * z0) - (-4.0d0)) * z0) + (((((64.0d0 * z0) - (-21.333333333333332d0)) * z0) * z0) * z0)
    end if
    code = tmp
end function
public static double code(double z0) {
	double tmp;
	if (z0 <= -6.5e-9) {
		tmp = -Math.log(((-4.0 * z0) - -1.0));
	} else {
		tmp = (((8.0 * z0) - -4.0) * z0) + (((((64.0 * z0) - -21.333333333333332) * z0) * z0) * z0);
	}
	return tmp;
}
def code(z0):
	tmp = 0
	if z0 <= -6.5e-9:
		tmp = -math.log(((-4.0 * z0) - -1.0))
	else:
		tmp = (((8.0 * z0) - -4.0) * z0) + (((((64.0 * z0) - -21.333333333333332) * z0) * z0) * z0)
	return tmp
function code(z0)
	tmp = 0.0
	if (z0 <= -6.5e-9)
		tmp = Float64(-log(Float64(Float64(-4.0 * z0) - -1.0)));
	else
		tmp = Float64(Float64(Float64(Float64(8.0 * z0) - -4.0) * z0) + Float64(Float64(Float64(Float64(Float64(64.0 * z0) - -21.333333333333332) * z0) * z0) * z0));
	end
	return tmp
end
function tmp_2 = code(z0)
	tmp = 0.0;
	if (z0 <= -6.5e-9)
		tmp = -log(((-4.0 * z0) - -1.0));
	else
		tmp = (((8.0 * z0) - -4.0) * z0) + (((((64.0 * z0) - -21.333333333333332) * z0) * z0) * z0);
	end
	tmp_2 = tmp;
end
code[z0_] := If[LessEqual[z0, -6.5e-9], (-N[Log[N[(N[(-4.0 * z0), $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision]), N[(N[(N[(N[(8.0 * z0), $MachinePrecision] - -4.0), $MachinePrecision] * z0), $MachinePrecision] + N[(N[(N[(N[(N[(64.0 * z0), $MachinePrecision] - -21.333333333333332), $MachinePrecision] * z0), $MachinePrecision] * z0), $MachinePrecision] * z0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z0 \leq -6.5 \cdot 10^{-9}:\\
\;\;\;\;-\log \left(-4 \cdot z0 - -1\right)\\

\mathbf{else}:\\
\;\;\;\;\left(8 \cdot z0 - -4\right) \cdot z0 + \left(\left(\left(64 \cdot z0 - -21.333333333333332\right) \cdot z0\right) \cdot z0\right) \cdot z0\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z0 < -6.5000000000000003e-9

    1. Initial program 38.2%

      \[-\log \left(-4 \cdot z0 - -1\right) \]

    if -6.5000000000000003e-9 < z0

    1. Initial program 38.2%

      \[-\log \left(-4 \cdot z0 - -1\right) \]
    2. Taylor expanded in z0 around 0

      \[\leadsto \color{blue}{z0 \cdot \left(4 + z0 \cdot \left(8 + z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right)\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto z0 \cdot \color{blue}{\left(4 + z0 \cdot \left(8 + z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right)\right)} \]
      2. lower-+.f64N/A

        \[\leadsto z0 \cdot \left(4 + \color{blue}{z0 \cdot \left(8 + z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto z0 \cdot \left(4 + z0 \cdot \color{blue}{\left(8 + z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right)}\right) \]
      4. lower-+.f64N/A

        \[\leadsto z0 \cdot \left(4 + z0 \cdot \left(8 + \color{blue}{z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)}\right)\right) \]
      5. lower-*.f64N/A

        \[\leadsto z0 \cdot \left(4 + z0 \cdot \left(8 + z0 \cdot \color{blue}{\left(\frac{64}{3} + 64 \cdot z0\right)}\right)\right) \]
      6. lower-+.f64N/A

        \[\leadsto z0 \cdot \left(4 + z0 \cdot \left(8 + z0 \cdot \left(\frac{64}{3} + \color{blue}{64 \cdot z0}\right)\right)\right) \]
      7. lower-*.f6467.3%

        \[\leadsto z0 \cdot \left(4 + z0 \cdot \left(8 + z0 \cdot \left(21.333333333333332 + 64 \cdot \color{blue}{z0}\right)\right)\right) \]
    4. Applied rewrites67.3%

      \[\leadsto \color{blue}{z0 \cdot \left(4 + z0 \cdot \left(8 + z0 \cdot \left(21.333333333333332 + 64 \cdot z0\right)\right)\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto z0 \cdot \color{blue}{\left(4 + z0 \cdot \left(8 + z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right)\right)} \]
      2. lift-+.f64N/A

        \[\leadsto z0 \cdot \left(4 + \color{blue}{z0 \cdot \left(8 + z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right)}\right) \]
      3. lift-*.f64N/A

        \[\leadsto z0 \cdot \left(4 + z0 \cdot \color{blue}{\left(8 + z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right)}\right) \]
      4. lift-+.f64N/A

        \[\leadsto z0 \cdot \left(4 + z0 \cdot \left(8 + \color{blue}{z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)}\right)\right) \]
      5. distribute-rgt-inN/A

        \[\leadsto z0 \cdot \left(4 + \left(8 \cdot z0 + \color{blue}{\left(z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right) \cdot z0}\right)\right) \]
      6. lift-*.f64N/A

        \[\leadsto z0 \cdot \left(4 + \left(8 \cdot z0 + \color{blue}{\left(z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right)} \cdot z0\right)\right) \]
      7. associate-+r+N/A

        \[\leadsto z0 \cdot \left(\left(4 + 8 \cdot z0\right) + \color{blue}{\left(z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right) \cdot z0}\right) \]
      8. lift-+.f64N/A

        \[\leadsto z0 \cdot \left(\left(4 + 8 \cdot z0\right) + \color{blue}{\left(z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right)} \cdot z0\right) \]
      9. distribute-rgt-inN/A

        \[\leadsto \left(4 + 8 \cdot z0\right) \cdot z0 + \color{blue}{\left(\left(z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right) \cdot z0\right) \cdot z0} \]
      10. *-commutativeN/A

        \[\leadsto z0 \cdot \left(4 + 8 \cdot z0\right) + \color{blue}{\left(\left(z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right) \cdot z0\right)} \cdot z0 \]
      11. lift-*.f64N/A

        \[\leadsto z0 \cdot \left(4 + 8 \cdot z0\right) + \color{blue}{\left(\left(z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right) \cdot z0\right)} \cdot z0 \]
      12. lower-+.f64N/A

        \[\leadsto z0 \cdot \left(4 + 8 \cdot z0\right) + \color{blue}{\left(\left(z0 \cdot \left(\frac{64}{3} + 64 \cdot z0\right)\right) \cdot z0\right) \cdot z0} \]
    6. Applied rewrites67.3%

      \[\leadsto \left(8 \cdot z0 - -4\right) \cdot z0 + \color{blue}{\left(\left(\left(64 \cdot z0 - -21.333333333333332\right) \cdot z0\right) \cdot z0\right) \cdot z0} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 68.2% accurate, 4.1× speedup?

\[\left(\left(21.333333333333332 \cdot z0 - -8\right) \cdot z0\right) \cdot z0 - z0 \cdot -4 \]
(FPCore (z0)
  :precision binary64
  (- (* (* (- (* 21.333333333333332 z0) -8.0) z0) z0) (* z0 -4.0)))
double code(double z0) {
	return ((((21.333333333333332 * z0) - -8.0) * z0) * z0) - (z0 * -4.0);
}
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(z0)
use fmin_fmax_functions
    real(8), intent (in) :: z0
    code = ((((21.333333333333332d0 * z0) - (-8.0d0)) * z0) * z0) - (z0 * (-4.0d0))
end function
public static double code(double z0) {
	return ((((21.333333333333332 * z0) - -8.0) * z0) * z0) - (z0 * -4.0);
}
def code(z0):
	return ((((21.333333333333332 * z0) - -8.0) * z0) * z0) - (z0 * -4.0)
function code(z0)
	return Float64(Float64(Float64(Float64(Float64(21.333333333333332 * z0) - -8.0) * z0) * z0) - Float64(z0 * -4.0))
end
function tmp = code(z0)
	tmp = ((((21.333333333333332 * z0) - -8.0) * z0) * z0) - (z0 * -4.0);
end
code[z0_] := N[(N[(N[(N[(N[(21.333333333333332 * z0), $MachinePrecision] - -8.0), $MachinePrecision] * z0), $MachinePrecision] * z0), $MachinePrecision] - N[(z0 * -4.0), $MachinePrecision]), $MachinePrecision]
\left(\left(21.333333333333332 \cdot z0 - -8\right) \cdot z0\right) \cdot z0 - z0 \cdot -4
Derivation
  1. Initial program 38.2%

    \[-\log \left(-4 \cdot z0 - -1\right) \]
  2. Taylor expanded in z0 around 0

    \[\leadsto \color{blue}{z0 \cdot \left(4 + z0 \cdot \left(8 + \frac{64}{3} \cdot z0\right)\right)} \]
  3. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto z0 \cdot \color{blue}{\left(4 + z0 \cdot \left(8 + \frac{64}{3} \cdot z0\right)\right)} \]
    2. lower-+.f64N/A

      \[\leadsto z0 \cdot \left(4 + \color{blue}{z0 \cdot \left(8 + \frac{64}{3} \cdot z0\right)}\right) \]
    3. lower-*.f64N/A

      \[\leadsto z0 \cdot \left(4 + z0 \cdot \color{blue}{\left(8 + \frac{64}{3} \cdot z0\right)}\right) \]
    4. lower-+.f64N/A

      \[\leadsto z0 \cdot \left(4 + z0 \cdot \left(8 + \color{blue}{\frac{64}{3} \cdot z0}\right)\right) \]
    5. lower-*.f6468.2%

      \[\leadsto z0 \cdot \left(4 + z0 \cdot \left(8 + 21.333333333333332 \cdot \color{blue}{z0}\right)\right) \]
  4. Applied rewrites68.2%

    \[\leadsto \color{blue}{z0 \cdot \left(4 + z0 \cdot \left(8 + 21.333333333333332 \cdot z0\right)\right)} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto z0 \cdot \color{blue}{\left(4 + z0 \cdot \left(8 + \frac{64}{3} \cdot z0\right)\right)} \]
    2. lift-+.f64N/A

      \[\leadsto z0 \cdot \left(4 + \color{blue}{z0 \cdot \left(8 + \frac{64}{3} \cdot z0\right)}\right) \]
    3. +-commutativeN/A

      \[\leadsto z0 \cdot \left(z0 \cdot \left(8 + \frac{64}{3} \cdot z0\right) + \color{blue}{4}\right) \]
    4. distribute-rgt-inN/A

      \[\leadsto \left(z0 \cdot \left(8 + \frac{64}{3} \cdot z0\right)\right) \cdot z0 + \color{blue}{4 \cdot z0} \]
    5. fp-cancel-sign-sub-invN/A

      \[\leadsto \left(z0 \cdot \left(8 + \frac{64}{3} \cdot z0\right)\right) \cdot z0 - \color{blue}{\left(\mathsf{neg}\left(4\right)\right) \cdot z0} \]
    6. metadata-evalN/A

      \[\leadsto \left(z0 \cdot \left(8 + \frac{64}{3} \cdot z0\right)\right) \cdot z0 - -4 \cdot z0 \]
    7. *-commutativeN/A

      \[\leadsto \left(z0 \cdot \left(8 + \frac{64}{3} \cdot z0\right)\right) \cdot z0 - z0 \cdot \color{blue}{-4} \]
    8. lift-*.f64N/A

      \[\leadsto \left(z0 \cdot \left(8 + \frac{64}{3} \cdot z0\right)\right) \cdot z0 - z0 \cdot \color{blue}{-4} \]
    9. lower--.f64N/A

      \[\leadsto \left(z0 \cdot \left(8 + \frac{64}{3} \cdot z0\right)\right) \cdot z0 - \color{blue}{z0 \cdot -4} \]
    10. lower-*.f6468.2%

      \[\leadsto \left(z0 \cdot \left(8 + 21.333333333333332 \cdot z0\right)\right) \cdot z0 - \color{blue}{z0} \cdot -4 \]
    11. lift-*.f64N/A

      \[\leadsto \left(z0 \cdot \left(8 + \frac{64}{3} \cdot z0\right)\right) \cdot z0 - z0 \cdot -4 \]
    12. *-commutativeN/A

      \[\leadsto \left(\left(8 + \frac{64}{3} \cdot z0\right) \cdot z0\right) \cdot z0 - z0 \cdot -4 \]
    13. lower-*.f6468.2%

      \[\leadsto \left(\left(8 + 21.333333333333332 \cdot z0\right) \cdot z0\right) \cdot z0 - z0 \cdot -4 \]
    14. lift-+.f64N/A

      \[\leadsto \left(\left(8 + \frac{64}{3} \cdot z0\right) \cdot z0\right) \cdot z0 - z0 \cdot -4 \]
    15. +-commutativeN/A

      \[\leadsto \left(\left(\frac{64}{3} \cdot z0 + 8\right) \cdot z0\right) \cdot z0 - z0 \cdot -4 \]
    16. add-flipN/A

      \[\leadsto \left(\left(\frac{64}{3} \cdot z0 - \left(\mathsf{neg}\left(8\right)\right)\right) \cdot z0\right) \cdot z0 - z0 \cdot -4 \]
    17. lower--.f64N/A

      \[\leadsto \left(\left(\frac{64}{3} \cdot z0 - \left(\mathsf{neg}\left(8\right)\right)\right) \cdot z0\right) \cdot z0 - z0 \cdot -4 \]
    18. metadata-eval68.2%

      \[\leadsto \left(\left(21.333333333333332 \cdot z0 - -8\right) \cdot z0\right) \cdot z0 - z0 \cdot -4 \]
  6. Applied rewrites68.2%

    \[\leadsto \left(\left(21.333333333333332 \cdot z0 - -8\right) \cdot z0\right) \cdot z0 - \color{blue}{z0 \cdot -4} \]
  7. Add Preprocessing

Alternative 4: 68.2% accurate, 5.0× speedup?

\[z0 \cdot \left(4 + z0 \cdot \left(8 + 21.333333333333332 \cdot z0\right)\right) \]
(FPCore (z0)
  :precision binary64
  (* z0 (+ 4.0 (* z0 (+ 8.0 (* 21.333333333333332 z0))))))
double code(double z0) {
	return z0 * (4.0 + (z0 * (8.0 + (21.333333333333332 * z0))));
}
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(z0)
use fmin_fmax_functions
    real(8), intent (in) :: z0
    code = z0 * (4.0d0 + (z0 * (8.0d0 + (21.333333333333332d0 * z0))))
end function
public static double code(double z0) {
	return z0 * (4.0 + (z0 * (8.0 + (21.333333333333332 * z0))));
}
def code(z0):
	return z0 * (4.0 + (z0 * (8.0 + (21.333333333333332 * z0))))
function code(z0)
	return Float64(z0 * Float64(4.0 + Float64(z0 * Float64(8.0 + Float64(21.333333333333332 * z0)))))
end
function tmp = code(z0)
	tmp = z0 * (4.0 + (z0 * (8.0 + (21.333333333333332 * z0))));
end
code[z0_] := N[(z0 * N[(4.0 + N[(z0 * N[(8.0 + N[(21.333333333333332 * z0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
z0 \cdot \left(4 + z0 \cdot \left(8 + 21.333333333333332 \cdot z0\right)\right)
Derivation
  1. Initial program 38.2%

    \[-\log \left(-4 \cdot z0 - -1\right) \]
  2. Taylor expanded in z0 around 0

    \[\leadsto \color{blue}{z0 \cdot \left(4 + z0 \cdot \left(8 + \frac{64}{3} \cdot z0\right)\right)} \]
  3. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto z0 \cdot \color{blue}{\left(4 + z0 \cdot \left(8 + \frac{64}{3} \cdot z0\right)\right)} \]
    2. lower-+.f64N/A

      \[\leadsto z0 \cdot \left(4 + \color{blue}{z0 \cdot \left(8 + \frac{64}{3} \cdot z0\right)}\right) \]
    3. lower-*.f64N/A

      \[\leadsto z0 \cdot \left(4 + z0 \cdot \color{blue}{\left(8 + \frac{64}{3} \cdot z0\right)}\right) \]
    4. lower-+.f64N/A

      \[\leadsto z0 \cdot \left(4 + z0 \cdot \left(8 + \color{blue}{\frac{64}{3} \cdot z0}\right)\right) \]
    5. lower-*.f6468.2%

      \[\leadsto z0 \cdot \left(4 + z0 \cdot \left(8 + 21.333333333333332 \cdot \color{blue}{z0}\right)\right) \]
  4. Applied rewrites68.2%

    \[\leadsto \color{blue}{z0 \cdot \left(4 + z0 \cdot \left(8 + 21.333333333333332 \cdot z0\right)\right)} \]
  5. Add Preprocessing

Alternative 5: 67.8% accurate, 18.5× speedup?

\[4 \cdot z0 \]
(FPCore (z0)
  :precision binary64
  (* 4.0 z0))
double code(double z0) {
	return 4.0 * z0;
}
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(z0)
use fmin_fmax_functions
    real(8), intent (in) :: z0
    code = 4.0d0 * z0
end function
public static double code(double z0) {
	return 4.0 * z0;
}
def code(z0):
	return 4.0 * z0
function code(z0)
	return Float64(4.0 * z0)
end
function tmp = code(z0)
	tmp = 4.0 * z0;
end
code[z0_] := N[(4.0 * z0), $MachinePrecision]
4 \cdot z0
Derivation
  1. Initial program 38.2%

    \[-\log \left(-4 \cdot z0 - -1\right) \]
  2. Taylor expanded in z0 around 0

    \[\leadsto \color{blue}{4 \cdot z0} \]
  3. Step-by-step derivation
    1. lower-*.f6467.8%

      \[\leadsto 4 \cdot \color{blue}{z0} \]
  4. Applied rewrites67.8%

    \[\leadsto \color{blue}{4 \cdot z0} \]
  5. Add Preprocessing

Reproduce

?
herbie shell --seed 2025250 
(FPCore (z0)
  :name "(- (log (- (* -4 z0) -1)))"
  :precision binary64
  (- (log (- (* -4.0 z0) -1.0))))