
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
(FPCore (x y z t) :precision binary64 (/ (/ x (- z y)) (- z t)))
double code(double x, double y, double z, double t) {
return (x / (z - y)) / (z - t);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / (z - y)) / (z - t)
end function
public static double code(double x, double y, double z, double t) {
return (x / (z - y)) / (z - t);
}
def code(x, y, z, t): return (x / (z - y)) / (z - t)
function code(x, y, z, t) return Float64(Float64(x / Float64(z - y)) / Float64(z - t)) end
function tmp = code(x, y, z, t) tmp = (x / (z - y)) / (z - t); end
code[x_, y_, z_, t_] := N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x}{z - y}}{z - t}
\end{array}
Initial program 88.7%
Applied rewrites96.9%
(FPCore (x y z t) :precision binary64 (/ (/ x (- z t)) (- z y)))
double code(double x, double y, double z, double t) {
return (x / (z - t)) / (z - y);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / (z - t)) / (z - y)
end function
public static double code(double x, double y, double z, double t) {
return (x / (z - t)) / (z - y);
}
def code(x, y, z, t): return (x / (z - t)) / (z - y)
function code(x, y, z, t) return Float64(Float64(x / Float64(z - t)) / Float64(z - y)) end
function tmp = code(x, y, z, t) tmp = (x / (z - t)) / (z - y); end
code[x_, y_, z_, t_] := N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x}{z - t}}{z - y}
\end{array}
Initial program 88.7%
Applied rewrites97.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) (- t z)))) (if (<= t_1 1e+299) (/ x t_1) (/ (/ x (- z y)) z))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if (t_1 <= 1e+299) {
tmp = x / t_1;
} else {
tmp = (x / (z - y)) / z;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y - z) * (t - z)
if (t_1 <= 1d+299) then
tmp = x / t_1
else
tmp = (x / (z - y)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if (t_1 <= 1e+299) {
tmp = x / t_1;
} else {
tmp = (x / (z - y)) / z;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if t_1 <= 1e+299: tmp = x / t_1 else: tmp = (x / (z - y)) / z return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (t_1 <= 1e+299) tmp = Float64(x / t_1); else tmp = Float64(Float64(x / Float64(z - y)) / z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * (t - z); tmp = 0.0; if (t_1 <= 1e+299) tmp = x / t_1; else tmp = (x / (z - y)) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+299], N[(x / t$95$1), $MachinePrecision], N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;t\_1 \leq 10^{+299}:\\
\;\;\;\;\frac{x}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z - y}}{z}\\
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < 1.0000000000000001e299Initial program 88.7%
if 1.0000000000000001e299 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 88.7%
Applied rewrites96.9%
Taylor expanded in t around 0
Applied rewrites52.8%
Applied rewrites60.2%
(FPCore (x y z t) :precision binary64 (if (<= y -9e-85) (/ x (* y (- t z))) (if (<= y 4.5e-88) (/ (/ x (- z t)) z) (/ x (* (- y z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e-85) {
tmp = x / (y * (t - z));
} else if (y <= 4.5e-88) {
tmp = (x / (z - t)) / z;
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-9d-85)) then
tmp = x / (y * (t - z))
else if (y <= 4.5d-88) then
tmp = (x / (z - t)) / z
else
tmp = x / ((y - z) * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e-85) {
tmp = x / (y * (t - z));
} else if (y <= 4.5e-88) {
tmp = (x / (z - t)) / z;
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9e-85: tmp = x / (y * (t - z)) elif y <= 4.5e-88: tmp = (x / (z - t)) / z else: tmp = x / ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9e-85) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (y <= 4.5e-88) tmp = Float64(Float64(x / Float64(z - t)) / z); else tmp = Float64(x / Float64(Float64(y - z) * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -9e-85) tmp = x / (y * (t - z)); elseif (y <= 4.5e-88) tmp = (x / (z - t)) / z; else tmp = x / ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9e-85], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e-88], N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-85}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-88}:\\
\;\;\;\;\frac{\frac{x}{z - t}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -9.00000000000000008e-85Initial program 88.7%
Taylor expanded in y around inf
Applied rewrites57.2%
if -9.00000000000000008e-85 < y < 4.49999999999999991e-88Initial program 88.7%
Applied rewrites96.9%
Taylor expanded in y around 0
Applied rewrites53.3%
Applied rewrites60.4%
if 4.49999999999999991e-88 < y Initial program 88.7%
Taylor expanded in z around 0
Applied rewrites57.5%
(FPCore (x y z t) :precision binary64 (if (<= y -9e-85) (/ x (* y (- t z))) (if (<= y 2.4e-114) (/ x (* z (- z t))) (/ x (* (- y z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e-85) {
tmp = x / (y * (t - z));
} else if (y <= 2.4e-114) {
tmp = x / (z * (z - t));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-9d-85)) then
tmp = x / (y * (t - z))
else if (y <= 2.4d-114) then
tmp = x / (z * (z - t))
else
tmp = x / ((y - z) * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e-85) {
tmp = x / (y * (t - z));
} else if (y <= 2.4e-114) {
tmp = x / (z * (z - t));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9e-85: tmp = x / (y * (t - z)) elif y <= 2.4e-114: tmp = x / (z * (z - t)) else: tmp = x / ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9e-85) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (y <= 2.4e-114) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(x / Float64(Float64(y - z) * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -9e-85) tmp = x / (y * (t - z)); elseif (y <= 2.4e-114) tmp = x / (z * (z - t)); else tmp = x / ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9e-85], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4e-114], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-85}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-114}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -9.00000000000000008e-85Initial program 88.7%
Taylor expanded in y around inf
Applied rewrites57.2%
if -9.00000000000000008e-85 < y < 2.4000000000000001e-114Initial program 88.7%
Applied rewrites96.9%
Taylor expanded in y around 0
Applied rewrites53.3%
if 2.4000000000000001e-114 < y Initial program 88.7%
Taylor expanded in z around 0
Applied rewrites57.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ x (* y (- t z))))) (if (<= y -9e-85) t_1 (if (<= y 7e-90) (/ x (* z (- z t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x / (y * (t - z));
double tmp;
if (y <= -9e-85) {
tmp = t_1;
} else if (y <= 7e-90) {
tmp = x / (z * (z - t));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / (y * (t - z))
if (y <= (-9d-85)) then
tmp = t_1
else if (y <= 7d-90) then
tmp = x / (z * (z - t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (y * (t - z));
double tmp;
if (y <= -9e-85) {
tmp = t_1;
} else if (y <= 7e-90) {
tmp = x / (z * (z - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (y * (t - z)) tmp = 0 if y <= -9e-85: tmp = t_1 elif y <= 7e-90: tmp = x / (z * (z - t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(y * Float64(t - z))) tmp = 0.0 if (y <= -9e-85) tmp = t_1; elseif (y <= 7e-90) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (y * (t - z)); tmp = 0.0; if (y <= -9e-85) tmp = t_1; elseif (y <= 7e-90) tmp = x / (z * (z - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9e-85], t$95$1, If[LessEqual[y, 7e-90], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{if}\;y \leq -9 \cdot 10^{-85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-90}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.00000000000000008e-85 or 6.9999999999999997e-90 < y Initial program 88.7%
Taylor expanded in y around inf
Applied rewrites57.2%
if -9.00000000000000008e-85 < y < 6.9999999999999997e-90Initial program 88.7%
Applied rewrites96.9%
Taylor expanded in y around 0
Applied rewrites53.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* z (- z y)))))
(if (<= z -2.2e-105)
t_1
(if (<= z 6.5e-74)
(/ x (* t y))
(if (<= z 1.46e+35) t_1 (/ x (* z (- z t))))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z * (z - y));
double tmp;
if (z <= -2.2e-105) {
tmp = t_1;
} else if (z <= 6.5e-74) {
tmp = x / (t * y);
} else if (z <= 1.46e+35) {
tmp = t_1;
} else {
tmp = x / (z * (z - t));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / (z * (z - y))
if (z <= (-2.2d-105)) then
tmp = t_1
else if (z <= 6.5d-74) then
tmp = x / (t * y)
else if (z <= 1.46d+35) then
tmp = t_1
else
tmp = x / (z * (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (z * (z - y));
double tmp;
if (z <= -2.2e-105) {
tmp = t_1;
} else if (z <= 6.5e-74) {
tmp = x / (t * y);
} else if (z <= 1.46e+35) {
tmp = t_1;
} else {
tmp = x / (z * (z - t));
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z * (z - y)) tmp = 0 if z <= -2.2e-105: tmp = t_1 elif z <= 6.5e-74: tmp = x / (t * y) elif z <= 1.46e+35: tmp = t_1 else: tmp = x / (z * (z - t)) return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z * Float64(z - y))) tmp = 0.0 if (z <= -2.2e-105) tmp = t_1; elseif (z <= 6.5e-74) tmp = Float64(x / Float64(t * y)); elseif (z <= 1.46e+35) tmp = t_1; else tmp = Float64(x / Float64(z * Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z * (z - y)); tmp = 0.0; if (z <= -2.2e-105) tmp = t_1; elseif (z <= 6.5e-74) tmp = x / (t * y); elseif (z <= 1.46e+35) tmp = t_1; else tmp = x / (z * (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e-105], t$95$1, If[LessEqual[z, 6.5e-74], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.46e+35], t$95$1, N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{-105}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-74}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{elif}\;z \leq 1.46 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\end{array}
\end{array}
if z < -2.20000000000000004e-105 or 6.5000000000000002e-74 < z < 1.4599999999999999e35Initial program 88.7%
Applied rewrites96.9%
Taylor expanded in t around 0
Applied rewrites52.8%
if -2.20000000000000004e-105 < z < 6.5000000000000002e-74Initial program 88.7%
Taylor expanded in z around 0
Applied rewrites39.6%
if 1.4599999999999999e35 < z Initial program 88.7%
Applied rewrites96.9%
Taylor expanded in y around 0
Applied rewrites53.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ x (* z (- z t))))) (if (<= z -1.7e-103) t_1 (if (<= z 1.42e-89) (/ x (* t y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z * (z - t));
double tmp;
if (z <= -1.7e-103) {
tmp = t_1;
} else if (z <= 1.42e-89) {
tmp = x / (t * y);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / (z * (z - t))
if (z <= (-1.7d-103)) then
tmp = t_1
else if (z <= 1.42d-89) then
tmp = x / (t * y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (z * (z - t));
double tmp;
if (z <= -1.7e-103) {
tmp = t_1;
} else if (z <= 1.42e-89) {
tmp = x / (t * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z * (z - t)) tmp = 0 if z <= -1.7e-103: tmp = t_1 elif z <= 1.42e-89: tmp = x / (t * y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z * Float64(z - t))) tmp = 0.0 if (z <= -1.7e-103) tmp = t_1; elseif (z <= 1.42e-89) tmp = Float64(x / Float64(t * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z * (z - t)); tmp = 0.0; if (z <= -1.7e-103) tmp = t_1; elseif (z <= 1.42e-89) tmp = x / (t * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e-103], t$95$1, If[LessEqual[z, 1.42e-89], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{-103}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.42 \cdot 10^{-89}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.70000000000000001e-103 or 1.42e-89 < z Initial program 88.7%
Applied rewrites96.9%
Taylor expanded in y around 0
Applied rewrites53.3%
if -1.70000000000000001e-103 < z < 1.42e-89Initial program 88.7%
Taylor expanded in z around 0
Applied rewrites39.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ x (* z z)))) (if (<= z -8e-6) t_1 (if (<= z 1.65e-43) (/ x (* t y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z * z);
double tmp;
if (z <= -8e-6) {
tmp = t_1;
} else if (z <= 1.65e-43) {
tmp = x / (t * y);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / (z * z)
if (z <= (-8d-6)) then
tmp = t_1
else if (z <= 1.65d-43) then
tmp = x / (t * y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (z * z);
double tmp;
if (z <= -8e-6) {
tmp = t_1;
} else if (z <= 1.65e-43) {
tmp = x / (t * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z * z) tmp = 0 if z <= -8e-6: tmp = t_1 elif z <= 1.65e-43: tmp = x / (t * y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z * z)) tmp = 0.0 if (z <= -8e-6) tmp = t_1; elseif (z <= 1.65e-43) tmp = Float64(x / Float64(t * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z * z); tmp = 0.0; if (z <= -8e-6) tmp = t_1; elseif (z <= 1.65e-43) tmp = x / (t * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e-6], t$95$1, If[LessEqual[z, 1.65e-43], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot z}\\
\mathbf{if}\;z \leq -8 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-43}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.99999999999999964e-6 or 1.65000000000000008e-43 < z Initial program 88.7%
Applied rewrites96.9%
Taylor expanded in t around 0
Applied rewrites52.8%
Taylor expanded in y around 0
Applied rewrites40.2%
if -7.99999999999999964e-6 < z < 1.65000000000000008e-43Initial program 88.7%
Taylor expanded in z around 0
Applied rewrites39.6%
(FPCore (x y z t) :precision binary64 (/ x (* z z)))
double code(double x, double y, double z, double t) {
return x / (z * z);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / (z * z)
end function
public static double code(double x, double y, double z, double t) {
return x / (z * z);
}
def code(x, y, z, t): return x / (z * z)
function code(x, y, z, t) return Float64(x / Float64(z * z)) end
function tmp = code(x, y, z, t) tmp = x / (z * z); end
code[x_, y_, z_, t_] := N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{z \cdot z}
\end{array}
Initial program 88.7%
Applied rewrites96.9%
Taylor expanded in t around 0
Applied rewrites52.8%
Taylor expanded in y around 0
Applied rewrites40.2%
herbie shell --seed 2025153
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
(/ x (* (- y z) (- t z))))