
(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 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)
Herbie found 6 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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 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)
(FPCore (z0)
:precision binary64
(let* ((t_0 (- (* (- (* -64.0 z0) 21.333333333333332) z0) 8.0))
(t_1 (log (- (* -4.0 z0) -1.0)))
(t_2 (* t_0 z0)))
(if (<= t_1 1e-11)
(* (- 16.0 (* (* t_2 z0) t_0)) (* (/ 1.0 (- -4.0 t_2)) z0))
t_1)))double code(double z0) {
double t_0 = (((-64.0 * z0) - 21.333333333333332) * z0) - 8.0;
double t_1 = log(((-4.0 * z0) - -1.0));
double t_2 = t_0 * z0;
double tmp;
if (t_1 <= 1e-11) {
tmp = (16.0 - ((t_2 * z0) * t_0)) * ((1.0 / (-4.0 - t_2)) * z0);
} 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(z0)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = ((((-64.0d0) * z0) - 21.333333333333332d0) * z0) - 8.0d0
t_1 = log((((-4.0d0) * z0) - (-1.0d0)))
t_2 = t_0 * z0
if (t_1 <= 1d-11) then
tmp = (16.0d0 - ((t_2 * z0) * t_0)) * ((1.0d0 / ((-4.0d0) - t_2)) * z0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double z0) {
double t_0 = (((-64.0 * z0) - 21.333333333333332) * z0) - 8.0;
double t_1 = Math.log(((-4.0 * z0) - -1.0));
double t_2 = t_0 * z0;
double tmp;
if (t_1 <= 1e-11) {
tmp = (16.0 - ((t_2 * z0) * t_0)) * ((1.0 / (-4.0 - t_2)) * z0);
} else {
tmp = t_1;
}
return tmp;
}
def code(z0): t_0 = (((-64.0 * z0) - 21.333333333333332) * z0) - 8.0 t_1 = math.log(((-4.0 * z0) - -1.0)) t_2 = t_0 * z0 tmp = 0 if t_1 <= 1e-11: tmp = (16.0 - ((t_2 * z0) * t_0)) * ((1.0 / (-4.0 - t_2)) * z0) else: tmp = t_1 return tmp
function code(z0) t_0 = Float64(Float64(Float64(Float64(-64.0 * z0) - 21.333333333333332) * z0) - 8.0) t_1 = log(Float64(Float64(-4.0 * z0) - -1.0)) t_2 = Float64(t_0 * z0) tmp = 0.0 if (t_1 <= 1e-11) tmp = Float64(Float64(16.0 - Float64(Float64(t_2 * z0) * t_0)) * Float64(Float64(1.0 / Float64(-4.0 - t_2)) * z0)); else tmp = t_1; end return tmp end
function tmp_2 = code(z0) t_0 = (((-64.0 * z0) - 21.333333333333332) * z0) - 8.0; t_1 = log(((-4.0 * z0) - -1.0)); t_2 = t_0 * z0; tmp = 0.0; if (t_1 <= 1e-11) tmp = (16.0 - ((t_2 * z0) * t_0)) * ((1.0 / (-4.0 - t_2)) * z0); else tmp = t_1; end tmp_2 = tmp; end
code[z0_] := Block[{t$95$0 = N[(N[(N[(N[(-64.0 * z0), $MachinePrecision] - 21.333333333333332), $MachinePrecision] * z0), $MachinePrecision] - 8.0), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[(N[(-4.0 * z0), $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * z0), $MachinePrecision]}, If[LessEqual[t$95$1, 1e-11], N[(N[(16.0 - N[(N[(t$95$2 * z0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / N[(-4.0 - t$95$2), $MachinePrecision]), $MachinePrecision] * z0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_0 := \left(-64 \cdot z0 - 21.333333333333332\right) \cdot z0 - 8\\
t_1 := \log \left(-4 \cdot z0 - -1\right)\\
t_2 := t\_0 \cdot z0\\
\mathbf{if}\;t\_1 \leq 10^{-11}:\\
\;\;\;\;\left(16 - \left(t\_2 \cdot z0\right) \cdot t\_0\right) \cdot \left(\frac{1}{-4 - t\_2} \cdot z0\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (log.f64 (-.f64 (*.f64 #s(literal -4 binary64) z0) #s(literal -1 binary64))) < 9.9999999999999994e-12Initial program 38.2%
Taylor expanded in z0 around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.3%
Applied rewrites67.3%
lift--.f64N/A
flip--N/A
lower-unsound-/.f64N/A
Applied rewrites67.1%
lift-*.f64N/A
*-commutativeN/A
Applied rewrites67.1%
if 9.9999999999999994e-12 < (log.f64 (-.f64 (*.f64 #s(literal -4 binary64) z0) #s(literal -1 binary64))) Initial program 38.2%
(FPCore (z0)
:precision binary64
(let* ((t_0 (- (* (- (* -64.0 z0) 21.333333333333332) z0) 8.0))
(t_1 (* t_0 z0)))
(if (<= (log (- (* -4.0 z0) -1.0)) 1e-11)
(* (- 16.0 (* (* t_1 z0) t_0)) (* (/ 1.0 (- -4.0 t_1)) z0))
(- (log (- 0.25 z0)) -1.3862943611198906))))double code(double z0) {
double t_0 = (((-64.0 * z0) - 21.333333333333332) * z0) - 8.0;
double t_1 = t_0 * z0;
double tmp;
if (log(((-4.0 * z0) - -1.0)) <= 1e-11) {
tmp = (16.0 - ((t_1 * z0) * t_0)) * ((1.0 / (-4.0 - t_1)) * z0);
} else {
tmp = log((0.25 - z0)) - -1.3862943611198906;
}
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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((((-64.0d0) * z0) - 21.333333333333332d0) * z0) - 8.0d0
t_1 = t_0 * z0
if (log((((-4.0d0) * z0) - (-1.0d0))) <= 1d-11) then
tmp = (16.0d0 - ((t_1 * z0) * t_0)) * ((1.0d0 / ((-4.0d0) - t_1)) * z0)
else
tmp = log((0.25d0 - z0)) - (-1.3862943611198906d0)
end if
code = tmp
end function
public static double code(double z0) {
double t_0 = (((-64.0 * z0) - 21.333333333333332) * z0) - 8.0;
double t_1 = t_0 * z0;
double tmp;
if (Math.log(((-4.0 * z0) - -1.0)) <= 1e-11) {
tmp = (16.0 - ((t_1 * z0) * t_0)) * ((1.0 / (-4.0 - t_1)) * z0);
} else {
tmp = Math.log((0.25 - z0)) - -1.3862943611198906;
}
return tmp;
}
def code(z0): t_0 = (((-64.0 * z0) - 21.333333333333332) * z0) - 8.0 t_1 = t_0 * z0 tmp = 0 if math.log(((-4.0 * z0) - -1.0)) <= 1e-11: tmp = (16.0 - ((t_1 * z0) * t_0)) * ((1.0 / (-4.0 - t_1)) * z0) else: tmp = math.log((0.25 - z0)) - -1.3862943611198906 return tmp
function code(z0) t_0 = Float64(Float64(Float64(Float64(-64.0 * z0) - 21.333333333333332) * z0) - 8.0) t_1 = Float64(t_0 * z0) tmp = 0.0 if (log(Float64(Float64(-4.0 * z0) - -1.0)) <= 1e-11) tmp = Float64(Float64(16.0 - Float64(Float64(t_1 * z0) * t_0)) * Float64(Float64(1.0 / Float64(-4.0 - t_1)) * z0)); else tmp = Float64(log(Float64(0.25 - z0)) - -1.3862943611198906); end return tmp end
function tmp_2 = code(z0) t_0 = (((-64.0 * z0) - 21.333333333333332) * z0) - 8.0; t_1 = t_0 * z0; tmp = 0.0; if (log(((-4.0 * z0) - -1.0)) <= 1e-11) tmp = (16.0 - ((t_1 * z0) * t_0)) * ((1.0 / (-4.0 - t_1)) * z0); else tmp = log((0.25 - z0)) - -1.3862943611198906; end tmp_2 = tmp; end
code[z0_] := Block[{t$95$0 = N[(N[(N[(N[(-64.0 * z0), $MachinePrecision] - 21.333333333333332), $MachinePrecision] * z0), $MachinePrecision] - 8.0), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * z0), $MachinePrecision]}, If[LessEqual[N[Log[N[(N[(-4.0 * z0), $MachinePrecision] - -1.0), $MachinePrecision]], $MachinePrecision], 1e-11], N[(N[(16.0 - N[(N[(t$95$1 * z0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / N[(-4.0 - t$95$1), $MachinePrecision]), $MachinePrecision] * z0), $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(0.25 - z0), $MachinePrecision]], $MachinePrecision] - -1.3862943611198906), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \left(-64 \cdot z0 - 21.333333333333332\right) \cdot z0 - 8\\
t_1 := t\_0 \cdot z0\\
\mathbf{if}\;\log \left(-4 \cdot z0 - -1\right) \leq 10^{-11}:\\
\;\;\;\;\left(16 - \left(t\_1 \cdot z0\right) \cdot t\_0\right) \cdot \left(\frac{1}{-4 - t\_1} \cdot z0\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(0.25 - z0\right) - -1.3862943611198906\\
\end{array}
if (log.f64 (-.f64 (*.f64 #s(literal -4 binary64) z0) #s(literal -1 binary64))) < 9.9999999999999994e-12Initial program 38.2%
Taylor expanded in z0 around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.3%
Applied rewrites67.3%
lift--.f64N/A
flip--N/A
lower-unsound-/.f64N/A
Applied rewrites67.1%
lift-*.f64N/A
*-commutativeN/A
Applied rewrites67.1%
if 9.9999999999999994e-12 < (log.f64 (-.f64 (*.f64 #s(literal -4 binary64) z0) #s(literal -1 binary64))) Initial program 38.2%
Applied rewrites38.2%
Evaluated real constant38.2%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f64N/A
metadata-evalN/A
metadata-eval38.2%
Applied rewrites38.2%
(FPCore (z0) :precision binary64 (/ 1.0 (/ (- (* 0.5 z0) 0.25) z0)))
double code(double z0) {
return 1.0 / (((0.5 * z0) - 0.25) / 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 = 1.0d0 / (((0.5d0 * z0) - 0.25d0) / z0)
end function
public static double code(double z0) {
return 1.0 / (((0.5 * z0) - 0.25) / z0);
}
def code(z0): return 1.0 / (((0.5 * z0) - 0.25) / z0)
function code(z0) return Float64(1.0 / Float64(Float64(Float64(0.5 * z0) - 0.25) / z0)) end
function tmp = code(z0) tmp = 1.0 / (((0.5 * z0) - 0.25) / z0); end
code[z0_] := N[(1.0 / N[(N[(N[(0.5 * z0), $MachinePrecision] - 0.25), $MachinePrecision] / z0), $MachinePrecision]), $MachinePrecision]
\frac{1}{\frac{0.5 \cdot z0 - 0.25}{z0}}
Initial program 38.2%
Taylor expanded in z0 around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.3%
Applied rewrites67.3%
lift--.f64N/A
flip--N/A
lower-unsound-/.f64N/A
Applied rewrites67.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f64N/A
Applied rewrites67.0%
Taylor expanded in z0 around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f6471.3%
Applied rewrites71.3%
(FPCore (z0) :precision binary64 (- (* (* (- (* -21.333333333333332 z0) 8.0) z0) z0) (* 4.0 z0)))
double code(double z0) {
return ((((-21.333333333333332 * z0) - 8.0) * z0) * z0) - (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 = (((((-21.333333333333332d0) * z0) - 8.0d0) * z0) * z0) - (4.0d0 * z0)
end function
public static double code(double z0) {
return ((((-21.333333333333332 * z0) - 8.0) * z0) * z0) - (4.0 * z0);
}
def code(z0): return ((((-21.333333333333332 * z0) - 8.0) * z0) * z0) - (4.0 * z0)
function code(z0) return Float64(Float64(Float64(Float64(Float64(-21.333333333333332 * z0) - 8.0) * z0) * z0) - Float64(4.0 * z0)) end
function tmp = code(z0) tmp = ((((-21.333333333333332 * z0) - 8.0) * z0) * z0) - (4.0 * z0); end
code[z0_] := N[(N[(N[(N[(N[(-21.333333333333332 * z0), $MachinePrecision] - 8.0), $MachinePrecision] * z0), $MachinePrecision] * z0), $MachinePrecision] - N[(4.0 * z0), $MachinePrecision]), $MachinePrecision]
\left(\left(-21.333333333333332 \cdot z0 - 8\right) \cdot z0\right) \cdot z0 - 4 \cdot z0
Initial program 38.2%
Taylor expanded in z0 around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6468.2%
Applied rewrites68.2%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
metadata-evalN/A
distribute-rgt-inN/A
add-flipN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
lower-*.f6468.2%
Applied rewrites68.2%
(FPCore (z0) :precision binary64 (* z0 (- (* z0 (- (* -21.333333333333332 z0) 8.0)) 4.0)))
double code(double z0) {
return z0 * ((z0 * ((-21.333333333333332 * z0) - 8.0)) - 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 = z0 * ((z0 * (((-21.333333333333332d0) * z0) - 8.0d0)) - 4.0d0)
end function
public static double code(double z0) {
return z0 * ((z0 * ((-21.333333333333332 * z0) - 8.0)) - 4.0);
}
def code(z0): return z0 * ((z0 * ((-21.333333333333332 * z0) - 8.0)) - 4.0)
function code(z0) return Float64(z0 * Float64(Float64(z0 * Float64(Float64(-21.333333333333332 * z0) - 8.0)) - 4.0)) end
function tmp = code(z0) tmp = z0 * ((z0 * ((-21.333333333333332 * z0) - 8.0)) - 4.0); end
code[z0_] := N[(z0 * N[(N[(z0 * N[(N[(-21.333333333333332 * z0), $MachinePrecision] - 8.0), $MachinePrecision]), $MachinePrecision] - 4.0), $MachinePrecision]), $MachinePrecision]
z0 \cdot \left(z0 \cdot \left(-21.333333333333332 \cdot z0 - 8\right) - 4\right)
Initial program 38.2%
Taylor expanded in z0 around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6468.2%
Applied rewrites68.2%
(FPCore (z0) :precision binary64 (* z0 -4.0))
double code(double z0) {
return 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 = z0 * (-4.0d0)
end function
public static double code(double z0) {
return z0 * -4.0;
}
def code(z0): return z0 * -4.0
function code(z0) return Float64(z0 * -4.0) end
function tmp = code(z0) tmp = z0 * -4.0; end
code[z0_] := N[(z0 * -4.0), $MachinePrecision]
z0 \cdot -4
Initial program 38.2%
Taylor expanded in z0 around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6468.2%
Applied rewrites68.2%
Taylor expanded in z0 around 0
Applied rewrites67.8%
herbie shell --seed 2025250
(FPCore (z0)
:name "(log (- (* -4 z0) -1))"
:precision binary64
(log (- (* -4.0 z0) -1.0)))