
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - 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 + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - 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 + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1
(*
-1.0
(*
x
(-
(* y (fma -1.0 (/ (- z t) (* x (- a t))) (/ z (* y (- a t)))))
(+ 1.0 (/ t (- a t)))))))
(t_2 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -2e-299)
(+ (/ (fma (- x) (- z t) (* (- z t) y)) (- a t)) x)
(if (<= t_2 0.0)
(+ (- (/ (* (- y x) (- z a)) t)) y)
(if (<= t_2 2e+284) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -1.0 * (x * ((y * fma(-1.0, ((z - t) / (x * (a - t))), (z / (y * (a - t))))) - (1.0 + (t / (a - t)))));
double t_2 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -2e-299) {
tmp = (fma(-x, (z - t), ((z - t) * y)) / (a - t)) + x;
} else if (t_2 <= 0.0) {
tmp = -(((y - x) * (z - a)) / t) + y;
} else if (t_2 <= 2e+284) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(-1.0 * Float64(x * Float64(Float64(y * fma(-1.0, Float64(Float64(z - t) / Float64(x * Float64(a - t))), Float64(z / Float64(y * Float64(a - t))))) - Float64(1.0 + Float64(t / Float64(a - t)))))) t_2 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -2e-299) tmp = Float64(Float64(fma(Float64(-x), Float64(z - t), Float64(Float64(z - t) * y)) / Float64(a - t)) + x); elseif (t_2 <= 0.0) tmp = Float64(Float64(-Float64(Float64(Float64(y - x) * Float64(z - a)) / t)) + y); elseif (t_2 <= 2e+284) tmp = t_2; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-1.0 * N[(x * N[(N[(y * N[(-1.0 * N[(N[(z - t), $MachinePrecision] / N[(x * N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z / N[(y * N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -2e-299], N[(N[(N[((-x) * N[(z - t), $MachinePrecision] + N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[((-N[(N[(N[(y - x), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]) + y), $MachinePrecision], If[LessEqual[t$95$2, 2e+284], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -1 \cdot \left(x \cdot \left(y \cdot \mathsf{fma}\left(-1, \frac{z - t}{x \cdot \left(a - t\right)}, \frac{z}{y \cdot \left(a - t\right)}\right) - \left(1 + \frac{t}{a - t}\right)\right)\right)\\
t_2 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-299}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x, z - t, \left(z - t\right) \cdot y\right)}{a - t} + x\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\left(-\frac{\left(y - x\right) \cdot \left(z - a\right)}{t}\right) + y\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+284}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -inf.0 or 2.00000000000000016e284 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 67.6%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
mult-flipN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6467.6
Applied rewrites67.6%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites71.0%
Taylor expanded in y around inf
lower-*.f64N/A
sub-divN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6473.4
Applied rewrites73.4%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -1.99999999999999998e-299Initial program 67.6%
Taylor expanded in y around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites66.9%
if -1.99999999999999998e-299 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 67.6%
Taylor expanded in t 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 rewrites46.5%
if 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 2.00000000000000016e284Initial program 67.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ (- z t) (- a t)))))
(if (<= t -6.2e+220)
t_1
(if (<= t -7.5e+51)
(*
-1.0
(*
x
(-
(fma -1.0 (/ (* y (- z t)) (* x (- a t))) (/ z (- a t)))
(+ 1.0 (/ t (- a t))))))
(if (<= t 1.4e+116)
(+ x (/ (* (- y x) (- z t)) (- a t)))
(if (<= t 1.35e+203) t_1 (+ (- (/ (* (- y x) (- z a)) t)) y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (a - t));
double tmp;
if (t <= -6.2e+220) {
tmp = t_1;
} else if (t <= -7.5e+51) {
tmp = -1.0 * (x * (fma(-1.0, ((y * (z - t)) / (x * (a - t))), (z / (a - t))) - (1.0 + (t / (a - t)))));
} else if (t <= 1.4e+116) {
tmp = x + (((y - x) * (z - t)) / (a - t));
} else if (t <= 1.35e+203) {
tmp = t_1;
} else {
tmp = -(((y - x) * (z - a)) / t) + y;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(z - t) / Float64(a - t))) tmp = 0.0 if (t <= -6.2e+220) tmp = t_1; elseif (t <= -7.5e+51) tmp = Float64(-1.0 * Float64(x * Float64(fma(-1.0, Float64(Float64(y * Float64(z - t)) / Float64(x * Float64(a - t))), Float64(z / Float64(a - t))) - Float64(1.0 + Float64(t / Float64(a - t)))))); elseif (t <= 1.4e+116) tmp = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))); elseif (t <= 1.35e+203) tmp = t_1; else tmp = Float64(Float64(-Float64(Float64(Float64(y - x) * Float64(z - a)) / t)) + y); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.2e+220], t$95$1, If[LessEqual[t, -7.5e+51], N[(-1.0 * N[(x * N[(N[(-1.0 * N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(x * N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e+116], N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+203], t$95$1, N[((-N[(N[(N[(y - x), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]) + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;t \leq -6.2 \cdot 10^{+220}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -7.5 \cdot 10^{+51}:\\
\;\;\;\;-1 \cdot \left(x \cdot \left(\mathsf{fma}\left(-1, \frac{y \cdot \left(z - t\right)}{x \cdot \left(a - t\right)}, \frac{z}{a - t}\right) - \left(1 + \frac{t}{a - t}\right)\right)\right)\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+116}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+203}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{\left(y - x\right) \cdot \left(z - a\right)}{t}\right) + y\\
\end{array}
\end{array}
if t < -6.2000000000000001e220 or 1.40000000000000002e116 < t < 1.35e203Initial program 67.6%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
mult-flipN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6467.6
Applied rewrites67.6%
Taylor expanded in y around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.1
Applied rewrites51.1%
if -6.2000000000000001e220 < t < -7.4999999999999999e51Initial program 67.6%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
mult-flipN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6467.6
Applied rewrites67.6%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites71.0%
if -7.4999999999999999e51 < t < 1.40000000000000002e116Initial program 67.6%
if 1.35e203 < t Initial program 67.6%
Taylor expanded in t 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 rewrites46.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (- (* (/ (fma t (/ (- y x) z) (- (- y x))) (- a t)) z))))
(t_2 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -2e-299)
(+ (/ (fma (- x) (- z t) (* (- z t) y)) (- a t)) x)
(if (<= t_2 0.0)
(+ (- (/ (* (- y x) (- z a)) t)) y)
(if (<= t_2 2e+284) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + -((fma(t, ((y - x) / z), -(y - x)) / (a - t)) * z);
double t_2 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -2e-299) {
tmp = (fma(-x, (z - t), ((z - t) * y)) / (a - t)) + x;
} else if (t_2 <= 0.0) {
tmp = -(((y - x) * (z - a)) / t) + y;
} else if (t_2 <= 2e+284) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(-Float64(Float64(fma(t, Float64(Float64(y - x) / z), Float64(-Float64(y - x))) / Float64(a - t)) * z))) t_2 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -2e-299) tmp = Float64(Float64(fma(Float64(-x), Float64(z - t), Float64(Float64(z - t) * y)) / Float64(a - t)) + x); elseif (t_2 <= 0.0) tmp = Float64(Float64(-Float64(Float64(Float64(y - x) * Float64(z - a)) / t)) + y); elseif (t_2 <= 2e+284) tmp = t_2; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + (-N[(N[(N[(t * N[(N[(y - x), $MachinePrecision] / z), $MachinePrecision] + (-N[(y - x), $MachinePrecision])), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision])), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -2e-299], N[(N[(N[((-x) * N[(z - t), $MachinePrecision] + N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[((-N[(N[(N[(y - x), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]) + y), $MachinePrecision], If[LessEqual[t$95$2, 2e+284], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(-\frac{\mathsf{fma}\left(t, \frac{y - x}{z}, -\left(y - x\right)\right)}{a - t} \cdot z\right)\\
t_2 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-299}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x, z - t, \left(z - t\right) \cdot y\right)}{a - t} + x\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\left(-\frac{\left(y - x\right) \cdot \left(z - a\right)}{t}\right) + y\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+284}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -inf.0 or 2.00000000000000016e284 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 67.6%
Taylor expanded in z around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.9%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -1.99999999999999998e-299Initial program 67.6%
Taylor expanded in y around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites66.9%
if -1.99999999999999998e-299 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 67.6%
Taylor expanded in t 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 rewrites46.5%
if 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 2.00000000000000016e284Initial program 67.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (<= t_1 (- INFINITY))
(* y (/ (- z t) (- a t)))
(if (<= t_1 -2e-299)
(+ (/ (fma (- x) (- z t) (* (- z t) y)) (- a t)) x)
(if (<= t_1 0.0)
(+ (- (/ (* (- y x) (- z a)) t)) y)
(if (<= t_1 2e+284) t_1 (* z (/ (- y x) (- a t)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * ((z - t) / (a - t));
} else if (t_1 <= -2e-299) {
tmp = (fma(-x, (z - t), ((z - t) * y)) / (a - t)) + x;
} else if (t_1 <= 0.0) {
tmp = -(((y - x) * (z - a)) / t) + y;
} else if (t_1 <= 2e+284) {
tmp = t_1;
} else {
tmp = z * ((y - x) / (a - t));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * Float64(Float64(z - t) / Float64(a - t))); elseif (t_1 <= -2e-299) tmp = Float64(Float64(fma(Float64(-x), Float64(z - t), Float64(Float64(z - t) * y)) / Float64(a - t)) + x); elseif (t_1 <= 0.0) tmp = Float64(Float64(-Float64(Float64(Float64(y - x) * Float64(z - a)) / t)) + y); elseif (t_1 <= 2e+284) tmp = t_1; else tmp = Float64(z * Float64(Float64(y - x) / Float64(a - t))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-299], N[(N[(N[((-x) * N[(z - t), $MachinePrecision] + N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[((-N[(N[(N[(y - x), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]) + y), $MachinePrecision], If[LessEqual[t$95$1, 2e+284], t$95$1, N[(z * N[(N[(y - x), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y \cdot \frac{z - t}{a - t}\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-299}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x, z - t, \left(z - t\right) \cdot y\right)}{a - t} + x\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\left(-\frac{\left(y - x\right) \cdot \left(z - a\right)}{t}\right) + y\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+284}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y - x}{a - t}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -inf.0Initial program 67.6%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
mult-flipN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6467.6
Applied rewrites67.6%
Taylor expanded in y around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.1
Applied rewrites51.1%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -1.99999999999999998e-299Initial program 67.6%
Taylor expanded in y around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites66.9%
if -1.99999999999999998e-299 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 67.6%
Taylor expanded in t 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 rewrites46.5%
if 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 2.00000000000000016e284Initial program 67.6%
if 2.00000000000000016e284 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 67.6%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
mult-flipN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6467.6
Applied rewrites67.6%
Taylor expanded in z around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6441.9
Applied rewrites41.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (<= t_1 (- INFINITY))
(* y (/ (- z t) (- a t)))
(if (<= t_1 -2e-299)
t_1
(if (<= t_1 0.0)
(+ (- (/ (* (- y x) (- z a)) t)) y)
(if (<= t_1 2e+284) t_1 (* z (/ (- y x) (- a t)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * ((z - t) / (a - t));
} else if (t_1 <= -2e-299) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = -(((y - x) * (z - a)) / t) + y;
} else if (t_1 <= 2e+284) {
tmp = t_1;
} else {
tmp = z * ((y - x) / (a - t));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = y * ((z - t) / (a - t));
} else if (t_1 <= -2e-299) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = -(((y - x) * (z - a)) / t) + y;
} else if (t_1 <= 2e+284) {
tmp = t_1;
} else {
tmp = z * ((y - x) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - x) * (z - t)) / (a - t)) tmp = 0 if t_1 <= -math.inf: tmp = y * ((z - t) / (a - t)) elif t_1 <= -2e-299: tmp = t_1 elif t_1 <= 0.0: tmp = -(((y - x) * (z - a)) / t) + y elif t_1 <= 2e+284: tmp = t_1 else: tmp = z * ((y - x) / (a - t)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * Float64(Float64(z - t) / Float64(a - t))); elseif (t_1 <= -2e-299) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(-Float64(Float64(Float64(y - x) * Float64(z - a)) / t)) + y); elseif (t_1 <= 2e+284) tmp = t_1; else tmp = Float64(z * Float64(Float64(y - x) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - x) * (z - t)) / (a - t)); tmp = 0.0; if (t_1 <= -Inf) tmp = y * ((z - t) / (a - t)); elseif (t_1 <= -2e-299) tmp = t_1; elseif (t_1 <= 0.0) tmp = -(((y - x) * (z - a)) / t) + y; elseif (t_1 <= 2e+284) tmp = t_1; else tmp = z * ((y - x) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-299], t$95$1, If[LessEqual[t$95$1, 0.0], N[((-N[(N[(N[(y - x), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]) + y), $MachinePrecision], If[LessEqual[t$95$1, 2e+284], t$95$1, N[(z * N[(N[(y - x), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y \cdot \frac{z - t}{a - t}\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-299}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\left(-\frac{\left(y - x\right) \cdot \left(z - a\right)}{t}\right) + y\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+284}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y - x}{a - t}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -inf.0Initial program 67.6%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
mult-flipN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6467.6
Applied rewrites67.6%
Taylor expanded in y around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.1
Applied rewrites51.1%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -1.99999999999999998e-299 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 2.00000000000000016e284Initial program 67.6%
if -1.99999999999999998e-299 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 67.6%
Taylor expanded in t 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 rewrites46.5%
if 2.00000000000000016e284 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 67.6%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
mult-flipN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6467.6
Applied rewrites67.6%
Taylor expanded in z around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6441.9
Applied rewrites41.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ (- z t) (- a t)))))
(if (<= t -4.5e+210)
t_1
(if (<= t 1.4e+116)
(fma (* (- z t) (- y x)) (/ 1.0 (- a t)) x)
(if (<= t 1.35e+203) t_1 (+ (- (/ (* (- y x) (- z a)) t)) y))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (a - t));
double tmp;
if (t <= -4.5e+210) {
tmp = t_1;
} else if (t <= 1.4e+116) {
tmp = fma(((z - t) * (y - x)), (1.0 / (a - t)), x);
} else if (t <= 1.35e+203) {
tmp = t_1;
} else {
tmp = -(((y - x) * (z - a)) / t) + y;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(z - t) / Float64(a - t))) tmp = 0.0 if (t <= -4.5e+210) tmp = t_1; elseif (t <= 1.4e+116) tmp = fma(Float64(Float64(z - t) * Float64(y - x)), Float64(1.0 / Float64(a - t)), x); elseif (t <= 1.35e+203) tmp = t_1; else tmp = Float64(Float64(-Float64(Float64(Float64(y - x) * Float64(z - a)) / t)) + y); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.5e+210], t$95$1, If[LessEqual[t, 1.4e+116], N[(N[(N[(z - t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 1.35e+203], t$95$1, N[((-N[(N[(N[(y - x), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]) + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{+210}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+116}:\\
\;\;\;\;\mathsf{fma}\left(\left(z - t\right) \cdot \left(y - x\right), \frac{1}{a - t}, x\right)\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+203}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{\left(y - x\right) \cdot \left(z - a\right)}{t}\right) + y\\
\end{array}
\end{array}
if t < -4.50000000000000004e210 or 1.40000000000000002e116 < t < 1.35e203Initial program 67.6%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
mult-flipN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6467.6
Applied rewrites67.6%
Taylor expanded in y around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.1
Applied rewrites51.1%
if -4.50000000000000004e210 < t < 1.40000000000000002e116Initial program 67.6%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
mult-flipN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6467.6
Applied rewrites67.6%
if 1.35e203 < t Initial program 67.6%
Taylor expanded in t 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 rewrites46.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y x) (/ (- z t) a) x)))
(if (<= a -240.0)
t_1
(if (<= a 8.8e-7) (+ (- (/ (* (- y x) (- z a)) t)) y) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - x), ((z - t) / a), x);
double tmp;
if (a <= -240.0) {
tmp = t_1;
} else if (a <= 8.8e-7) {
tmp = -(((y - x) * (z - a)) / t) + y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - x), Float64(Float64(z - t) / a), x) tmp = 0.0 if (a <= -240.0) tmp = t_1; elseif (a <= 8.8e-7) tmp = Float64(Float64(-Float64(Float64(Float64(y - x) * Float64(z - a)) / t)) + y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -240.0], t$95$1, If[LessEqual[a, 8.8e-7], N[((-N[(N[(N[(y - x), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]) + y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - x, \frac{z - t}{a}, x\right)\\
\mathbf{if}\;a \leq -240:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 8.8 \cdot 10^{-7}:\\
\;\;\;\;\left(-\frac{\left(y - x\right) \cdot \left(z - a\right)}{t}\right) + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -240 or 8.8000000000000004e-7 < a Initial program 67.6%
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 -240 < a < 8.8000000000000004e-7Initial program 67.6%
Taylor expanded in t 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 rewrites46.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ (- z t) (- a t)))))
(if (<= t -4.5e+48)
t_1
(if (<= t 2.5e+70) (fma (- y x) (/ (- z t) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (a - t));
double tmp;
if (t <= -4.5e+48) {
tmp = t_1;
} else if (t <= 2.5e+70) {
tmp = fma((y - x), ((z - t) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(z - t) / Float64(a - t))) tmp = 0.0 if (t <= -4.5e+48) tmp = t_1; elseif (t <= 2.5e+70) tmp = fma(Float64(y - x), Float64(Float64(z - t) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.5e+48], t$95$1, If[LessEqual[t, 2.5e+70], N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{+70}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.49999999999999995e48 or 2.5000000000000001e70 < t Initial program 67.6%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
mult-flipN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6467.6
Applied rewrites67.6%
Taylor expanded in y around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.1
Applied rewrites51.1%
if -4.49999999999999995e48 < t < 2.5000000000000001e70Initial program 67.6%
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 (let* ((t_1 (* y (/ (- z t) (- a t))))) (if (<= t -1.7e+48) t_1 (if (<= t 2.1e+70) (+ x (/ (* (- y x) z) a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (a - t));
double tmp;
if (t <= -1.7e+48) {
tmp = t_1;
} else if (t <= 2.1e+70) {
tmp = x + (((y - x) * z) / a);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = y * ((z - t) / (a - t))
if (t <= (-1.7d+48)) then
tmp = t_1
else if (t <= 2.1d+70) then
tmp = x + (((y - x) * z) / a)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (a - t));
double tmp;
if (t <= -1.7e+48) {
tmp = t_1;
} else if (t <= 2.1e+70) {
tmp = x + (((y - x) * z) / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((z - t) / (a - t)) tmp = 0 if t <= -1.7e+48: tmp = t_1 elif t <= 2.1e+70: tmp = x + (((y - x) * z) / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(z - t) / Float64(a - t))) tmp = 0.0 if (t <= -1.7e+48) tmp = t_1; elseif (t <= 2.1e+70) tmp = Float64(x + Float64(Float64(Float64(y - x) * z) / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((z - t) / (a - t)); tmp = 0.0; if (t <= -1.7e+48) tmp = t_1; elseif (t <= 2.1e+70) tmp = x + (((y - x) * z) / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.7e+48], t$95$1, If[LessEqual[t, 2.1e+70], N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;t \leq -1.7 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{+70}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.7000000000000002e48 or 2.10000000000000008e70 < t Initial program 67.6%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
mult-flipN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6467.6
Applied rewrites67.6%
Taylor expanded in y around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.1
Applied rewrites51.1%
if -1.7000000000000002e48 < t < 2.10000000000000008e70Initial program 67.6%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6444.2
Applied rewrites44.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* y (/ (- z t) (- a t))))) (if (<= t -4.4e+48) t_1 (if (<= t 2.5e+70) (fma z (/ (- y x) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (a - t));
double tmp;
if (t <= -4.4e+48) {
tmp = t_1;
} else if (t <= 2.5e+70) {
tmp = fma(z, ((y - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(z - t) / Float64(a - t))) tmp = 0.0 if (t <= -4.4e+48) tmp = t_1; elseif (t <= 2.5e+70) tmp = fma(z, Float64(Float64(y - x) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.4e+48], t$95$1, If[LessEqual[t, 2.5e+70], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;t \leq -4.4 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{+70}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.3999999999999999e48 or 2.5000000000000001e70 < t Initial program 67.6%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
mult-flipN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6467.6
Applied rewrites67.6%
Taylor expanded in y around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6451.1
Applied rewrites51.1%
if -4.3999999999999999e48 < t < 2.5000000000000001e70Initial program 67.6%
Taylor expanded in t 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
(let* ((t_1 (fma z (/ (- y x) a) x)))
(if (<= a -2.05e+67)
t_1
(if (<= a 1.15e+62) (/ (* (- y x) z) (- a t)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(z, ((y - x) / a), x);
double tmp;
if (a <= -2.05e+67) {
tmp = t_1;
} else if (a <= 1.15e+62) {
tmp = ((y - x) * z) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(z, Float64(Float64(y - x) / a), x) tmp = 0.0 if (a <= -2.05e+67) tmp = t_1; elseif (a <= 1.15e+62) tmp = Float64(Float64(Float64(y - x) * z) / Float64(a - t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2.05e+67], t$95$1, If[LessEqual[a, 1.15e+62], N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{if}\;a \leq -2.05 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{+62}:\\
\;\;\;\;\frac{\left(y - x\right) \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.0499999999999999e67 or 1.14999999999999992e62 < a Initial program 67.6%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6447.7
Applied rewrites47.7%
if -2.0499999999999999e67 < a < 1.14999999999999992e62Initial program 67.6%
Taylor expanded in z around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6437.6
Applied rewrites37.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -5.1e+199) y (if (<= t 3.25e+125) (fma z (/ (- y x) a) x) y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.1e+199) {
tmp = y;
} else if (t <= 3.25e+125) {
tmp = fma(z, ((y - x) / a), x);
} else {
tmp = y;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.1e+199) tmp = y; elseif (t <= 3.25e+125) tmp = fma(z, Float64(Float64(y - x) / a), x); else tmp = y; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.1e+199], y, If[LessEqual[t, 3.25e+125], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.1 \cdot 10^{+199}:\\
\;\;\;\;y\\
\mathbf{elif}\;t \leq 3.25 \cdot 10^{+125}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if t < -5.10000000000000005e199 or 3.2499999999999999e125 < t Initial program 67.6%
Taylor expanded in y around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites66.9%
Taylor expanded in t around inf
lower-+.f64N/A
lower-+.f64N/A
lower-*.f6419.3
Applied rewrites19.3%
Taylor expanded in x around 0
Applied rewrites25.4%
if -5.10000000000000005e199 < t < 3.2499999999999999e125Initial program 67.6%
Taylor expanded in t 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 (<= t -5.1e+199) y (if (<= t 3.25e+125) (fma z (/ y a) x) y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.1e+199) {
tmp = y;
} else if (t <= 3.25e+125) {
tmp = fma(z, (y / a), x);
} else {
tmp = y;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.1e+199) tmp = y; elseif (t <= 3.25e+125) tmp = fma(z, Float64(y / a), x); else tmp = y; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.1e+199], y, If[LessEqual[t, 3.25e+125], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.1 \cdot 10^{+199}:\\
\;\;\;\;y\\
\mathbf{elif}\;t \leq 3.25 \cdot 10^{+125}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if t < -5.10000000000000005e199 or 3.2499999999999999e125 < t Initial program 67.6%
Taylor expanded in y around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites66.9%
Taylor expanded in t around inf
lower-+.f64N/A
lower-+.f64N/A
lower-*.f6419.3
Applied rewrites19.3%
Taylor expanded in x around 0
Applied rewrites25.4%
if -5.10000000000000005e199 < t < 3.2499999999999999e125Initial program 67.6%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6447.7
Applied rewrites47.7%
Taylor expanded in x around 0
Applied rewrites39.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -5e+199) y (if (<= t 2.8e+125) (* 1.0 x) y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5e+199) {
tmp = y;
} else if (t <= 2.8e+125) {
tmp = 1.0 * x;
} else {
tmp = y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, 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 (t <= (-5d+199)) then
tmp = y
else if (t <= 2.8d+125) then
tmp = 1.0d0 * x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5e+199) {
tmp = y;
} else if (t <= 2.8e+125) {
tmp = 1.0 * x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5e+199: tmp = y elif t <= 2.8e+125: tmp = 1.0 * x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5e+199) tmp = y; elseif (t <= 2.8e+125) tmp = Float64(1.0 * x); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5e+199) tmp = y; elseif (t <= 2.8e+125) tmp = 1.0 * x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5e+199], y, If[LessEqual[t, 2.8e+125], N[(1.0 * x), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+199}:\\
\;\;\;\;y\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{+125}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if t < -4.9999999999999998e199 or 2.8000000000000001e125 < t Initial program 67.6%
Taylor expanded in y around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites66.9%
Taylor expanded in t around inf
lower-+.f64N/A
lower-+.f64N/A
lower-*.f6419.3
Applied rewrites19.3%
Taylor expanded in x around 0
Applied rewrites25.4%
if -4.9999999999999998e199 < t < 2.8000000000000001e125Initial program 67.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
mul-1-negN/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
lower--.f6443.4
Applied rewrites43.4%
Taylor expanded in a around inf
Applied rewrites25.4%
(FPCore (x y z t a) :precision binary64 y)
double code(double x, double y, double z, double t, double a) {
return y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, 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 = y
end function
public static double code(double x, double y, double z, double t, double a) {
return y;
}
def code(x, y, z, t, a): return y
function code(x, y, z, t, a) return y end
function tmp = code(x, y, z, t, a) tmp = y; end
code[x_, y_, z_, t_, a_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 67.6%
Taylor expanded in y around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites66.9%
Taylor expanded in t around inf
lower-+.f64N/A
lower-+.f64N/A
lower-*.f6419.3
Applied rewrites19.3%
Taylor expanded in x around 0
Applied rewrites25.4%
herbie shell --seed 2025136
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:precision binary64
(+ x (/ (* (- y x) (- z t)) (- a t))))