
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.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(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 * 0.5d0) - y) * sqrt((z * 2.0d0))) * exp(((t * t) / 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.exp(((t * t) / 2.0));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.exp(((t * t) / 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * exp(Float64(Float64(t * t) / 2.0))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}
\end{array}
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.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(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 * 0.5d0) - y) * sqrt((z * 2.0d0))) * exp(((t * t) / 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.exp(((t * t) / 2.0));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.exp(((t * t) / 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * exp(Float64(Float64(t * t) / 2.0))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}
\end{array}
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (pow (exp t) (* t 0.5))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * pow(exp(t), (t * 0.5));
}
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 * 0.5d0) - y) * sqrt((z * 2.0d0))) * (exp(t) ** (t * 0.5d0))
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.pow(Math.exp(t), (t * 0.5));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.pow(math.exp(t), (t * 0.5))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * (exp(t) ^ Float64(t * 0.5))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * (exp(t) ^ (t * 0.5)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Power[N[Exp[t], $MachinePrecision], N[(t * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot {\left(e^{t}\right)}^{\left(t \cdot 0.5\right)}
\end{array}
Initial program 99.4%
lift-exp.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
exp-sqrtN/A
pow1/2N/A
pow2N/A
exp-prodN/A
pow-unpowN/A
lower-pow.f64N/A
lower-exp.f64N/A
lower-*.f6499.4
Applied rewrites99.4%
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (pow (sqrt (exp t)) t)))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * pow(sqrt(exp(t)), 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 * 0.5d0) - y) * sqrt((z * 2.0d0))) * (sqrt(exp(t)) ** t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.pow(Math.sqrt(Math.exp(t)), t);
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.pow(math.sqrt(math.exp(t)), t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * (sqrt(exp(t)) ^ t)) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * (sqrt(exp(t)) ^ t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sqrt[N[Exp[t], $MachinePrecision]], $MachinePrecision], t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot {\left(\sqrt{e^{t}}\right)}^{t}
\end{array}
Initial program 99.4%
lift-exp.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
pow2N/A
associate-/l*N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-sqrtN/A
lower-sqrt.f64N/A
lower-exp.f6499.4
Applied rewrites99.4%
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.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(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 * 0.5d0) - y) * sqrt((z * 2.0d0))) * exp(((t * t) / 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.exp(((t * t) / 2.0));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.exp(((t * t) / 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * exp(Float64(Float64(t * t) / 2.0))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}
\end{array}
Initial program 99.4%
(FPCore (x y z t) :precision binary64 (* (* (- (* 0.5 x) y) (sqrt (* 2.0 (exp (* t t))))) (sqrt z)))
double code(double x, double y, double z, double t) {
return (((0.5 * x) - y) * sqrt((2.0 * exp((t * t))))) * sqrt(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 = (((0.5d0 * x) - y) * sqrt((2.0d0 * exp((t * t))))) * sqrt(z)
end function
public static double code(double x, double y, double z, double t) {
return (((0.5 * x) - y) * Math.sqrt((2.0 * Math.exp((t * t))))) * Math.sqrt(z);
}
def code(x, y, z, t): return (((0.5 * x) - y) * math.sqrt((2.0 * math.exp((t * t))))) * math.sqrt(z)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(0.5 * x) - y) * sqrt(Float64(2.0 * exp(Float64(t * t))))) * sqrt(z)) end
function tmp = code(x, y, z, t) tmp = (((0.5 * x) - y) * sqrt((2.0 * exp((t * t))))) * sqrt(z); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * N[Exp[N[(t * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(0.5 \cdot x - y\right) \cdot \sqrt{2 \cdot e^{t \cdot t}}\right) \cdot \sqrt{z}
\end{array}
Initial program 99.4%
Applied rewrites99.6%
(FPCore (x y z t) :precision binary64 (* (sqrt (* 2.0 (exp (* t t)))) (* (- (* 0.5 x) y) (sqrt z))))
double code(double x, double y, double z, double t) {
return sqrt((2.0 * exp((t * t)))) * (((0.5 * x) - y) * sqrt(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 = sqrt((2.0d0 * exp((t * t)))) * (((0.5d0 * x) - y) * sqrt(z))
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt((2.0 * Math.exp((t * t)))) * (((0.5 * x) - y) * Math.sqrt(z));
}
def code(x, y, z, t): return math.sqrt((2.0 * math.exp((t * t)))) * (((0.5 * x) - y) * math.sqrt(z))
function code(x, y, z, t) return Float64(sqrt(Float64(2.0 * exp(Float64(t * t)))) * Float64(Float64(Float64(0.5 * x) - y) * sqrt(z))) end
function tmp = code(x, y, z, t) tmp = sqrt((2.0 * exp((t * t)))) * (((0.5 * x) - y) * sqrt(z)); end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(2.0 * N[Exp[N[(t * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{2 \cdot e^{t \cdot t}} \cdot \left(\left(0.5 \cdot x - y\right) \cdot \sqrt{z}\right)
\end{array}
Initial program 99.4%
Applied rewrites99.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (sqrt (+ z z)) (* (fma (* t t) 0.5 1.0) (- (* x 0.5) y)))))
(if (<= t 11.2)
t_1
(if (<= t 3e+104) (* (- (sqrt (* (exp (* t t)) (+ z z)))) y) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + z)) * (fma((t * t), 0.5, 1.0) * ((x * 0.5) - y));
double tmp;
if (t <= 11.2) {
tmp = t_1;
} else if (t <= 3e+104) {
tmp = -sqrt((exp((t * t)) * (z + z))) * y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(sqrt(Float64(z + z)) * Float64(fma(Float64(t * t), 0.5, 1.0) * Float64(Float64(x * 0.5) - y))) tmp = 0.0 if (t <= 11.2) tmp = t_1; elseif (t <= 3e+104) tmp = Float64(Float64(-sqrt(Float64(exp(Float64(t * t)) * Float64(z + z)))) * y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(t * t), $MachinePrecision] * 0.5 + 1.0), $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 11.2], t$95$1, If[LessEqual[t, 3e+104], N[((-N[Sqrt[N[(N[Exp[N[(t * t), $MachinePrecision]], $MachinePrecision] * N[(z + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z + z} \cdot \left(\mathsf{fma}\left(t \cdot t, 0.5, 1\right) \cdot \left(x \cdot 0.5 - y\right)\right)\\
\mathbf{if}\;t \leq 11.2:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+104}:\\
\;\;\;\;\left(-\sqrt{e^{t \cdot t} \cdot \left(z + z\right)}\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < 11.199999999999999 or 2.99999999999999969e104 < t Initial program 99.4%
Taylor expanded in t around 0
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
lower-*.f64N/A
Applied rewrites90.0%
Taylor expanded in z around 0
associate-*r*N/A
lower-*.f64N/A
sqrt-unprodN/A
*-commutativeN/A
count-2-revN/A
lift-sqrt.f64N/A
lift-+.f64N/A
lower-*.f64N/A
*-commutativeN/A
pow2N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6491.6
Applied rewrites91.6%
if 11.199999999999999 < t < 2.99999999999999969e104Initial program 98.8%
Taylor expanded in x around 0
Applied rewrites72.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (* (- (* 0.5 x) y) (sqrt (fma t (+ t t) 2.0))) (sqrt z))))
(if (<= t 2.8e+15)
t_1
(if (<= t 7e+56)
(* (sqrt (* 2.0 1.0)) (* (* (sqrt z) (fma (/ x y) 0.5 -1.0)) y))
(if (<= t 1.25e+141)
(* (* (sqrt (* (* (* t t) (* t t)) z)) 0.5) x)
t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (((0.5 * x) - y) * sqrt(fma(t, (t + t), 2.0))) * sqrt(z);
double tmp;
if (t <= 2.8e+15) {
tmp = t_1;
} else if (t <= 7e+56) {
tmp = sqrt((2.0 * 1.0)) * ((sqrt(z) * fma((x / y), 0.5, -1.0)) * y);
} else if (t <= 1.25e+141) {
tmp = (sqrt((((t * t) * (t * t)) * z)) * 0.5) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(Float64(Float64(0.5 * x) - y) * sqrt(fma(t, Float64(t + t), 2.0))) * sqrt(z)) tmp = 0.0 if (t <= 2.8e+15) tmp = t_1; elseif (t <= 7e+56) tmp = Float64(sqrt(Float64(2.0 * 1.0)) * Float64(Float64(sqrt(z) * fma(Float64(x / y), 0.5, -1.0)) * y)); elseif (t <= 1.25e+141) tmp = Float64(Float64(sqrt(Float64(Float64(Float64(t * t) * Float64(t * t)) * z)) * 0.5) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(t * N[(t + t), $MachinePrecision] + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 2.8e+15], t$95$1, If[LessEqual[t, 7e+56], N[(N[Sqrt[N[(2.0 * 1.0), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[z], $MachinePrecision] * N[(N[(x / y), $MachinePrecision] * 0.5 + -1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.25e+141], N[(N[(N[Sqrt[N[(N[(N[(t * t), $MachinePrecision] * N[(t * t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(0.5 \cdot x - y\right) \cdot \sqrt{\mathsf{fma}\left(t, t + t, 2\right)}\right) \cdot \sqrt{z}\\
\mathbf{if}\;t \leq 2.8 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+56}:\\
\;\;\;\;\sqrt{2 \cdot 1} \cdot \left(\left(\sqrt{z} \cdot \mathsf{fma}\left(\frac{x}{y}, 0.5, -1\right)\right) \cdot y\right)\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{+141}:\\
\;\;\;\;\left(\sqrt{\left(\left(t \cdot t\right) \cdot \left(t \cdot t\right)\right) \cdot z} \cdot 0.5\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < 2.8e15 or 1.25000000000000006e141 < t Initial program 99.5%
lift-exp.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
exp-sqrtN/A
pow1/2N/A
pow2N/A
exp-prodN/A
pow-unpowN/A
lower-pow.f64N/A
lower-exp.f64N/A
lower-*.f6499.5
Applied rewrites99.5%
Applied rewrites99.5%
Taylor expanded in t around 0
*-commutativeN/A
+-commutativeN/A
count-2-revN/A
pow2N/A
pow2N/A
distribute-rgt-outN/A
lower-fma.f64N/A
lower-+.f6488.7
Applied rewrites88.7%
if 2.8e15 < t < 6.99999999999999999e56Initial program 99.6%
Applied rewrites99.6%
Taylor expanded in y around inf
*-commutativeN/A
distribute-rgt-out--N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-*.f64N/A
Applied rewrites99.6%
Taylor expanded in t around 0
Applied rewrites27.3%
if 6.99999999999999999e56 < t < 1.25000000000000006e141Initial program 98.3%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites77.9%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
distribute-rgt-outN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
count-2-revN/A
lift-+.f6453.0
Applied rewrites53.0%
Taylor expanded in t around inf
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6468.6
Applied rewrites68.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (* (- (* 0.5 x) y) (sqrt (fma t (+ t t) 2.0))) (sqrt z))))
(if (<= t 32500.0)
t_1
(if (<= t 3.2e+40)
(* (sqrt 2.0) (* (* (/ 1.0 (sqrt z)) (- (* x 0.5) y)) z))
(if (<= t 1.25e+141)
(* (* (sqrt (* (* (* t t) (* t t)) z)) 0.5) x)
t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (((0.5 * x) - y) * sqrt(fma(t, (t + t), 2.0))) * sqrt(z);
double tmp;
if (t <= 32500.0) {
tmp = t_1;
} else if (t <= 3.2e+40) {
tmp = sqrt(2.0) * (((1.0 / sqrt(z)) * ((x * 0.5) - y)) * z);
} else if (t <= 1.25e+141) {
tmp = (sqrt((((t * t) * (t * t)) * z)) * 0.5) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(Float64(Float64(0.5 * x) - y) * sqrt(fma(t, Float64(t + t), 2.0))) * sqrt(z)) tmp = 0.0 if (t <= 32500.0) tmp = t_1; elseif (t <= 3.2e+40) tmp = Float64(sqrt(2.0) * Float64(Float64(Float64(1.0 / sqrt(z)) * Float64(Float64(x * 0.5) - y)) * z)); elseif (t <= 1.25e+141) tmp = Float64(Float64(sqrt(Float64(Float64(Float64(t * t) * Float64(t * t)) * z)) * 0.5) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(t * N[(t + t), $MachinePrecision] + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 32500.0], t$95$1, If[LessEqual[t, 3.2e+40], N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[(1.0 / N[Sqrt[z], $MachinePrecision]), $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.25e+141], N[(N[(N[Sqrt[N[(N[(N[(t * t), $MachinePrecision] * N[(t * t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(0.5 \cdot x - y\right) \cdot \sqrt{\mathsf{fma}\left(t, t + t, 2\right)}\right) \cdot \sqrt{z}\\
\mathbf{if}\;t \leq 32500:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{+40}:\\
\;\;\;\;\sqrt{2} \cdot \left(\left(\frac{1}{\sqrt{z}} \cdot \left(x \cdot 0.5 - y\right)\right) \cdot z\right)\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{+141}:\\
\;\;\;\;\left(\sqrt{\left(\left(t \cdot t\right) \cdot \left(t \cdot t\right)\right) \cdot z} \cdot 0.5\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < 32500 or 1.25000000000000006e141 < t Initial program 99.5%
lift-exp.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
exp-sqrtN/A
pow1/2N/A
pow2N/A
exp-prodN/A
pow-unpowN/A
lower-pow.f64N/A
lower-exp.f64N/A
lower-*.f6499.5
Applied rewrites99.5%
Applied rewrites99.5%
Taylor expanded in t around 0
*-commutativeN/A
+-commutativeN/A
count-2-revN/A
pow2N/A
pow2N/A
distribute-rgt-outN/A
lower-fma.f64N/A
lower-+.f6489.3
Applied rewrites89.3%
if 32500 < t < 3.19999999999999981e40Initial program 100.0%
Applied rewrites100.0%
Taylor expanded in t around 0
Applied rewrites15.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lift-sqrt.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6428.4
Applied rewrites28.4%
if 3.19999999999999981e40 < t < 1.25000000000000006e141Initial program 98.5%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites76.3%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
distribute-rgt-outN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
count-2-revN/A
lift-+.f6449.1
Applied rewrites49.1%
Taylor expanded in t around inf
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6461.9
Applied rewrites61.9%
(FPCore (x y z t) :precision binary64 (* (sqrt (+ z z)) (* (fma (* t t) 0.5 1.0) (- (* x 0.5) y))))
double code(double x, double y, double z, double t) {
return sqrt((z + z)) * (fma((t * t), 0.5, 1.0) * ((x * 0.5) - y));
}
function code(x, y, z, t) return Float64(sqrt(Float64(z + z)) * Float64(fma(Float64(t * t), 0.5, 1.0) * Float64(Float64(x * 0.5) - y))) end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(t * t), $MachinePrecision] * 0.5 + 1.0), $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{z + z} \cdot \left(\mathsf{fma}\left(t \cdot t, 0.5, 1\right) \cdot \left(x \cdot 0.5 - y\right)\right)
\end{array}
Initial program 99.4%
Taylor expanded in t around 0
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
distribute-lft1-inN/A
+-commutativeN/A
lower-*.f64N/A
Applied rewrites85.3%
Taylor expanded in z around 0
associate-*r*N/A
lower-*.f64N/A
sqrt-unprodN/A
*-commutativeN/A
count-2-revN/A
lift-sqrt.f64N/A
lift-+.f64N/A
lower-*.f64N/A
*-commutativeN/A
pow2N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6487.5
Applied rewrites87.5%
(FPCore (x y z t)
:precision binary64
(if (<= t 5.6e-6)
(* (sqrt (+ z z)) (- (* 0.5 x) y))
(if (<= t 3.2e+40)
(* (sqrt 2.0) (* (* (/ 1.0 (sqrt z)) (- (* x 0.5) y)) z))
(* (* (sqrt (* (* (* t t) (* t t)) z)) 0.5) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 5.6e-6) {
tmp = sqrt((z + z)) * ((0.5 * x) - y);
} else if (t <= 3.2e+40) {
tmp = sqrt(2.0) * (((1.0 / sqrt(z)) * ((x * 0.5) - y)) * z);
} else {
tmp = (sqrt((((t * t) * (t * t)) * z)) * 0.5) * x;
}
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 (t <= 5.6d-6) then
tmp = sqrt((z + z)) * ((0.5d0 * x) - y)
else if (t <= 3.2d+40) then
tmp = sqrt(2.0d0) * (((1.0d0 / sqrt(z)) * ((x * 0.5d0) - y)) * z)
else
tmp = (sqrt((((t * t) * (t * t)) * z)) * 0.5d0) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 5.6e-6) {
tmp = Math.sqrt((z + z)) * ((0.5 * x) - y);
} else if (t <= 3.2e+40) {
tmp = Math.sqrt(2.0) * (((1.0 / Math.sqrt(z)) * ((x * 0.5) - y)) * z);
} else {
tmp = (Math.sqrt((((t * t) * (t * t)) * z)) * 0.5) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 5.6e-6: tmp = math.sqrt((z + z)) * ((0.5 * x) - y) elif t <= 3.2e+40: tmp = math.sqrt(2.0) * (((1.0 / math.sqrt(z)) * ((x * 0.5) - y)) * z) else: tmp = (math.sqrt((((t * t) * (t * t)) * z)) * 0.5) * x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 5.6e-6) tmp = Float64(sqrt(Float64(z + z)) * Float64(Float64(0.5 * x) - y)); elseif (t <= 3.2e+40) tmp = Float64(sqrt(2.0) * Float64(Float64(Float64(1.0 / sqrt(z)) * Float64(Float64(x * 0.5) - y)) * z)); else tmp = Float64(Float64(sqrt(Float64(Float64(Float64(t * t) * Float64(t * t)) * z)) * 0.5) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 5.6e-6) tmp = sqrt((z + z)) * ((0.5 * x) - y); elseif (t <= 3.2e+40) tmp = sqrt(2.0) * (((1.0 / sqrt(z)) * ((x * 0.5) - y)) * z); else tmp = (sqrt((((t * t) * (t * t)) * z)) * 0.5) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 5.6e-6], N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e+40], N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[(1.0 / N[Sqrt[z], $MachinePrecision]), $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(N[(N[(t * t), $MachinePrecision] * N[(t * t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.6 \cdot 10^{-6}:\\
\;\;\;\;\sqrt{z + z} \cdot \left(0.5 \cdot x - y\right)\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{+40}:\\
\;\;\;\;\sqrt{2} \cdot \left(\left(\frac{1}{\sqrt{z}} \cdot \left(x \cdot 0.5 - y\right)\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{\left(\left(t \cdot t\right) \cdot \left(t \cdot t\right)\right) \cdot z} \cdot 0.5\right) \cdot x\\
\end{array}
\end{array}
if t < 5.59999999999999975e-6Initial program 99.5%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
sqrt-unprodN/A
lift-sqrt.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f64N/A
lift--.f64N/A
lift-*.f6471.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.8
Applied rewrites71.8%
if 5.59999999999999975e-6 < t < 3.19999999999999981e40Initial program 99.4%
Applied rewrites99.1%
Taylor expanded in t around 0
Applied rewrites21.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lift-sqrt.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6431.3
Applied rewrites31.3%
if 3.19999999999999981e40 < t Initial program 99.0%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites74.5%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
distribute-rgt-outN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
count-2-revN/A
lift-+.f6463.7
Applied rewrites63.7%
Taylor expanded in t around inf
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6468.8
Applied rewrites68.8%
(FPCore (x y z t) :precision binary64 (if (<= t 5.5e+38) (* (sqrt (+ z z)) (- (* 0.5 x) y)) (* (* (sqrt (* (* (* t t) (* t t)) z)) 0.5) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 5.5e+38) {
tmp = sqrt((z + z)) * ((0.5 * x) - y);
} else {
tmp = (sqrt((((t * t) * (t * t)) * z)) * 0.5) * x;
}
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 (t <= 5.5d+38) then
tmp = sqrt((z + z)) * ((0.5d0 * x) - y)
else
tmp = (sqrt((((t * t) * (t * t)) * z)) * 0.5d0) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 5.5e+38) {
tmp = Math.sqrt((z + z)) * ((0.5 * x) - y);
} else {
tmp = (Math.sqrt((((t * t) * (t * t)) * z)) * 0.5) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 5.5e+38: tmp = math.sqrt((z + z)) * ((0.5 * x) - y) else: tmp = (math.sqrt((((t * t) * (t * t)) * z)) * 0.5) * x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 5.5e+38) tmp = Float64(sqrt(Float64(z + z)) * Float64(Float64(0.5 * x) - y)); else tmp = Float64(Float64(sqrt(Float64(Float64(Float64(t * t) * Float64(t * t)) * z)) * 0.5) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 5.5e+38) tmp = sqrt((z + z)) * ((0.5 * x) - y); else tmp = (sqrt((((t * t) * (t * t)) * z)) * 0.5) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 5.5e+38], N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(N[(N[(t * t), $MachinePrecision] * N[(t * t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.5 \cdot 10^{+38}:\\
\;\;\;\;\sqrt{z + z} \cdot \left(0.5 \cdot x - y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{\left(\left(t \cdot t\right) \cdot \left(t \cdot t\right)\right) \cdot z} \cdot 0.5\right) \cdot x\\
\end{array}
\end{array}
if t < 5.5000000000000003e38Initial program 99.5%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
sqrt-unprodN/A
lift-sqrt.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f64N/A
lift--.f64N/A
lift-*.f6469.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6469.4
Applied rewrites69.4%
if 5.5000000000000003e38 < t Initial program 99.0%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites74.6%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
distribute-rgt-outN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
count-2-revN/A
lift-+.f6463.5
Applied rewrites63.5%
Taylor expanded in t around inf
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6468.5
Applied rewrites68.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ z z))))
(if (<= t 1e+39)
(* t_1 (- (* 0.5 x) y))
(* (* (* (* (* t t) t_1) 0.5) 0.5) x))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + z));
double tmp;
if (t <= 1e+39) {
tmp = t_1 * ((0.5 * x) - y);
} else {
tmp = ((((t * t) * t_1) * 0.5) * 0.5) * x;
}
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 = sqrt((z + z))
if (t <= 1d+39) then
tmp = t_1 * ((0.5d0 * x) - y)
else
tmp = ((((t * t) * t_1) * 0.5d0) * 0.5d0) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z + z));
double tmp;
if (t <= 1e+39) {
tmp = t_1 * ((0.5 * x) - y);
} else {
tmp = ((((t * t) * t_1) * 0.5) * 0.5) * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z + z)) tmp = 0 if t <= 1e+39: tmp = t_1 * ((0.5 * x) - y) else: tmp = ((((t * t) * t_1) * 0.5) * 0.5) * x return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z + z)) tmp = 0.0 if (t <= 1e+39) tmp = Float64(t_1 * Float64(Float64(0.5 * x) - y)); else tmp = Float64(Float64(Float64(Float64(Float64(t * t) * t_1) * 0.5) * 0.5) * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z + z)); tmp = 0.0; if (t <= 1e+39) tmp = t_1 * ((0.5 * x) - y); else tmp = ((((t * t) * t_1) * 0.5) * 0.5) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 1e+39], N[(t$95$1 * N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(t * t), $MachinePrecision] * t$95$1), $MachinePrecision] * 0.5), $MachinePrecision] * 0.5), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z + z}\\
\mathbf{if}\;t \leq 10^{+39}:\\
\;\;\;\;t\_1 \cdot \left(0.5 \cdot x - y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(t \cdot t\right) \cdot t\_1\right) \cdot 0.5\right) \cdot 0.5\right) \cdot x\\
\end{array}
\end{array}
if t < 9.9999999999999994e38Initial program 99.5%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
sqrt-unprodN/A
lift-sqrt.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f64N/A
lift--.f64N/A
lift-*.f6469.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6469.4
Applied rewrites69.4%
if 9.9999999999999994e38 < t Initial program 99.0%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites74.6%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lift-sqrt.f64N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
lower-sqrt.f6456.0
Applied rewrites56.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
sqrt-unprodN/A
*-commutativeN/A
lower-sqrt.f64N/A
count-2-revN/A
lift-+.f6456.0
Applied rewrites56.0%
(FPCore (x y z t) :precision binary64 (if (<= t 8e+39) (* (sqrt (+ z z)) (- (* 0.5 x) y)) (* (* (sqrt (* (fma t t 1.0) (+ z z))) 0.5) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 8e+39) {
tmp = sqrt((z + z)) * ((0.5 * x) - y);
} else {
tmp = (sqrt((fma(t, t, 1.0) * (z + z))) * 0.5) * x;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= 8e+39) tmp = Float64(sqrt(Float64(z + z)) * Float64(Float64(0.5 * x) - y)); else tmp = Float64(Float64(sqrt(Float64(fma(t, t, 1.0) * Float64(z + z))) * 0.5) * x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, 8e+39], N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(N[(t * t + 1.0), $MachinePrecision] * N[(z + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 8 \cdot 10^{+39}:\\
\;\;\;\;\sqrt{z + z} \cdot \left(0.5 \cdot x - y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{\mathsf{fma}\left(t, t, 1\right) \cdot \left(z + z\right)} \cdot 0.5\right) \cdot x\\
\end{array}
\end{array}
if t < 7.99999999999999952e39Initial program 99.5%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
sqrt-unprodN/A
lift-sqrt.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f64N/A
lift--.f64N/A
lift-*.f6469.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6469.4
Applied rewrites69.4%
if 7.99999999999999952e39 < t Initial program 99.0%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites74.6%
Taylor expanded in t around 0
+-commutativeN/A
pow2N/A
lower-fma.f6454.0
Applied rewrites54.0%
(FPCore (x y z t) :precision binary64 (* (sqrt (+ z z)) (- (* 0.5 x) y)))
double code(double x, double y, double z, double t) {
return sqrt((z + z)) * ((0.5 * x) - 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 = sqrt((z + z)) * ((0.5d0 * x) - y)
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt((z + z)) * ((0.5 * x) - y);
}
def code(x, y, z, t): return math.sqrt((z + z)) * ((0.5 * x) - y)
function code(x, y, z, t) return Float64(sqrt(Float64(z + z)) * Float64(Float64(0.5 * x) - y)) end
function tmp = code(x, y, z, t) tmp = sqrt((z + z)) * ((0.5 * x) - y); end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{z + z} \cdot \left(0.5 \cdot x - y\right)
\end{array}
Initial program 99.4%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
sqrt-unprodN/A
lift-sqrt.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f64N/A
lift--.f64N/A
lift-*.f6457.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6457.0
Applied rewrites57.0%
(FPCore (x y z t) :precision binary64 (* (* (sqrt (+ z z)) 0.5) x))
double code(double x, double y, double z, double t) {
return (sqrt((z + z)) * 0.5) * x;
}
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 = (sqrt((z + z)) * 0.5d0) * x
end function
public static double code(double x, double y, double z, double t) {
return (Math.sqrt((z + z)) * 0.5) * x;
}
def code(x, y, z, t): return (math.sqrt((z + z)) * 0.5) * x
function code(x, y, z, t) return Float64(Float64(sqrt(Float64(z + z)) * 0.5) * x) end
function tmp = code(x, y, z, t) tmp = (sqrt((z + z)) * 0.5) * x; end
code[x_, y_, z_, t_] := N[(N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
\left(\sqrt{z + z} \cdot 0.5\right) \cdot x
\end{array}
Initial program 99.4%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites62.4%
Taylor expanded in t around 0
count-2-revN/A
lift-+.f6429.9
Applied rewrites29.9%
herbie shell --seed 2025130
(FPCore (x y z t)
:name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A"
:precision binary64
(* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))