
(FPCore (x y z t) :precision binary64 :pre TRUE (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = (x / y) + (((2) + ((z * (2)) * ((1) - t))) / (t * z)) END code
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 :pre TRUE (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = (x / y) + (((2) + ((z * (2)) * ((1) - t))) / (t * z)) END code
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
(FPCore (x y z t) :precision binary64 :pre TRUE (fma (fma -2.0 (- t 1.0) (/ 2.0 z)) (/ 1.0 t) (/ x y)))
double code(double x, double y, double z, double t) {
return fma(fma(-2.0, (t - 1.0), (2.0 / z)), (1.0 / t), (x / y));
}
function code(x, y, z, t) return fma(fma(-2.0, Float64(t - 1.0), Float64(2.0 / z)), Float64(1.0 / t), Float64(x / y)) end
code[x_, y_, z_, t_] := N[(N[(-2.0 * N[(t - 1.0), $MachinePrecision] + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = ((((-2) * (t - (1))) + ((2) / z)) * ((1) / t)) + (x / y) END code
\mathsf{fma}\left(\mathsf{fma}\left(-2, t - 1, \frac{2}{z}\right), \frac{1}{t}, \frac{x}{y}\right)
Initial program 86.0%
Applied rewrites99.3%
(FPCore (x y z t) :precision binary64 :pre TRUE (fma x (/ 1.0 y) (/ (fma -2.0 (- t 1.0) (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
return fma(x, (1.0 / y), (fma(-2.0, (t - 1.0), (2.0 / z)) / t));
}
function code(x, y, z, t) return fma(x, Float64(1.0 / y), Float64(fma(-2.0, Float64(t - 1.0), Float64(2.0 / z)) / t)) end
code[x_, y_, z_, t_] := N[(x * N[(1.0 / y), $MachinePrecision] + N[(N[(-2.0 * N[(t - 1.0), $MachinePrecision] + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = (x * ((1) / y)) + ((((-2) * (t - (1))) + ((2) / z)) / t) END code
\mathsf{fma}\left(x, \frac{1}{y}, \frac{\mathsf{fma}\left(-2, t - 1, \frac{2}{z}\right)}{t}\right)
Initial program 86.0%
Applied rewrites99.4%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (+ (/ x y) (/ (+ 2.0 (* 2.0 z)) (* t z)))))
(if (<= (/ x y) -50.0)
t_1
(if (<= (/ x y) 0.1) (/ (fma (- t 1.0) -2.0 (/ 2.0 z)) t) t_1))))double code(double x, double y, double z, double t) {
double t_1 = (x / y) + ((2.0 + (2.0 * z)) / (t * z));
double tmp;
if ((x / y) <= -50.0) {
tmp = t_1;
} else if ((x / y) <= 0.1) {
tmp = fma((t - 1.0), -2.0, (2.0 / z)) / t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(2.0 * z)) / Float64(t * z))) tmp = 0.0 if (Float64(x / y) <= -50.0) tmp = t_1; elseif (Float64(x / y) <= 0.1) tmp = Float64(fma(Float64(t - 1.0), -2.0, Float64(2.0 / z)) / t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(2.0 * z), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -50.0], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 0.1], N[(N[(N[(t - 1.0), $MachinePrecision] * -2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET t_1 = ((x / y) + (((2) + ((2) * z)) / (t * z))) IN LET tmp_1 = IF ((x / y) <= (1000000000000000055511151231257827021181583404541015625e-55)) THEN ((((t - (1)) * (-2)) + ((2) / z)) / t) ELSE t_1 ENDIF IN LET tmp = IF ((x / y) <= (-50)) THEN t_1 ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2 + 2 \cdot z}{t \cdot z}\\
\mathbf{if}\;\frac{x}{y} \leq -50:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 0.1:\\
\;\;\;\;\frac{\mathsf{fma}\left(t - 1, -2, \frac{2}{z}\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 x y) < -50 or 0.10000000000000001 < (/.f64 x y) Initial program 86.0%
Taylor expanded in t around 0
Applied rewrites79.9%
if -50 < (/.f64 x y) < 0.10000000000000001Initial program 86.0%
Taylor expanded in x around 0
Applied rewrites66.4%
Applied rewrites66.3%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (+ (/ x y) (/ (/ 2.0 t) z))))
(if (<= (/ x y) -5e+56)
t_1
(if (<= (/ x y) 5e+133)
(/ (fma (- t 1.0) -2.0 (/ 2.0 z)) t)
t_1))))double code(double x, double y, double z, double t) {
double t_1 = (x / y) + ((2.0 / t) / z);
double tmp;
if ((x / y) <= -5e+56) {
tmp = t_1;
} else if ((x / y) <= 5e+133) {
tmp = fma((t - 1.0), -2.0, (2.0 / z)) / t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)) tmp = 0.0 if (Float64(x / y) <= -5e+56) tmp = t_1; elseif (Float64(x / y) <= 5e+133) tmp = Float64(fma(Float64(t - 1.0), -2.0, Float64(2.0 / z)) / t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -5e+56], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 5e+133], N[(N[(N[(t - 1.0), $MachinePrecision] * -2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET t_1 = ((x / y) + (((2) / t) / z)) IN LET tmp_1 = IF ((x / y) <= (49999999999999996074101824835349657503774913686486230752187555524924150803830162236428630807572544714024682228918922745266209965473792)) THEN ((((t - (1)) * (-2)) + ((2) / z)) / t) ELSE t_1 ENDIF IN LET tmp = IF ((x / y) <= (-500000000000000024173346057776829528764197422945257127936)) THEN t_1 ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{+133}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t - 1, -2, \frac{2}{z}\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 x y) < -5.0000000000000002e56 or 4.9999999999999996e133 < (/.f64 x y) Initial program 86.0%
Taylor expanded in z around 0
Applied rewrites62.1%
Applied rewrites62.1%
if -5.0000000000000002e56 < (/.f64 x y) < 4.9999999999999996e133Initial program 86.0%
Taylor expanded in x around 0
Applied rewrites66.4%
Applied rewrites66.3%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (+ (+ (/ 2.0 t) -2.0) (/ x y))))
(if (<= z -1.1527263176328143e-32)
t_1
(if (<= z 2.2804222428380006e-48)
(+ (/ x y) (/ (/ 2.0 t) z))
t_1))))double code(double x, double y, double z, double t) {
double t_1 = ((2.0 / t) + -2.0) + (x / y);
double tmp;
if (z <= -1.1527263176328143e-32) {
tmp = t_1;
} else if (z <= 2.2804222428380006e-48) {
tmp = (x / y) + ((2.0 / t) / z);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
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) :: t_1
real(8) :: tmp
t_1 = ((2.0d0 / t) + (-2.0d0)) + (x / y)
if (z <= (-1.1527263176328143d-32)) then
tmp = t_1
else if (z <= 2.2804222428380006d-48) then
tmp = (x / y) + ((2.0d0 / t) / z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = ((2.0 / t) + -2.0) + (x / y);
double tmp;
if (z <= -1.1527263176328143e-32) {
tmp = t_1;
} else if (z <= 2.2804222428380006e-48) {
tmp = (x / y) + ((2.0 / t) / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((2.0 / t) + -2.0) + (x / y) tmp = 0 if z <= -1.1527263176328143e-32: tmp = t_1 elif z <= 2.2804222428380006e-48: tmp = (x / y) + ((2.0 / t) / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(2.0 / t) + -2.0) + Float64(x / y)) tmp = 0.0 if (z <= -1.1527263176328143e-32) tmp = t_1; elseif (z <= 2.2804222428380006e-48) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((2.0 / t) + -2.0) + (x / y); tmp = 0.0; if (z <= -1.1527263176328143e-32) tmp = t_1; elseif (z <= 2.2804222428380006e-48) tmp = (x / y) + ((2.0 / t) / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.1527263176328143e-32], t$95$1, If[LessEqual[z, 2.2804222428380006e-48], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET t_1 = ((((2) / t) + (-2)) + (x / y)) IN LET tmp_1 = IF (z <= (228042224283800059809609376234241336538274904084958403300396680134643890249126720821505716309192713695574511552482672820107989508642276632599532604217529296875e-206)) THEN ((x / y) + (((2) / t) / z)) ELSE t_1 ENDIF IN LET tmp = IF (z <= (-11527263176328143227424342740422383978830461433611629481166701467372269894677480809685836404820946654581348411738872528076171875e-159)) THEN t_1 ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \left(\frac{2}{t} + -2\right) + \frac{x}{y}\\
\mathbf{if}\;z \leq -1.1527263176328143 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.2804222428380006 \cdot 10^{-48}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.1527263176328143e-32 or 2.2804222428380006e-48 < z Initial program 86.0%
Taylor expanded in z around inf
Applied rewrites72.2%
Applied rewrites72.0%
Applied rewrites72.2%
if -1.1527263176328143e-32 < z < 2.2804222428380006e-48Initial program 86.0%
Taylor expanded in z around 0
Applied rewrites62.1%
Applied rewrites62.1%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (+ (+ (/ 2.0 t) -2.0) (/ x y))))
(if (<= z -1.1527263176328143e-32)
t_1
(if (<= z 2.2804222428380006e-48)
(+ (/ x y) (/ 2.0 (* t z)))
t_1))))double code(double x, double y, double z, double t) {
double t_1 = ((2.0 / t) + -2.0) + (x / y);
double tmp;
if (z <= -1.1527263176328143e-32) {
tmp = t_1;
} else if (z <= 2.2804222428380006e-48) {
tmp = (x / y) + (2.0 / (t * z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
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) :: t_1
real(8) :: tmp
t_1 = ((2.0d0 / t) + (-2.0d0)) + (x / y)
if (z <= (-1.1527263176328143d-32)) then
tmp = t_1
else if (z <= 2.2804222428380006d-48) then
tmp = (x / y) + (2.0d0 / (t * z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = ((2.0 / t) + -2.0) + (x / y);
double tmp;
if (z <= -1.1527263176328143e-32) {
tmp = t_1;
} else if (z <= 2.2804222428380006e-48) {
tmp = (x / y) + (2.0 / (t * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((2.0 / t) + -2.0) + (x / y) tmp = 0 if z <= -1.1527263176328143e-32: tmp = t_1 elif z <= 2.2804222428380006e-48: tmp = (x / y) + (2.0 / (t * z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(2.0 / t) + -2.0) + Float64(x / y)) tmp = 0.0 if (z <= -1.1527263176328143e-32) tmp = t_1; elseif (z <= 2.2804222428380006e-48) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(t * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((2.0 / t) + -2.0) + (x / y); tmp = 0.0; if (z <= -1.1527263176328143e-32) tmp = t_1; elseif (z <= 2.2804222428380006e-48) tmp = (x / y) + (2.0 / (t * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.1527263176328143e-32], t$95$1, If[LessEqual[z, 2.2804222428380006e-48], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET t_1 = ((((2) / t) + (-2)) + (x / y)) IN LET tmp_1 = IF (z <= (228042224283800059809609376234241336538274904084958403300396680134643890249126720821505716309192713695574511552482672820107989508642276632599532604217529296875e-206)) THEN ((x / y) + ((2) / (t * z))) ELSE t_1 ENDIF IN LET tmp = IF (z <= (-11527263176328143227424342740422383978830461433611629481166701467372269894677480809685836404820946654581348411738872528076171875e-159)) THEN t_1 ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \left(\frac{2}{t} + -2\right) + \frac{x}{y}\\
\mathbf{if}\;z \leq -1.1527263176328143 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.2804222428380006 \cdot 10^{-48}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.1527263176328143e-32 or 2.2804222428380006e-48 < z Initial program 86.0%
Taylor expanded in z around inf
Applied rewrites72.2%
Applied rewrites72.0%
Applied rewrites72.2%
if -1.1527263176328143e-32 < z < 2.2804222428380006e-48Initial program 86.0%
Taylor expanded in z around 0
Applied rewrites62.1%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (/ (fma z 2.0 2.0) (* t z)))
(t_2 (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
(if (<= t_2 -2e+192)
t_1
(if (<= t_2 2e+233)
(+ (+ (/ 2.0 t) -2.0) (/ x y))
(if (<= t_2 INFINITY) t_1 (+ (/ x y) -2.0))))))double code(double x, double y, double z, double t) {
double t_1 = fma(z, 2.0, 2.0) / (t * z);
double t_2 = (2.0 + ((z * 2.0) * (1.0 - t))) / (t * z);
double tmp;
if (t_2 <= -2e+192) {
tmp = t_1;
} else if (t_2 <= 2e+233) {
tmp = ((2.0 / t) + -2.0) + (x / y);
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (x / y) + -2.0;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(fma(z, 2.0, 2.0) / Float64(t * z)) t_2 = Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z)) tmp = 0.0 if (t_2 <= -2e+192) tmp = t_1; elseif (t_2 <= 2e+233) tmp = Float64(Float64(Float64(2.0 / t) + -2.0) + Float64(x / y)); elseif (t_2 <= Inf) tmp = t_1; else tmp = Float64(Float64(x / y) + -2.0); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * 2.0 + 2.0), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+192], t$95$1, If[LessEqual[t$95$2, 2e+233], N[(N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$1, N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(z, 2, 2\right)}{t \cdot z}\\
t_2 := \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+192}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+233}:\\
\;\;\;\;\left(\frac{2}{t} + -2\right) + \frac{x}{y}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + -2\\
\end{array}
if (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) < -2.0000000000000001e192 or 1.9999999999999999e233 < (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) < +inf.0Initial program 86.0%
Taylor expanded in x around 0
Applied rewrites66.4%
Applied rewrites60.0%
Taylor expanded in t around 0
Applied rewrites47.8%
Applied rewrites47.8%
if -2.0000000000000001e192 < (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) < 1.9999999999999999e233Initial program 86.0%
Taylor expanded in z around inf
Applied rewrites72.2%
Applied rewrites72.0%
Applied rewrites72.2%
if +inf.0 < (/.f64 (+.f64 #s(literal 2 binary64) (*.f64 (*.f64 z #s(literal 2 binary64)) (-.f64 #s(literal 1 binary64) t))) (*.f64 t z)) Initial program 86.0%
Taylor expanded in t around inf
Applied rewrites54.1%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (+ (/ x y) -2.0)))
(if (<= t -206451349775.9092)
t_1
(if (<= t 2.4938250291154155e-30) (/ (- (/ 2.0 z) -2.0) t) t_1))))double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if (t <= -206451349775.9092) {
tmp = t_1;
} else if (t <= 2.4938250291154155e-30) {
tmp = ((2.0 / z) - -2.0) / t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
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) :: t_1
real(8) :: tmp
t_1 = (x / y) + (-2.0d0)
if (t <= (-206451349775.9092d0)) then
tmp = t_1
else if (t <= 2.4938250291154155d-30) then
tmp = ((2.0d0 / z) - (-2.0d0)) / t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if (t <= -206451349775.9092) {
tmp = t_1;
} else if (t <= 2.4938250291154155e-30) {
tmp = ((2.0 / z) - -2.0) / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + -2.0 tmp = 0 if t <= -206451349775.9092: tmp = t_1 elif t <= 2.4938250291154155e-30: tmp = ((2.0 / z) - -2.0) / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + -2.0) tmp = 0.0 if (t <= -206451349775.9092) tmp = t_1; elseif (t <= 2.4938250291154155e-30) tmp = Float64(Float64(Float64(2.0 / z) - -2.0) / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + -2.0; tmp = 0.0; if (t <= -206451349775.9092) tmp = t_1; elseif (t <= 2.4938250291154155e-30) tmp = ((2.0 / z) - -2.0) / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[t, -206451349775.9092], t$95$1, If[LessEqual[t, 2.4938250291154155e-30], N[(N[(N[(2.0 / z), $MachinePrecision] - -2.0), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET t_1 = ((x / y) + (-2)) IN LET tmp_1 = IF (t <= (249382502911541550355192637886397054984156366211968544873980887146575280560191999190688960652551031671464443206787109375e-149)) THEN ((((2) / z) - (-2)) / t) ELSE t_1 ENDIF IN LET tmp = IF (t <= (-206451349775909210205078125e-15)) THEN t_1 ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
\mathbf{if}\;t \leq -206451349775.9092:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.4938250291154155 \cdot 10^{-30}:\\
\;\;\;\;\frac{\frac{2}{z} - -2}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -206451349775.90921 or 2.4938250291154155e-30 < t Initial program 86.0%
Taylor expanded in t around inf
Applied rewrites54.1%
if -206451349775.90921 < t < 2.4938250291154155e-30Initial program 86.0%
Taylor expanded in t around 0
Applied rewrites47.9%
Applied rewrites47.9%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (+ (/ x y) -2.0)))
(if (<= (/ x y) -83.87016083948713)
t_1
(if (<= (/ x y) -5.422130002277487e-40)
(/ 2.0 (* t z))
(if (<= (/ x y) 4.341024126774362e+78)
(+ (/ 2.0 t) -2.0)
t_1)))))double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if ((x / y) <= -83.87016083948713) {
tmp = t_1;
} else if ((x / y) <= -5.422130002277487e-40) {
tmp = 2.0 / (t * z);
} else if ((x / y) <= 4.341024126774362e+78) {
tmp = (2.0 / t) + -2.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
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) :: t_1
real(8) :: tmp
t_1 = (x / y) + (-2.0d0)
if ((x / y) <= (-83.87016083948713d0)) then
tmp = t_1
else if ((x / y) <= (-5.422130002277487d-40)) then
tmp = 2.0d0 / (t * z)
else if ((x / y) <= 4.341024126774362d+78) then
tmp = (2.0d0 / t) + (-2.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if ((x / y) <= -83.87016083948713) {
tmp = t_1;
} else if ((x / y) <= -5.422130002277487e-40) {
tmp = 2.0 / (t * z);
} else if ((x / y) <= 4.341024126774362e+78) {
tmp = (2.0 / t) + -2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + -2.0 tmp = 0 if (x / y) <= -83.87016083948713: tmp = t_1 elif (x / y) <= -5.422130002277487e-40: tmp = 2.0 / (t * z) elif (x / y) <= 4.341024126774362e+78: tmp = (2.0 / t) + -2.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + -2.0) tmp = 0.0 if (Float64(x / y) <= -83.87016083948713) tmp = t_1; elseif (Float64(x / y) <= -5.422130002277487e-40) tmp = Float64(2.0 / Float64(t * z)); elseif (Float64(x / y) <= 4.341024126774362e+78) tmp = Float64(Float64(2.0 / t) + -2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + -2.0; tmp = 0.0; if ((x / y) <= -83.87016083948713) tmp = t_1; elseif ((x / y) <= -5.422130002277487e-40) tmp = 2.0 / (t * z); elseif ((x / y) <= 4.341024126774362e+78) tmp = (2.0 / t) + -2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -83.87016083948713], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -5.422130002277487e-40], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 4.341024126774362e+78], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], t$95$1]]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET t_1 = ((x / y) + (-2)) IN LET tmp_2 = IF ((x / y) <= (4341024126774361912387758395932053365125021319042548456651306295327418256195584)) THEN (((2) / t) + (-2)) ELSE t_1 ENDIF IN LET tmp_1 = IF ((x / y) <= (-542213000227748740623245459074508043051958398136356926030504625131376132386926413115796477702148487118512243387868920763139612972736358642578125e-183)) THEN ((2) / (t * z)) ELSE tmp_2 ENDIF IN LET tmp = IF ((x / y) <= (-838701608394871271912052179686725139617919921875e-46)) THEN t_1 ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
\mathbf{if}\;\frac{x}{y} \leq -83.87016083948713:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq -5.422130002277487 \cdot 10^{-40}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;\frac{x}{y} \leq 4.341024126774362 \cdot 10^{+78}:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 x y) < -83.870160839487127 or 4.3410241267743619e78 < (/.f64 x y) Initial program 86.0%
Taylor expanded in t around inf
Applied rewrites54.1%
if -83.870160839487127 < (/.f64 x y) < -5.4221300022774874e-40Initial program 86.0%
Taylor expanded in x around 0
Applied rewrites66.4%
Applied rewrites60.0%
Taylor expanded in z around 0
Applied rewrites30.2%
if -5.4221300022774874e-40 < (/.f64 x y) < 4.3410241267743619e78Initial program 86.0%
Taylor expanded in z around inf
Applied rewrites72.2%
Taylor expanded in x around 0
Applied rewrites38.2%
Applied rewrites38.2%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (+ (/ x y) -2.0)))
(if (<= (/ x y) -6.699564148421449e+56)
t_1
(if (<= (/ x y) 4.341024126774362e+78) (+ (/ 2.0 t) -2.0) t_1))))double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if ((x / y) <= -6.699564148421449e+56) {
tmp = t_1;
} else if ((x / y) <= 4.341024126774362e+78) {
tmp = (2.0 / t) + -2.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
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) :: t_1
real(8) :: tmp
t_1 = (x / y) + (-2.0d0)
if ((x / y) <= (-6.699564148421449d+56)) then
tmp = t_1
else if ((x / y) <= 4.341024126774362d+78) then
tmp = (2.0d0 / t) + (-2.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if ((x / y) <= -6.699564148421449e+56) {
tmp = t_1;
} else if ((x / y) <= 4.341024126774362e+78) {
tmp = (2.0 / t) + -2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + -2.0 tmp = 0 if (x / y) <= -6.699564148421449e+56: tmp = t_1 elif (x / y) <= 4.341024126774362e+78: tmp = (2.0 / t) + -2.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + -2.0) tmp = 0.0 if (Float64(x / y) <= -6.699564148421449e+56) tmp = t_1; elseif (Float64(x / y) <= 4.341024126774362e+78) tmp = Float64(Float64(2.0 / t) + -2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + -2.0; tmp = 0.0; if ((x / y) <= -6.699564148421449e+56) tmp = t_1; elseif ((x / y) <= 4.341024126774362e+78) tmp = (2.0 / t) + -2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -6.699564148421449e+56], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 4.341024126774362e+78], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], t$95$1]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET t_1 = ((x / y) + (-2)) IN LET tmp_1 = IF ((x / y) <= (4341024126774361912387758395932053365125021319042548456651306295327418256195584)) THEN (((2) / t) + (-2)) ELSE t_1 ENDIF IN LET tmp = IF ((x / y) <= (-669956414842144940630113263268846291481863438817984249856)) THEN t_1 ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
\mathbf{if}\;\frac{x}{y} \leq -6.699564148421449 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 4.341024126774362 \cdot 10^{+78}:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 x y) < -6.6995641484214494e56 or 4.3410241267743619e78 < (/.f64 x y) Initial program 86.0%
Taylor expanded in t around inf
Applied rewrites54.1%
if -6.6995641484214494e56 < (/.f64 x y) < 4.3410241267743619e78Initial program 86.0%
Taylor expanded in z around inf
Applied rewrites72.2%
Taylor expanded in x around 0
Applied rewrites38.2%
Applied rewrites38.2%
(FPCore (x y z t) :precision binary64 :pre TRUE (+ (/ 2.0 t) -2.0))
double code(double x, double y, double z, double t) {
return (2.0 / t) + -2.0;
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (2.0d0 / t) + (-2.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (2.0 / t) + -2.0;
}
def code(x, y, z, t): return (2.0 / t) + -2.0
function code(x, y, z, t) return Float64(Float64(2.0 / t) + -2.0) end
function tmp = code(x, y, z, t) tmp = (2.0 / t) + -2.0; end
code[x_, y_, z_, t_] := N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = ((2) / t) + (-2) END code
\frac{2}{t} + -2
Initial program 86.0%
Taylor expanded in z around inf
Applied rewrites72.2%
Taylor expanded in x around 0
Applied rewrites38.2%
Applied rewrites38.2%
(FPCore (x y z t) :precision binary64 :pre TRUE -2.0)
double code(double x, double y, double z, double t) {
return -2.0;
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -2.0d0
end function
public static double code(double x, double y, double z, double t) {
return -2.0;
}
def code(x, y, z, t): return -2.0
function code(x, y, z, t) return -2.0 end
function tmp = code(x, y, z, t) tmp = -2.0; end
code[x_, y_, z_, t_] := -2.0
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = -2 END code
-2
Initial program 86.0%
Taylor expanded in x around 0
Applied rewrites66.4%
Taylor expanded in t around inf
Applied rewrites20.3%
herbie shell --seed 2026092
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))