
(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 15 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) (- a z)) t (* (+ (/ (- (- y z)) (- a z)) 1.0) x)))
(t_2 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (<= t_2 -5e-300)
t_1
(if (<= t_2 0.0) (+ (* -1.0 (* x (/ (- a y) z))) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((y - z) / (a - z)), t, (((-(y - z) / (a - z)) + 1.0) * x));
double t_2 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if (t_2 <= -5e-300) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = (-1.0 * (x * ((a - y) / z))) + t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(y - z) / Float64(a - z)), t, Float64(Float64(Float64(Float64(-Float64(y - z)) / Float64(a - z)) + 1.0) * x)) t_2 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if (t_2 <= -5e-300) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(Float64(-1.0 * Float64(x * Float64(Float64(a - y) / z))) + t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t + N[(N[(N[((-N[(y - z), $MachinePrecision]) / N[(a - z), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * x), $MachinePrecision]), $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-300], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(-1.0 * N[(x * N[(N[(a - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y - z}{a - z}, t, \left(\frac{-\left(y - z\right)}{a - z} + 1\right) \cdot 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^{-300}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;-1 \cdot \left(x \cdot \frac{a - y}{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.99999999999999996e-300 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 72.9%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites90.8%
if -4.99999999999999996e-300 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 5.0%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites98.9%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6499.0
Applied rewrites99.0%
(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-300)
t_1
(if (<= t_2 0.0)
(+ (* -1.0 (* x (/ (- a y) z))) t)
(if (<= t_2 1e+298) 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-300) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = (-1.0 * (x * ((a - y) / z))) + t;
} else if (t_2 <= 1e+298) {
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-300) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(Float64(-1.0 * Float64(x * Float64(Float64(a - y) / z))) + t); elseif (t_2 <= 1e+298) 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-300], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(-1.0 * N[(x * N[(N[(a - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[t$95$2, 1e+298], 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^{-300}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;-1 \cdot \left(x \cdot \frac{a - y}{z}\right) + t\\
\mathbf{elif}\;t\_2 \leq 10^{+298}:\\
\;\;\;\;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.99999999999999996e-300 or 9.9999999999999996e297 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 63.0%
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--.f6484.7
Applied rewrites84.7%
if -4.99999999999999996e-300 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 5.0%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites98.9%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6499.0
Applied rewrites99.0%
if 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 9.9999999999999996e297Initial program 96.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-300)
t_1
(if (<= t_2 0.0) (+ (* -1.0 (* x (/ (- a y) 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-300) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = (-1.0 * (x * ((a - y) / 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-300) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(Float64(-1.0 * Float64(x * Float64(Float64(a - y) / 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-300], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(-1.0 * N[(x * N[(N[(a - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $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^{-300}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;-1 \cdot \left(x \cdot \frac{a - y}{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.99999999999999996e-300 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 72.9%
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--.f6486.1
Applied rewrites86.1%
if -4.99999999999999996e-300 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0Initial program 5.0%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites98.9%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6499.0
Applied rewrites99.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (* -1.0 (* x (/ (- a y) z))) t)))
(if (<= z -3.5e+110)
t_1
(if (<= z -1.65e-112)
(fma (/ (- y z) (- a z)) t x)
(if (<= z 4.2) (fma (- t x) (/ (- y z) a) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (-1.0 * (x * ((a - y) / z))) + t;
double tmp;
if (z <= -3.5e+110) {
tmp = t_1;
} else if (z <= -1.65e-112) {
tmp = fma(((y - z) / (a - z)), t, x);
} else if (z <= 4.2) {
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(-1.0 * Float64(x * Float64(Float64(a - y) / z))) + t) tmp = 0.0 if (z <= -3.5e+110) tmp = t_1; elseif (z <= -1.65e-112) tmp = fma(Float64(Float64(y - z) / Float64(a - z)), t, x); elseif (z <= 4.2) 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[(-1.0 * N[(x * N[(N[(a - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -3.5e+110], t$95$1, If[LessEqual[z, -1.65e-112], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t + x), $MachinePrecision], If[LessEqual[z, 4.2], 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 := -1 \cdot \left(x \cdot \frac{a - y}{z}\right) + t\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{+110}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-112}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a - z}, t, x\right)\\
\mathbf{elif}\;z \leq 4.2:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.4999999999999999e110 or 4.20000000000000018 < z Initial program 40.4%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites61.9%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6470.3
Applied rewrites70.3%
if -3.4999999999999999e110 < z < -1.65e-112Initial program 78.4%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites90.1%
Taylor expanded in a around 0
lower-/.f6460.7
Applied rewrites60.7%
Taylor expanded in a around inf
Applied rewrites68.8%
if -1.65e-112 < z < 4.20000000000000018Initial program 90.6%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6481.6
Applied rewrites81.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (/ (* x (- y a)) z) t)))
(if (<= z -0.016)
t_1
(if (<= z -1.65e-112)
(fma (/ (- y z) (- a z)) t x)
(if (<= z 4.2) (fma (- t x) (/ (- y z) a) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((x * (y - a)) / z) + t;
double tmp;
if (z <= -0.016) {
tmp = t_1;
} else if (z <= -1.65e-112) {
tmp = fma(((y - z) / (a - z)), t, x);
} else if (z <= 4.2) {
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(x * Float64(y - a)) / z) + t) tmp = 0.0 if (z <= -0.016) tmp = t_1; elseif (z <= -1.65e-112) tmp = fma(Float64(Float64(y - z) / Float64(a - z)), t, x); elseif (z <= 4.2) 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[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -0.016], t$95$1, If[LessEqual[z, -1.65e-112], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t + x), $MachinePrecision], If[LessEqual[z, 4.2], 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 := \frac{x \cdot \left(y - a\right)}{z} + t\\
\mathbf{if}\;z \leq -0.016:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-112}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a - z}, t, x\right)\\
\mathbf{elif}\;z \leq 4.2:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.016 or 4.20000000000000018 < z Initial program 45.8%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites61.4%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lift--.f6459.6
Applied rewrites59.6%
if -0.016 < z < -1.65e-112Initial program 86.9%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.0%
Taylor expanded in a around 0
lower-/.f6454.7
Applied rewrites54.7%
Taylor expanded in a around inf
Applied rewrites72.4%
if -1.65e-112 < z < 4.20000000000000018Initial program 90.6%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6481.6
Applied rewrites81.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (/ (* x (- y a)) z) t)))
(if (<= z -1.45e+91)
t_1
(if (<= z -1.7e-60)
(- t (/ (* y (- t x)) z))
(if (<= z 4.2) (fma (- t x) (/ (- y z) a) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((x * (y - a)) / z) + t;
double tmp;
if (z <= -1.45e+91) {
tmp = t_1;
} else if (z <= -1.7e-60) {
tmp = t - ((y * (t - x)) / z);
} else if (z <= 4.2) {
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(x * Float64(y - a)) / z) + t) tmp = 0.0 if (z <= -1.45e+91) tmp = t_1; elseif (z <= -1.7e-60) tmp = Float64(t - Float64(Float64(y * Float64(t - x)) / z)); elseif (z <= 4.2) 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[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -1.45e+91], t$95$1, If[LessEqual[z, -1.7e-60], N[(t - N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2], 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 := \frac{x \cdot \left(y - a\right)}{z} + t\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-60}:\\
\;\;\;\;t - \frac{y \cdot \left(t - x\right)}{z}\\
\mathbf{elif}\;z \leq 4.2:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.45000000000000007e91 or 4.20000000000000018 < z Initial program 41.2%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites61.7%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lift--.f6461.3
Applied rewrites61.3%
if -1.45000000000000007e91 < z < -1.70000000000000003e-60Initial program 77.4%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites56.4%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6451.4
Applied rewrites51.4%
if -1.70000000000000003e-60 < z < 4.20000000000000018Initial program 90.3%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6480.2
Applied rewrites80.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (/ (* x (- y a)) z) t)))
(if (<= z -1.45e+91)
t_1
(if (<= z -1.7e-60)
(- t (/ (* y (- t x)) z))
(if (<= z 4.1e-12) (fma y (/ (- t x) a) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((x * (y - a)) / z) + t;
double tmp;
if (z <= -1.45e+91) {
tmp = t_1;
} else if (z <= -1.7e-60) {
tmp = t - ((y * (t - x)) / z);
} else if (z <= 4.1e-12) {
tmp = fma(y, ((t - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(x * Float64(y - a)) / z) + t) tmp = 0.0 if (z <= -1.45e+91) tmp = t_1; elseif (z <= -1.7e-60) tmp = Float64(t - Float64(Float64(y * Float64(t - x)) / z)); elseif (z <= 4.1e-12) tmp = fma(y, Float64(Float64(t - x) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -1.45e+91], t$95$1, If[LessEqual[z, -1.7e-60], N[(t - N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.1e-12], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot \left(y - a\right)}{z} + t\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-60}:\\
\;\;\;\;t - \frac{y \cdot \left(t - x\right)}{z}\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{-12}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.45000000000000007e91 or 4.0999999999999999e-12 < z Initial program 42.2%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites61.3%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lift--.f6460.7
Applied rewrites60.7%
if -1.45000000000000007e91 < z < -1.70000000000000003e-60Initial program 77.4%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites56.4%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6451.4
Applied rewrites51.4%
if -1.70000000000000003e-60 < z < 4.0999999999999999e-12Initial program 90.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6476.1
Applied rewrites76.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- t (/ (* y (- t x)) z)))) (if (<= z -1.7e-60) t_1 (if (<= z 7.5e-12) (fma y (/ (- t x) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((y * (t - x)) / z);
double tmp;
if (z <= -1.7e-60) {
tmp = t_1;
} else if (z <= 7.5e-12) {
tmp = fma(y, ((t - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(y * Float64(t - x)) / z)) tmp = 0.0 if (z <= -1.7e-60) tmp = t_1; elseif (z <= 7.5e-12) tmp = fma(y, Float64(Float64(t - x) / 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 * N[(t - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e-60], t$95$1, If[LessEqual[z, 7.5e-12], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{y \cdot \left(t - x\right)}{z}\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{-60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-12}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.70000000000000003e-60 or 7.5e-12 < z Initial program 49.9%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites60.3%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6456.9
Applied rewrites56.9%
if -1.70000000000000003e-60 < z < 7.5e-12Initial program 90.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6476.1
Applied rewrites76.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -3e-31) (+ (/ (* x y) z) t) (if (<= z 6.6e+30) (fma y (/ (- t x) a) x) (fma 1.0 t (* (/ y z) x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3e-31) {
tmp = ((x * y) / z) + t;
} else if (z <= 6.6e+30) {
tmp = fma(y, ((t - x) / a), x);
} else {
tmp = fma(1.0, t, ((y / z) * x));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3e-31) tmp = Float64(Float64(Float64(x * y) / z) + t); elseif (z <= 6.6e+30) tmp = fma(y, Float64(Float64(t - x) / a), x); else tmp = fma(1.0, t, Float64(Float64(y / z) * x)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3e-31], N[(N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, 6.6e+30], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(1.0 * t + N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-31}:\\
\;\;\;\;\frac{x \cdot y}{z} + t\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, t, \frac{y}{z} \cdot x\right)\\
\end{array}
\end{array}
if z < -2.99999999999999981e-31Initial program 49.4%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites60.9%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lift--.f6458.7
Applied rewrites58.7%
Taylor expanded in y around inf
Applied rewrites53.5%
if -2.99999999999999981e-31 < z < 6.60000000000000053e30Initial program 89.8%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6472.9
Applied rewrites72.9%
if 6.60000000000000053e30 < z Initial program 41.2%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
sub-divN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.8%
Taylor expanded in a around 0
lower-/.f6476.9
Applied rewrites76.9%
Taylor expanded in z around inf
Applied rewrites60.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ (/ (* x y) z) t))) (if (<= z -3e-31) t_1 (if (<= z 6.6e+30) (fma y (/ (- t x) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((x * y) / z) + t;
double tmp;
if (z <= -3e-31) {
tmp = t_1;
} else if (z <= 6.6e+30) {
tmp = fma(y, ((t - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(x * y) / z) + t) tmp = 0.0 if (z <= -3e-31) tmp = t_1; elseif (z <= 6.6e+30) tmp = fma(y, Float64(Float64(t - x) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -3e-31], t$95$1, If[LessEqual[z, 6.6e+30], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{z} + t\\
\mathbf{if}\;z \leq -3 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.99999999999999981e-31 or 6.60000000000000053e30 < z Initial program 45.8%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites61.3%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lift--.f6459.6
Applied rewrites59.6%
Taylor expanded in y around inf
Applied rewrites54.1%
if -2.99999999999999981e-31 < z < 6.60000000000000053e30Initial program 89.8%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6472.9
Applied rewrites72.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.5e+75) (fma y (/ t a) x) (if (<= a 1.5e-11) (+ (/ (* x y) z) t) (* (- 1.0 (/ y a)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.5e+75) {
tmp = fma(y, (t / a), x);
} else if (a <= 1.5e-11) {
tmp = ((x * y) / z) + t;
} else {
tmp = (1.0 - (y / a)) * x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.5e+75) tmp = fma(y, Float64(t / a), x); elseif (a <= 1.5e-11) tmp = Float64(Float64(Float64(x * y) / z) + t); else tmp = Float64(Float64(1.0 - Float64(y / a)) * x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.5e+75], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 1.5e-11], N[(N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], N[(N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{-11}:\\
\;\;\;\;\frac{x \cdot y}{z} + t\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{y}{a}\right) \cdot x\\
\end{array}
\end{array}
if a < -2.5000000000000001e75Initial program 69.1%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6471.7
Applied rewrites71.7%
Taylor expanded in x around 0
Applied rewrites63.9%
if -2.5000000000000001e75 < a < 1.5e-11Initial program 67.4%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites69.7%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lift--.f6459.2
Applied rewrites59.2%
Taylor expanded in y around inf
Applied rewrites55.0%
if 1.5e-11 < a 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--.f6452.7
Applied rewrites52.7%
Taylor expanded in z around 0
lower--.f64N/A
lower-/.f6449.9
Applied rewrites49.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* t (- 1.0 (/ y z))))) (if (<= z -8.6e-61) t_1 (if (<= z 7.5e-5) (fma y (/ t a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (1.0 - (y / z));
double tmp;
if (z <= -8.6e-61) {
tmp = t_1;
} else if (z <= 7.5e-5) {
tmp = fma(y, (t / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -8.6e-61) tmp = t_1; elseif (z <= 7.5e-5) tmp = fma(y, Float64(t / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.6e-61], t$95$1, If[LessEqual[z, 7.5e-5], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -8.6 \cdot 10^{-61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.6000000000000007e-61 or 7.49999999999999934e-5 < z Initial program 49.6%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
sub-divN/A
distribute-lft-out--N/A
associate-*r/N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites60.5%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6457.1
Applied rewrites57.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lift-/.f6450.0
Applied rewrites50.0%
if -8.6000000000000007e-61 < z < 7.49999999999999934e-5Initial program 90.3%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6475.7
Applied rewrites75.7%
Taylor expanded in x around 0
Applied rewrites61.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -0.043) t (if (<= z 1.98e+31) (fma y (/ t a) x) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -0.043) {
tmp = t;
} else if (z <= 1.98e+31) {
tmp = fma(y, (t / a), x);
} else {
tmp = t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -0.043) tmp = t; elseif (z <= 1.98e+31) tmp = fma(y, Float64(t / a), x); else tmp = t; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -0.043], t, If[LessEqual[z, 1.98e+31], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.043:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 1.98 \cdot 10^{+31}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -0.042999999999999997 or 1.98e31 < z Initial program 43.9%
Taylor expanded in z around inf
Applied rewrites43.3%
if -0.042999999999999997 < z < 1.98e31Initial program 89.6%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6471.8
Applied rewrites71.8%
Taylor expanded in x around 0
Applied rewrites58.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.7e+87) x (if (<= a 1.5e-11) t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.7e+87) {
tmp = x;
} else if (a <= 1.5e-11) {
tmp = t;
} else {
tmp = 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.7d+87)) then
tmp = x
else if (a <= 1.5d-11) then
tmp = t
else
tmp = 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.7e+87) {
tmp = x;
} else if (a <= 1.5e-11) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.7e+87: tmp = x elif a <= 1.5e-11: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.7e+87) tmp = x; elseif (a <= 1.5e-11) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.7e+87) tmp = x; elseif (a <= 1.5e-11) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.7e+87], x, If[LessEqual[a, 1.5e-11], t, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.7 \cdot 10^{+87}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{-11}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.7000000000000001e87 or 1.5e-11 < a Initial program 68.4%
Taylor expanded in a around inf
Applied rewrites43.9%
if -1.7000000000000001e87 < a < 1.5e-11Initial program 67.6%
Taylor expanded in z around inf
Applied rewrites32.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.0%
Taylor expanded in z around inf
Applied rewrites25.0%
herbie shell --seed 2025106
(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))))