
(FPCore (z0 z1) :precision binary64 (/ -1.0 (- (- -1.0 z0) (/ (sqrt (- (- 1.0 z1) z1)) (* (* 1.7724539041519165 z1) (exp (* z1 z1)))))))
double code(double z0, double z1) {
return -1.0 / ((-1.0 - z0) - (sqrt(((1.0 - z1) - z1)) / ((1.7724539041519165 * z1) * exp((z1 * z1)))));
}
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, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
code = (-1.0d0) / (((-1.0d0) - z0) - (sqrt(((1.0d0 - z1) - z1)) / ((1.7724539041519165d0 * z1) * exp((z1 * z1)))))
end function
public static double code(double z0, double z1) {
return -1.0 / ((-1.0 - z0) - (Math.sqrt(((1.0 - z1) - z1)) / ((1.7724539041519165 * z1) * Math.exp((z1 * z1)))));
}
def code(z0, z1): return -1.0 / ((-1.0 - z0) - (math.sqrt(((1.0 - z1) - z1)) / ((1.7724539041519165 * z1) * math.exp((z1 * z1)))))
function code(z0, z1) return Float64(-1.0 / Float64(Float64(-1.0 - z0) - Float64(sqrt(Float64(Float64(1.0 - z1) - z1)) / Float64(Float64(1.7724539041519165 * z1) * exp(Float64(z1 * z1)))))) end
function tmp = code(z0, z1) tmp = -1.0 / ((-1.0 - z0) - (sqrt(((1.0 - z1) - z1)) / ((1.7724539041519165 * z1) * exp((z1 * z1))))); end
code[z0_, z1_] := N[(-1.0 / N[(N[(-1.0 - z0), $MachinePrecision] - N[(N[Sqrt[N[(N[(1.0 - z1), $MachinePrecision] - z1), $MachinePrecision]], $MachinePrecision] / N[(N[(1.7724539041519165 * z1), $MachinePrecision] * N[Exp[N[(z1 * z1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{-1}{\left(-1 - z0\right) - \frac{\sqrt{\left(1 - z1\right) - z1}}{\left(1.7724539041519165 \cdot z1\right) \cdot e^{z1 \cdot z1}}}
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (z0 z1) :precision binary64 (/ -1.0 (- (- -1.0 z0) (/ (sqrt (- (- 1.0 z1) z1)) (* (* 1.7724539041519165 z1) (exp (* z1 z1)))))))
double code(double z0, double z1) {
return -1.0 / ((-1.0 - z0) - (sqrt(((1.0 - z1) - z1)) / ((1.7724539041519165 * z1) * exp((z1 * z1)))));
}
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, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
code = (-1.0d0) / (((-1.0d0) - z0) - (sqrt(((1.0d0 - z1) - z1)) / ((1.7724539041519165d0 * z1) * exp((z1 * z1)))))
end function
public static double code(double z0, double z1) {
return -1.0 / ((-1.0 - z0) - (Math.sqrt(((1.0 - z1) - z1)) / ((1.7724539041519165 * z1) * Math.exp((z1 * z1)))));
}
def code(z0, z1): return -1.0 / ((-1.0 - z0) - (math.sqrt(((1.0 - z1) - z1)) / ((1.7724539041519165 * z1) * math.exp((z1 * z1)))))
function code(z0, z1) return Float64(-1.0 / Float64(Float64(-1.0 - z0) - Float64(sqrt(Float64(Float64(1.0 - z1) - z1)) / Float64(Float64(1.7724539041519165 * z1) * exp(Float64(z1 * z1)))))) end
function tmp = code(z0, z1) tmp = -1.0 / ((-1.0 - z0) - (sqrt(((1.0 - z1) - z1)) / ((1.7724539041519165 * z1) * exp((z1 * z1))))); end
code[z0_, z1_] := N[(-1.0 / N[(N[(-1.0 - z0), $MachinePrecision] - N[(N[Sqrt[N[(N[(1.0 - z1), $MachinePrecision] - z1), $MachinePrecision]], $MachinePrecision] / N[(N[(1.7724539041519165 * z1), $MachinePrecision] * N[Exp[N[(z1 * z1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{-1}{\left(-1 - z0\right) - \frac{\sqrt{\left(1 - z1\right) - z1}}{\left(1.7724539041519165 \cdot z1\right) \cdot e^{z1 \cdot z1}}}
(FPCore (z0 z1) :precision binary64 (/ -1.0 (- (- -1.0 z0) (/ (sqrt (- 1.0 z1)) (* (* 1.7724539041519165 z1) (exp (* z1 z1)))))))
double code(double z0, double z1) {
return -1.0 / ((-1.0 - z0) - (sqrt((1.0 - z1)) / ((1.7724539041519165 * z1) * exp((z1 * z1)))));
}
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, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
code = (-1.0d0) / (((-1.0d0) - z0) - (sqrt((1.0d0 - z1)) / ((1.7724539041519165d0 * z1) * exp((z1 * z1)))))
end function
public static double code(double z0, double z1) {
return -1.0 / ((-1.0 - z0) - (Math.sqrt((1.0 - z1)) / ((1.7724539041519165 * z1) * Math.exp((z1 * z1)))));
}
def code(z0, z1): return -1.0 / ((-1.0 - z0) - (math.sqrt((1.0 - z1)) / ((1.7724539041519165 * z1) * math.exp((z1 * z1)))))
function code(z0, z1) return Float64(-1.0 / Float64(Float64(-1.0 - z0) - Float64(sqrt(Float64(1.0 - z1)) / Float64(Float64(1.7724539041519165 * z1) * exp(Float64(z1 * z1)))))) end
function tmp = code(z0, z1) tmp = -1.0 / ((-1.0 - z0) - (sqrt((1.0 - z1)) / ((1.7724539041519165 * z1) * exp((z1 * z1))))); end
code[z0_, z1_] := N[(-1.0 / N[(N[(-1.0 - z0), $MachinePrecision] - N[(N[Sqrt[N[(1.0 - z1), $MachinePrecision]], $MachinePrecision] / N[(N[(1.7724539041519165 * z1), $MachinePrecision] * N[Exp[N[(z1 * z1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{-1}{\left(-1 - z0\right) - \frac{\sqrt{1 - z1}}{\left(1.7724539041519165 \cdot z1\right) \cdot e^{z1 \cdot z1}}}
Initial program 99.8%
Taylor expanded in z1 around 0
Applied rewrites99.1%
(FPCore (z0 z1) :precision binary64 (/ 1.0 (- (/ (sqrt (- 1.0 z1)) (* (- (* z1 z1) -1.0) (* 1.7724539041519165 z1))) (- -1.0 z0))))
double code(double z0, double z1) {
return 1.0 / ((sqrt((1.0 - z1)) / (((z1 * z1) - -1.0) * (1.7724539041519165 * z1))) - (-1.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, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
code = 1.0d0 / ((sqrt((1.0d0 - z1)) / (((z1 * z1) - (-1.0d0)) * (1.7724539041519165d0 * z1))) - ((-1.0d0) - z0))
end function
public static double code(double z0, double z1) {
return 1.0 / ((Math.sqrt((1.0 - z1)) / (((z1 * z1) - -1.0) * (1.7724539041519165 * z1))) - (-1.0 - z0));
}
def code(z0, z1): return 1.0 / ((math.sqrt((1.0 - z1)) / (((z1 * z1) - -1.0) * (1.7724539041519165 * z1))) - (-1.0 - z0))
function code(z0, z1) return Float64(1.0 / Float64(Float64(sqrt(Float64(1.0 - z1)) / Float64(Float64(Float64(z1 * z1) - -1.0) * Float64(1.7724539041519165 * z1))) - Float64(-1.0 - z0))) end
function tmp = code(z0, z1) tmp = 1.0 / ((sqrt((1.0 - z1)) / (((z1 * z1) - -1.0) * (1.7724539041519165 * z1))) - (-1.0 - z0)); end
code[z0_, z1_] := N[(1.0 / N[(N[(N[Sqrt[N[(1.0 - z1), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(z1 * z1), $MachinePrecision] - -1.0), $MachinePrecision] * N[(1.7724539041519165 * z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-1.0 - z0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{1}{\frac{\sqrt{1 - z1}}{\left(z1 \cdot z1 - -1\right) \cdot \left(1.7724539041519165 \cdot z1\right)} - \left(-1 - z0\right)}
Initial program 99.8%
Taylor expanded in z1 around 0
Applied rewrites99.1%
Taylor expanded in z1 around 0
lower-+.f64N/A
lower-pow.f6498.9%
Applied rewrites98.9%
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6498.9%
Applied rewrites98.9%
(FPCore (z0 z1) :precision binary64 (/ -1.0 (- (- -1.0 z0) (/ 0.5641895665989011 z1))))
double code(double z0, double z1) {
return -1.0 / ((-1.0 - z0) - (0.5641895665989011 / z1));
}
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, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
code = (-1.0d0) / (((-1.0d0) - z0) - (0.5641895665989011d0 / z1))
end function
public static double code(double z0, double z1) {
return -1.0 / ((-1.0 - z0) - (0.5641895665989011 / z1));
}
def code(z0, z1): return -1.0 / ((-1.0 - z0) - (0.5641895665989011 / z1))
function code(z0, z1) return Float64(-1.0 / Float64(Float64(-1.0 - z0) - Float64(0.5641895665989011 / z1))) end
function tmp = code(z0, z1) tmp = -1.0 / ((-1.0 - z0) - (0.5641895665989011 / z1)); end
code[z0_, z1_] := N[(-1.0 / N[(N[(-1.0 - z0), $MachinePrecision] - N[(0.5641895665989011 / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{-1}{\left(-1 - z0\right) - \frac{0.5641895665989011}{z1}}
Initial program 99.8%
Taylor expanded in z1 around 0
lower-/.f6498.4%
Applied rewrites98.4%
(FPCore (z0 z1)
:precision binary64
(if (<= z0 -1e+31)
(/ 1.0 z0)
(if (<= z0 2.65e+73)
(/ -1.0 (- -1.0 (/ 0.5641895665989011 z1)))
(/ 1.0 z0))))double code(double z0, double z1) {
double tmp;
if (z0 <= -1e+31) {
tmp = 1.0 / z0;
} else if (z0 <= 2.65e+73) {
tmp = -1.0 / (-1.0 - (0.5641895665989011 / z1));
} else {
tmp = 1.0 / 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, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: tmp
if (z0 <= (-1d+31)) then
tmp = 1.0d0 / z0
else if (z0 <= 2.65d+73) then
tmp = (-1.0d0) / ((-1.0d0) - (0.5641895665989011d0 / z1))
else
tmp = 1.0d0 / z0
end if
code = tmp
end function
public static double code(double z0, double z1) {
double tmp;
if (z0 <= -1e+31) {
tmp = 1.0 / z0;
} else if (z0 <= 2.65e+73) {
tmp = -1.0 / (-1.0 - (0.5641895665989011 / z1));
} else {
tmp = 1.0 / z0;
}
return tmp;
}
def code(z0, z1): tmp = 0 if z0 <= -1e+31: tmp = 1.0 / z0 elif z0 <= 2.65e+73: tmp = -1.0 / (-1.0 - (0.5641895665989011 / z1)) else: tmp = 1.0 / z0 return tmp
function code(z0, z1) tmp = 0.0 if (z0 <= -1e+31) tmp = Float64(1.0 / z0); elseif (z0 <= 2.65e+73) tmp = Float64(-1.0 / Float64(-1.0 - Float64(0.5641895665989011 / z1))); else tmp = Float64(1.0 / z0); end return tmp end
function tmp_2 = code(z0, z1) tmp = 0.0; if (z0 <= -1e+31) tmp = 1.0 / z0; elseif (z0 <= 2.65e+73) tmp = -1.0 / (-1.0 - (0.5641895665989011 / z1)); else tmp = 1.0 / z0; end tmp_2 = tmp; end
code[z0_, z1_] := If[LessEqual[z0, -1e+31], N[(1.0 / z0), $MachinePrecision], If[LessEqual[z0, 2.65e+73], N[(-1.0 / N[(-1.0 - N[(0.5641895665989011 / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / z0), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z0 \leq -1 \cdot 10^{+31}:\\
\;\;\;\;\frac{1}{z0}\\
\mathbf{elif}\;z0 \leq 2.65 \cdot 10^{+73}:\\
\;\;\;\;\frac{-1}{-1 - \frac{0.5641895665989011}{z1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z0}\\
\end{array}
if z0 < -9.9999999999999996e30 or 2.65e73 < z0 Initial program 99.8%
Taylor expanded in z0 around inf
lower-/.f6434.9%
Applied rewrites34.9%
if -9.9999999999999996e30 < z0 < 2.65e73Initial program 99.8%
Taylor expanded in z0 around 0
Applied rewrites66.6%
Taylor expanded in z1 around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f6453.2%
Applied rewrites53.2%
Taylor expanded in z1 around 0
Applied rewrites65.2%
(FPCore (z0 z1)
:precision binary64
(let* ((t_0
(/
(sqrt (- (- 1.0 z1) z1))
(* (* 1.7724539041519165 z1) (exp (* z1 z1))))))
(if (<= t_0 -5e+43)
(* z1 (+ 1.7724539041519165 (* -3.141592842343371 (* z0 z1))))
(if (<= t_0 2e+153) (/ 1.0 z0) (* z1 1.7724539041519165)))))double code(double z0, double z1) {
double t_0 = sqrt(((1.0 - z1) - z1)) / ((1.7724539041519165 * z1) * exp((z1 * z1)));
double tmp;
if (t_0 <= -5e+43) {
tmp = z1 * (1.7724539041519165 + (-3.141592842343371 * (z0 * z1)));
} else if (t_0 <= 2e+153) {
tmp = 1.0 / z0;
} else {
tmp = z1 * 1.7724539041519165;
}
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, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt(((1.0d0 - z1) - z1)) / ((1.7724539041519165d0 * z1) * exp((z1 * z1)))
if (t_0 <= (-5d+43)) then
tmp = z1 * (1.7724539041519165d0 + ((-3.141592842343371d0) * (z0 * z1)))
else if (t_0 <= 2d+153) then
tmp = 1.0d0 / z0
else
tmp = z1 * 1.7724539041519165d0
end if
code = tmp
end function
public static double code(double z0, double z1) {
double t_0 = Math.sqrt(((1.0 - z1) - z1)) / ((1.7724539041519165 * z1) * Math.exp((z1 * z1)));
double tmp;
if (t_0 <= -5e+43) {
tmp = z1 * (1.7724539041519165 + (-3.141592842343371 * (z0 * z1)));
} else if (t_0 <= 2e+153) {
tmp = 1.0 / z0;
} else {
tmp = z1 * 1.7724539041519165;
}
return tmp;
}
def code(z0, z1): t_0 = math.sqrt(((1.0 - z1) - z1)) / ((1.7724539041519165 * z1) * math.exp((z1 * z1))) tmp = 0 if t_0 <= -5e+43: tmp = z1 * (1.7724539041519165 + (-3.141592842343371 * (z0 * z1))) elif t_0 <= 2e+153: tmp = 1.0 / z0 else: tmp = z1 * 1.7724539041519165 return tmp
function code(z0, z1) t_0 = Float64(sqrt(Float64(Float64(1.0 - z1) - z1)) / Float64(Float64(1.7724539041519165 * z1) * exp(Float64(z1 * z1)))) tmp = 0.0 if (t_0 <= -5e+43) tmp = Float64(z1 * Float64(1.7724539041519165 + Float64(-3.141592842343371 * Float64(z0 * z1)))); elseif (t_0 <= 2e+153) tmp = Float64(1.0 / z0); else tmp = Float64(z1 * 1.7724539041519165); end return tmp end
function tmp_2 = code(z0, z1) t_0 = sqrt(((1.0 - z1) - z1)) / ((1.7724539041519165 * z1) * exp((z1 * z1))); tmp = 0.0; if (t_0 <= -5e+43) tmp = z1 * (1.7724539041519165 + (-3.141592842343371 * (z0 * z1))); elseif (t_0 <= 2e+153) tmp = 1.0 / z0; else tmp = z1 * 1.7724539041519165; end tmp_2 = tmp; end
code[z0_, z1_] := Block[{t$95$0 = N[(N[Sqrt[N[(N[(1.0 - z1), $MachinePrecision] - z1), $MachinePrecision]], $MachinePrecision] / N[(N[(1.7724539041519165 * z1), $MachinePrecision] * N[Exp[N[(z1 * z1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+43], N[(z1 * N[(1.7724539041519165 + N[(-3.141592842343371 * N[(z0 * z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+153], N[(1.0 / z0), $MachinePrecision], N[(z1 * 1.7724539041519165), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{\sqrt{\left(1 - z1\right) - z1}}{\left(1.7724539041519165 \cdot z1\right) \cdot e^{z1 \cdot z1}}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+43}:\\
\;\;\;\;z1 \cdot \left(1.7724539041519165 + -3.141592842343371 \cdot \left(z0 \cdot z1\right)\right)\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+153}:\\
\;\;\;\;\frac{1}{z0}\\
\mathbf{else}:\\
\;\;\;\;z1 \cdot 1.7724539041519165\\
\end{array}
if (/.f64 (sqrt.f64 (-.f64 (-.f64 #s(literal 1 binary64) z1) z1)) (*.f64 (*.f64 #s(literal 3544907808303833/2000000000000000 binary64) z1) (exp.f64 (*.f64 z1 z1)))) < -5.0000000000000004e43Initial program 99.8%
Taylor expanded in z0 around inf
lower-/.f6434.9%
Applied rewrites34.9%
Taylor expanded in z1 around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6450.4%
Applied rewrites50.4%
Taylor expanded in z0 around inf
lower-*.f6450.1%
Applied rewrites50.1%
if -5.0000000000000004e43 < (/.f64 (sqrt.f64 (-.f64 (-.f64 #s(literal 1 binary64) z1) z1)) (*.f64 (*.f64 #s(literal 3544907808303833/2000000000000000 binary64) z1) (exp.f64 (*.f64 z1 z1)))) < 2e153Initial program 99.8%
Taylor expanded in z0 around inf
lower-/.f6434.9%
Applied rewrites34.9%
if 2e153 < (/.f64 (sqrt.f64 (-.f64 (-.f64 #s(literal 1 binary64) z1) z1)) (*.f64 (*.f64 #s(literal 3544907808303833/2000000000000000 binary64) z1) (exp.f64 (*.f64 z1 z1)))) Initial program 99.8%
Taylor expanded in z0 around inf
lower-/.f6434.9%
Applied rewrites34.9%
Taylor expanded in z1 around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6450.4%
Applied rewrites50.4%
Taylor expanded in z1 around 0
Applied rewrites50.2%
(FPCore (z0 z1) :precision binary64 (if (<= z1 -1.4e-35) (/ 1.0 z0) (if (<= z1 2.8e-155) (* z1 1.7724539041519165) (/ 1.0 z0))))
double code(double z0, double z1) {
double tmp;
if (z1 <= -1.4e-35) {
tmp = 1.0 / z0;
} else if (z1 <= 2.8e-155) {
tmp = z1 * 1.7724539041519165;
} else {
tmp = 1.0 / 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, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: tmp
if (z1 <= (-1.4d-35)) then
tmp = 1.0d0 / z0
else if (z1 <= 2.8d-155) then
tmp = z1 * 1.7724539041519165d0
else
tmp = 1.0d0 / z0
end if
code = tmp
end function
public static double code(double z0, double z1) {
double tmp;
if (z1 <= -1.4e-35) {
tmp = 1.0 / z0;
} else if (z1 <= 2.8e-155) {
tmp = z1 * 1.7724539041519165;
} else {
tmp = 1.0 / z0;
}
return tmp;
}
def code(z0, z1): tmp = 0 if z1 <= -1.4e-35: tmp = 1.0 / z0 elif z1 <= 2.8e-155: tmp = z1 * 1.7724539041519165 else: tmp = 1.0 / z0 return tmp
function code(z0, z1) tmp = 0.0 if (z1 <= -1.4e-35) tmp = Float64(1.0 / z0); elseif (z1 <= 2.8e-155) tmp = Float64(z1 * 1.7724539041519165); else tmp = Float64(1.0 / z0); end return tmp end
function tmp_2 = code(z0, z1) tmp = 0.0; if (z1 <= -1.4e-35) tmp = 1.0 / z0; elseif (z1 <= 2.8e-155) tmp = z1 * 1.7724539041519165; else tmp = 1.0 / z0; end tmp_2 = tmp; end
code[z0_, z1_] := If[LessEqual[z1, -1.4e-35], N[(1.0 / z0), $MachinePrecision], If[LessEqual[z1, 2.8e-155], N[(z1 * 1.7724539041519165), $MachinePrecision], N[(1.0 / z0), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z1 \leq -1.4 \cdot 10^{-35}:\\
\;\;\;\;\frac{1}{z0}\\
\mathbf{elif}\;z1 \leq 2.8 \cdot 10^{-155}:\\
\;\;\;\;z1 \cdot 1.7724539041519165\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z0}\\
\end{array}
if z1 < -1.4e-35 or 2.8e-155 < z1 Initial program 99.8%
Taylor expanded in z0 around inf
lower-/.f6434.9%
Applied rewrites34.9%
if -1.4e-35 < z1 < 2.8e-155Initial program 99.8%
Taylor expanded in z0 around inf
lower-/.f6434.9%
Applied rewrites34.9%
Taylor expanded in z1 around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6450.4%
Applied rewrites50.4%
Taylor expanded in z1 around 0
Applied rewrites50.2%
(FPCore (z0 z1)
:precision binary64
(if (<= z1 -1.4e-35)
(/ 1.0 z0)
(if (<= z1 2.8e-155)
(* z1 (+ 1.7724539041519165 (* -1.3691389381914547 z1)))
(/ 1.0 z0))))double code(double z0, double z1) {
double tmp;
if (z1 <= -1.4e-35) {
tmp = 1.0 / z0;
} else if (z1 <= 2.8e-155) {
tmp = z1 * (1.7724539041519165 + (-1.3691389381914547 * z1));
} else {
tmp = 1.0 / 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, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
real(8) :: tmp
if (z1 <= (-1.4d-35)) then
tmp = 1.0d0 / z0
else if (z1 <= 2.8d-155) then
tmp = z1 * (1.7724539041519165d0 + ((-1.3691389381914547d0) * z1))
else
tmp = 1.0d0 / z0
end if
code = tmp
end function
public static double code(double z0, double z1) {
double tmp;
if (z1 <= -1.4e-35) {
tmp = 1.0 / z0;
} else if (z1 <= 2.8e-155) {
tmp = z1 * (1.7724539041519165 + (-1.3691389381914547 * z1));
} else {
tmp = 1.0 / z0;
}
return tmp;
}
def code(z0, z1): tmp = 0 if z1 <= -1.4e-35: tmp = 1.0 / z0 elif z1 <= 2.8e-155: tmp = z1 * (1.7724539041519165 + (-1.3691389381914547 * z1)) else: tmp = 1.0 / z0 return tmp
function code(z0, z1) tmp = 0.0 if (z1 <= -1.4e-35) tmp = Float64(1.0 / z0); elseif (z1 <= 2.8e-155) tmp = Float64(z1 * Float64(1.7724539041519165 + Float64(-1.3691389381914547 * z1))); else tmp = Float64(1.0 / z0); end return tmp end
function tmp_2 = code(z0, z1) tmp = 0.0; if (z1 <= -1.4e-35) tmp = 1.0 / z0; elseif (z1 <= 2.8e-155) tmp = z1 * (1.7724539041519165 + (-1.3691389381914547 * z1)); else tmp = 1.0 / z0; end tmp_2 = tmp; end
code[z0_, z1_] := If[LessEqual[z1, -1.4e-35], N[(1.0 / z0), $MachinePrecision], If[LessEqual[z1, 2.8e-155], N[(z1 * N[(1.7724539041519165 + N[(-1.3691389381914547 * z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / z0), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z1 \leq -1.4 \cdot 10^{-35}:\\
\;\;\;\;\frac{1}{z0}\\
\mathbf{elif}\;z1 \leq 2.8 \cdot 10^{-155}:\\
\;\;\;\;z1 \cdot \left(1.7724539041519165 + -1.3691389381914547 \cdot z1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z0}\\
\end{array}
if z1 < -1.4e-35 or 2.8e-155 < z1 Initial program 99.8%
Taylor expanded in z0 around inf
lower-/.f6434.9%
Applied rewrites34.9%
if -1.4e-35 < z1 < 2.8e-155Initial program 99.8%
Taylor expanded in z0 around inf
lower-/.f6434.9%
Applied rewrites34.9%
Taylor expanded in z1 around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6450.4%
Applied rewrites50.4%
Taylor expanded in z0 around 0
lower-*.f6450.5%
Applied rewrites50.5%
(FPCore (z0 z1) :precision binary64 (* z1 1.7724539041519165))
double code(double z0, double z1) {
return z1 * 1.7724539041519165;
}
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, z1)
use fmin_fmax_functions
real(8), intent (in) :: z0
real(8), intent (in) :: z1
code = z1 * 1.7724539041519165d0
end function
public static double code(double z0, double z1) {
return z1 * 1.7724539041519165;
}
def code(z0, z1): return z1 * 1.7724539041519165
function code(z0, z1) return Float64(z1 * 1.7724539041519165) end
function tmp = code(z0, z1) tmp = z1 * 1.7724539041519165; end
code[z0_, z1_] := N[(z1 * 1.7724539041519165), $MachinePrecision]
z1 \cdot 1.7724539041519165
Initial program 99.8%
Taylor expanded in z0 around inf
lower-/.f6434.9%
Applied rewrites34.9%
Taylor expanded in z1 around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6450.4%
Applied rewrites50.4%
Taylor expanded in z1 around 0
Applied rewrites50.2%
herbie shell --seed 2025250
(FPCore (z0 z1)
:name "(/ -1 (- (- -1 z0) (/ (sqrt (- (- 1 z1) z1)) (* (* 3544907808303833/2000000000000000 z1) (exp (* z1 z1))))))"
:precision binary64
(/ -1.0 (- (- -1.0 z0) (/ (sqrt (- (- 1.0 z1) z1)) (* (* 1.7724539041519165 z1) (exp (* z1 z1)))))))