
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - 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, a)
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), intent (in) :: a
code = x + (((y - z) * (t - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - 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, a)
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), intent (in) :: a
code = x + (((y - z) * (t - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) (- a z)) x))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_2 -1e+295)
t_1
(if (<= t_2 -5e-294)
(+ (fma (/ (- y z) (- a z)) t (/ (* (- x) (- y z)) (- a z))) x)
(if (<= t_2 5e-298)
(+ (- (/ (* (- t x) (- y a)) z)) t)
(if (<= t_2 5e+307) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((t - x) / (a - z)), x);
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_2 <= -1e+295) {
tmp = t_1;
} else if (t_2 <= -5e-294) {
tmp = fma(((y - z) / (a - z)), t, ((-x * (y - z)) / (a - z))) + x;
} else if (t_2 <= 5e-298) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else if (t_2 <= 5e+307) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(t - x) / Float64(a - z)), x) t_2 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_2 <= -1e+295) tmp = t_1; elseif (t_2 <= -5e-294) tmp = Float64(fma(Float64(Float64(y - z) / Float64(a - z)), t, Float64(Float64(Float64(-x) * Float64(y - z)) / Float64(a - z))) + x); elseif (t_2 <= 5e-298) tmp = Float64(Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z)) + t); elseif (t_2 <= 5e+307) tmp = t_2; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+295], t$95$1, If[LessEqual[t$95$2, -5e-294], N[(N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t + N[(N[((-x) * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$2, 5e-298], N[((-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + t), $MachinePrecision], If[LessEqual[t$95$2, 5e+307], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\
t_2 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+295}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-294}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a - z}, t, \frac{\left(-x\right) \cdot \left(y - z\right)}{a - z}\right) + x\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-298}:\\
\;\;\;\;\left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right) + t\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+307}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -9.9999999999999998e294 or 5e307 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
if -9.9999999999999998e294 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -5.0000000000000003e-294Initial program 68.3%
Taylor expanded in t around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites74.2%
if -5.0000000000000003e-294 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 5.0000000000000002e-298Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.5
Applied rewrites46.5%
if 5.0000000000000002e-298 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 5e307Initial program 68.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) (- a z)) x))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_2 -1e+295)
t_1
(if (<= t_2 -5e-294)
t_2
(if (<= t_2 5e-298)
(+ (- (/ (* (- t x) (- y a)) z)) t)
(if (<= t_2 5e+307) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((t - x) / (a - z)), x);
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_2 <= -1e+295) {
tmp = t_1;
} else if (t_2 <= -5e-294) {
tmp = t_2;
} else if (t_2 <= 5e-298) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else if (t_2 <= 5e+307) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(t - x) / Float64(a - z)), x) t_2 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_2 <= -1e+295) tmp = t_1; elseif (t_2 <= -5e-294) tmp = t_2; elseif (t_2 <= 5e-298) tmp = Float64(Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z)) + t); elseif (t_2 <= 5e+307) tmp = t_2; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+295], t$95$1, If[LessEqual[t$95$2, -5e-294], t$95$2, If[LessEqual[t$95$2, 5e-298], N[((-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + t), $MachinePrecision], If[LessEqual[t$95$2, 5e+307], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\
t_2 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+295}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-294}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-298}:\\
\;\;\;\;\left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right) + t\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+307}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -9.9999999999999998e294 or 5e307 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
if -9.9999999999999998e294 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -5.0000000000000003e-294 or 5.0000000000000002e-298 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 5e307Initial program 68.3%
if -5.0000000000000003e-294 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 5.0000000000000002e-298Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.5
Applied rewrites46.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) (- a z)) x))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_2 -5e-294)
t_1
(if (<= t_2 5e-298) (+ (- (/ (* (- t x) (- y a)) z)) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((t - x) / (a - z)), x);
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_2 <= -5e-294) {
tmp = t_1;
} else if (t_2 <= 5e-298) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(t - x) / Float64(a - z)), x) t_2 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_2 <= -5e-294) tmp = t_1; elseif (t_2 <= 5e-298) tmp = Float64(Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z)) + t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-294], t$95$1, If[LessEqual[t$95$2, 5e-298], N[((-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\
t_2 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-294}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-298}:\\
\;\;\;\;\left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right) + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -5.0000000000000003e-294 or 5.0000000000000002e-298 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
if -5.0000000000000003e-294 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 5.0000000000000002e-298Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.5
Applied rewrites46.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) a) x)))
(if (<= a -1.05e-23)
t_1
(if (<= a 3.1e-147)
(+ (- (/ (* (- t x) (- y a)) z)) t)
(if (<= a 2.52e+67) (* t (/ (- y z) (- a z))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((t - x) / a), x);
double tmp;
if (a <= -1.05e-23) {
tmp = t_1;
} else if (a <= 3.1e-147) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else if (a <= 2.52e+67) {
tmp = t * ((y - z) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(t - x) / a), x) tmp = 0.0 if (a <= -1.05e-23) tmp = t_1; elseif (a <= 3.1e-147) tmp = Float64(Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z)) + t); elseif (a <= 2.52e+67) tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -1.05e-23], t$95$1, If[LessEqual[a, 3.1e-147], N[((-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + t), $MachinePrecision], If[LessEqual[a, 2.52e+67], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{if}\;a \leq -1.05 \cdot 10^{-23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.1 \cdot 10^{-147}:\\
\;\;\;\;\left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right) + t\\
\mathbf{elif}\;a \leq 2.52 \cdot 10^{+67}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.05e-23 or 2.5199999999999999e67 < a Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in z around 0
Applied rewrites52.3%
if -1.05e-23 < a < 3.1000000000000003e-147Initial program 68.3%
Taylor expanded in z around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6446.5
Applied rewrites46.5%
if 3.1000000000000003e-147 < a < 2.5199999999999999e67Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6451.6
Applied rewrites51.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) a) x)))
(if (<= a -38000000.0)
t_1
(if (<= a -2.1e-54)
(* y (/ (- t x) (- a z)))
(if (<= a 2.52e+67) (* t (/ (- y z) (- a z))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((t - x) / a), x);
double tmp;
if (a <= -38000000.0) {
tmp = t_1;
} else if (a <= -2.1e-54) {
tmp = y * ((t - x) / (a - z));
} else if (a <= 2.52e+67) {
tmp = t * ((y - z) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(t - x) / a), x) tmp = 0.0 if (a <= -38000000.0) tmp = t_1; elseif (a <= -2.1e-54) tmp = Float64(y * Float64(Float64(t - x) / Float64(a - z))); elseif (a <= 2.52e+67) tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -38000000.0], t$95$1, If[LessEqual[a, -2.1e-54], N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.52e+67], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{if}\;a \leq -38000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.1 \cdot 10^{-54}:\\
\;\;\;\;y \cdot \frac{t - x}{a - z}\\
\mathbf{elif}\;a \leq 2.52 \cdot 10^{+67}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.8e7 or 2.5199999999999999e67 < a Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in z around 0
Applied rewrites52.3%
if -3.8e7 < a < -2.1e-54Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in y around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6441.6
Applied rewrites41.6%
if -2.1e-54 < a < 2.5199999999999999e67Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6451.6
Applied rewrites51.6%
(FPCore (x y z t a)
:precision binary64
(if (<= a -5.5e+61)
(fma (- y z) (/ t a) x)
(if (<= a -2.1e-54)
(* y (/ (- t x) (- a z)))
(if (<= a 2.52e+67)
(* t (/ (- y z) (- a z)))
(fma (- t x) (/ (- y z) a) x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.5e+61) {
tmp = fma((y - z), (t / a), x);
} else if (a <= -2.1e-54) {
tmp = y * ((t - x) / (a - z));
} else if (a <= 2.52e+67) {
tmp = t * ((y - z) / (a - z));
} else {
tmp = fma((t - x), ((y - z) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.5e+61) tmp = fma(Float64(y - z), Float64(t / a), x); elseif (a <= -2.1e-54) tmp = Float64(y * Float64(Float64(t - x) / Float64(a - z))); elseif (a <= 2.52e+67) tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z))); else tmp = fma(Float64(t - x), Float64(Float64(y - z) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.5e+61], N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, -2.1e-54], N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.52e+67], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{+61}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\mathbf{elif}\;a \leq -2.1 \cdot 10^{-54}:\\
\;\;\;\;y \cdot \frac{t - x}{a - z}\\
\mathbf{elif}\;a \leq 2.52 \cdot 10^{+67}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\end{array}
\end{array}
if a < -5.50000000000000036e61Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in z around 0
Applied rewrites52.3%
Taylor expanded in x around 0
Applied rewrites44.9%
if -5.50000000000000036e61 < a < -2.1e-54Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in y around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6441.6
Applied rewrites41.6%
if -2.1e-54 < a < 2.5199999999999999e67Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6451.6
Applied rewrites51.6%
if 2.5199999999999999e67 < a Initial program 68.3%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.8
Applied rewrites53.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ t a) x)))
(if (<= a -5.5e+61)
t_1
(if (<= a -2.1e-54)
(* y (/ (- t x) (- a z)))
(if (<= a 2.52e+67) (* t (/ (- y z) (- a z))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), (t / a), x);
double tmp;
if (a <= -5.5e+61) {
tmp = t_1;
} else if (a <= -2.1e-54) {
tmp = y * ((t - x) / (a - z));
} else if (a <= 2.52e+67) {
tmp = t * ((y - z) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(t / a), x) tmp = 0.0 if (a <= -5.5e+61) tmp = t_1; elseif (a <= -2.1e-54) tmp = Float64(y * Float64(Float64(t - x) / Float64(a - z))); elseif (a <= 2.52e+67) tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -5.5e+61], t$95$1, If[LessEqual[a, -2.1e-54], N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.52e+67], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\mathbf{if}\;a \leq -5.5 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.1 \cdot 10^{-54}:\\
\;\;\;\;y \cdot \frac{t - x}{a - z}\\
\mathbf{elif}\;a \leq 2.52 \cdot 10^{+67}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.50000000000000036e61 or 2.5199999999999999e67 < a Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in z around 0
Applied rewrites52.3%
Taylor expanded in x around 0
Applied rewrites44.9%
if -5.50000000000000036e61 < a < -2.1e-54Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in y around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6441.6
Applied rewrites41.6%
if -2.1e-54 < a < 2.5199999999999999e67Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6451.6
Applied rewrites51.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ (- y z) (- a z)))))
(if (<= t -3.2e-18)
t_1
(if (<= t 6.1e-52) (* (+ (/ (- (- y z)) (- a z)) 1.0) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * ((y - z) / (a - z));
double tmp;
if (t <= -3.2e-18) {
tmp = t_1;
} else if (t <= 6.1e-52) {
tmp = ((-(y - z) / (a - z)) + 1.0) * x;
} 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, a)
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), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = t * ((y - z) / (a - z))
if (t <= (-3.2d-18)) then
tmp = t_1
else if (t <= 6.1d-52) then
tmp = ((-(y - z) / (a - z)) + 1.0d0) * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t * ((y - z) / (a - z));
double tmp;
if (t <= -3.2e-18) {
tmp = t_1;
} else if (t <= 6.1e-52) {
tmp = ((-(y - z) / (a - z)) + 1.0) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * ((y - z) / (a - z)) tmp = 0 if t <= -3.2e-18: tmp = t_1 elif t <= 6.1e-52: tmp = ((-(y - z) / (a - z)) + 1.0) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(Float64(y - z) / Float64(a - z))) tmp = 0.0 if (t <= -3.2e-18) tmp = t_1; elseif (t <= 6.1e-52) tmp = Float64(Float64(Float64(Float64(-Float64(y - z)) / Float64(a - z)) + 1.0) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * ((y - z) / (a - z)); tmp = 0.0; if (t <= -3.2e-18) tmp = t_1; elseif (t <= 6.1e-52) tmp = ((-(y - z) / (a - z)) + 1.0) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.2e-18], t$95$1, If[LessEqual[t, 6.1e-52], N[(N[(N[((-N[(y - z), $MachinePrecision]) / N[(a - z), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y - z}{a - z}\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{-18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.1 \cdot 10^{-52}:\\
\;\;\;\;\left(\frac{-\left(y - z\right)}{a - z} + 1\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.1999999999999999e-18 or 6.0999999999999999e-52 < t Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6451.6
Applied rewrites51.6%
if -3.1999999999999999e-18 < t < 6.0999999999999999e-52Initial program 68.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lift--.f6443.5
Applied rewrites43.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ t a) x)))
(if (<= a -0.054)
t_1
(if (<= a -3.25e-55)
(/ (* (- t x) y) (- a z))
(if (<= a 2.52e+67) (* t (/ (- y z) (- a z))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), (t / a), x);
double tmp;
if (a <= -0.054) {
tmp = t_1;
} else if (a <= -3.25e-55) {
tmp = ((t - x) * y) / (a - z);
} else if (a <= 2.52e+67) {
tmp = t * ((y - z) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(t / a), x) tmp = 0.0 if (a <= -0.054) tmp = t_1; elseif (a <= -3.25e-55) tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); elseif (a <= 2.52e+67) tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -0.054], t$95$1, If[LessEqual[a, -3.25e-55], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.52e+67], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\mathbf{if}\;a \leq -0.054:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -3.25 \cdot 10^{-55}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{elif}\;a \leq 2.52 \cdot 10^{+67}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -0.0539999999999999994 or 2.5199999999999999e67 < a Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in z around 0
Applied rewrites52.3%
Taylor expanded in x around 0
Applied rewrites44.9%
if -0.0539999999999999994 < a < -3.25000000000000003e-55Initial program 68.3%
Taylor expanded in y around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6437.7
Applied rewrites37.7%
if -3.25000000000000003e-55 < a < 2.5199999999999999e67Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6451.6
Applied rewrites51.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ t a) x)))
(if (<= a -0.054)
t_1
(if (<= a -2.3e-200)
(/ (* (- t x) y) (- a z))
(if (<= a 1.76e-68) (/ (* (- y z) t) (- a z)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), (t / a), x);
double tmp;
if (a <= -0.054) {
tmp = t_1;
} else if (a <= -2.3e-200) {
tmp = ((t - x) * y) / (a - z);
} else if (a <= 1.76e-68) {
tmp = ((y - z) * t) / (a - z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(t / a), x) tmp = 0.0 if (a <= -0.054) tmp = t_1; elseif (a <= -2.3e-200) tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); elseif (a <= 1.76e-68) tmp = Float64(Float64(Float64(y - z) * t) / Float64(a - z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -0.054], t$95$1, If[LessEqual[a, -2.3e-200], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.76e-68], N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\mathbf{if}\;a \leq -0.054:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.3 \cdot 10^{-200}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{elif}\;a \leq 1.76 \cdot 10^{-68}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -0.0539999999999999994 or 1.76e-68 < a Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in z around 0
Applied rewrites52.3%
Taylor expanded in x around 0
Applied rewrites44.9%
if -0.0539999999999999994 < a < -2.30000000000000007e-200Initial program 68.3%
Taylor expanded in y around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6437.7
Applied rewrites37.7%
if -2.30000000000000007e-200 < a < 1.76e-68Initial program 68.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6440.1
Applied rewrites40.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- y z) (/ t a) x))) (if (<= a -0.054) t_1 (if (<= a 1.5e-63) (/ (* (- t x) y) (- a z)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), (t / a), x);
double tmp;
if (a <= -0.054) {
tmp = t_1;
} else if (a <= 1.5e-63) {
tmp = ((t - x) * y) / (a - z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(t / a), x) tmp = 0.0 if (a <= -0.054) tmp = t_1; elseif (a <= 1.5e-63) tmp = Float64(Float64(Float64(t - x) * y) / Float64(a - z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -0.054], t$95$1, If[LessEqual[a, 1.5e-63], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\mathbf{if}\;a \leq -0.054:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{-63}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -0.0539999999999999994 or 1.4999999999999999e-63 < a Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in z around 0
Applied rewrites52.3%
Taylor expanded in x around 0
Applied rewrites44.9%
if -0.0539999999999999994 < a < 1.4999999999999999e-63Initial program 68.3%
Taylor expanded in y around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6437.7
Applied rewrites37.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.85e+58)
t
(if (<= z 9.2e-227)
(fma y (/ (- t x) a) x)
(if (<= z 5.5e+139) (fma (- y z) (/ t a) x) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.85e+58) {
tmp = t;
} else if (z <= 9.2e-227) {
tmp = fma(y, ((t - x) / a), x);
} else if (z <= 5.5e+139) {
tmp = fma((y - z), (t / a), x);
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.85e+58) tmp = t; elseif (z <= 9.2e-227) tmp = fma(y, Float64(Float64(t - x) / a), x); elseif (z <= 5.5e+139) tmp = fma(Float64(y - z), Float64(t / a), x); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.85e+58], t, If[LessEqual[z, 9.2e-227], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 5.5e+139], N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision] + x), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+58}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-227}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+139}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -1.8500000000000001e58 or 5.4999999999999996e139 < z Initial program 68.3%
Taylor expanded in z around inf
Applied rewrites25.1%
if -1.8500000000000001e58 < z < 9.20000000000000048e-227Initial program 68.3%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6447.8
Applied rewrites47.8%
if 9.20000000000000048e-227 < z < 5.4999999999999996e139Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in z around 0
Applied rewrites52.3%
Taylor expanded in x around 0
Applied rewrites44.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.85e+58) t (if (<= z 5.3e+166) (fma y (/ (- t x) a) x) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.85e+58) {
tmp = t;
} else if (z <= 5.3e+166) {
tmp = fma(y, ((t - x) / a), x);
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.85e+58) tmp = t; elseif (z <= 5.3e+166) tmp = fma(y, Float64(Float64(t - x) / a), x); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.85e+58], t, If[LessEqual[z, 5.3e+166], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+58}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{+166}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -1.8500000000000001e58 or 5.3e166 < z Initial program 68.3%
Taylor expanded in z around inf
Applied rewrites25.1%
if -1.8500000000000001e58 < z < 5.3e166Initial program 68.3%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6447.8
Applied rewrites47.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- 1.0 (/ y a)) x)))
(if (<= z -1.3e+24)
t
(if (<= z -6.6e-248)
t_1
(if (<= z 5e-200) (/ (* (- t x) y) a) (if (<= z 5.3e+166) t_1 t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (1.0 - (y / a)) * x;
double tmp;
if (z <= -1.3e+24) {
tmp = t;
} else if (z <= -6.6e-248) {
tmp = t_1;
} else if (z <= 5e-200) {
tmp = ((t - x) * y) / a;
} else if (z <= 5.3e+166) {
tmp = t_1;
} else {
tmp = t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (1.0d0 - (y / a)) * x
if (z <= (-1.3d+24)) then
tmp = t
else if (z <= (-6.6d-248)) then
tmp = t_1
else if (z <= 5d-200) then
tmp = ((t - x) * y) / a
else if (z <= 5.3d+166) then
tmp = t_1
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (1.0 - (y / a)) * x;
double tmp;
if (z <= -1.3e+24) {
tmp = t;
} else if (z <= -6.6e-248) {
tmp = t_1;
} else if (z <= 5e-200) {
tmp = ((t - x) * y) / a;
} else if (z <= 5.3e+166) {
tmp = t_1;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (1.0 - (y / a)) * x tmp = 0 if z <= -1.3e+24: tmp = t elif z <= -6.6e-248: tmp = t_1 elif z <= 5e-200: tmp = ((t - x) * y) / a elif z <= 5.3e+166: tmp = t_1 else: tmp = t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(1.0 - Float64(y / a)) * x) tmp = 0.0 if (z <= -1.3e+24) tmp = t; elseif (z <= -6.6e-248) tmp = t_1; elseif (z <= 5e-200) tmp = Float64(Float64(Float64(t - x) * y) / a); elseif (z <= 5.3e+166) tmp = t_1; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (1.0 - (y / a)) * x; tmp = 0.0; if (z <= -1.3e+24) tmp = t; elseif (z <= -6.6e-248) tmp = t_1; elseif (z <= 5e-200) tmp = ((t - x) * y) / a; elseif (z <= 5.3e+166) tmp = t_1; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -1.3e+24], t, If[LessEqual[z, -6.6e-248], t$95$1, If[LessEqual[z, 5e-200], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 5.3e+166], t$95$1, t]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - \frac{y}{a}\right) \cdot x\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{+24}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-248}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-200}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a}\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{+166}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -1.2999999999999999e24 or 5.3e166 < z Initial program 68.3%
Taylor expanded in z around inf
Applied rewrites25.1%
if -1.2999999999999999e24 < z < -6.6000000000000004e-248 or 4.99999999999999991e-200 < z < 5.3e166Initial program 68.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lift--.f6443.5
Applied rewrites43.5%
Taylor expanded in z around 0
lower--.f64N/A
lower-/.f6437.1
Applied rewrites37.1%
if -6.6000000000000004e-248 < z < 4.99999999999999991e-200Initial program 68.3%
Taylor expanded in y around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6437.7
Applied rewrites37.7%
Taylor expanded in z around 0
Applied rewrites23.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- 1.0 (/ y a)) x)))
(if (<= z -1.3e+24)
t
(if (<= z -1.55e-120)
t_1
(if (<= z 3.8e-200) (/ (* t y) (- a z)) (if (<= z 5.3e+166) t_1 t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (1.0 - (y / a)) * x;
double tmp;
if (z <= -1.3e+24) {
tmp = t;
} else if (z <= -1.55e-120) {
tmp = t_1;
} else if (z <= 3.8e-200) {
tmp = (t * y) / (a - z);
} else if (z <= 5.3e+166) {
tmp = t_1;
} else {
tmp = t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (1.0d0 - (y / a)) * x
if (z <= (-1.3d+24)) then
tmp = t
else if (z <= (-1.55d-120)) then
tmp = t_1
else if (z <= 3.8d-200) then
tmp = (t * y) / (a - z)
else if (z <= 5.3d+166) then
tmp = t_1
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (1.0 - (y / a)) * x;
double tmp;
if (z <= -1.3e+24) {
tmp = t;
} else if (z <= -1.55e-120) {
tmp = t_1;
} else if (z <= 3.8e-200) {
tmp = (t * y) / (a - z);
} else if (z <= 5.3e+166) {
tmp = t_1;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (1.0 - (y / a)) * x tmp = 0 if z <= -1.3e+24: tmp = t elif z <= -1.55e-120: tmp = t_1 elif z <= 3.8e-200: tmp = (t * y) / (a - z) elif z <= 5.3e+166: tmp = t_1 else: tmp = t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(1.0 - Float64(y / a)) * x) tmp = 0.0 if (z <= -1.3e+24) tmp = t; elseif (z <= -1.55e-120) tmp = t_1; elseif (z <= 3.8e-200) tmp = Float64(Float64(t * y) / Float64(a - z)); elseif (z <= 5.3e+166) tmp = t_1; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (1.0 - (y / a)) * x; tmp = 0.0; if (z <= -1.3e+24) tmp = t; elseif (z <= -1.55e-120) tmp = t_1; elseif (z <= 3.8e-200) tmp = (t * y) / (a - z); elseif (z <= 5.3e+166) tmp = t_1; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -1.3e+24], t, If[LessEqual[z, -1.55e-120], t$95$1, If[LessEqual[z, 3.8e-200], N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.3e+166], t$95$1, t]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - \frac{y}{a}\right) \cdot x\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{+24}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{-120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-200}:\\
\;\;\;\;\frac{t \cdot y}{a - z}\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{+166}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -1.2999999999999999e24 or 5.3e166 < z Initial program 68.3%
Taylor expanded in z around inf
Applied rewrites25.1%
if -1.2999999999999999e24 < z < -1.5500000000000001e-120 or 3.8e-200 < z < 5.3e166Initial program 68.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lift--.f6443.5
Applied rewrites43.5%
Taylor expanded in z around 0
lower--.f64N/A
lower-/.f6437.1
Applied rewrites37.1%
if -1.5500000000000001e-120 < z < 3.8e-200Initial program 68.3%
Taylor expanded in y around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6437.7
Applied rewrites37.7%
Taylor expanded in x around 0
Applied rewrites21.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.3e+24) t (if (<= z 5.3e+166) (* (- 1.0 (/ y a)) x) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.3e+24) {
tmp = t;
} else if (z <= 5.3e+166) {
tmp = (1.0 - (y / a)) * x;
} else {
tmp = t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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), intent (in) :: a
real(8) :: tmp
if (z <= (-1.3d+24)) then
tmp = t
else if (z <= 5.3d+166) then
tmp = (1.0d0 - (y / a)) * x
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.3e+24) {
tmp = t;
} else if (z <= 5.3e+166) {
tmp = (1.0 - (y / a)) * x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.3e+24: tmp = t elif z <= 5.3e+166: tmp = (1.0 - (y / a)) * x else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.3e+24) tmp = t; elseif (z <= 5.3e+166) tmp = Float64(Float64(1.0 - Float64(y / a)) * x); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.3e+24) tmp = t; elseif (z <= 5.3e+166) tmp = (1.0 - (y / a)) * x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.3e+24], t, If[LessEqual[z, 5.3e+166], N[(N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+24}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{+166}:\\
\;\;\;\;\left(1 - \frac{y}{a}\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -1.2999999999999999e24 or 5.3e166 < z Initial program 68.3%
Taylor expanded in z around inf
Applied rewrites25.1%
if -1.2999999999999999e24 < z < 5.3e166Initial program 68.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lift--.f6443.5
Applied rewrites43.5%
Taylor expanded in z around 0
lower--.f64N/A
lower-/.f6437.1
Applied rewrites37.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.1e+57) t (if (<= z 1.65e-196) (/ (* t y) a) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e+57) {
tmp = t;
} else if (z <= 1.65e-196) {
tmp = (t * y) / a;
} else {
tmp = x + t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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), intent (in) :: a
real(8) :: tmp
if (z <= (-1.1d+57)) then
tmp = t
else if (z <= 1.65d-196) then
tmp = (t * y) / a
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e+57) {
tmp = t;
} else if (z <= 1.65e-196) {
tmp = (t * y) / a;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.1e+57: tmp = t elif z <= 1.65e-196: tmp = (t * y) / a else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.1e+57) tmp = t; elseif (z <= 1.65e-196) tmp = Float64(Float64(t * y) / a); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.1e+57) tmp = t; elseif (z <= 1.65e-196) tmp = (t * y) / a; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.1e+57], t, If[LessEqual[z, 1.65e-196], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+57}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-196}:\\
\;\;\;\;\frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.1e57Initial program 68.3%
Taylor expanded in z around inf
Applied rewrites25.1%
if -1.1e57 < z < 1.64999999999999999e-196Initial program 68.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in y around inf
sub-divN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift--.f6441.6
Applied rewrites41.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lift--.f6421.7
Applied rewrites21.7%
Taylor expanded in z around 0
Applied rewrites16.8%
if 1.64999999999999999e-196 < z Initial program 68.3%
Taylor expanded in z around inf
lift--.f6418.8
Applied rewrites18.8%
Taylor expanded in x around 0
Applied rewrites33.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ y z) x))) (if (<= y -7.7e+205) t_1 (if (<= y 2.5e+82) (+ x t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / z) * x;
double tmp;
if (y <= -7.7e+205) {
tmp = t_1;
} else if (y <= 2.5e+82) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (y / z) * x
if (y <= (-7.7d+205)) then
tmp = t_1
else if (y <= 2.5d+82) then
tmp = x + t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y / z) * x;
double tmp;
if (y <= -7.7e+205) {
tmp = t_1;
} else if (y <= 2.5e+82) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / z) * x tmp = 0 if y <= -7.7e+205: tmp = t_1 elif y <= 2.5e+82: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / z) * x) tmp = 0.0 if (y <= -7.7e+205) tmp = t_1; elseif (y <= 2.5e+82) tmp = Float64(x + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / z) * x; tmp = 0.0; if (y <= -7.7e+205) tmp = t_1; elseif (y <= 2.5e+82) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, -7.7e+205], t$95$1, If[LessEqual[y, 2.5e+82], N[(x + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} \cdot x\\
\mathbf{if}\;y \leq -7.7 \cdot 10^{+205}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+82}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.6999999999999999e205 or 2.50000000000000008e82 < y Initial program 68.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lift--.f6443.5
Applied rewrites43.5%
Taylor expanded in a around 0
lower-/.f6418.6
Applied rewrites18.6%
if -7.6999999999999999e205 < y < 2.50000000000000008e82Initial program 68.3%
Taylor expanded in z around inf
lift--.f6418.8
Applied rewrites18.8%
Taylor expanded in x around 0
Applied rewrites33.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.45e-5) t (if (<= z 7.6e-23) x (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.45e-5) {
tmp = t;
} else if (z <= 7.6e-23) {
tmp = x;
} else {
tmp = x + t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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), intent (in) :: a
real(8) :: tmp
if (z <= (-2.45d-5)) then
tmp = t
else if (z <= 7.6d-23) then
tmp = x
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.45e-5) {
tmp = t;
} else if (z <= 7.6e-23) {
tmp = x;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.45e-5: tmp = t elif z <= 7.6e-23: tmp = x else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.45e-5) tmp = t; elseif (z <= 7.6e-23) tmp = x; else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.45e-5) tmp = t; elseif (z <= 7.6e-23) tmp = x; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.45e-5], t, If[LessEqual[z, 7.6e-23], x, N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{-5}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-23}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -2.45e-5Initial program 68.3%
Taylor expanded in z around inf
Applied rewrites25.1%
if -2.45e-5 < z < 7.60000000000000023e-23Initial program 68.3%
Taylor expanded in a around inf
Applied rewrites25.9%
if 7.60000000000000023e-23 < z Initial program 68.3%
Taylor expanded in z around inf
lift--.f6418.8
Applied rewrites18.8%
Taylor expanded in x around 0
Applied rewrites33.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.45e-5) t (if (<= z 1.05e-5) x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.45e-5) {
tmp = t;
} else if (z <= 1.05e-5) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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), intent (in) :: a
real(8) :: tmp
if (z <= (-2.45d-5)) then
tmp = t
else if (z <= 1.05d-5) then
tmp = x
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.45e-5) {
tmp = t;
} else if (z <= 1.05e-5) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.45e-5: tmp = t elif z <= 1.05e-5: tmp = x else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.45e-5) tmp = t; elseif (z <= 1.05e-5) tmp = x; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.45e-5) tmp = t; elseif (z <= 1.05e-5) tmp = x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.45e-5], t, If[LessEqual[z, 1.05e-5], x, t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{-5}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-5}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -2.45e-5 or 1.04999999999999994e-5 < z Initial program 68.3%
Taylor expanded in z around inf
Applied rewrites25.1%
if -2.45e-5 < z < 1.04999999999999994e-5Initial program 68.3%
Taylor expanded in a around inf
Applied rewrites25.9%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return t;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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), intent (in) :: a
code = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 68.3%
Taylor expanded in z around inf
Applied rewrites25.1%
herbie shell --seed 2025123
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
:precision binary64
(+ x (/ (* (- y z) (- t x)) (- a z))))