
(FPCore (x y z t) :precision binary64 (+ (* (/ x y) (- z t)) t))
double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x / y) * (z - t)) + t
end function
public static double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + t;
}
def code(x, y, z, t): return ((x / y) * (z - t)) + t
function code(x, y, z, t) return Float64(Float64(Float64(x / y) * Float64(z - t)) + t) end
function tmp = code(x, y, z, t) tmp = ((x / y) * (z - t)) + t; end
code[x_, y_, z_, t_] := N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} \cdot \left(z - t\right) + t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (* (/ x y) (- z t)) t))
double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x / y) * (z - t)) + t
end function
public static double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + t;
}
def code(x, y, z, t): return ((x / y) * (z - t)) + t
function code(x, y, z, t) return Float64(Float64(Float64(x / y) * Float64(z - t)) + t) end
function tmp = code(x, y, z, t) tmp = ((x / y) * (z - t)) + t; end
code[x_, y_, z_, t_] := N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} \cdot \left(z - t\right) + t
\end{array}
(FPCore (x y z t) :precision binary64 (+ (/ (- z t) (/ y x)) t))
double code(double x, double y, double z, double t) {
return ((z - t) / (y / x)) + t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((z - t) / (y / x)) + t
end function
public static double code(double x, double y, double z, double t) {
return ((z - t) / (y / x)) + t;
}
def code(x, y, z, t): return ((z - t) / (y / x)) + t
function code(x, y, z, t) return Float64(Float64(Float64(z - t) / Float64(y / x)) + t) end
function tmp = code(x, y, z, t) tmp = ((z - t) / (y / x)) + t; end
code[x_, y_, z_, t_] := N[(N[(N[(z - t), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\begin{array}{l}
\\
\frac{z - t}{\frac{y}{x}} + t
\end{array}
Initial program 98.4%
Simplified0
Applied egg-rr0
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x y) z)) (t_2 (* t (- 1.0 (/ x y)))))
(if (<= t -6.1e+32)
t_2
(if (<= t -2.5e-12)
t_1
(if (<= t -4.1e-88)
t_2
(if (<= t 1e-183)
t_1
(if (<= t 9.5e-150)
t_2
(if (<= t 1.12e-74) (* (/ z y) x) t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) * z;
double t_2 = t * (1.0 - (x / y));
double tmp;
if (t <= -6.1e+32) {
tmp = t_2;
} else if (t <= -2.5e-12) {
tmp = t_1;
} else if (t <= -4.1e-88) {
tmp = t_2;
} else if (t <= 1e-183) {
tmp = t_1;
} else if (t <= 9.5e-150) {
tmp = t_2;
} else if (t <= 1.12e-74) {
tmp = (z / y) * x;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
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) :: t_2
real(8) :: tmp
t_1 = (x / y) * z
t_2 = t * (1.0d0 - (x / y))
if (t <= (-6.1d+32)) then
tmp = t_2
else if (t <= (-2.5d-12)) then
tmp = t_1
else if (t <= (-4.1d-88)) then
tmp = t_2
else if (t <= 1d-183) then
tmp = t_1
else if (t <= 9.5d-150) then
tmp = t_2
else if (t <= 1.12d-74) then
tmp = (z / y) * x
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) * z;
double t_2 = t * (1.0 - (x / y));
double tmp;
if (t <= -6.1e+32) {
tmp = t_2;
} else if (t <= -2.5e-12) {
tmp = t_1;
} else if (t <= -4.1e-88) {
tmp = t_2;
} else if (t <= 1e-183) {
tmp = t_1;
} else if (t <= 9.5e-150) {
tmp = t_2;
} else if (t <= 1.12e-74) {
tmp = (z / y) * x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) * z t_2 = t * (1.0 - (x / y)) tmp = 0 if t <= -6.1e+32: tmp = t_2 elif t <= -2.5e-12: tmp = t_1 elif t <= -4.1e-88: tmp = t_2 elif t <= 1e-183: tmp = t_1 elif t <= 9.5e-150: tmp = t_2 elif t <= 1.12e-74: tmp = (z / y) * x else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) * z) t_2 = Float64(t * Float64(1.0 - Float64(x / y))) tmp = 0.0 if (t <= -6.1e+32) tmp = t_2; elseif (t <= -2.5e-12) tmp = t_1; elseif (t <= -4.1e-88) tmp = t_2; elseif (t <= 1e-183) tmp = t_1; elseif (t <= 9.5e-150) tmp = t_2; elseif (t <= 1.12e-74) tmp = Float64(Float64(z / y) * x); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) * z; t_2 = t * (1.0 - (x / y)); tmp = 0.0; if (t <= -6.1e+32) tmp = t_2; elseif (t <= -2.5e-12) tmp = t_1; elseif (t <= -4.1e-88) tmp = t_2; elseif (t <= 1e-183) tmp = t_1; elseif (t <= 9.5e-150) tmp = t_2; elseif (t <= 1.12e-74) tmp = (z / y) * x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.1e+32], t$95$2, If[LessEqual[t, -2.5e-12], t$95$1, If[LessEqual[t, -4.1e-88], t$95$2, If[LessEqual[t, 1e-183], t$95$1, If[LessEqual[t, 9.5e-150], t$95$2, If[LessEqual[t, 1.12e-74], N[(N[(z / y), $MachinePrecision] * x), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} \cdot z\\
t_2 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;t \leq -6.1 \cdot 10^{+32}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -2.5 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -4.1 \cdot 10^{-88}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 10^{-183}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-150}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{-74}:\\
\;\;\;\;\frac{z}{y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -6.10000000000000027e32 or -2.49999999999999985e-12 < t < -4.1000000000000001e-88 or 1.00000000000000001e-183 < t < 9.50000000000000013e-150 or 1.11999999999999999e-74 < t Initial program 98.8%
Simplified0
Taylor expanded in t around inf 0
Simplified0
if -6.10000000000000027e32 < t < -2.49999999999999985e-12 or -4.1000000000000001e-88 < t < 1.00000000000000001e-183Initial program 98.5%
Simplified0
Taylor expanded in t around 0 0
Simplified0
Applied egg-rr0
if 9.50000000000000013e-150 < t < 1.11999999999999999e-74Initial program 94.4%
Simplified0
Taylor expanded in t around 0 0
Simplified0
Applied egg-rr0
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (- 1.0 (/ x y)))) (t_2 (* (/ (- z t) y) x)))
(if (<= (/ x y) -1000000.0)
t_2
(if (<= (/ x y) 2e-88)
t_1
(if (<= (/ x y) 2e-50)
(* (/ x y) z)
(if (<= (/ x y) 2e+26) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double t_2 = ((z - t) / y) * x;
double tmp;
if ((x / y) <= -1000000.0) {
tmp = t_2;
} else if ((x / y) <= 2e-88) {
tmp = t_1;
} else if ((x / y) <= 2e-50) {
tmp = (x / y) * z;
} else if ((x / y) <= 2e+26) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
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) :: t_2
real(8) :: tmp
t_1 = t * (1.0d0 - (x / y))
t_2 = ((z - t) / y) * x
if ((x / y) <= (-1000000.0d0)) then
tmp = t_2
else if ((x / y) <= 2d-88) then
tmp = t_1
else if ((x / y) <= 2d-50) then
tmp = (x / y) * z
else if ((x / y) <= 2d+26) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double t_2 = ((z - t) / y) * x;
double tmp;
if ((x / y) <= -1000000.0) {
tmp = t_2;
} else if ((x / y) <= 2e-88) {
tmp = t_1;
} else if ((x / y) <= 2e-50) {
tmp = (x / y) * z;
} else if ((x / y) <= 2e+26) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (1.0 - (x / y)) t_2 = ((z - t) / y) * x tmp = 0 if (x / y) <= -1000000.0: tmp = t_2 elif (x / y) <= 2e-88: tmp = t_1 elif (x / y) <= 2e-50: tmp = (x / y) * z elif (x / y) <= 2e+26: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(1.0 - Float64(x / y))) t_2 = Float64(Float64(Float64(z - t) / y) * x) tmp = 0.0 if (Float64(x / y) <= -1000000.0) tmp = t_2; elseif (Float64(x / y) <= 2e-88) tmp = t_1; elseif (Float64(x / y) <= 2e-50) tmp = Float64(Float64(x / y) * z); elseif (Float64(x / y) <= 2e+26) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (1.0 - (x / y)); t_2 = ((z - t) / y) * x; tmp = 0.0; if ((x / y) <= -1000000.0) tmp = t_2; elseif ((x / y) <= 2e-88) tmp = t_1; elseif ((x / y) <= 2e-50) tmp = (x / y) * z; elseif ((x / y) <= 2e+26) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -1000000.0], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], 2e-88], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 2e-50], N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2e+26], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\
t_2 := \frac{z - t}{y} \cdot x\\
\mathbf{if}\;\frac{x}{y} \leq -1000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{-88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{-50}:\\
\;\;\;\;\frac{x}{y} \cdot z\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+26}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 x y) < -1e6 or 2.0000000000000001e26 < (/.f64 x y) Initial program 96.9%
Simplified0
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
if -1e6 < (/.f64 x y) < 1.99999999999999987e-88 or 2.00000000000000002e-50 < (/.f64 x y) < 2.0000000000000001e26Initial program 99.9%
Simplified0
Taylor expanded in t around inf 0
Simplified0
if 1.99999999999999987e-88 < (/.f64 x y) < 2.00000000000000002e-50Initial program 99.7%
Simplified0
Taylor expanded in t around 0 0
Simplified0
Applied egg-rr0
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -4e-6) (+ t (/ (* x (- z t)) y)) (if (<= (/ x y) 1e+20) (+ (/ z (/ y x)) t) (* (/ (- z t) y) x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -4e-6) {
tmp = t + ((x * (z - t)) / y);
} else if ((x / y) <= 1e+20) {
tmp = (z / (y / x)) + t;
} else {
tmp = ((z - t) / y) * x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-4d-6)) then
tmp = t + ((x * (z - t)) / y)
else if ((x / y) <= 1d+20) then
tmp = (z / (y / x)) + t
else
tmp = ((z - t) / y) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -4e-6) {
tmp = t + ((x * (z - t)) / y);
} else if ((x / y) <= 1e+20) {
tmp = (z / (y / x)) + t;
} else {
tmp = ((z - t) / y) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -4e-6: tmp = t + ((x * (z - t)) / y) elif (x / y) <= 1e+20: tmp = (z / (y / x)) + t else: tmp = ((z - t) / y) * x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -4e-6) tmp = Float64(t + Float64(Float64(x * Float64(z - t)) / y)); elseif (Float64(x / y) <= 1e+20) tmp = Float64(Float64(z / Float64(y / x)) + t); else tmp = Float64(Float64(Float64(z - t) / y) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -4e-6) tmp = t + ((x * (z - t)) / y); elseif ((x / y) <= 1e+20) tmp = (z / (y / x)) + t; else tmp = ((z - t) / y) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -4e-6], N[(t + N[(N[(x * N[(z - t), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1e+20], N[(N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], N[(N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -4 \cdot 10^{-6}:\\
\;\;\;\;t + \frac{x \cdot \left(z - t\right)}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 10^{+20}:\\
\;\;\;\;\frac{z}{\frac{y}{x}} + t\\
\mathbf{else}:\\
\;\;\;\;\frac{z - t}{y} \cdot x\\
\end{array}
\end{array}
if (/.f64 x y) < -3.99999999999999982e-6Initial program 95.7%
Simplified0
if -3.99999999999999982e-6 < (/.f64 x y) < 1e20Initial program 99.9%
Taylor expanded in z around inf 0
Simplified0
Applied egg-rr0
if 1e20 < (/.f64 x y) Initial program 98.3%
Simplified0
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -500.0) (/ (* x (- z t)) y) (if (<= (/ x y) 1e+20) (+ (/ z (/ y x)) t) (* (/ (- z t) y) x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -500.0) {
tmp = (x * (z - t)) / y;
} else if ((x / y) <= 1e+20) {
tmp = (z / (y / x)) + t;
} else {
tmp = ((z - t) / y) * x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-500.0d0)) then
tmp = (x * (z - t)) / y
else if ((x / y) <= 1d+20) then
tmp = (z / (y / x)) + t
else
tmp = ((z - t) / y) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -500.0) {
tmp = (x * (z - t)) / y;
} else if ((x / y) <= 1e+20) {
tmp = (z / (y / x)) + t;
} else {
tmp = ((z - t) / y) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -500.0: tmp = (x * (z - t)) / y elif (x / y) <= 1e+20: tmp = (z / (y / x)) + t else: tmp = ((z - t) / y) * x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -500.0) tmp = Float64(Float64(x * Float64(z - t)) / y); elseif (Float64(x / y) <= 1e+20) tmp = Float64(Float64(z / Float64(y / x)) + t); else tmp = Float64(Float64(Float64(z - t) / y) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -500.0) tmp = (x * (z - t)) / y; elseif ((x / y) <= 1e+20) tmp = (z / (y / x)) + t; else tmp = ((z - t) / y) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -500.0], N[(N[(x * N[(z - t), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1e+20], N[(N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], N[(N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -500:\\
\;\;\;\;\frac{x \cdot \left(z - t\right)}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 10^{+20}:\\
\;\;\;\;\frac{z}{\frac{y}{x}} + t\\
\mathbf{else}:\\
\;\;\;\;\frac{z - t}{y} \cdot x\\
\end{array}
\end{array}
if (/.f64 x y) < -500Initial program 95.6%
Simplified0
Taylor expanded in x around inf 0
Simplified0
if -500 < (/.f64 x y) < 1e20Initial program 99.9%
Taylor expanded in z around inf 0
Simplified0
Applied egg-rr0
if 1e20 < (/.f64 x y) Initial program 98.3%
Simplified0
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ (- z t) y) x)))
(if (<= (/ x y) -5e+17)
t_1
(if (<= (/ x y) 1e+20) (+ (/ z (/ y x)) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((z - t) / y) * x;
double tmp;
if ((x / y) <= -5e+17) {
tmp = t_1;
} else if ((x / y) <= 1e+20) {
tmp = (z / (y / x)) + t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
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 = ((z - t) / y) * x
if ((x / y) <= (-5d+17)) then
tmp = t_1
else if ((x / y) <= 1d+20) then
tmp = (z / (y / x)) + 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 = ((z - t) / y) * x;
double tmp;
if ((x / y) <= -5e+17) {
tmp = t_1;
} else if ((x / y) <= 1e+20) {
tmp = (z / (y / x)) + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((z - t) / y) * x tmp = 0 if (x / y) <= -5e+17: tmp = t_1 elif (x / y) <= 1e+20: tmp = (z / (y / x)) + t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(z - t) / y) * x) tmp = 0.0 if (Float64(x / y) <= -5e+17) tmp = t_1; elseif (Float64(x / y) <= 1e+20) tmp = Float64(Float64(z / Float64(y / x)) + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((z - t) / y) * x; tmp = 0.0; if ((x / y) <= -5e+17) tmp = t_1; elseif ((x / y) <= 1e+20) tmp = (z / (y / x)) + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -5e+17], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 1e+20], N[(N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{y} \cdot x\\
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 10^{+20}:\\
\;\;\;\;\frac{z}{\frac{y}{x}} + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -5e17 or 1e20 < (/.f64 x y) Initial program 96.8%
Simplified0
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
if -5e17 < (/.f64 x y) < 1e20Initial program 99.8%
Taylor expanded in z around inf 0
Simplified0
Applied egg-rr0
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ (- z t) y) x)))
(if (<= (/ x y) -5e+17)
t_1
(if (<= (/ x y) 1e+20) (+ (* (/ x y) z) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((z - t) / y) * x;
double tmp;
if ((x / y) <= -5e+17) {
tmp = t_1;
} else if ((x / y) <= 1e+20) {
tmp = ((x / y) * z) + t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
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 = ((z - t) / y) * x
if ((x / y) <= (-5d+17)) then
tmp = t_1
else if ((x / y) <= 1d+20) then
tmp = ((x / y) * z) + 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 = ((z - t) / y) * x;
double tmp;
if ((x / y) <= -5e+17) {
tmp = t_1;
} else if ((x / y) <= 1e+20) {
tmp = ((x / y) * z) + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((z - t) / y) * x tmp = 0 if (x / y) <= -5e+17: tmp = t_1 elif (x / y) <= 1e+20: tmp = ((x / y) * z) + t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(z - t) / y) * x) tmp = 0.0 if (Float64(x / y) <= -5e+17) tmp = t_1; elseif (Float64(x / y) <= 1e+20) tmp = Float64(Float64(Float64(x / y) * z) + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((z - t) / y) * x; tmp = 0.0; if ((x / y) <= -5e+17) tmp = t_1; elseif ((x / y) <= 1e+20) tmp = ((x / y) * z) + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -5e+17], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 1e+20], N[(N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{y} \cdot x\\
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 10^{+20}:\\
\;\;\;\;\frac{x}{y} \cdot z + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -5e17 or 1e20 < (/.f64 x y) Initial program 96.8%
Simplified0
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
if -5e17 < (/.f64 x y) < 1e20Initial program 99.8%
Taylor expanded in z around inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -4e-27) (* (/ x y) z) (if (<= (/ x y) 2e-88) t (/ z (/ y x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -4e-27) {
tmp = (x / y) * z;
} else if ((x / y) <= 2e-88) {
tmp = t;
} else {
tmp = z / (y / x);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-4d-27)) then
tmp = (x / y) * z
else if ((x / y) <= 2d-88) then
tmp = t
else
tmp = z / (y / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -4e-27) {
tmp = (x / y) * z;
} else if ((x / y) <= 2e-88) {
tmp = t;
} else {
tmp = z / (y / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -4e-27: tmp = (x / y) * z elif (x / y) <= 2e-88: tmp = t else: tmp = z / (y / x) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -4e-27) tmp = Float64(Float64(x / y) * z); elseif (Float64(x / y) <= 2e-88) tmp = t; else tmp = Float64(z / Float64(y / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -4e-27) tmp = (x / y) * z; elseif ((x / y) <= 2e-88) tmp = t; else tmp = z / (y / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -4e-27], N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2e-88], t, N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -4 \cdot 10^{-27}:\\
\;\;\;\;\frac{x}{y} \cdot z\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{-88}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{y}{x}}\\
\end{array}
\end{array}
if (/.f64 x y) < -4.0000000000000002e-27Initial program 95.8%
Simplified0
Taylor expanded in t around 0 0
Simplified0
Applied egg-rr0
if -4.0000000000000002e-27 < (/.f64 x y) < 1.99999999999999987e-88Initial program 99.9%
Simplified0
Taylor expanded in x around 0 0
Simplified0
if 1.99999999999999987e-88 < (/.f64 x y) Initial program 98.7%
Simplified0
Taylor expanded in t around 0 0
Simplified0
Applied egg-rr0
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ x y) z))) (if (<= (/ x y) -4e-27) t_1 (if (<= (/ x y) 2e-88) t t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) * z;
double tmp;
if ((x / y) <= -4e-27) {
tmp = t_1;
} else if ((x / y) <= 2e-88) {
tmp = t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
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) * z
if ((x / y) <= (-4d-27)) then
tmp = t_1
else if ((x / y) <= 2d-88) then
tmp = 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) * z;
double tmp;
if ((x / y) <= -4e-27) {
tmp = t_1;
} else if ((x / y) <= 2e-88) {
tmp = t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) * z tmp = 0 if (x / y) <= -4e-27: tmp = t_1 elif (x / y) <= 2e-88: tmp = t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) * z) tmp = 0.0 if (Float64(x / y) <= -4e-27) tmp = t_1; elseif (Float64(x / y) <= 2e-88) tmp = t; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) * z; tmp = 0.0; if ((x / y) <= -4e-27) tmp = t_1; elseif ((x / y) <= 2e-88) tmp = t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -4e-27], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 2e-88], t, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} \cdot z\\
\mathbf{if}\;\frac{x}{y} \leq -4 \cdot 10^{-27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{-88}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -4.0000000000000002e-27 or 1.99999999999999987e-88 < (/.f64 x y) Initial program 97.5%
Simplified0
Taylor expanded in t around 0 0
Simplified0
Applied egg-rr0
if -4.0000000000000002e-27 < (/.f64 x y) < 1.99999999999999987e-88Initial program 99.9%
Simplified0
Taylor expanded in x around 0 0
Simplified0
(FPCore (x y z t) :precision binary64 (+ (* (/ x y) (- z t)) t))
double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x / y) * (z - t)) + t
end function
public static double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + t;
}
def code(x, y, z, t): return ((x / y) * (z - t)) + t
function code(x, y, z, t) return Float64(Float64(Float64(x / y) * Float64(z - t)) + t) end
function tmp = code(x, y, z, t) tmp = ((x / y) * (z - t)) + t; end
code[x_, y_, z_, t_] := N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} \cdot \left(z - t\right) + t
\end{array}
Initial program 98.4%
(FPCore (x y z t) :precision binary64 t)
double code(double x, double y, double z, double t) {
return t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t
end function
public static double code(double x, double y, double z, double t) {
return t;
}
def code(x, y, z, t): return t
function code(x, y, z, t) return t end
function tmp = code(x, y, z, t) tmp = t; end
code[x_, y_, z_, t_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 98.4%
Simplified0
Taylor expanded in x around 0 0
Simplified0
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* (/ x y) (- z t)) t)))
(if (< z 2.759456554562692e-282)
t_1
(if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((x / y) * (z - t)) + t;
double tmp;
if (z < 2.759456554562692e-282) {
tmp = t_1;
} else if (z < 2.326994450874436e-110) {
tmp = (x * ((z - t) / y)) + t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
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) * (z - t)) + t
if (z < 2.759456554562692d-282) then
tmp = t_1
else if (z < 2.326994450874436d-110) then
tmp = (x * ((z - t) / y)) + 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) * (z - t)) + t;
double tmp;
if (z < 2.759456554562692e-282) {
tmp = t_1;
} else if (z < 2.326994450874436e-110) {
tmp = (x * ((z - t) / y)) + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((x / y) * (z - t)) + t tmp = 0 if z < 2.759456554562692e-282: tmp = t_1 elif z < 2.326994450874436e-110: tmp = (x * ((z - t) / y)) + t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(x / y) * Float64(z - t)) + t) tmp = 0.0 if (z < 2.759456554562692e-282) tmp = t_1; elseif (z < 2.326994450874436e-110) tmp = Float64(Float64(x * Float64(Float64(z - t) / y)) + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((x / y) * (z - t)) + t; tmp = 0.0; if (z < 2.759456554562692e-282) tmp = t_1; elseif (z < 2.326994450874436e-110) tmp = (x * ((z - t) / y)) + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]}, If[Less[z, 2.759456554562692e-282], t$95$1, If[Less[z, 2.326994450874436e-110], N[(N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} \cdot \left(z - t\right) + t\\
\mathbf{if}\;z < 2.759456554562692 \cdot 10^{-282}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 2.326994450874436 \cdot 10^{-110}:\\
\;\;\;\;x \cdot \frac{z - t}{y} + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024110
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
:precision binary64
:alt
(if (< z 2.759456554562692e-282) (+ (* (/ x y) (- z t)) t) (if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) (+ (* (/ x y) (- z t)) t)))
(+ (* (/ x y) (- z t)) t))