
(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 18 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 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_1 -5e+214)
(fma (- y z) (/ (- t x) (- a z)) x)
(if (<= t_1 -5e-244)
t_1
(if (<= t_1 0.0)
(+ (- (/ (* (- t x) (- y a)) z)) t)
(if (<= t_1 2e+299)
(+ (fma (/ (- y z) (- a z)) t (/ (* (- x) (- y z)) (- a z))) x)
(fma (- y z) (- (/ t (- a z)) (/ x (- a z))) x)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_1 <= -5e+214) {
tmp = fma((y - z), ((t - x) / (a - z)), x);
} else if (t_1 <= -5e-244) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else if (t_1 <= 2e+299) {
tmp = fma(((y - z) / (a - z)), t, ((-x * (y - z)) / (a - z))) + x;
} else {
tmp = fma((y - z), ((t / (a - z)) - (x / (a - z))), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_1 <= -5e+214) tmp = fma(Float64(y - z), Float64(Float64(t - x) / Float64(a - z)), x); elseif (t_1 <= -5e-244) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z)) + t); elseif (t_1 <= 2e+299) tmp = Float64(fma(Float64(Float64(y - z) / Float64(a - z)), t, Float64(Float64(Float64(-x) * Float64(y - z)) / Float64(a - z))) + x); else tmp = fma(Float64(y - z), Float64(Float64(t / Float64(a - z)) - Float64(x / Float64(a - z))), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+214], N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, -5e-244], t$95$1, If[LessEqual[t$95$1, 0.0], N[((-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + t), $MachinePrecision], If[LessEqual[t$95$1, 2e+299], 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], N[(N[(y - z), $MachinePrecision] * N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(x / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+214}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-244}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right) + t\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a - z}, t, \frac{\left(-x\right) \cdot \left(y - z\right)}{a - z}\right) + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a - z} - \frac{x}{a - z}, x\right)\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -4.99999999999999953e214Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
if -4.99999999999999953e214 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -4.99999999999999998e-244Initial program 67.5%
if -4.99999999999999998e-244 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 67.5%
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.2
Applied rewrites46.2%
if 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 2.0000000000000001e299Initial program 67.5%
Taylor expanded in t around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites74.6%
if 2.0000000000000001e299 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-divN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6479.9
Applied rewrites79.9%
(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+214)
t_1
(if (<= t_2 -5e-244)
t_2
(if (<= t_2 0.0)
(+ (- (/ (* (- t x) (- y a)) z)) t)
(if (<= t_2 2e+299) 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 <= -5e+214) {
tmp = t_1;
} else if (t_2 <= -5e-244) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else if (t_2 <= 2e+299) {
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 <= -5e+214) tmp = t_1; elseif (t_2 <= -5e-244) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z)) + t); elseif (t_2 <= 2e+299) 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, -5e+214], t$95$1, If[LessEqual[t$95$2, -5e-244], t$95$2, If[LessEqual[t$95$2, 0.0], N[((-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + t), $MachinePrecision], If[LessEqual[t$95$2, 2e+299], 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 -5 \cdot 10^{+214}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-244}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right) + t\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -4.99999999999999953e214 or 2.0000000000000001e299 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
if -4.99999999999999953e214 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -4.99999999999999998e-244 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 2.0000000000000001e299Initial program 67.5%
if -4.99999999999999998e-244 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 67.5%
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.2
Applied rewrites46.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_1 -5e+214)
(fma (- y z) (/ (- t x) (- a z)) x)
(if (<= t_1 -5e-244)
t_1
(if (<= t_1 0.0)
(+ (- (/ (* (- t x) (- y a)) z)) t)
(if (<= t_1 2e+299)
t_1
(fma (- y z) (- (/ t (- a z)) (/ x (- a z))) x)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_1 <= -5e+214) {
tmp = fma((y - z), ((t - x) / (a - z)), x);
} else if (t_1 <= -5e-244) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = -(((t - x) * (y - a)) / z) + t;
} else if (t_1 <= 2e+299) {
tmp = t_1;
} else {
tmp = fma((y - z), ((t / (a - z)) - (x / (a - z))), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_1 <= -5e+214) tmp = fma(Float64(y - z), Float64(Float64(t - x) / Float64(a - z)), x); elseif (t_1 <= -5e-244) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z)) + t); elseif (t_1 <= 2e+299) tmp = t_1; else tmp = fma(Float64(y - z), Float64(Float64(t / Float64(a - z)) - Float64(x / Float64(a - z))), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+214], N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, -5e-244], t$95$1, If[LessEqual[t$95$1, 0.0], N[((-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + t), $MachinePrecision], If[LessEqual[t$95$1, 2e+299], t$95$1, N[(N[(y - z), $MachinePrecision] * N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(x / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+214}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-244}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right) + t\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a - z} - \frac{x}{a - z}, x\right)\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -4.99999999999999953e214Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
if -4.99999999999999953e214 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -4.99999999999999998e-244 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 2.0000000000000001e299Initial program 67.5%
if -4.99999999999999998e-244 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 67.5%
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.2
Applied rewrites46.2%
if 2.0000000000000001e299 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-divN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6479.9
Applied rewrites79.9%
(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-244)
t_1
(if (<= t_2 4e-255) (+ (- (/ (* (- 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-244) {
tmp = t_1;
} else if (t_2 <= 4e-255) {
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-244) tmp = t_1; elseif (t_2 <= 4e-255) 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-244], t$95$1, If[LessEqual[t$95$2, 4e-255], 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^{-244}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-255}:\\
\;\;\;\;\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))) < -4.99999999999999998e-244 or 4e-255 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
if -4.99999999999999998e-244 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 4e-255Initial program 67.5%
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.2
Applied rewrites46.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (- (/ (* (- t x) (- y a)) z)) t)))
(if (<= z -9.5e-7)
t_1
(if (<= z 750000.0) (fma (- t x) (/ (- y z) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -(((t - x) * (y - a)) / z) + t;
double tmp;
if (z <= -9.5e-7) {
tmp = t_1;
} else if (z <= 750000.0) {
tmp = fma((t - x), ((y - z) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(-Float64(Float64(Float64(t - x) * Float64(y - a)) / z)) + t) tmp = 0.0 if (z <= -9.5e-7) tmp = t_1; elseif (z <= 750000.0) tmp = fma(Float64(t - x), Float64(Float64(y - z) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + t), $MachinePrecision]}, If[LessEqual[z, -9.5e-7], t$95$1, If[LessEqual[z, 750000.0], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right) + t\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 750000:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.5000000000000001e-7 or 7.5e5 < z Initial program 67.5%
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.2
Applied rewrites46.2%
if -9.5000000000000001e-7 < z < 7.5e5Initial program 67.5%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.4
Applied rewrites53.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -9.5e-7)
(+ t (* -1.0 (/ (* y (- t x)) z)))
(if (<= z 1.2e-63)
(fma (- t x) (/ (- y z) a) x)
(if (<= z 5.6e+82) (* y (/ (- t x) (- a z))) (* t (/ (- y z) (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.5e-7) {
tmp = t + (-1.0 * ((y * (t - x)) / z));
} else if (z <= 1.2e-63) {
tmp = fma((t - x), ((y - z) / a), x);
} else if (z <= 5.6e+82) {
tmp = y * ((t - x) / (a - z));
} else {
tmp = t * ((y - z) / (a - z));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9.5e-7) tmp = Float64(t + Float64(-1.0 * Float64(Float64(y * Float64(t - x)) / z))); elseif (z <= 1.2e-63) tmp = fma(Float64(t - x), Float64(Float64(y - z) / a), x); elseif (z <= 5.6e+82) tmp = Float64(y * Float64(Float64(t - x) / Float64(a - z))); else tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.5e-7], N[(t + N[(-1.0 * N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e-63], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 5.6e+82], N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-7}:\\
\;\;\;\;t + -1 \cdot \frac{y \cdot \left(t - x\right)}{z}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-63}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+82}:\\
\;\;\;\;y \cdot \frac{t - x}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\end{array}
\end{array}
if z < -9.5000000000000001e-7Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-divN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6477.7
Applied rewrites77.7%
Taylor expanded in a around 0
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6443.6
Applied rewrites43.6%
if -9.5000000000000001e-7 < z < 1.2e-63Initial program 67.5%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.4
Applied rewrites53.4%
if 1.2e-63 < z < 5.6000000000000001e82Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-divN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in y around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6442.7
Applied rewrites42.7%
if 5.6000000000000001e82 < z Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-divN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.7
Applied rewrites51.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ (- y z) (- a z)))))
(if (<= z -3.1e-6)
t_1
(if (<= z 1.2e-63)
(fma (- t x) (/ (- y z) a) x)
(if (<= z 5.6e+82) (* y (/ (- t x) (- a z))) 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 (z <= -3.1e-6) {
tmp = t_1;
} else if (z <= 1.2e-63) {
tmp = fma((t - x), ((y - z) / a), x);
} else if (z <= 5.6e+82) {
tmp = y * ((t - x) / (a - z));
} 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 (z <= -3.1e-6) tmp = t_1; elseif (z <= 1.2e-63) tmp = fma(Float64(t - x), Float64(Float64(y - z) / a), x); elseif (z <= 5.6e+82) tmp = Float64(y * Float64(Float64(t - x) / Float64(a - z))); else tmp = t_1; end return 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[z, -3.1e-6], t$95$1, If[LessEqual[z, 1.2e-63], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 5.6e+82], N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y - z}{a - z}\\
\mathbf{if}\;z \leq -3.1 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-63}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+82}:\\
\;\;\;\;y \cdot \frac{t - x}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.1e-6 or 5.6000000000000001e82 < z Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-divN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.7
Applied rewrites51.7%
if -3.1e-6 < z < 1.2e-63Initial program 67.5%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6453.4
Applied rewrites53.4%
if 1.2e-63 < z < 5.6000000000000001e82Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-divN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in y around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6442.7
Applied rewrites42.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ (- y z) (- a z)))))
(if (<= z -4.5e-44)
t_1
(if (<= z 2.8e-64)
(fma (- t x) (/ y a) x)
(if (<= z 5.6e+82) (* y (/ (- t x) (- a z))) 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 (z <= -4.5e-44) {
tmp = t_1;
} else if (z <= 2.8e-64) {
tmp = fma((t - x), (y / a), x);
} else if (z <= 5.6e+82) {
tmp = y * ((t - x) / (a - z));
} 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 (z <= -4.5e-44) tmp = t_1; elseif (z <= 2.8e-64) tmp = fma(Float64(t - x), Float64(y / a), x); elseif (z <= 5.6e+82) tmp = Float64(y * Float64(Float64(t - x) / Float64(a - z))); else tmp = t_1; end return 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[z, -4.5e-44], t$95$1, If[LessEqual[z, 2.8e-64], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 5.6e+82], N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y - z}{a - z}\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-64}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+82}:\\
\;\;\;\;y \cdot \frac{t - x}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.4999999999999999e-44 or 5.6000000000000001e82 < z Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-divN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.7
Applied rewrites51.7%
if -4.4999999999999999e-44 < z < 2.80000000000000004e-64Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
Taylor expanded in z around 0
associate-/l*N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f6448.8
Applied rewrites48.8%
if 2.80000000000000004e-64 < z < 5.6000000000000001e82Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-divN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in y around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6442.7
Applied rewrites42.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* t (/ (- y z) (- a z))))) (if (<= z -4.5e-44) t_1 (if (<= z 1.1e+79) (fma (- t x) (/ y a) 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 (z <= -4.5e-44) {
tmp = t_1;
} else if (z <= 1.1e+79) {
tmp = fma((t - x), (y / a), 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 (z <= -4.5e-44) tmp = t_1; elseif (z <= 1.1e+79) tmp = fma(Float64(t - x), Float64(y / a), x); else tmp = t_1; end return 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[z, -4.5e-44], t$95$1, If[LessEqual[z, 1.1e+79], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y - z}{a - z}\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+79}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.4999999999999999e-44 or 1.0999999999999999e79 < z Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-divN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.7
Applied rewrites51.7%
if -4.4999999999999999e-44 < z < 1.0999999999999999e79Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
Taylor expanded in z around 0
associate-/l*N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f6448.8
Applied rewrites48.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -106000000.0) (* t 1.0) (if (<= z 1.3e+106) (fma (- t x) (/ y a) x) (* t 1.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -106000000.0) {
tmp = t * 1.0;
} else if (z <= 1.3e+106) {
tmp = fma((t - x), (y / a), x);
} else {
tmp = t * 1.0;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -106000000.0) tmp = Float64(t * 1.0); elseif (z <= 1.3e+106) tmp = fma(Float64(t - x), Float64(y / a), x); else tmp = Float64(t * 1.0); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -106000000.0], N[(t * 1.0), $MachinePrecision], If[LessEqual[z, 1.3e+106], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(t * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -106000000:\\
\;\;\;\;t \cdot 1\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+106}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot 1\\
\end{array}
\end{array}
if z < -1.06e8 or 1.3000000000000001e106 < z Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-divN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.7
Applied rewrites51.7%
Taylor expanded in z around inf
Applied rewrites25.0%
if -1.06e8 < z < 1.3000000000000001e106Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
Taylor expanded in z around 0
associate-/l*N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f6448.8
Applied rewrites48.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -106000000.0) (* t 1.0) (if (<= z 2.4e+104) (fma y (/ (- t x) a) x) (* t 1.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -106000000.0) {
tmp = t * 1.0;
} else if (z <= 2.4e+104) {
tmp = fma(y, ((t - x) / a), x);
} else {
tmp = t * 1.0;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -106000000.0) tmp = Float64(t * 1.0); elseif (z <= 2.4e+104) tmp = fma(y, Float64(Float64(t - x) / a), x); else tmp = Float64(t * 1.0); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -106000000.0], N[(t * 1.0), $MachinePrecision], If[LessEqual[z, 2.4e+104], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(t * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -106000000:\\
\;\;\;\;t \cdot 1\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+104}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot 1\\
\end{array}
\end{array}
if z < -1.06e8 or 2.4e104 < z Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-divN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.7
Applied rewrites51.7%
Taylor expanded in z around inf
Applied rewrites25.0%
if -1.06e8 < z < 2.4e104Initial program 67.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6447.7
Applied rewrites47.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.35e+59)
(* t 1.0)
(if (<= z 3.3e-76)
(fma x (/ (- z y) a) x)
(if (<= z 2.4e+104) (+ x (/ (* t y) a)) (* t 1.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e+59) {
tmp = t * 1.0;
} else if (z <= 3.3e-76) {
tmp = fma(x, ((z - y) / a), x);
} else if (z <= 2.4e+104) {
tmp = x + ((t * y) / a);
} else {
tmp = t * 1.0;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.35e+59) tmp = Float64(t * 1.0); elseif (z <= 3.3e-76) tmp = fma(x, Float64(Float64(z - y) / a), x); elseif (z <= 2.4e+104) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = Float64(t * 1.0); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.35e+59], N[(t * 1.0), $MachinePrecision], If[LessEqual[z, 3.3e-76], N[(x * N[(N[(z - y), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 2.4e+104], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(t * 1.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+59}:\\
\;\;\;\;t \cdot 1\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-76}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{z - y}{a}, x\right)\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+104}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot 1\\
\end{array}
\end{array}
if z < -1.3500000000000001e59 or 2.4e104 < z Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-divN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.7
Applied rewrites51.7%
Taylor expanded in z around inf
Applied rewrites25.0%
if -1.3500000000000001e59 < z < 3.29999999999999984e-76Initial program 67.5%
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--.f6442.5
Applied rewrites42.5%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6436.1
Applied rewrites36.1%
if 3.29999999999999984e-76 < z < 2.4e104Initial program 67.5%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6444.2
Applied rewrites44.2%
Taylor expanded in x around 0
Applied rewrites37.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.35e+59)
(* t 1.0)
(if (<= z 3.3e-76)
(* (- 1.0 (/ y a)) x)
(if (<= z 2.4e+104) (+ x (/ (* t y) a)) (* t 1.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e+59) {
tmp = t * 1.0;
} else if (z <= 3.3e-76) {
tmp = (1.0 - (y / a)) * x;
} else if (z <= 2.4e+104) {
tmp = x + ((t * y) / a);
} else {
tmp = t * 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, 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.35d+59)) then
tmp = t * 1.0d0
else if (z <= 3.3d-76) then
tmp = (1.0d0 - (y / a)) * x
else if (z <= 2.4d+104) then
tmp = x + ((t * y) / a)
else
tmp = t * 1.0d0
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.35e+59) {
tmp = t * 1.0;
} else if (z <= 3.3e-76) {
tmp = (1.0 - (y / a)) * x;
} else if (z <= 2.4e+104) {
tmp = x + ((t * y) / a);
} else {
tmp = t * 1.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.35e+59: tmp = t * 1.0 elif z <= 3.3e-76: tmp = (1.0 - (y / a)) * x elif z <= 2.4e+104: tmp = x + ((t * y) / a) else: tmp = t * 1.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.35e+59) tmp = Float64(t * 1.0); elseif (z <= 3.3e-76) tmp = Float64(Float64(1.0 - Float64(y / a)) * x); elseif (z <= 2.4e+104) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = Float64(t * 1.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.35e+59) tmp = t * 1.0; elseif (z <= 3.3e-76) tmp = (1.0 - (y / a)) * x; elseif (z <= 2.4e+104) tmp = x + ((t * y) / a); else tmp = t * 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.35e+59], N[(t * 1.0), $MachinePrecision], If[LessEqual[z, 3.3e-76], N[(N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 2.4e+104], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(t * 1.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+59}:\\
\;\;\;\;t \cdot 1\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-76}:\\
\;\;\;\;\left(1 - \frac{y}{a}\right) \cdot x\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+104}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot 1\\
\end{array}
\end{array}
if z < -1.3500000000000001e59 or 2.4e104 < z Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-divN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.7
Applied rewrites51.7%
Taylor expanded in z around inf
Applied rewrites25.0%
if -1.3500000000000001e59 < z < 3.29999999999999984e-76Initial program 67.5%
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--.f6442.5
Applied rewrites42.5%
Taylor expanded in z around 0
lower--.f64N/A
lower-/.f6436.2
Applied rewrites36.2%
if 3.29999999999999984e-76 < z < 2.4e104Initial program 67.5%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6444.2
Applied rewrites44.2%
Taylor expanded in x around 0
Applied rewrites37.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.35e+59)
(* t 1.0)
(if (<= z 1.25e-64)
(* (- 1.0 (/ y a)) x)
(if (<= z 5.2e+21) (* y (/ (- t x) a)) (* t 1.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e+59) {
tmp = t * 1.0;
} else if (z <= 1.25e-64) {
tmp = (1.0 - (y / a)) * x;
} else if (z <= 5.2e+21) {
tmp = y * ((t - x) / a);
} else {
tmp = t * 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, 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.35d+59)) then
tmp = t * 1.0d0
else if (z <= 1.25d-64) then
tmp = (1.0d0 - (y / a)) * x
else if (z <= 5.2d+21) then
tmp = y * ((t - x) / a)
else
tmp = t * 1.0d0
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.35e+59) {
tmp = t * 1.0;
} else if (z <= 1.25e-64) {
tmp = (1.0 - (y / a)) * x;
} else if (z <= 5.2e+21) {
tmp = y * ((t - x) / a);
} else {
tmp = t * 1.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.35e+59: tmp = t * 1.0 elif z <= 1.25e-64: tmp = (1.0 - (y / a)) * x elif z <= 5.2e+21: tmp = y * ((t - x) / a) else: tmp = t * 1.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.35e+59) tmp = Float64(t * 1.0); elseif (z <= 1.25e-64) tmp = Float64(Float64(1.0 - Float64(y / a)) * x); elseif (z <= 5.2e+21) tmp = Float64(y * Float64(Float64(t - x) / a)); else tmp = Float64(t * 1.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.35e+59) tmp = t * 1.0; elseif (z <= 1.25e-64) tmp = (1.0 - (y / a)) * x; elseif (z <= 5.2e+21) tmp = y * ((t - x) / a); else tmp = t * 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.35e+59], N[(t * 1.0), $MachinePrecision], If[LessEqual[z, 1.25e-64], N[(N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 5.2e+21], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(t * 1.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+59}:\\
\;\;\;\;t \cdot 1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-64}:\\
\;\;\;\;\left(1 - \frac{y}{a}\right) \cdot x\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+21}:\\
\;\;\;\;y \cdot \frac{t - x}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot 1\\
\end{array}
\end{array}
if z < -1.3500000000000001e59 or 5.2e21 < z Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-divN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.7
Applied rewrites51.7%
Taylor expanded in z around inf
Applied rewrites25.0%
if -1.3500000000000001e59 < z < 1.25000000000000008e-64Initial program 67.5%
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--.f6442.5
Applied rewrites42.5%
Taylor expanded in z around 0
lower--.f64N/A
lower-/.f6436.2
Applied rewrites36.2%
if 1.25000000000000008e-64 < z < 5.2e21Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
Taylor expanded in z around 0
associate-/l*N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f6448.8
Applied rewrites48.8%
Taylor expanded in y around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6426.4
Applied rewrites26.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.5e-44) (* t 1.0) (if (<= z 5.2e+21) (* y (/ (- t x) a)) (* t 1.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.5e-44) {
tmp = t * 1.0;
} else if (z <= 5.2e+21) {
tmp = y * ((t - x) / a);
} else {
tmp = t * 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, 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 <= (-4.5d-44)) then
tmp = t * 1.0d0
else if (z <= 5.2d+21) then
tmp = y * ((t - x) / a)
else
tmp = t * 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.5e-44) {
tmp = t * 1.0;
} else if (z <= 5.2e+21) {
tmp = y * ((t - x) / a);
} else {
tmp = t * 1.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.5e-44: tmp = t * 1.0 elif z <= 5.2e+21: tmp = y * ((t - x) / a) else: tmp = t * 1.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.5e-44) tmp = Float64(t * 1.0); elseif (z <= 5.2e+21) tmp = Float64(y * Float64(Float64(t - x) / a)); else tmp = Float64(t * 1.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.5e-44) tmp = t * 1.0; elseif (z <= 5.2e+21) tmp = y * ((t - x) / a); else tmp = t * 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.5e-44], N[(t * 1.0), $MachinePrecision], If[LessEqual[z, 5.2e+21], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(t * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-44}:\\
\;\;\;\;t \cdot 1\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+21}:\\
\;\;\;\;y \cdot \frac{t - x}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot 1\\
\end{array}
\end{array}
if z < -4.4999999999999999e-44 or 5.2e21 < z Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-divN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.7
Applied rewrites51.7%
Taylor expanded in z around inf
Applied rewrites25.0%
if -4.4999999999999999e-44 < z < 5.2e21Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
Taylor expanded in z around 0
associate-/l*N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f6448.8
Applied rewrites48.8%
Taylor expanded in y around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f6426.4
Applied rewrites26.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.22e+101) (* 1.0 x) (if (<= a 1.9e+146) (* t 1.0) (* 1.0 x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.22e+101) {
tmp = 1.0 * x;
} else if (a <= 1.9e+146) {
tmp = t * 1.0;
} else {
tmp = 1.0 * x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, 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 (a <= (-1.22d+101)) then
tmp = 1.0d0 * x
else if (a <= 1.9d+146) then
tmp = t * 1.0d0
else
tmp = 1.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.22e+101) {
tmp = 1.0 * x;
} else if (a <= 1.9e+146) {
tmp = t * 1.0;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.22e+101: tmp = 1.0 * x elif a <= 1.9e+146: tmp = t * 1.0 else: tmp = 1.0 * x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.22e+101) tmp = Float64(1.0 * x); elseif (a <= 1.9e+146) tmp = Float64(t * 1.0); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.22e+101) tmp = 1.0 * x; elseif (a <= 1.9e+146) tmp = t * 1.0; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.22e+101], N[(1.0 * x), $MachinePrecision], If[LessEqual[a, 1.9e+146], N[(t * 1.0), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.22 \cdot 10^{+101}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;a \leq 1.9 \cdot 10^{+146}:\\
\;\;\;\;t \cdot 1\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if a < -1.22e101 or 1.8999999999999999e146 < a Initial program 67.5%
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--.f6442.5
Applied rewrites42.5%
Taylor expanded in a around inf
Applied rewrites24.6%
if -1.22e101 < a < 1.8999999999999999e146Initial program 67.5%
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--.f6480.2
Applied rewrites80.2%
lift--.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-divN/A
lower--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6479.9
Applied rewrites79.9%
Taylor expanded in t around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.7
Applied rewrites51.7%
Taylor expanded in z around inf
Applied rewrites25.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.75e-37) (+ x t) (if (<= z 2.15e-88) (* 1.0 x) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.75e-37) {
tmp = x + t;
} else if (z <= 2.15e-88) {
tmp = 1.0 * 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 <= (-1.75d-37)) then
tmp = x + t
else if (z <= 2.15d-88) then
tmp = 1.0d0 * 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 <= -1.75e-37) {
tmp = x + t;
} else if (z <= 2.15e-88) {
tmp = 1.0 * x;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.75e-37: tmp = x + t elif z <= 2.15e-88: tmp = 1.0 * x else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.75e-37) tmp = Float64(x + t); elseif (z <= 2.15e-88) tmp = Float64(1.0 * x); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.75e-37) tmp = x + t; elseif (z <= 2.15e-88) tmp = 1.0 * x; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.75e-37], N[(x + t), $MachinePrecision], If[LessEqual[z, 2.15e-88], N[(1.0 * x), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-37}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-88}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.7500000000000001e-37 or 2.1499999999999999e-88 < z Initial program 67.5%
Taylor expanded in z around inf
lift--.f6419.3
Applied rewrites19.3%
Taylor expanded in x around 0
Applied rewrites33.5%
if -1.7500000000000001e-37 < z < 2.1499999999999999e-88Initial program 67.5%
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--.f6442.5
Applied rewrites42.5%
Taylor expanded in a around inf
Applied rewrites24.6%
(FPCore (x y z t a) :precision binary64 (+ x t))
double code(double x, double y, double z, double t, double a) {
return x + 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 = x + t
end function
public static double code(double x, double y, double z, double t, double a) {
return x + t;
}
def code(x, y, z, t, a): return x + t
function code(x, y, z, t, a) return Float64(x + t) end
function tmp = code(x, y, z, t, a) tmp = x + t; end
code[x_, y_, z_, t_, a_] := N[(x + t), $MachinePrecision]
\begin{array}{l}
\\
x + t
\end{array}
Initial program 67.5%
Taylor expanded in z around inf
lift--.f6419.3
Applied rewrites19.3%
Taylor expanded in x around 0
Applied rewrites33.5%
herbie shell --seed 2025131
(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))))