
(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]
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}
Herbie found 18 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]
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}
(FPCore (x y z t) :precision binary64 (* (* (pow (exp (* 0.5 t)) t) (- (* 0.5 x) y)) (sqrt (+ z z))))
double code(double x, double y, double z, double t) {
return (pow(exp((0.5 * t)), t) * ((0.5 * x) - y)) * sqrt((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 = ((exp((0.5d0 * t)) ** t) * ((0.5d0 * x) - y)) * sqrt((z + z))
end function
public static double code(double x, double y, double z, double t) {
return (Math.pow(Math.exp((0.5 * t)), t) * ((0.5 * x) - y)) * Math.sqrt((z + z));
}
def code(x, y, z, t): return (math.pow(math.exp((0.5 * t)), t) * ((0.5 * x) - y)) * math.sqrt((z + z))
function code(x, y, z, t) return Float64(Float64((exp(Float64(0.5 * t)) ^ t) * Float64(Float64(0.5 * x) - y)) * sqrt(Float64(z + z))) end
function tmp = code(x, y, z, t) tmp = ((exp((0.5 * t)) ^ t) * ((0.5 * x) - y)) * sqrt((z + z)); end
code[x_, y_, z_, t_] := N[(N[(N[Power[N[Exp[N[(0.5 * t), $MachinePrecision]], $MachinePrecision], t], $MachinePrecision] * N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\left({\left(e^{0.5 \cdot t}\right)}^{t} \cdot \left(0.5 \cdot x - y\right)\right) \cdot \sqrt{z + z}
Initial program 99.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6499.8%
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
lower-*.f6499.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6499.8%
Applied rewrites99.8%
lift-exp.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f6499.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8%
Applied rewrites99.8%
(FPCore (x y z t) :precision binary64 (* (* (pow 1.6487212707001282 (* t t)) (- (* 0.5 x) y)) (sqrt (+ z z))))
double code(double x, double y, double z, double t) {
return (pow(1.6487212707001282, (t * t)) * ((0.5 * x) - y)) * sqrt((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 = ((1.6487212707001282d0 ** (t * t)) * ((0.5d0 * x) - y)) * sqrt((z + z))
end function
public static double code(double x, double y, double z, double t) {
return (Math.pow(1.6487212707001282, (t * t)) * ((0.5 * x) - y)) * Math.sqrt((z + z));
}
def code(x, y, z, t): return (math.pow(1.6487212707001282, (t * t)) * ((0.5 * x) - y)) * math.sqrt((z + z))
function code(x, y, z, t) return Float64(Float64((1.6487212707001282 ^ Float64(t * t)) * Float64(Float64(0.5 * x) - y)) * sqrt(Float64(z + z))) end
function tmp = code(x, y, z, t) tmp = ((1.6487212707001282 ^ (t * t)) * ((0.5 * x) - y)) * sqrt((z + z)); end
code[x_, y_, z_, t_] := N[(N[(N[Power[1.6487212707001282, N[(t * t), $MachinePrecision]], $MachinePrecision] * N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\left({1.6487212707001282}^{\left(t \cdot t\right)} \cdot \left(0.5 \cdot x - y\right)\right) \cdot \sqrt{z + z}
Initial program 99.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6499.8%
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
lower-*.f6499.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6499.8%
Applied rewrites99.8%
lift-exp.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f6499.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8%
Applied rewrites99.8%
lift-pow.f64N/A
lift-exp.f64N/A
pow-expN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
exp-prodN/A
lower-pow.f64N/A
metadata-evalN/A
exp-sqrtN/A
lower-sqrt.f64N/A
exp-1-eN/A
lower-E.f6499.8%
Applied rewrites99.8%
Evaluated real constant99.8%
(FPCore (x y z t) :precision binary64 (* (- (* 0.5 x) y) (sqrt (* (exp (* t t)) (+ z z)))))
double code(double x, double y, double z, double t) {
return ((0.5 * x) - y) * sqrt((exp((t * t)) * (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 = ((0.5d0 * x) - y) * sqrt((exp((t * t)) * (z + z)))
end function
public static double code(double x, double y, double z, double t) {
return ((0.5 * x) - y) * Math.sqrt((Math.exp((t * t)) * (z + z)));
}
def code(x, y, z, t): return ((0.5 * x) - y) * math.sqrt((math.exp((t * t)) * (z + z)))
function code(x, y, z, t) return Float64(Float64(Float64(0.5 * x) - y) * sqrt(Float64(exp(Float64(t * t)) * Float64(z + z)))) end
function tmp = code(x, y, z, t) tmp = ((0.5 * x) - y) * sqrt((exp((t * t)) * (z + z))); end
code[x_, y_, z_, t_] := N[(N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[Exp[N[(t * t), $MachinePrecision]], $MachinePrecision] * N[(z + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\left(0.5 \cdot x - y\right) \cdot \sqrt{e^{t \cdot t} \cdot \left(z + z\right)}
Initial program 99.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sqrt.f64N/A
lift-exp.f64N/A
lift-/.f64N/A
exp-sqrtN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-exp.f6499.8%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6499.8%
Applied rewrites99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ z z))))
(if (<= (fabs t) 1.45e-12)
(* (- (* x 0.5) y) (* t_1 1.0))
(* (* (exp (* (* (fabs t) (fabs t)) 0.5)) (- y)) t_1))))double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + z));
double tmp;
if (fabs(t) <= 1.45e-12) {
tmp = ((x * 0.5) - y) * (t_1 * 1.0);
} else {
tmp = (exp(((fabs(t) * fabs(t)) * 0.5)) * -y) * 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 = sqrt((z + z))
if (abs(t) <= 1.45d-12) then
tmp = ((x * 0.5d0) - y) * (t_1 * 1.0d0)
else
tmp = (exp(((abs(t) * abs(t)) * 0.5d0)) * -y) * t_1
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 (Math.abs(t) <= 1.45e-12) {
tmp = ((x * 0.5) - y) * (t_1 * 1.0);
} else {
tmp = (Math.exp(((Math.abs(t) * Math.abs(t)) * 0.5)) * -y) * t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z + z)) tmp = 0 if math.fabs(t) <= 1.45e-12: tmp = ((x * 0.5) - y) * (t_1 * 1.0) else: tmp = (math.exp(((math.fabs(t) * math.fabs(t)) * 0.5)) * -y) * t_1 return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z + z)) tmp = 0.0 if (abs(t) <= 1.45e-12) tmp = Float64(Float64(Float64(x * 0.5) - y) * Float64(t_1 * 1.0)); else tmp = Float64(Float64(exp(Float64(Float64(abs(t) * abs(t)) * 0.5)) * Float64(-y)) * t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z + z)); tmp = 0.0; if (abs(t) <= 1.45e-12) tmp = ((x * 0.5) - y) * (t_1 * 1.0); else tmp = (exp(((abs(t) * abs(t)) * 0.5)) * -y) * t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[t], $MachinePrecision], 1.45e-12], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[(t$95$1 * 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[N[(N[(N[Abs[t], $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision] * t$95$1), $MachinePrecision]]]
\begin{array}{l}
t_1 := \sqrt{z + z}\\
\mathbf{if}\;\left|t\right| \leq 1.45 \cdot 10^{-12}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \left(t\_1 \cdot 1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(e^{\left(\left|t\right| \cdot \left|t\right|\right) \cdot 0.5} \cdot \left(-y\right)\right) \cdot t\_1\\
\end{array}
if t < 1.4500000000000001e-12Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6457.2%
lift-*.f64N/A
count-2-revN/A
lift-+.f6457.2%
Applied rewrites57.2%
if 1.4500000000000001e-12 < t Initial program 99.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6499.8%
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
lower-*.f6499.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6499.8%
Applied rewrites99.8%
Taylor expanded in x around 0
lower-*.f6463.0%
Applied rewrites63.0%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6463.0%
Applied rewrites63.0%
(FPCore (x y z t) :precision binary64 (if (<= (fabs t) 1.45e-12) (* (- (* x 0.5) y) (* (sqrt (+ z z)) 1.0)) (* (sqrt (* (exp (* (fabs t) (fabs t))) (+ z z))) (- y))))
double code(double x, double y, double z, double t) {
double tmp;
if (fabs(t) <= 1.45e-12) {
tmp = ((x * 0.5) - y) * (sqrt((z + z)) * 1.0);
} else {
tmp = sqrt((exp((fabs(t) * fabs(t))) * (z + z))) * -y;
}
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 (abs(t) <= 1.45d-12) then
tmp = ((x * 0.5d0) - y) * (sqrt((z + z)) * 1.0d0)
else
tmp = sqrt((exp((abs(t) * abs(t))) * (z + z))) * -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (Math.abs(t) <= 1.45e-12) {
tmp = ((x * 0.5) - y) * (Math.sqrt((z + z)) * 1.0);
} else {
tmp = Math.sqrt((Math.exp((Math.abs(t) * Math.abs(t))) * (z + z))) * -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if math.fabs(t) <= 1.45e-12: tmp = ((x * 0.5) - y) * (math.sqrt((z + z)) * 1.0) else: tmp = math.sqrt((math.exp((math.fabs(t) * math.fabs(t))) * (z + z))) * -y return tmp
function code(x, y, z, t) tmp = 0.0 if (abs(t) <= 1.45e-12) tmp = Float64(Float64(Float64(x * 0.5) - y) * Float64(sqrt(Float64(z + z)) * 1.0)); else tmp = Float64(sqrt(Float64(exp(Float64(abs(t) * abs(t))) * Float64(z + z))) * Float64(-y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (abs(t) <= 1.45e-12) tmp = ((x * 0.5) - y) * (sqrt((z + z)) * 1.0); else tmp = sqrt((exp((abs(t) * abs(t))) * (z + z))) * -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[Abs[t], $MachinePrecision], 1.45e-12], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[Exp[N[(N[Abs[t], $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(z + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|t\right| \leq 1.45 \cdot 10^{-12}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z + z} \cdot 1\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{e^{\left|t\right| \cdot \left|t\right|} \cdot \left(z + z\right)} \cdot \left(-y\right)\\
\end{array}
if t < 1.4500000000000001e-12Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6457.2%
lift-*.f64N/A
count-2-revN/A
lift-+.f6457.2%
Applied rewrites57.2%
if 1.4500000000000001e-12 < t Initial program 99.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6499.8%
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
lower-*.f6499.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6499.8%
Applied rewrites99.8%
Taylor expanded in x around 0
lower-*.f6463.0%
Applied rewrites63.0%
Applied rewrites63.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= (fabs t) 7.5e+24)
(* t_1 (* (sqrt (+ z z)) 1.0))
(if (<= (fabs t) 5e+79)
(* (* x (* (/ (sqrt (sqrt (* (+ z z) (+ z z)))) x) t_1)) 1.0)
(* (sqrt (* (+ 1.0 (pow (fabs t) 2.0)) (+ z z))) (- y))))))double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (fabs(t) <= 7.5e+24) {
tmp = t_1 * (sqrt((z + z)) * 1.0);
} else if (fabs(t) <= 5e+79) {
tmp = (x * ((sqrt(sqrt(((z + z) * (z + z)))) / x) * t_1)) * 1.0;
} else {
tmp = sqrt(((1.0 + pow(fabs(t), 2.0)) * (z + z))) * -y;
}
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 * 0.5d0) - y
if (abs(t) <= 7.5d+24) then
tmp = t_1 * (sqrt((z + z)) * 1.0d0)
else if (abs(t) <= 5d+79) then
tmp = (x * ((sqrt(sqrt(((z + z) * (z + z)))) / x) * t_1)) * 1.0d0
else
tmp = sqrt(((1.0d0 + (abs(t) ** 2.0d0)) * (z + z))) * -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (Math.abs(t) <= 7.5e+24) {
tmp = t_1 * (Math.sqrt((z + z)) * 1.0);
} else if (Math.abs(t) <= 5e+79) {
tmp = (x * ((Math.sqrt(Math.sqrt(((z + z) * (z + z)))) / x) * t_1)) * 1.0;
} else {
tmp = Math.sqrt(((1.0 + Math.pow(Math.abs(t), 2.0)) * (z + z))) * -y;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 0.5) - y tmp = 0 if math.fabs(t) <= 7.5e+24: tmp = t_1 * (math.sqrt((z + z)) * 1.0) elif math.fabs(t) <= 5e+79: tmp = (x * ((math.sqrt(math.sqrt(((z + z) * (z + z)))) / x) * t_1)) * 1.0 else: tmp = math.sqrt(((1.0 + math.pow(math.fabs(t), 2.0)) * (z + z))) * -y return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (abs(t) <= 7.5e+24) tmp = Float64(t_1 * Float64(sqrt(Float64(z + z)) * 1.0)); elseif (abs(t) <= 5e+79) tmp = Float64(Float64(x * Float64(Float64(sqrt(sqrt(Float64(Float64(z + z) * Float64(z + z)))) / x) * t_1)) * 1.0); else tmp = Float64(sqrt(Float64(Float64(1.0 + (abs(t) ^ 2.0)) * Float64(z + z))) * Float64(-y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 0.5) - y; tmp = 0.0; if (abs(t) <= 7.5e+24) tmp = t_1 * (sqrt((z + z)) * 1.0); elseif (abs(t) <= 5e+79) tmp = (x * ((sqrt(sqrt(((z + z) * (z + z)))) / x) * t_1)) * 1.0; else tmp = sqrt(((1.0 + (abs(t) ^ 2.0)) * (z + z))) * -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[N[Abs[t], $MachinePrecision], 7.5e+24], N[(t$95$1 * N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[t], $MachinePrecision], 5e+79], N[(N[(x * N[(N[(N[Sqrt[N[Sqrt[N[(N[(z + z), $MachinePrecision] * N[(z + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Sqrt[N[(N[(1.0 + N[Power[N[Abs[t], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(z + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision]]]]
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;\left|t\right| \leq 7.5 \cdot 10^{+24}:\\
\;\;\;\;t\_1 \cdot \left(\sqrt{z + z} \cdot 1\right)\\
\mathbf{elif}\;\left|t\right| \leq 5 \cdot 10^{+79}:\\
\;\;\;\;\left(x \cdot \left(\frac{\sqrt{\sqrt{\left(z + z\right) \cdot \left(z + z\right)}}}{x} \cdot t\_1\right)\right) \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(1 + {\left(\left|t\right|\right)}^{2}\right) \cdot \left(z + z\right)} \cdot \left(-y\right)\\
\end{array}
if t < 7.5000000000000001e24Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6457.2%
lift-*.f64N/A
count-2-revN/A
lift-+.f6457.2%
Applied rewrites57.2%
if 7.5000000000000001e24 < t < 5e79Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6457.6%
Applied rewrites57.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
pow1/2N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
pow1/2N/A
lift-sqrt.f64N/A
Applied rewrites55.1%
rem-square-sqrtN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6445.3%
Applied rewrites45.3%
if 5e79 < t Initial program 99.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6499.8%
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
lower-*.f6499.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6499.8%
Applied rewrites99.8%
Taylor expanded in x around 0
lower-*.f6463.0%
Applied rewrites63.0%
Applied rewrites63.0%
Taylor expanded in t around 0
lower-+.f64N/A
lower-pow.f6450.9%
Applied rewrites50.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* t t) 2.0))
(t_2 (sqrt (/ 2.0 z)))
(t_3 (- (* x 0.5) y)))
(if (<= t_1 3.1e+49)
(* t_3 (* (sqrt (+ z z)) 1.0))
(if (<= t_1 4.5e+157)
(* (* x (* (/ (sqrt (sqrt (* (+ z z) (+ z z)))) x) t_3)) 1.0)
(* (* x (* z (+ (* -1.0 (/ (* y t_2) x)) (* 0.5 t_2)))) 1.0)))))double code(double x, double y, double z, double t) {
double t_1 = (t * t) / 2.0;
double t_2 = sqrt((2.0 / z));
double t_3 = (x * 0.5) - y;
double tmp;
if (t_1 <= 3.1e+49) {
tmp = t_3 * (sqrt((z + z)) * 1.0);
} else if (t_1 <= 4.5e+157) {
tmp = (x * ((sqrt(sqrt(((z + z) * (z + z)))) / x) * t_3)) * 1.0;
} else {
tmp = (x * (z * ((-1.0 * ((y * t_2) / x)) + (0.5 * t_2)))) * 1.0;
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (t * t) / 2.0d0
t_2 = sqrt((2.0d0 / z))
t_3 = (x * 0.5d0) - y
if (t_1 <= 3.1d+49) then
tmp = t_3 * (sqrt((z + z)) * 1.0d0)
else if (t_1 <= 4.5d+157) then
tmp = (x * ((sqrt(sqrt(((z + z) * (z + z)))) / x) * t_3)) * 1.0d0
else
tmp = (x * (z * (((-1.0d0) * ((y * t_2) / x)) + (0.5d0 * t_2)))) * 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (t * t) / 2.0;
double t_2 = Math.sqrt((2.0 / z));
double t_3 = (x * 0.5) - y;
double tmp;
if (t_1 <= 3.1e+49) {
tmp = t_3 * (Math.sqrt((z + z)) * 1.0);
} else if (t_1 <= 4.5e+157) {
tmp = (x * ((Math.sqrt(Math.sqrt(((z + z) * (z + z)))) / x) * t_3)) * 1.0;
} else {
tmp = (x * (z * ((-1.0 * ((y * t_2) / x)) + (0.5 * t_2)))) * 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = (t * t) / 2.0 t_2 = math.sqrt((2.0 / z)) t_3 = (x * 0.5) - y tmp = 0 if t_1 <= 3.1e+49: tmp = t_3 * (math.sqrt((z + z)) * 1.0) elif t_1 <= 4.5e+157: tmp = (x * ((math.sqrt(math.sqrt(((z + z) * (z + z)))) / x) * t_3)) * 1.0 else: tmp = (x * (z * ((-1.0 * ((y * t_2) / x)) + (0.5 * t_2)))) * 1.0 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(t * t) / 2.0) t_2 = sqrt(Float64(2.0 / z)) t_3 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (t_1 <= 3.1e+49) tmp = Float64(t_3 * Float64(sqrt(Float64(z + z)) * 1.0)); elseif (t_1 <= 4.5e+157) tmp = Float64(Float64(x * Float64(Float64(sqrt(sqrt(Float64(Float64(z + z) * Float64(z + z)))) / x) * t_3)) * 1.0); else tmp = Float64(Float64(x * Float64(z * Float64(Float64(-1.0 * Float64(Float64(y * t_2) / x)) + Float64(0.5 * t_2)))) * 1.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (t * t) / 2.0; t_2 = sqrt((2.0 / z)); t_3 = (x * 0.5) - y; tmp = 0.0; if (t_1 <= 3.1e+49) tmp = t_3 * (sqrt((z + z)) * 1.0); elseif (t_1 <= 4.5e+157) tmp = (x * ((sqrt(sqrt(((z + z) * (z + z)))) / x) * t_3)) * 1.0; else tmp = (x * (z * ((-1.0 * ((y * t_2) / x)) + (0.5 * t_2)))) * 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(2.0 / z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t$95$1, 3.1e+49], N[(t$95$3 * N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4.5e+157], N[(N[(x * N[(N[(N[Sqrt[N[Sqrt[N[(N[(z + z), $MachinePrecision] * N[(z + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(x * N[(z * N[(N[(-1.0 * N[(N[(y * t$95$2), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(0.5 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \frac{t \cdot t}{2}\\
t_2 := \sqrt{\frac{2}{z}}\\
t_3 := x \cdot 0.5 - y\\
\mathbf{if}\;t\_1 \leq 3.1 \cdot 10^{+49}:\\
\;\;\;\;t\_3 \cdot \left(\sqrt{z + z} \cdot 1\right)\\
\mathbf{elif}\;t\_1 \leq 4.5 \cdot 10^{+157}:\\
\;\;\;\;\left(x \cdot \left(\frac{\sqrt{\sqrt{\left(z + z\right) \cdot \left(z + z\right)}}}{x} \cdot t\_3\right)\right) \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(z \cdot \left(-1 \cdot \frac{y \cdot t\_2}{x} + 0.5 \cdot t\_2\right)\right)\right) \cdot 1\\
\end{array}
if (/.f64 (*.f64 t t) #s(literal 2 binary64)) < 3.0999999999999999e49Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6457.2%
lift-*.f64N/A
count-2-revN/A
lift-+.f6457.2%
Applied rewrites57.2%
if 3.0999999999999999e49 < (/.f64 (*.f64 t t) #s(literal 2 binary64)) < 4.4999999999999998e157Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6457.6%
Applied rewrites57.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
pow1/2N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
pow1/2N/A
lift-sqrt.f64N/A
Applied rewrites55.1%
rem-square-sqrtN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6445.3%
Applied rewrites45.3%
if 4.4999999999999998e157 < (/.f64 (*.f64 t t) #s(literal 2 binary64)) Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6457.6%
Applied rewrites57.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6457.5%
Applied rewrites57.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ z z)))
(t_2 (/ (* t t) 2.0))
(t_3 (- (* x 0.5) y)))
(if (<= t_2 3.1e+49)
(* t_3 (* t_1 1.0))
(if (<= t_2 4.5e+157)
(* (* x (* (/ (sqrt (sqrt (* (+ z z) (+ z z)))) x) t_3)) 1.0)
(* (/ 1.0 (/ x (* (* t_3 x) t_1))) 1.0)))))double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + z));
double t_2 = (t * t) / 2.0;
double t_3 = (x * 0.5) - y;
double tmp;
if (t_2 <= 3.1e+49) {
tmp = t_3 * (t_1 * 1.0);
} else if (t_2 <= 4.5e+157) {
tmp = (x * ((sqrt(sqrt(((z + z) * (z + z)))) / x) * t_3)) * 1.0;
} else {
tmp = (1.0 / (x / ((t_3 * x) * t_1))) * 1.0;
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((z + z))
t_2 = (t * t) / 2.0d0
t_3 = (x * 0.5d0) - y
if (t_2 <= 3.1d+49) then
tmp = t_3 * (t_1 * 1.0d0)
else if (t_2 <= 4.5d+157) then
tmp = (x * ((sqrt(sqrt(((z + z) * (z + z)))) / x) * t_3)) * 1.0d0
else
tmp = (1.0d0 / (x / ((t_3 * x) * t_1))) * 1.0d0
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 t_2 = (t * t) / 2.0;
double t_3 = (x * 0.5) - y;
double tmp;
if (t_2 <= 3.1e+49) {
tmp = t_3 * (t_1 * 1.0);
} else if (t_2 <= 4.5e+157) {
tmp = (x * ((Math.sqrt(Math.sqrt(((z + z) * (z + z)))) / x) * t_3)) * 1.0;
} else {
tmp = (1.0 / (x / ((t_3 * x) * t_1))) * 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z + z)) t_2 = (t * t) / 2.0 t_3 = (x * 0.5) - y tmp = 0 if t_2 <= 3.1e+49: tmp = t_3 * (t_1 * 1.0) elif t_2 <= 4.5e+157: tmp = (x * ((math.sqrt(math.sqrt(((z + z) * (z + z)))) / x) * t_3)) * 1.0 else: tmp = (1.0 / (x / ((t_3 * x) * t_1))) * 1.0 return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z + z)) t_2 = Float64(Float64(t * t) / 2.0) t_3 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (t_2 <= 3.1e+49) tmp = Float64(t_3 * Float64(t_1 * 1.0)); elseif (t_2 <= 4.5e+157) tmp = Float64(Float64(x * Float64(Float64(sqrt(sqrt(Float64(Float64(z + z) * Float64(z + z)))) / x) * t_3)) * 1.0); else tmp = Float64(Float64(1.0 / Float64(x / Float64(Float64(t_3 * x) * t_1))) * 1.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z + z)); t_2 = (t * t) / 2.0; t_3 = (x * 0.5) - y; tmp = 0.0; if (t_2 <= 3.1e+49) tmp = t_3 * (t_1 * 1.0); elseif (t_2 <= 4.5e+157) tmp = (x * ((sqrt(sqrt(((z + z) * (z + z)))) / x) * t_3)) * 1.0; else tmp = (1.0 / (x / ((t_3 * x) * t_1))) * 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t$95$2, 3.1e+49], N[(t$95$3 * N[(t$95$1 * 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4.5e+157], N[(N[(x * N[(N[(N[Sqrt[N[Sqrt[N[(N[(z + z), $MachinePrecision] * N[(z + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(1.0 / N[(x / N[(N[(t$95$3 * x), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \sqrt{z + z}\\
t_2 := \frac{t \cdot t}{2}\\
t_3 := x \cdot 0.5 - y\\
\mathbf{if}\;t\_2 \leq 3.1 \cdot 10^{+49}:\\
\;\;\;\;t\_3 \cdot \left(t\_1 \cdot 1\right)\\
\mathbf{elif}\;t\_2 \leq 4.5 \cdot 10^{+157}:\\
\;\;\;\;\left(x \cdot \left(\frac{\sqrt{\sqrt{\left(z + z\right) \cdot \left(z + z\right)}}}{x} \cdot t\_3\right)\right) \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x}{\left(t\_3 \cdot x\right) \cdot t\_1}} \cdot 1\\
\end{array}
if (/.f64 (*.f64 t t) #s(literal 2 binary64)) < 3.0999999999999999e49Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6457.2%
lift-*.f64N/A
count-2-revN/A
lift-+.f6457.2%
Applied rewrites57.2%
if 3.0999999999999999e49 < (/.f64 (*.f64 t t) #s(literal 2 binary64)) < 4.4999999999999998e157Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6457.6%
Applied rewrites57.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
pow1/2N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
pow1/2N/A
lift-sqrt.f64N/A
Applied rewrites55.1%
rem-square-sqrtN/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6445.3%
Applied rewrites45.3%
if 4.4999999999999998e157 < (/.f64 (*.f64 t t) #s(literal 2 binary64)) Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6457.6%
Applied rewrites57.6%
Applied rewrites51.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ z z))) (t_2 (- (* x 0.5) y)))
(if (<= (fabs t) 46000000.0)
(* t_2 (* t_1 1.0))
(* (/ (* (* t_2 x) t_1) x) 1.0))))double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + z));
double t_2 = (x * 0.5) - y;
double tmp;
if (fabs(t) <= 46000000.0) {
tmp = t_2 * (t_1 * 1.0);
} else {
tmp = (((t_2 * x) * t_1) / x) * 1.0;
}
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) :: t_2
real(8) :: tmp
t_1 = sqrt((z + z))
t_2 = (x * 0.5d0) - y
if (abs(t) <= 46000000.0d0) then
tmp = t_2 * (t_1 * 1.0d0)
else
tmp = (((t_2 * x) * t_1) / x) * 1.0d0
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 t_2 = (x * 0.5) - y;
double tmp;
if (Math.abs(t) <= 46000000.0) {
tmp = t_2 * (t_1 * 1.0);
} else {
tmp = (((t_2 * x) * t_1) / x) * 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z + z)) t_2 = (x * 0.5) - y tmp = 0 if math.fabs(t) <= 46000000.0: tmp = t_2 * (t_1 * 1.0) else: tmp = (((t_2 * x) * t_1) / x) * 1.0 return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z + z)) t_2 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (abs(t) <= 46000000.0) tmp = Float64(t_2 * Float64(t_1 * 1.0)); else tmp = Float64(Float64(Float64(Float64(t_2 * x) * t_1) / x) * 1.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z + z)); t_2 = (x * 0.5) - y; tmp = 0.0; if (abs(t) <= 46000000.0) tmp = t_2 * (t_1 * 1.0); else tmp = (((t_2 * x) * t_1) / x) * 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[N[Abs[t], $MachinePrecision], 46000000.0], N[(t$95$2 * N[(t$95$1 * 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t$95$2 * x), $MachinePrecision] * t$95$1), $MachinePrecision] / x), $MachinePrecision] * 1.0), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \sqrt{z + z}\\
t_2 := x \cdot 0.5 - y\\
\mathbf{if}\;\left|t\right| \leq 46000000:\\
\;\;\;\;t\_2 \cdot \left(t\_1 \cdot 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(t\_2 \cdot x\right) \cdot t\_1}{x} \cdot 1\\
\end{array}
if t < 4.6e7Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6457.2%
lift-*.f64N/A
count-2-revN/A
lift-+.f6457.2%
Applied rewrites57.2%
if 4.6e7 < t Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6457.6%
Applied rewrites57.6%
Applied rewrites51.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ z z))) (t_2 (- (* x 0.5) y)))
(if (<= (fabs t) 46000000.0)
(* t_2 (* t_1 1.0))
(* (/ 1.0 (/ x (* (* t_2 x) t_1))) 1.0))))double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + z));
double t_2 = (x * 0.5) - y;
double tmp;
if (fabs(t) <= 46000000.0) {
tmp = t_2 * (t_1 * 1.0);
} else {
tmp = (1.0 / (x / ((t_2 * x) * t_1))) * 1.0;
}
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) :: t_2
real(8) :: tmp
t_1 = sqrt((z + z))
t_2 = (x * 0.5d0) - y
if (abs(t) <= 46000000.0d0) then
tmp = t_2 * (t_1 * 1.0d0)
else
tmp = (1.0d0 / (x / ((t_2 * x) * t_1))) * 1.0d0
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 t_2 = (x * 0.5) - y;
double tmp;
if (Math.abs(t) <= 46000000.0) {
tmp = t_2 * (t_1 * 1.0);
} else {
tmp = (1.0 / (x / ((t_2 * x) * t_1))) * 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z + z)) t_2 = (x * 0.5) - y tmp = 0 if math.fabs(t) <= 46000000.0: tmp = t_2 * (t_1 * 1.0) else: tmp = (1.0 / (x / ((t_2 * x) * t_1))) * 1.0 return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z + z)) t_2 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (abs(t) <= 46000000.0) tmp = Float64(t_2 * Float64(t_1 * 1.0)); else tmp = Float64(Float64(1.0 / Float64(x / Float64(Float64(t_2 * x) * t_1))) * 1.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z + z)); t_2 = (x * 0.5) - y; tmp = 0.0; if (abs(t) <= 46000000.0) tmp = t_2 * (t_1 * 1.0); else tmp = (1.0 / (x / ((t_2 * x) * t_1))) * 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[N[Abs[t], $MachinePrecision], 46000000.0], N[(t$95$2 * N[(t$95$1 * 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(x / N[(N[(t$95$2 * x), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \sqrt{z + z}\\
t_2 := x \cdot 0.5 - y\\
\mathbf{if}\;\left|t\right| \leq 46000000:\\
\;\;\;\;t\_2 \cdot \left(t\_1 \cdot 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x}{\left(t\_2 \cdot x\right) \cdot t\_1}} \cdot 1\\
\end{array}
if t < 4.6e7Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6457.2%
lift-*.f64N/A
count-2-revN/A
lift-+.f6457.2%
Applied rewrites57.2%
if 4.6e7 < t Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6457.6%
Applied rewrites57.6%
Applied rewrites51.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ z z))) (t_2 (- (* x 0.5) y)) (t_3 (/ t_1 x)))
(if (<= (fabs t) 8e+21)
(* t_2 (* t_1 1.0))
(if (<= (fabs t) 2.7e+165)
(* (* x (* t_3 t_2)) 1.0)
(* (* t_3 (* t_2 x)) 1.0)))))double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + z));
double t_2 = (x * 0.5) - y;
double t_3 = t_1 / x;
double tmp;
if (fabs(t) <= 8e+21) {
tmp = t_2 * (t_1 * 1.0);
} else if (fabs(t) <= 2.7e+165) {
tmp = (x * (t_3 * t_2)) * 1.0;
} else {
tmp = (t_3 * (t_2 * x)) * 1.0;
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((z + z))
t_2 = (x * 0.5d0) - y
t_3 = t_1 / x
if (abs(t) <= 8d+21) then
tmp = t_2 * (t_1 * 1.0d0)
else if (abs(t) <= 2.7d+165) then
tmp = (x * (t_3 * t_2)) * 1.0d0
else
tmp = (t_3 * (t_2 * x)) * 1.0d0
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 t_2 = (x * 0.5) - y;
double t_3 = t_1 / x;
double tmp;
if (Math.abs(t) <= 8e+21) {
tmp = t_2 * (t_1 * 1.0);
} else if (Math.abs(t) <= 2.7e+165) {
tmp = (x * (t_3 * t_2)) * 1.0;
} else {
tmp = (t_3 * (t_2 * x)) * 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z + z)) t_2 = (x * 0.5) - y t_3 = t_1 / x tmp = 0 if math.fabs(t) <= 8e+21: tmp = t_2 * (t_1 * 1.0) elif math.fabs(t) <= 2.7e+165: tmp = (x * (t_3 * t_2)) * 1.0 else: tmp = (t_3 * (t_2 * x)) * 1.0 return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z + z)) t_2 = Float64(Float64(x * 0.5) - y) t_3 = Float64(t_1 / x) tmp = 0.0 if (abs(t) <= 8e+21) tmp = Float64(t_2 * Float64(t_1 * 1.0)); elseif (abs(t) <= 2.7e+165) tmp = Float64(Float64(x * Float64(t_3 * t_2)) * 1.0); else tmp = Float64(Float64(t_3 * Float64(t_2 * x)) * 1.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z + z)); t_2 = (x * 0.5) - y; t_3 = t_1 / x; tmp = 0.0; if (abs(t) <= 8e+21) tmp = t_2 * (t_1 * 1.0); elseif (abs(t) <= 2.7e+165) tmp = (x * (t_3 * t_2)) * 1.0; else tmp = (t_3 * (t_2 * x)) * 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / x), $MachinePrecision]}, If[LessEqual[N[Abs[t], $MachinePrecision], 8e+21], N[(t$95$2 * N[(t$95$1 * 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[t], $MachinePrecision], 2.7e+165], N[(N[(x * N[(t$95$3 * t$95$2), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(t$95$3 * N[(t$95$2 * x), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \sqrt{z + z}\\
t_2 := x \cdot 0.5 - y\\
t_3 := \frac{t\_1}{x}\\
\mathbf{if}\;\left|t\right| \leq 8 \cdot 10^{+21}:\\
\;\;\;\;t\_2 \cdot \left(t\_1 \cdot 1\right)\\
\mathbf{elif}\;\left|t\right| \leq 2.7 \cdot 10^{+165}:\\
\;\;\;\;\left(x \cdot \left(t\_3 \cdot t\_2\right)\right) \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\left(t\_3 \cdot \left(t\_2 \cdot x\right)\right) \cdot 1\\
\end{array}
if t < 8e21Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6457.2%
lift-*.f64N/A
count-2-revN/A
lift-+.f6457.2%
Applied rewrites57.2%
if 8e21 < t < 2.7e165Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6457.6%
Applied rewrites57.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
pow1/2N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
pow1/2N/A
lift-sqrt.f64N/A
Applied rewrites55.1%
if 2.7e165 < t Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6457.6%
Applied rewrites57.6%
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
pow1/2N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
pow1/2N/A
lift-sqrt.f64N/A
Applied rewrites50.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ z z))) (t_2 (- (* x 0.5) y)))
(if (<= (/ (* t t) 2.0) 3.6e+48)
(* t_2 (* t_1 1.0))
(* (* x (* (/ t_1 x) t_2)) 1.0))))double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + z));
double t_2 = (x * 0.5) - y;
double tmp;
if (((t * t) / 2.0) <= 3.6e+48) {
tmp = t_2 * (t_1 * 1.0);
} else {
tmp = (x * ((t_1 / x) * t_2)) * 1.0;
}
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) :: t_2
real(8) :: tmp
t_1 = sqrt((z + z))
t_2 = (x * 0.5d0) - y
if (((t * t) / 2.0d0) <= 3.6d+48) then
tmp = t_2 * (t_1 * 1.0d0)
else
tmp = (x * ((t_1 / x) * t_2)) * 1.0d0
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 t_2 = (x * 0.5) - y;
double tmp;
if (((t * t) / 2.0) <= 3.6e+48) {
tmp = t_2 * (t_1 * 1.0);
} else {
tmp = (x * ((t_1 / x) * t_2)) * 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z + z)) t_2 = (x * 0.5) - y tmp = 0 if ((t * t) / 2.0) <= 3.6e+48: tmp = t_2 * (t_1 * 1.0) else: tmp = (x * ((t_1 / x) * t_2)) * 1.0 return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z + z)) t_2 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (Float64(Float64(t * t) / 2.0) <= 3.6e+48) tmp = Float64(t_2 * Float64(t_1 * 1.0)); else tmp = Float64(Float64(x * Float64(Float64(t_1 / x) * t_2)) * 1.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z + z)); t_2 = (x * 0.5) - y; tmp = 0.0; if (((t * t) / 2.0) <= 3.6e+48) tmp = t_2 * (t_1 * 1.0); else tmp = (x * ((t_1 / x) * t_2)) * 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision], 3.6e+48], N[(t$95$2 * N[(t$95$1 * 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(t$95$1 / x), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \sqrt{z + z}\\
t_2 := x \cdot 0.5 - y\\
\mathbf{if}\;\frac{t \cdot t}{2} \leq 3.6 \cdot 10^{+48}:\\
\;\;\;\;t\_2 \cdot \left(t\_1 \cdot 1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(\frac{t\_1}{x} \cdot t\_2\right)\right) \cdot 1\\
\end{array}
if (/.f64 (*.f64 t t) #s(literal 2 binary64)) < 3.5999999999999998e48Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6457.2%
lift-*.f64N/A
count-2-revN/A
lift-+.f6457.2%
Applied rewrites57.2%
if 3.5999999999999998e48 < (/.f64 (*.f64 t t) #s(literal 2 binary64)) Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6457.6%
Applied rewrites57.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
pow1/2N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
pow1/2N/A
lift-sqrt.f64N/A
Applied rewrites55.1%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* t t) 2.0) 6.5) (* (- (* x 0.5) y) (* (sqrt (+ z z)) 1.0)) (* (* z (* (sqrt (/ 2.0 z)) (- (* 0.5 x) y))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((t * t) / 2.0) <= 6.5) {
tmp = ((x * 0.5) - y) * (sqrt((z + z)) * 1.0);
} else {
tmp = (z * (sqrt((2.0 / z)) * ((0.5 * x) - y))) * 1.0;
}
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 * t) / 2.0d0) <= 6.5d0) then
tmp = ((x * 0.5d0) - y) * (sqrt((z + z)) * 1.0d0)
else
tmp = (z * (sqrt((2.0d0 / z)) * ((0.5d0 * x) - y))) * 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((t * t) / 2.0) <= 6.5) {
tmp = ((x * 0.5) - y) * (Math.sqrt((z + z)) * 1.0);
} else {
tmp = (z * (Math.sqrt((2.0 / z)) * ((0.5 * x) - y))) * 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((t * t) / 2.0) <= 6.5: tmp = ((x * 0.5) - y) * (math.sqrt((z + z)) * 1.0) else: tmp = (z * (math.sqrt((2.0 / z)) * ((0.5 * x) - y))) * 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(t * t) / 2.0) <= 6.5) tmp = Float64(Float64(Float64(x * 0.5) - y) * Float64(sqrt(Float64(z + z)) * 1.0)); else tmp = Float64(Float64(z * Float64(sqrt(Float64(2.0 / z)) * Float64(Float64(0.5 * x) - y))) * 1.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((t * t) / 2.0) <= 6.5) tmp = ((x * 0.5) - y) * (sqrt((z + z)) * 1.0); else tmp = (z * (sqrt((2.0 / z)) * ((0.5 * x) - y))) * 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision], 6.5], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(N[Sqrt[N[(2.0 / z), $MachinePrecision]], $MachinePrecision] * N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\frac{t \cdot t}{2} \leq 6.5:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z + z} \cdot 1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(\sqrt{\frac{2}{z}} \cdot \left(0.5 \cdot x - y\right)\right)\right) \cdot 1\\
\end{array}
if (/.f64 (*.f64 t t) #s(literal 2 binary64)) < 6.5Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6457.2%
lift-*.f64N/A
count-2-revN/A
lift-+.f6457.2%
Applied rewrites57.2%
if 6.5 < (/.f64 (*.f64 t t) #s(literal 2 binary64)) Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6429.7%
Applied rewrites29.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
pow1/2N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
pow1/2N/A
lift-sqrt.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6429.7%
Applied rewrites29.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6456.6%
Applied rewrites56.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ z z))))
(if (<= (/ (* t t) 2.0) 2.5e-9)
(* (- (* x 0.5) y) (* t_1 1.0))
(* (* (* (- 0.5 (/ y x)) t_1) x) 1.0))))double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + z));
double tmp;
if (((t * t) / 2.0) <= 2.5e-9) {
tmp = ((x * 0.5) - y) * (t_1 * 1.0);
} else {
tmp = (((0.5 - (y / x)) * t_1) * x) * 1.0;
}
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 * t) / 2.0d0) <= 2.5d-9) then
tmp = ((x * 0.5d0) - y) * (t_1 * 1.0d0)
else
tmp = (((0.5d0 - (y / x)) * t_1) * x) * 1.0d0
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 * t) / 2.0) <= 2.5e-9) {
tmp = ((x * 0.5) - y) * (t_1 * 1.0);
} else {
tmp = (((0.5 - (y / x)) * t_1) * x) * 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z + z)) tmp = 0 if ((t * t) / 2.0) <= 2.5e-9: tmp = ((x * 0.5) - y) * (t_1 * 1.0) else: tmp = (((0.5 - (y / x)) * t_1) * x) * 1.0 return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z + z)) tmp = 0.0 if (Float64(Float64(t * t) / 2.0) <= 2.5e-9) tmp = Float64(Float64(Float64(x * 0.5) - y) * Float64(t_1 * 1.0)); else tmp = Float64(Float64(Float64(Float64(0.5 - Float64(y / x)) * t_1) * x) * 1.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z + z)); tmp = 0.0; if (((t * t) / 2.0) <= 2.5e-9) tmp = ((x * 0.5) - y) * (t_1 * 1.0); else tmp = (((0.5 - (y / x)) * t_1) * x) * 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision], 2.5e-9], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[(t$95$1 * 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(0.5 - N[(y / x), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * x), $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
t_1 := \sqrt{z + z}\\
\mathbf{if}\;\frac{t \cdot t}{2} \leq 2.5 \cdot 10^{-9}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \left(t\_1 \cdot 1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(0.5 - \frac{y}{x}\right) \cdot t\_1\right) \cdot x\right) \cdot 1\\
\end{array}
if (/.f64 (*.f64 t t) #s(literal 2 binary64)) < 2.5000000000000001e-9Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6457.2%
lift-*.f64N/A
count-2-revN/A
lift-+.f6457.2%
Applied rewrites57.2%
if 2.5000000000000001e-9 < (/.f64 (*.f64 t t) #s(literal 2 binary64)) Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6457.6%
Applied rewrites57.6%
lift-*.f64N/A
*-commutativeN/A
Applied rewrites57.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ z z))))
(if (<= (/ (* t t) 2.0) 3.1e+49)
(* (- (* x 0.5) y) (* t_1 1.0))
(* (* x (* (/ t_1 x) (- y))) 1.0))))double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + z));
double tmp;
if (((t * t) / 2.0) <= 3.1e+49) {
tmp = ((x * 0.5) - y) * (t_1 * 1.0);
} else {
tmp = (x * ((t_1 / x) * -y)) * 1.0;
}
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 * t) / 2.0d0) <= 3.1d+49) then
tmp = ((x * 0.5d0) - y) * (t_1 * 1.0d0)
else
tmp = (x * ((t_1 / x) * -y)) * 1.0d0
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 * t) / 2.0) <= 3.1e+49) {
tmp = ((x * 0.5) - y) * (t_1 * 1.0);
} else {
tmp = (x * ((t_1 / x) * -y)) * 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z + z)) tmp = 0 if ((t * t) / 2.0) <= 3.1e+49: tmp = ((x * 0.5) - y) * (t_1 * 1.0) else: tmp = (x * ((t_1 / x) * -y)) * 1.0 return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z + z)) tmp = 0.0 if (Float64(Float64(t * t) / 2.0) <= 3.1e+49) tmp = Float64(Float64(Float64(x * 0.5) - y) * Float64(t_1 * 1.0)); else tmp = Float64(Float64(x * Float64(Float64(t_1 / x) * Float64(-y))) * 1.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z + z)); tmp = 0.0; if (((t * t) / 2.0) <= 3.1e+49) tmp = ((x * 0.5) - y) * (t_1 * 1.0); else tmp = (x * ((t_1 / x) * -y)) * 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision], 3.1e+49], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[(t$95$1 * 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(t$95$1 / x), $MachinePrecision] * (-y)), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
t_1 := \sqrt{z + z}\\
\mathbf{if}\;\frac{t \cdot t}{2} \leq 3.1 \cdot 10^{+49}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \left(t\_1 \cdot 1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(\frac{t\_1}{x} \cdot \left(-y\right)\right)\right) \cdot 1\\
\end{array}
if (/.f64 (*.f64 t t) #s(literal 2 binary64)) < 3.0999999999999999e49Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6457.2%
lift-*.f64N/A
count-2-revN/A
lift-+.f6457.2%
Applied rewrites57.2%
if 3.0999999999999999e49 < (/.f64 (*.f64 t t) #s(literal 2 binary64)) Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6429.7%
Applied rewrites29.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
pow1/2N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
pow1/2N/A
lift-sqrt.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6429.7%
Applied rewrites29.7%
lift-*.f64N/A
*-rgt-identityN/A
*-inversesN/A
associate-/l*N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6430.5%
Applied rewrites30.5%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (* (sqrt (+ z z)) 1.0)))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * (sqrt((z + z)) * 1.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(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 + z)) * 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * (Math.sqrt((z + z)) * 1.0);
}
def code(x, y, z, t): return ((x * 0.5) - y) * (math.sqrt((z + z)) * 1.0)
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * Float64(sqrt(Float64(z + z)) * 1.0)) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * (sqrt((z + z)) * 1.0); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision]
\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{z + z} \cdot 1\right)
Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6457.2%
lift-*.f64N/A
count-2-revN/A
lift-+.f6457.2%
Applied rewrites57.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (* 0.5 (* x (sqrt (* 2.0 z)))) 1.0)))
(if (<= x -3.5e+47)
t_1
(if (<= x 4.2e-24) (* (* (sqrt (+ z z)) (- y)) 1.0) t_1))))double code(double x, double y, double z, double t) {
double t_1 = (0.5 * (x * sqrt((2.0 * z)))) * 1.0;
double tmp;
if (x <= -3.5e+47) {
tmp = t_1;
} else if (x <= 4.2e-24) {
tmp = (sqrt((z + z)) * -y) * 1.0;
} 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 = (0.5d0 * (x * sqrt((2.0d0 * z)))) * 1.0d0
if (x <= (-3.5d+47)) then
tmp = t_1
else if (x <= 4.2d-24) then
tmp = (sqrt((z + z)) * -y) * 1.0d0
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 = (0.5 * (x * Math.sqrt((2.0 * z)))) * 1.0;
double tmp;
if (x <= -3.5e+47) {
tmp = t_1;
} else if (x <= 4.2e-24) {
tmp = (Math.sqrt((z + z)) * -y) * 1.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (0.5 * (x * math.sqrt((2.0 * z)))) * 1.0 tmp = 0 if x <= -3.5e+47: tmp = t_1 elif x <= 4.2e-24: tmp = (math.sqrt((z + z)) * -y) * 1.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(0.5 * Float64(x * sqrt(Float64(2.0 * z)))) * 1.0) tmp = 0.0 if (x <= -3.5e+47) tmp = t_1; elseif (x <= 4.2e-24) tmp = Float64(Float64(sqrt(Float64(z + z)) * Float64(-y)) * 1.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (0.5 * (x * sqrt((2.0 * z)))) * 1.0; tmp = 0.0; if (x <= -3.5e+47) tmp = t_1; elseif (x <= 4.2e-24) tmp = (sqrt((z + z)) * -y) * 1.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(0.5 * N[(x * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[x, -3.5e+47], t$95$1, If[LessEqual[x, 4.2e-24], N[(N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision] * 1.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(0.5 \cdot \left(x \cdot \sqrt{2 \cdot z}\right)\right) \cdot 1\\
\mathbf{if}\;x \leq -3.5 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-24}:\\
\;\;\;\;\left(\sqrt{z + z} \cdot \left(-y\right)\right) \cdot 1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -3.5000000000000002e47 or 4.1999999999999999e-24 < x Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6430.4%
Applied rewrites30.4%
if -3.5000000000000002e47 < x < 4.1999999999999999e-24Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6429.7%
Applied rewrites29.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
pow1/2N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
pow1/2N/A
lift-sqrt.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6429.7%
Applied rewrites29.7%
(FPCore (x y z t) :precision binary64 (* (* (sqrt (+ z z)) (- y)) 1.0))
double code(double x, double y, double z, double t) {
return (sqrt((z + z)) * -y) * 1.0;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(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)) * -y) * 1.0d0
end function
public static double code(double x, double y, double z, double t) {
return (Math.sqrt((z + z)) * -y) * 1.0;
}
def code(x, y, z, t): return (math.sqrt((z + z)) * -y) * 1.0
function code(x, y, z, t) return Float64(Float64(sqrt(Float64(z + z)) * Float64(-y)) * 1.0) end
function tmp = code(x, y, z, t) tmp = (sqrt((z + z)) * -y) * 1.0; end
code[x_, y_, z_, t_] := N[(N[(N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision] * 1.0), $MachinePrecision]
\left(\sqrt{z + z} \cdot \left(-y\right)\right) \cdot 1
Initial program 99.5%
Taylor expanded in t around 0
Applied rewrites57.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6429.7%
Applied rewrites29.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
lift-sqrt.f64N/A
pow1/2N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
pow1/2N/A
lift-sqrt.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6429.7%
Applied rewrites29.7%
herbie shell --seed 2025258
(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))))