
(FPCore (x y z t a) :precision binary64 :pre TRUE (/ (- (* x y) (* z t)) a))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
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)) / a
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
def code(x, y, z, t, a): return ((x * y) - (z * t)) / a
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(z * t)) / a) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - (z * t)) / a; end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = ((x * y) - (z * t)) / a END code
\frac{x \cdot y - z \cdot t}{a}
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 :pre TRUE (/ (- (* x y) (* z t)) a))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
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)) / a
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
def code(x, y, z, t, a): return ((x * y) - (z * t)) / a
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(z * t)) / a) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - (z * t)) / a; end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = ((x * y) - (z * t)) / a END code
\frac{x \cdot y - z \cdot t}{a}
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(let* ((t_1 (* (/ (fmin z t) a) (- (fmax z t))))
(t_2 (- (* (fmin x y) (fmax x y)) (* (fmin z t) (fmax z t)))))
(if (<= t_2 -2e+304)
(fma (fmax x y) (/ (fmin x y) a) t_1)
(if (<= t_2 2e+168)
(/ (fma (fmin x y) (fmax x y) (- (* (fmax z t) (fmin z t)))) a)
(fma (fmin x y) (/ (fmax x y) a) t_1)))))double code(double x, double y, double z, double t, double a) {
double t_1 = (fmin(z, t) / a) * -fmax(z, t);
double t_2 = (fmin(x, y) * fmax(x, y)) - (fmin(z, t) * fmax(z, t));
double tmp;
if (t_2 <= -2e+304) {
tmp = fma(fmax(x, y), (fmin(x, y) / a), t_1);
} else if (t_2 <= 2e+168) {
tmp = fma(fmin(x, y), fmax(x, y), -(fmax(z, t) * fmin(z, t))) / a;
} else {
tmp = fma(fmin(x, y), (fmax(x, y) / a), t_1);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(fmin(z, t) / a) * Float64(-fmax(z, t))) t_2 = Float64(Float64(fmin(x, y) * fmax(x, y)) - Float64(fmin(z, t) * fmax(z, t))) tmp = 0.0 if (t_2 <= -2e+304) tmp = fma(fmax(x, y), Float64(fmin(x, y) / a), t_1); elseif (t_2 <= 2e+168) tmp = Float64(fma(fmin(x, y), fmax(x, y), Float64(-Float64(fmax(z, t) * fmin(z, t)))) / a); else tmp = fma(fmin(x, y), Float64(fmax(x, y) / a), t_1); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[Min[z, t], $MachinePrecision] / a), $MachinePrecision] * (-N[Max[z, t], $MachinePrecision])), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] - N[(N[Min[z, t], $MachinePrecision] * N[Max[z, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+304], N[(N[Max[x, y], $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / a), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 2e+168], N[(N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision] + (-N[(N[Max[z, t], $MachinePrecision] * N[Min[z, t], $MachinePrecision]), $MachinePrecision])), $MachinePrecision] / a), $MachinePrecision], N[(N[Min[x, y], $MachinePrecision] * N[(N[Max[x, y], $MachinePrecision] / a), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp = IF (z < t) THEN z ELSE t ENDIF IN LET tmp_1 = IF (z > t) THEN z ELSE t ENDIF IN LET t_1 = ((tmp / a) * (- tmp_1)) IN LET tmp_2 = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_3 = IF (x > y) THEN x ELSE y ENDIF IN LET tmp_4 = IF (z < t) THEN z ELSE t ENDIF IN LET tmp_5 = IF (z > t) THEN z ELSE t ENDIF IN LET t_2 = ((tmp_2 * tmp_3) - (tmp_4 * tmp_5)) IN LET tmp_9 = IF (x > y) THEN x ELSE y ENDIF IN LET tmp_10 = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_16 = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_17 = IF (x > y) THEN x ELSE y ENDIF IN LET tmp_18 = IF (z > t) THEN z ELSE t ENDIF IN LET tmp_19 = IF (z < t) THEN z ELSE t ENDIF IN LET tmp_20 = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_21 = IF (x > y) THEN x ELSE y ENDIF IN LET tmp_15 = IF (t_2 <= (1999999999999999867720989669485949124743900432860663037223385644615401293399207295251384865191691894341829109199397042951078761626889625586558917010807457234988770000896)) THEN (((tmp_16 * tmp_17) + (- (tmp_18 * tmp_19))) / a) ELSE ((tmp_20 * (tmp_21 / a)) + t_1) ENDIF IN LET tmp_8 = IF (t_2 <= (-19999999999999998785071050110729243720080574440234649906381543142646409126026467805686618514881015496873712236112324345157434387485272061060471597681733765549974602883364022082135420506324881811687439605097103198153279365101643665319098224539215899610692069837325144812815208761691919724149808696276287488)) THEN ((tmp_9 * (tmp_10 / a)) + t_1) ELSE tmp_15 ENDIF IN tmp_8 END code
\begin{array}{l}
t_1 := \frac{\mathsf{min}\left(z, t\right)}{a} \cdot \left(-\mathsf{max}\left(z, t\right)\right)\\
t_2 := \mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right) - \mathsf{min}\left(z, t\right) \cdot \mathsf{max}\left(z, t\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+304}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{max}\left(x, y\right), \frac{\mathsf{min}\left(x, y\right)}{a}, t\_1\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+168}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{min}\left(x, y\right), \mathsf{max}\left(x, y\right), -\mathsf{max}\left(z, t\right) \cdot \mathsf{min}\left(z, t\right)\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{min}\left(x, y\right), \frac{\mathsf{max}\left(x, y\right)}{a}, t\_1\right)\\
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -1.9999999999999999e304Initial program 91.2%
Applied rewrites87.9%
if -1.9999999999999999e304 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1.9999999999999999e168Initial program 91.2%
Applied rewrites91.4%
if 1.9999999999999999e168 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 91.2%
Applied rewrites88.1%
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(let* ((t_1 (- (* (fmin x y) (fmax x y)) (* (fmin z t) (fmax z t))))
(t_2 (/ (fmin z t) a)))
(if (<= t_1 -2e+304)
(- (* (/ (fmin x y) a) (fmax x y)) (* t_2 (fmax z t)))
(if (<= t_1 2e+168)
(/ (fma (fmin x y) (fmax x y) (- (* (fmax z t) (fmin z t)))) a)
(fma (fmin x y) (/ (fmax x y) a) (* t_2 (- (fmax z t))))))))double code(double x, double y, double z, double t, double a) {
double t_1 = (fmin(x, y) * fmax(x, y)) - (fmin(z, t) * fmax(z, t));
double t_2 = fmin(z, t) / a;
double tmp;
if (t_1 <= -2e+304) {
tmp = ((fmin(x, y) / a) * fmax(x, y)) - (t_2 * fmax(z, t));
} else if (t_1 <= 2e+168) {
tmp = fma(fmin(x, y), fmax(x, y), -(fmax(z, t) * fmin(z, t))) / a;
} else {
tmp = fma(fmin(x, y), (fmax(x, y) / a), (t_2 * -fmax(z, t)));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(fmin(x, y) * fmax(x, y)) - Float64(fmin(z, t) * fmax(z, t))) t_2 = Float64(fmin(z, t) / a) tmp = 0.0 if (t_1 <= -2e+304) tmp = Float64(Float64(Float64(fmin(x, y) / a) * fmax(x, y)) - Float64(t_2 * fmax(z, t))); elseif (t_1 <= 2e+168) tmp = Float64(fma(fmin(x, y), fmax(x, y), Float64(-Float64(fmax(z, t) * fmin(z, t)))) / a); else tmp = fma(fmin(x, y), Float64(fmax(x, y) / a), Float64(t_2 * Float64(-fmax(z, t)))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] - N[(N[Min[z, t], $MachinePrecision] * N[Max[z, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Min[z, t], $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+304], N[(N[(N[(N[Min[x, y], $MachinePrecision] / a), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] - N[(t$95$2 * N[Max[z, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+168], N[(N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision] + (-N[(N[Max[z, t], $MachinePrecision] * N[Min[z, t], $MachinePrecision]), $MachinePrecision])), $MachinePrecision] / a), $MachinePrecision], N[(N[Min[x, y], $MachinePrecision] * N[(N[Max[x, y], $MachinePrecision] / a), $MachinePrecision] + N[(t$95$2 * (-N[Max[z, t], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_1 = IF (x > y) THEN x ELSE y ENDIF IN LET tmp_2 = IF (z < t) THEN z ELSE t ENDIF IN LET tmp_3 = IF (z > t) THEN z ELSE t ENDIF IN LET t_1 = ((tmp * tmp_1) - (tmp_2 * tmp_3)) IN LET tmp_4 = IF (z < t) THEN z ELSE t ENDIF IN LET t_2 = (tmp_4 / a) IN LET tmp_9 = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_10 = IF (x > y) THEN x ELSE y ENDIF IN LET tmp_11 = IF (z > t) THEN z ELSE t ENDIF IN LET tmp_17 = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_18 = IF (x > y) THEN x ELSE y ENDIF IN LET tmp_19 = IF (z > t) THEN z ELSE t ENDIF IN LET tmp_20 = IF (z < t) THEN z ELSE t ENDIF IN LET tmp_21 = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_22 = IF (x > y) THEN x ELSE y ENDIF IN LET tmp_23 = IF (z > t) THEN z ELSE t ENDIF IN LET tmp_16 = IF (t_1 <= (1999999999999999867720989669485949124743900432860663037223385644615401293399207295251384865191691894341829109199397042951078761626889625586558917010807457234988770000896)) THEN (((tmp_17 * tmp_18) + (- (tmp_19 * tmp_20))) / a) ELSE ((tmp_21 * (tmp_22 / a)) + (t_2 * (- tmp_23))) ENDIF IN LET tmp_8 = IF (t_1 <= (-19999999999999998785071050110729243720080574440234649906381543142646409126026467805686618514881015496873712236112324345157434387485272061060471597681733765549974602883364022082135420506324881811687439605097103198153279365101643665319098224539215899610692069837325144812815208761691919724149808696276287488)) THEN (((tmp_9 / a) * tmp_10) - (t_2 * tmp_11)) ELSE tmp_16 ENDIF IN tmp_8 END code
\begin{array}{l}
t_1 := \mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right) - \mathsf{min}\left(z, t\right) \cdot \mathsf{max}\left(z, t\right)\\
t_2 := \frac{\mathsf{min}\left(z, t\right)}{a}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+304}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{a} \cdot \mathsf{max}\left(x, y\right) - t\_2 \cdot \mathsf{max}\left(z, t\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+168}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{min}\left(x, y\right), \mathsf{max}\left(x, y\right), -\mathsf{max}\left(z, t\right) \cdot \mathsf{min}\left(z, t\right)\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{min}\left(x, y\right), \frac{\mathsf{max}\left(x, y\right)}{a}, t\_2 \cdot \left(-\mathsf{max}\left(z, t\right)\right)\right)\\
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -1.9999999999999999e304Initial program 91.2%
Applied rewrites88.1%
Applied rewrites87.3%
if -1.9999999999999999e304 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1.9999999999999999e168Initial program 91.2%
Applied rewrites91.4%
if 1.9999999999999999e168 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 91.2%
Applied rewrites88.1%
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(let* ((t_1 (* x (/ y a))))
(if (<= (* x y) -2e+304)
t_1
(if (<= (* x y) 2e+270) (/ (fma x y (- (* t z))) a) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x * (y / a);
double tmp;
if ((x * y) <= -2e+304) {
tmp = t_1;
} else if ((x * y) <= 2e+270) {
tmp = fma(x, y, -(t * z)) / a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x * Float64(y / a)) tmp = 0.0 if (Float64(x * y) <= -2e+304) tmp = t_1; elseif (Float64(x * y) <= 2e+270) tmp = Float64(fma(x, y, Float64(-Float64(t * z))) / a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+304], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e+270], N[(N[(x * y + (-N[(t * z), $MachinePrecision])), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET t_1 = (x * (y / a)) IN LET tmp_1 = IF ((x * y) <= (2000000000000000093507637770912255978379210862660820573682729745488032878789111789220736516360606673878153776268089900578652336369324860662948626554833959632774778559729275871173995040476704622045320156587457342770385866522124606869505276053562755097483935769278566891520)) THEN (((x * y) + (- (t * z))) / a) ELSE t_1 ENDIF IN LET tmp = IF ((x * y) <= (-19999999999999998785071050110729243720080574440234649906381543142646409126026467805686618514881015496873712236112324345157434387485272061060471597681733765549974602883364022082135420506324881811687439605097103198153279365101643665319098224539215899610692069837325144812815208761691919724149808696276287488)) THEN t_1 ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := x \cdot \frac{y}{a}\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+304}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+270}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, -t \cdot z\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 x y) < -1.9999999999999999e304 or 2.0000000000000001e270 < (*.f64 x y) Initial program 91.2%
Taylor expanded in x around inf
Applied rewrites49.6%
Applied rewrites50.6%
if -1.9999999999999999e304 < (*.f64 x y) < 2.0000000000000001e270Initial program 91.2%
Applied rewrites91.4%
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(let* ((t_1 (* x (/ y a))))
(if (<= (* x y) -2e+304)
t_1
(if (<= (* x y) 2e+270) (/ (- (* x y) (* z t)) a) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = x * (y / a);
double tmp;
if ((x * y) <= -2e+304) {
tmp = t_1;
} else if ((x * y) <= 2e+270) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = t_1;
}
return tmp;
}
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 = x * (y / a)
if ((x * y) <= (-2d+304)) then
tmp = t_1
else if ((x * y) <= 2d+270) then
tmp = ((x * y) - (z * t)) / 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 = x * (y / a);
double tmp;
if ((x * y) <= -2e+304) {
tmp = t_1;
} else if ((x * y) <= 2e+270) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x * (y / a) tmp = 0 if (x * y) <= -2e+304: tmp = t_1 elif (x * y) <= 2e+270: tmp = ((x * y) - (z * t)) / a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x * Float64(y / a)) tmp = 0.0 if (Float64(x * y) <= -2e+304) tmp = t_1; elseif (Float64(x * y) <= 2e+270) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x * (y / a); tmp = 0.0; if ((x * y) <= -2e+304) tmp = t_1; elseif ((x * y) <= 2e+270) tmp = ((x * y) - (z * t)) / a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+304], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e+270], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET t_1 = (x * (y / a)) IN LET tmp_1 = IF ((x * y) <= (2000000000000000093507637770912255978379210862660820573682729745488032878789111789220736516360606673878153776268089900578652336369324860662948626554833959632774778559729275871173995040476704622045320156587457342770385866522124606869505276053562755097483935769278566891520)) THEN (((x * y) - (z * t)) / a) ELSE t_1 ENDIF IN LET tmp = IF ((x * y) <= (-19999999999999998785071050110729243720080574440234649906381543142646409126026467805686618514881015496873712236112324345157434387485272061060471597681733765549974602883364022082135420506324881811687439605097103198153279365101643665319098224539215899610692069837325144812815208761691919724149808696276287488)) THEN t_1 ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := x \cdot \frac{y}{a}\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+304}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+270}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 x y) < -1.9999999999999999e304 or 2.0000000000000001e270 < (*.f64 x y) Initial program 91.2%
Taylor expanded in x around inf
Applied rewrites49.6%
Applied rewrites50.6%
if -1.9999999999999999e304 < (*.f64 x y) < 2.0000000000000001e270Initial program 91.2%
(FPCore (x y z t a) :precision binary64 :pre TRUE (if (<= (- (* (fmin x y) (fmax x y)) (* z t)) -2e+304) (- (* (/ (fmin x y) a) (fmax x y)) (* (/ z a) t)) (/ (fma (fmin x y) (fmax x y) (- (* t z))) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((fmin(x, y) * fmax(x, y)) - (z * t)) <= -2e+304) {
tmp = ((fmin(x, y) / a) * fmax(x, y)) - ((z / a) * t);
} else {
tmp = fma(fmin(x, y), fmax(x, y), -(t * z)) / a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (Float64(Float64(fmin(x, y) * fmax(x, y)) - Float64(z * t)) <= -2e+304) tmp = Float64(Float64(Float64(fmin(x, y) / a) * fmax(x, y)) - Float64(Float64(z / a) * t)); else tmp = Float64(fma(fmin(x, y), fmax(x, y), Float64(-Float64(t * z))) / a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision], -2e+304], N[(N[(N[(N[Min[x, y], $MachinePrecision] / a), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] - N[(N[(z / a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision] + (-N[(t * z), $MachinePrecision])), $MachinePrecision] / a), $MachinePrecision]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp_3 = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_4 = IF (x > y) THEN x ELSE y ENDIF IN LET tmp_5 = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_6 = IF (x > y) THEN x ELSE y ENDIF IN LET tmp_7 = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_8 = IF (x > y) THEN x ELSE y ENDIF IN LET tmp_2 = IF (((tmp_3 * tmp_4) - (z * t)) <= (-19999999999999998785071050110729243720080574440234649906381543142646409126026467805686618514881015496873712236112324345157434387485272061060471597681733765549974602883364022082135420506324881811687439605097103198153279365101643665319098224539215899610692069837325144812815208761691919724149808696276287488)) THEN (((tmp_5 / a) * tmp_6) - ((z / a) * t)) ELSE (((tmp_7 * tmp_8) + (- (t * z))) / a) ENDIF IN tmp_2 END code
\begin{array}{l}
\mathbf{if}\;\mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right) - z \cdot t \leq -2 \cdot 10^{+304}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{a} \cdot \mathsf{max}\left(x, y\right) - \frac{z}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{min}\left(x, y\right), \mathsf{max}\left(x, y\right), -t \cdot z\right)}{a}\\
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -1.9999999999999999e304Initial program 91.2%
Applied rewrites88.1%
Applied rewrites87.3%
if -1.9999999999999999e304 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 91.2%
Applied rewrites91.4%
(FPCore (x y z t a) :precision binary64 :pre TRUE (if (<= (- (* x y) (* (fmin z t) (fmax z t))) -2e+304) (* (/ (- (* x (/ y (fmin z t))) (fmax z t)) a) (fmin z t)) (/ (fma x y (- (* (fmax z t) (fmin z t)))) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((x * y) - (fmin(z, t) * fmax(z, t))) <= -2e+304) {
tmp = (((x * (y / fmin(z, t))) - fmax(z, t)) / a) * fmin(z, t);
} else {
tmp = fma(x, y, -(fmax(z, t) * fmin(z, t))) / a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (Float64(Float64(x * y) - Float64(fmin(z, t) * fmax(z, t))) <= -2e+304) tmp = Float64(Float64(Float64(Float64(x * Float64(y / fmin(z, t))) - fmax(z, t)) / a) * fmin(z, t)); else tmp = Float64(fma(x, y, Float64(-Float64(fmax(z, t) * fmin(z, t)))) / a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(x * y), $MachinePrecision] - N[(N[Min[z, t], $MachinePrecision] * N[Max[z, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e+304], N[(N[(N[(N[(x * N[(y / N[Min[z, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Max[z, t], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] * N[Min[z, t], $MachinePrecision]), $MachinePrecision], N[(N[(x * y + (-N[(N[Max[z, t], $MachinePrecision] * N[Min[z, t], $MachinePrecision]), $MachinePrecision])), $MachinePrecision] / a), $MachinePrecision]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp_4 = IF (z < t) THEN z ELSE t ENDIF IN LET tmp_5 = IF (z > t) THEN z ELSE t ENDIF IN LET tmp_6 = IF (z < t) THEN z ELSE t ENDIF IN LET tmp_7 = IF (z > t) THEN z ELSE t ENDIF IN LET tmp_8 = IF (z < t) THEN z ELSE t ENDIF IN LET tmp_9 = IF (z > t) THEN z ELSE t ENDIF IN LET tmp_10 = IF (z < t) THEN z ELSE t ENDIF IN LET tmp_3 = IF (((x * y) - (tmp_4 * tmp_5)) <= (-19999999999999998785071050110729243720080574440234649906381543142646409126026467805686618514881015496873712236112324345157434387485272061060471597681733765549974602883364022082135420506324881811687439605097103198153279365101643665319098224539215899610692069837325144812815208761691919724149808696276287488)) THEN ((((x * (y / tmp_6)) - tmp_7) / a) * tmp_8) ELSE (((x * y) + (- (tmp_9 * tmp_10))) / a) ENDIF IN tmp_3 END code
\begin{array}{l}
\mathbf{if}\;x \cdot y - \mathsf{min}\left(z, t\right) \cdot \mathsf{max}\left(z, t\right) \leq -2 \cdot 10^{+304}:\\
\;\;\;\;\frac{x \cdot \frac{y}{\mathsf{min}\left(z, t\right)} - \mathsf{max}\left(z, t\right)}{a} \cdot \mathsf{min}\left(z, t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, -\mathsf{max}\left(z, t\right) \cdot \mathsf{min}\left(z, t\right)\right)}{a}\\
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -1.9999999999999999e304Initial program 91.2%
Taylor expanded in z around inf
Applied rewrites79.6%
Applied rewrites81.8%
if -1.9999999999999999e304 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 91.2%
Applied rewrites91.4%
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(let* ((t_1 (* (fmin x y) (fmax x y))))
(if (<= t_1 -4e+42)
(* (/ (fmin x y) a) (fmax x y))
(if (<= t_1 1e-150)
(/ (* (- z) t) a)
(/ (fmax x y) (/ a (fmin x y)))))))double code(double x, double y, double z, double t, double a) {
double t_1 = fmin(x, y) * fmax(x, y);
double tmp;
if (t_1 <= -4e+42) {
tmp = (fmin(x, y) / a) * fmax(x, y);
} else if (t_1 <= 1e-150) {
tmp = (-z * t) / a;
} else {
tmp = fmax(x, y) / (a / fmin(x, y));
}
return tmp;
}
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 = fmin(x, y) * fmax(x, y)
if (t_1 <= (-4d+42)) then
tmp = (fmin(x, y) / a) * fmax(x, y)
else if (t_1 <= 1d-150) then
tmp = (-z * t) / a
else
tmp = fmax(x, y) / (a / fmin(x, y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = fmin(x, y) * fmax(x, y);
double tmp;
if (t_1 <= -4e+42) {
tmp = (fmin(x, y) / a) * fmax(x, y);
} else if (t_1 <= 1e-150) {
tmp = (-z * t) / a;
} else {
tmp = fmax(x, y) / (a / fmin(x, y));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = fmin(x, y) * fmax(x, y) tmp = 0 if t_1 <= -4e+42: tmp = (fmin(x, y) / a) * fmax(x, y) elif t_1 <= 1e-150: tmp = (-z * t) / a else: tmp = fmax(x, y) / (a / fmin(x, y)) return tmp
function code(x, y, z, t, a) t_1 = Float64(fmin(x, y) * fmax(x, y)) tmp = 0.0 if (t_1 <= -4e+42) tmp = Float64(Float64(fmin(x, y) / a) * fmax(x, y)); elseif (t_1 <= 1e-150) tmp = Float64(Float64(Float64(-z) * t) / a); else tmp = Float64(fmax(x, y) / Float64(a / fmin(x, y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = min(x, y) * max(x, y); tmp = 0.0; if (t_1 <= -4e+42) tmp = (min(x, y) / a) * max(x, y); elseif (t_1 <= 1e-150) tmp = (-z * t) / a; else tmp = max(x, y) / (a / min(x, y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+42], N[(N[(N[Min[x, y], $MachinePrecision] / a), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-150], N[(N[((-z) * t), $MachinePrecision] / a), $MachinePrecision], N[(N[Max[x, y], $MachinePrecision] / N[(a / N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_1 = IF (x > y) THEN x ELSE y ENDIF IN LET t_1 = (tmp * tmp_1) IN LET tmp_5 = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_6 = IF (x > y) THEN x ELSE y ENDIF IN LET tmp_8 = IF (x > y) THEN x ELSE y ENDIF IN LET tmp_9 = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_7 = IF (t_1 <= (100000000000000000629535823217296399721087933638737788046497104705520498254179321138129170532890503704405994963230580103067513751160865633202829165130023467457014156090990295018891776024374768764400416020911642797793722954229019546998397332759107067859731816710377579229973684101427943008113522349948331994414341250592547994858646301304824078966967156534016215353732892623384032049216330051422119140625e-551)) THEN (((- z) * t) / a) ELSE (tmp_8 / (a / tmp_9)) ENDIF IN LET tmp_4 = IF (t_1 <= (-4000000000000000179542850712303667142197248)) THEN ((tmp_5 / a) * tmp_6) ELSE tmp_7 ENDIF IN tmp_4 END code
\begin{array}{l}
t_1 := \mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+42}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{a} \cdot \mathsf{max}\left(x, y\right)\\
\mathbf{elif}\;t\_1 \leq 10^{-150}:\\
\;\;\;\;\frac{\left(-z\right) \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\frac{a}{\mathsf{min}\left(x, y\right)}}\\
\end{array}
if (*.f64 x y) < -4.0000000000000002e42Initial program 91.2%
Taylor expanded in x around inf
Applied rewrites49.6%
Applied rewrites50.6%
if -4.0000000000000002e42 < (*.f64 x y) < 1e-150Initial program 91.2%
Taylor expanded in x around 0
Applied rewrites51.3%
Applied rewrites51.3%
if 1e-150 < (*.f64 x y) Initial program 91.2%
Taylor expanded in x around inf
Applied rewrites49.6%
Applied rewrites50.6%
Applied rewrites50.5%
Applied rewrites50.6%
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(let* ((t_1 (* (fmin x y) (fmax x y))))
(if (<= t_1 -4e+42)
(* (/ (fmin x y) a) (fmax x y))
(if (<= t_1 5e-81)
(* (/ (- (fmax z t)) a) (fmin z t))
(/ (fmax x y) (/ a (fmin x y)))))))double code(double x, double y, double z, double t, double a) {
double t_1 = fmin(x, y) * fmax(x, y);
double tmp;
if (t_1 <= -4e+42) {
tmp = (fmin(x, y) / a) * fmax(x, y);
} else if (t_1 <= 5e-81) {
tmp = (-fmax(z, t) / a) * fmin(z, t);
} else {
tmp = fmax(x, y) / (a / fmin(x, y));
}
return tmp;
}
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 = fmin(x, y) * fmax(x, y)
if (t_1 <= (-4d+42)) then
tmp = (fmin(x, y) / a) * fmax(x, y)
else if (t_1 <= 5d-81) then
tmp = (-fmax(z, t) / a) * fmin(z, t)
else
tmp = fmax(x, y) / (a / fmin(x, y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = fmin(x, y) * fmax(x, y);
double tmp;
if (t_1 <= -4e+42) {
tmp = (fmin(x, y) / a) * fmax(x, y);
} else if (t_1 <= 5e-81) {
tmp = (-fmax(z, t) / a) * fmin(z, t);
} else {
tmp = fmax(x, y) / (a / fmin(x, y));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = fmin(x, y) * fmax(x, y) tmp = 0 if t_1 <= -4e+42: tmp = (fmin(x, y) / a) * fmax(x, y) elif t_1 <= 5e-81: tmp = (-fmax(z, t) / a) * fmin(z, t) else: tmp = fmax(x, y) / (a / fmin(x, y)) return tmp
function code(x, y, z, t, a) t_1 = Float64(fmin(x, y) * fmax(x, y)) tmp = 0.0 if (t_1 <= -4e+42) tmp = Float64(Float64(fmin(x, y) / a) * fmax(x, y)); elseif (t_1 <= 5e-81) tmp = Float64(Float64(Float64(-fmax(z, t)) / a) * fmin(z, t)); else tmp = Float64(fmax(x, y) / Float64(a / fmin(x, y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = min(x, y) * max(x, y); tmp = 0.0; if (t_1 <= -4e+42) tmp = (min(x, y) / a) * max(x, y); elseif (t_1 <= 5e-81) tmp = (-max(z, t) / a) * min(z, t); else tmp = max(x, y) / (a / min(x, y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+42], N[(N[(N[Min[x, y], $MachinePrecision] / a), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-81], N[(N[((-N[Max[z, t], $MachinePrecision]) / a), $MachinePrecision] * N[Min[z, t], $MachinePrecision]), $MachinePrecision], N[(N[Max[x, y], $MachinePrecision] / N[(a / N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_1 = IF (x > y) THEN x ELSE y ENDIF IN LET t_1 = (tmp * tmp_1) IN LET tmp_5 = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_6 = IF (x > y) THEN x ELSE y ENDIF IN LET tmp_10 = IF (z > t) THEN z ELSE t ENDIF IN LET tmp_11 = IF (z < t) THEN z ELSE t ENDIF IN LET tmp_12 = IF (x > y) THEN x ELSE y ENDIF IN LET tmp_13 = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_9 = IF (t_1 <= (49999999999999998071265875669377878796566773716936161200192095480366846040605233681099249956642833940716372505901801459595524545533008019196712992904908751668794919697705868294358289954628420535451792383607738656792207621037960052490234375e-319)) THEN (((- tmp_10) / a) * tmp_11) ELSE (tmp_12 / (a / tmp_13)) ENDIF IN LET tmp_4 = IF (t_1 <= (-4000000000000000179542850712303667142197248)) THEN ((tmp_5 / a) * tmp_6) ELSE tmp_9 ENDIF IN tmp_4 END code
\begin{array}{l}
t_1 := \mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+42}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{a} \cdot \mathsf{max}\left(x, y\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-81}:\\
\;\;\;\;\frac{-\mathsf{max}\left(z, t\right)}{a} \cdot \mathsf{min}\left(z, t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\frac{a}{\mathsf{min}\left(x, y\right)}}\\
\end{array}
if (*.f64 x y) < -4.0000000000000002e42Initial program 91.2%
Taylor expanded in x around inf
Applied rewrites49.6%
Applied rewrites50.6%
if -4.0000000000000002e42 < (*.f64 x y) < 4.9999999999999998e-81Initial program 91.2%
Taylor expanded in z around inf
Applied rewrites79.6%
Taylor expanded in x around 0
Applied rewrites52.1%
Applied rewrites52.1%
if 4.9999999999999998e-81 < (*.f64 x y) Initial program 91.2%
Taylor expanded in x around inf
Applied rewrites49.6%
Applied rewrites50.6%
Applied rewrites50.5%
Applied rewrites50.6%
(FPCore (x y z t a)
:precision binary64
:pre TRUE
(let* ((t_1 (* (fmin x y) (/ (fmax x y) a)))
(t_2 (* (fmin x y) (fmax x y)))
(t_3 (- t_2 (* z t))))
(if (<= t_3 -1e+222) t_1 (if (<= t_3 2e+270) (/ t_2 a) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = fmin(x, y) * (fmax(x, y) / a);
double t_2 = fmin(x, y) * fmax(x, y);
double t_3 = t_2 - (z * t);
double tmp;
if (t_3 <= -1e+222) {
tmp = t_1;
} else if (t_3 <= 2e+270) {
tmp = t_2 / a;
} else {
tmp = t_1;
}
return tmp;
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = fmin(x, y) * (fmax(x, y) / a)
t_2 = fmin(x, y) * fmax(x, y)
t_3 = t_2 - (z * t)
if (t_3 <= (-1d+222)) then
tmp = t_1
else if (t_3 <= 2d+270) then
tmp = t_2 / 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 = fmin(x, y) * (fmax(x, y) / a);
double t_2 = fmin(x, y) * fmax(x, y);
double t_3 = t_2 - (z * t);
double tmp;
if (t_3 <= -1e+222) {
tmp = t_1;
} else if (t_3 <= 2e+270) {
tmp = t_2 / a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = fmin(x, y) * (fmax(x, y) / a) t_2 = fmin(x, y) * fmax(x, y) t_3 = t_2 - (z * t) tmp = 0 if t_3 <= -1e+222: tmp = t_1 elif t_3 <= 2e+270: tmp = t_2 / a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(fmin(x, y) * Float64(fmax(x, y) / a)) t_2 = Float64(fmin(x, y) * fmax(x, y)) t_3 = Float64(t_2 - Float64(z * t)) tmp = 0.0 if (t_3 <= -1e+222) tmp = t_1; elseif (t_3 <= 2e+270) tmp = Float64(t_2 / a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = min(x, y) * (max(x, y) / a); t_2 = min(x, y) * max(x, y); t_3 = t_2 - (z * t); tmp = 0.0; if (t_3 <= -1e+222) tmp = t_1; elseif (t_3 <= 2e+270) tmp = t_2 / a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Min[x, y], $MachinePrecision] * N[(N[Max[x, y], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Min[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e+222], t$95$1, If[LessEqual[t$95$3, 2e+270], N[(t$95$2 / a), $MachinePrecision], t$95$1]]]]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_1 = IF (x > y) THEN x ELSE y ENDIF IN LET t_1 = (tmp * (tmp_1 / a)) IN LET tmp_2 = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_3 = IF (x > y) THEN x ELSE y ENDIF IN LET t_2 = (tmp_2 * tmp_3) IN LET t_3 = (t_2 - (z * t)) IN LET tmp_5 = IF (t_3 <= (2000000000000000093507637770912255978379210862660820573682729745488032878789111789220736516360606673878153776268089900578652336369324860662948626554833959632774778559729275871173995040476704622045320156587457342770385866522124606869505276053562755097483935769278566891520)) THEN (t_2 / a) ELSE t_1 ENDIF IN LET tmp_4 = IF (t_3 <= (-1000000000000000046601807174820697568405085809949376861420980458018682781323086299572767712214195712321033976595985489865317261666006898091360622097492643440587430127367316221899487205895055238326459735771560242784354959360)) THEN t_1 ELSE tmp_5 ENDIF IN tmp_4 END code
\begin{array}{l}
t_1 := \mathsf{min}\left(x, y\right) \cdot \frac{\mathsf{max}\left(x, y\right)}{a}\\
t_2 := \mathsf{min}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right)\\
t_3 := t\_2 - z \cdot t\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{+222}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+270}:\\
\;\;\;\;\frac{t\_2}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -1e222 or 2.0000000000000001e270 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 91.2%
Taylor expanded in x around inf
Applied rewrites49.6%
Applied rewrites50.6%
if -1e222 < (-.f64 (*.f64 x y) (*.f64 z t)) < 2.0000000000000001e270Initial program 91.2%
Taylor expanded in x around inf
Applied rewrites49.6%
(FPCore (x y z t a) :precision binary64 :pre TRUE (if (<= (fmin z t) -1.2235104707387102e-210) (* (/ (fmin x y) a) (fmax x y)) (* (fmin x y) (/ (fmax x y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (fmin(z, t) <= -1.2235104707387102e-210) {
tmp = (fmin(x, y) / a) * fmax(x, y);
} else {
tmp = fmin(x, y) * (fmax(x, y) / a);
}
return tmp;
}
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 (fmin(z, t) <= (-1.2235104707387102d-210)) then
tmp = (fmin(x, y) / a) * fmax(x, y)
else
tmp = fmin(x, y) * (fmax(x, y) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (fmin(z, t) <= -1.2235104707387102e-210) {
tmp = (fmin(x, y) / a) * fmax(x, y);
} else {
tmp = fmin(x, y) * (fmax(x, y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if fmin(z, t) <= -1.2235104707387102e-210: tmp = (fmin(x, y) / a) * fmax(x, y) else: tmp = fmin(x, y) * (fmax(x, y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (fmin(z, t) <= -1.2235104707387102e-210) tmp = Float64(Float64(fmin(x, y) / a) * fmax(x, y)); else tmp = Float64(fmin(x, y) * Float64(fmax(x, y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (min(z, t) <= -1.2235104707387102e-210) tmp = (min(x, y) / a) * max(x, y); else tmp = min(x, y) * (max(x, y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[Min[z, t], $MachinePrecision], -1.2235104707387102e-210], N[(N[(N[Min[x, y], $MachinePrecision] / a), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision], N[(N[Min[x, y], $MachinePrecision] * N[(N[Max[x, y], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = LET tmp_3 = IF (z < t) THEN z ELSE t ENDIF IN LET tmp_4 = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_5 = IF (x > y) THEN x ELSE y ENDIF IN LET tmp_6 = IF (x < y) THEN x ELSE y ENDIF IN LET tmp_7 = IF (x > y) THEN x ELSE y ENDIF IN LET tmp_2 = IF (tmp_3 <= (-1223510470738710237335215425752450026384389050022156570375992696948433371613196870618918284849804357227865176231039792727356811354597623322157205818206829503267871167040665877559095803499183684743100293266796431964681213353740850242688509890107108630157588811279546267801737443245067419084993323903159017287209003516901869553151809110844687293416199402587440006871932694810354866983830306361199055504827546955858733935087747834909030592048330829131504475506484286356306807648438141087474174257309690073969310475376914837397634983062744140625e-750)) THEN ((tmp_4 / a) * tmp_5) ELSE (tmp_6 * (tmp_7 / a)) ENDIF IN tmp_2 END code
\begin{array}{l}
\mathbf{if}\;\mathsf{min}\left(z, t\right) \leq -1.2235104707387102 \cdot 10^{-210}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{a} \cdot \mathsf{max}\left(x, y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{min}\left(x, y\right) \cdot \frac{\mathsf{max}\left(x, y\right)}{a}\\
\end{array}
if z < -1.2235104707387102e-210Initial program 91.2%
Taylor expanded in x around inf
Applied rewrites49.6%
Applied rewrites50.6%
if -1.2235104707387102e-210 < z Initial program 91.2%
Taylor expanded in x around inf
Applied rewrites49.6%
Applied rewrites50.6%
(FPCore (x y z t a) :precision binary64 :pre TRUE (* x (/ y a)))
double code(double x, double y, double z, double t, double a) {
return x * (y / a);
}
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 / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x * (y / a);
}
def code(x, y, z, t, a): return x * (y / a)
function code(x, y, z, t, a) return Float64(x * Float64(y / a)) end
function tmp = code(x, y, z, t, a) tmp = x * (y / a); end
code[x_, y_, z_, t_, a_] := N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]
f(x, y, z, t, a): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf], a in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t, a: real): real = x * (y / a) END code
x \cdot \frac{y}{a}
Initial program 91.2%
Taylor expanded in x around inf
Applied rewrites49.6%
Applied rewrites50.6%
herbie shell --seed 2026092
(FPCore (x y z t a)
:name "Data.Colour.Matrix:inverse from colour-2.3.3, B"
:precision binary64
(/ (- (* x y) (* z t)) a))