
(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 12 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 (let* ((t_1 (+ t (* (/ x y) (- z t))))) (if (<= t_1 (- INFINITY)) (fma x (/ (- z t) y) t) t_1)))
double code(double x, double y, double z, double t) {
double t_1 = t + ((x / y) * (z - t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma(x, ((z - t) / y), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(t + Float64(Float64(x / y) * Float64(z - t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = fma(x, Float64(Float64(z - t) / y), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t + N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision] + t), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \frac{x}{y} \cdot \left(z - t\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{z - t}{y}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (*.f64 (/.f64 x y) (-.f64 z t)) t) < -inf.0Initial program 84.4%
associate-*l/99.9%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
if -inf.0 < (+.f64 (*.f64 (/.f64 x y) (-.f64 z t)) t) Initial program 99.4%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ t (* (/ x y) (- z t))))) (if (<= t_1 (- INFINITY)) (+ t (/ x (/ y (- z t)))) t_1)))
double code(double x, double y, double z, double t) {
double t_1 = t + ((x / y) * (z - t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t + (x / (y / (z - t)));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = t + ((x / y) * (z - t));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t + (x / (y / (z - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t + ((x / y) * (z - t)) tmp = 0 if t_1 <= -math.inf: tmp = t + (x / (y / (z - t))) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t + Float64(Float64(x / y) * Float64(z - t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(t + Float64(x / Float64(y / Float64(z - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t + ((x / y) * (z - t)); tmp = 0.0; if (t_1 <= -Inf) tmp = t + (x / (y / (z - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t + N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(t + N[(x / N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \frac{x}{y} \cdot \left(z - t\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t + \frac{x}{\frac{y}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (*.f64 (/.f64 x y) (-.f64 z t)) t) < -inf.0Initial program 84.4%
associate-*l/99.9%
associate-*r/100.0%
clear-num100.0%
un-div-inv99.9%
Applied egg-rr99.9%
if -inf.0 < (+.f64 (*.f64 (/.f64 x y) (-.f64 z t)) t) Initial program 99.4%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -200000000.0) (not (<= (/ x y) 0.001))) (* (/ x y) (- t)) t))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -200000000.0) || !((x / y) <= 0.001)) {
tmp = (x / y) * -t;
} else {
tmp = t;
}
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) <= (-200000000.0d0)) .or. (.not. ((x / y) <= 0.001d0))) then
tmp = (x / y) * -t
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -200000000.0) || !((x / y) <= 0.001)) {
tmp = (x / y) * -t;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -200000000.0) or not ((x / y) <= 0.001): tmp = (x / y) * -t else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -200000000.0) || !(Float64(x / y) <= 0.001)) tmp = Float64(Float64(x / y) * Float64(-t)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -200000000.0) || ~(((x / y) <= 0.001))) tmp = (x / y) * -t; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -200000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 0.001]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] * (-t)), $MachinePrecision], t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -200000000 \lor \neg \left(\frac{x}{y} \leq 0.001\right):\\
\;\;\;\;\frac{x}{y} \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if (/.f64 x y) < -2e8 or 1e-3 < (/.f64 x y) Initial program 95.5%
Taylor expanded in z around 0 47.5%
mul-1-neg47.5%
unsub-neg47.5%
*-rgt-identity47.5%
associate-/l*51.9%
distribute-lft-out--51.9%
Simplified51.9%
Taylor expanded in y around 0 46.8%
mul-1-neg46.8%
+-commutative46.8%
sub-neg46.8%
distribute-lft-out--47.5%
associate-/l*51.9%
Simplified51.9%
Taylor expanded in y around 0 51.4%
neg-mul-151.4%
distribute-neg-frac251.4%
Simplified51.4%
if -2e8 < (/.f64 x y) < 1e-3Initial program 99.9%
Taylor expanded in x around 0 76.7%
Final simplification64.0%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -5e+21) (* x (/ t (- y))) (if (<= (/ x y) 0.001) t (* (/ x y) (- t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e+21) {
tmp = x * (t / -y);
} else if ((x / y) <= 0.001) {
tmp = t;
} else {
tmp = (x / y) * -t;
}
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) <= (-5d+21)) then
tmp = x * (t / -y)
else if ((x / y) <= 0.001d0) then
tmp = t
else
tmp = (x / y) * -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e+21) {
tmp = x * (t / -y);
} else if ((x / y) <= 0.001) {
tmp = t;
} else {
tmp = (x / y) * -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5e+21: tmp = x * (t / -y) elif (x / y) <= 0.001: tmp = t else: tmp = (x / y) * -t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5e+21) tmp = Float64(x * Float64(t / Float64(-y))); elseif (Float64(x / y) <= 0.001) tmp = t; else tmp = Float64(Float64(x / y) * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -5e+21) tmp = x * (t / -y); elseif ((x / y) <= 0.001) tmp = t; else tmp = (x / y) * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5e+21], N[(x * N[(t / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 0.001], t, N[(N[(x / y), $MachinePrecision] * (-t)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+21}:\\
\;\;\;\;x \cdot \frac{t}{-y}\\
\mathbf{elif}\;\frac{x}{y} \leq 0.001:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(-t\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -5e21Initial program 96.7%
Taylor expanded in z around 0 43.9%
mul-1-neg43.9%
unsub-neg43.9%
*-rgt-identity43.9%
associate-/l*51.6%
distribute-lft-out--51.6%
Simplified51.6%
Taylor expanded in x around inf 43.9%
associate-*r/43.9%
mul-1-neg43.9%
distribute-lft-neg-out43.9%
*-commutative43.9%
associate-*r/53.0%
Simplified53.0%
if -5e21 < (/.f64 x y) < 1e-3Initial program 99.9%
Taylor expanded in x around 0 75.7%
if 1e-3 < (/.f64 x y) Initial program 94.3%
Taylor expanded in z around 0 50.7%
mul-1-neg50.7%
unsub-neg50.7%
*-rgt-identity50.7%
associate-/l*52.2%
distribute-lft-out--52.3%
Simplified52.3%
Taylor expanded in y around 0 49.2%
mul-1-neg49.2%
+-commutative49.2%
sub-neg49.2%
distribute-lft-out--50.7%
associate-/l*52.2%
Simplified52.2%
Taylor expanded in y around 0 51.5%
neg-mul-151.5%
distribute-neg-frac251.5%
Simplified51.5%
Final simplification64.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.8e-46) (not (<= z 2.4e-111))) (+ t (* x (/ z y))) (* t (- 1.0 (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.8e-46) || !(z <= 2.4e-111)) {
tmp = t + (x * (z / y));
} else {
tmp = t * (1.0 - (x / y));
}
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 ((z <= (-1.8d-46)) .or. (.not. (z <= 2.4d-111))) then
tmp = t + (x * (z / y))
else
tmp = t * (1.0d0 - (x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.8e-46) || !(z <= 2.4e-111)) {
tmp = t + (x * (z / y));
} else {
tmp = t * (1.0 - (x / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.8e-46) or not (z <= 2.4e-111): tmp = t + (x * (z / y)) else: tmp = t * (1.0 - (x / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.8e-46) || !(z <= 2.4e-111)) tmp = Float64(t + Float64(x * Float64(z / y))); else tmp = Float64(t * Float64(1.0 - Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.8e-46) || ~((z <= 2.4e-111))) tmp = t + (x * (z / y)); else tmp = t * (1.0 - (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.8e-46], N[Not[LessEqual[z, 2.4e-111]], $MachinePrecision]], N[(t + N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-46} \lor \neg \left(z \leq 2.4 \cdot 10^{-111}\right):\\
\;\;\;\;t + x \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\end{array}
\end{array}
if z < -1.8e-46 or 2.4000000000000001e-111 < z Initial program 98.6%
Taylor expanded in z around inf 81.1%
associate-/l*82.9%
Simplified82.9%
if -1.8e-46 < z < 2.4000000000000001e-111Initial program 96.3%
Taylor expanded in z around 0 90.0%
mul-1-neg90.0%
unsub-neg90.0%
*-rgt-identity90.0%
associate-/l*91.7%
distribute-lft-out--91.7%
Simplified91.7%
Final simplification86.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -6.2e-41) (not (<= z 1.9e-111))) (+ t (* (/ x y) z)) (* t (- 1.0 (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.2e-41) || !(z <= 1.9e-111)) {
tmp = t + ((x / y) * z);
} else {
tmp = t * (1.0 - (x / y));
}
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 ((z <= (-6.2d-41)) .or. (.not. (z <= 1.9d-111))) then
tmp = t + ((x / y) * z)
else
tmp = t * (1.0d0 - (x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.2e-41) || !(z <= 1.9e-111)) {
tmp = t + ((x / y) * z);
} else {
tmp = t * (1.0 - (x / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -6.2e-41) or not (z <= 1.9e-111): tmp = t + ((x / y) * z) else: tmp = t * (1.0 - (x / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -6.2e-41) || !(z <= 1.9e-111)) tmp = Float64(t + Float64(Float64(x / y) * z)); else tmp = Float64(t * Float64(1.0 - Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -6.2e-41) || ~((z <= 1.9e-111))) tmp = t + ((x / y) * z); else tmp = t * (1.0 - (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6.2e-41], N[Not[LessEqual[z, 1.9e-111]], $MachinePrecision]], N[(t + N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-41} \lor \neg \left(z \leq 1.9 \cdot 10^{-111}\right):\\
\;\;\;\;t + \frac{x}{y} \cdot z\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\end{array}
\end{array}
if z < -6.20000000000000001e-41 or 1.90000000000000011e-111 < z Initial program 99.2%
associate-*l/89.8%
associate-*r/92.9%
clear-num92.8%
un-div-inv93.3%
Applied egg-rr93.3%
Taylor expanded in z around inf 83.7%
associate-/r/87.8%
Applied egg-rr87.8%
if -6.20000000000000001e-41 < z < 1.90000000000000011e-111Initial program 95.5%
Taylor expanded in z around 0 89.2%
mul-1-neg89.2%
unsub-neg89.2%
*-rgt-identity89.2%
associate-/l*90.9%
distribute-lft-out--90.9%
Simplified90.9%
Final simplification89.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -6.5e-41) (not (<= z 1.42e-111))) (+ t (* (/ x y) z)) (- t (* x (/ t y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.5e-41) || !(z <= 1.42e-111)) {
tmp = t + ((x / y) * z);
} else {
tmp = t - (x * (t / y));
}
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 ((z <= (-6.5d-41)) .or. (.not. (z <= 1.42d-111))) then
tmp = t + ((x / y) * z)
else
tmp = t - (x * (t / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.5e-41) || !(z <= 1.42e-111)) {
tmp = t + ((x / y) * z);
} else {
tmp = t - (x * (t / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -6.5e-41) or not (z <= 1.42e-111): tmp = t + ((x / y) * z) else: tmp = t - (x * (t / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -6.5e-41) || !(z <= 1.42e-111)) tmp = Float64(t + Float64(Float64(x / y) * z)); else tmp = Float64(t - Float64(x * Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -6.5e-41) || ~((z <= 1.42e-111))) tmp = t + ((x / y) * z); else tmp = t - (x * (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6.5e-41], N[Not[LessEqual[z, 1.42e-111]], $MachinePrecision]], N[(t + N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(t - N[(x * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{-41} \lor \neg \left(z \leq 1.42 \cdot 10^{-111}\right):\\
\;\;\;\;t + \frac{x}{y} \cdot z\\
\mathbf{else}:\\
\;\;\;\;t - x \cdot \frac{t}{y}\\
\end{array}
\end{array}
if z < -6.5000000000000004e-41 or 1.41999999999999991e-111 < z Initial program 99.2%
associate-*l/89.8%
associate-*r/92.9%
clear-num92.8%
un-div-inv93.3%
Applied egg-rr93.3%
Taylor expanded in z around inf 83.7%
associate-/r/87.8%
Applied egg-rr87.8%
if -6.5000000000000004e-41 < z < 1.41999999999999991e-111Initial program 95.5%
associate-*l/96.4%
associate-*r/98.1%
clear-num98.0%
un-div-inv98.1%
Applied egg-rr98.1%
Taylor expanded in z around 0 89.2%
mul-1-neg89.2%
*-commutative89.2%
associate-/l*91.0%
distribute-lft-neg-in91.0%
cancel-sign-sub-inv91.0%
Simplified91.0%
Final simplification89.1%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) (- INFINITY)) (* (/ x y) t) t))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -((double) INFINITY)) {
tmp = (x / y) * t;
} else {
tmp = t;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -Double.POSITIVE_INFINITY) {
tmp = (x / y) * t;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -math.inf: tmp = (x / y) * t else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= Float64(-Inf)) tmp = Float64(Float64(x / y) * t); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -Inf) tmp = (x / y) * t; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], (-Infinity)], N[(N[(x / y), $MachinePrecision] * t), $MachinePrecision], t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -\infty:\\
\;\;\;\;\frac{x}{y} \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if (/.f64 x y) < -inf.0Initial program 88.8%
Taylor expanded in z around 0 54.4%
mul-1-neg54.4%
*-commutative54.4%
associate-/l*54.4%
distribute-rgt-neg-in54.4%
distribute-neg-frac254.4%
Simplified54.4%
Taylor expanded in y around 0 54.4%
*-commutative54.4%
associate-*r*54.4%
*-commutative54.4%
distribute-rgt-out54.4%
neg-mul-154.4%
Simplified54.4%
Taylor expanded in x around inf 54.4%
mul-1-neg54.4%
distribute-lft-neg-out54.4%
*-commutative54.4%
Simplified54.4%
*-commutative54.4%
associate-/l*59.4%
add-sqr-sqrt24.1%
sqrt-unprod35.3%
sqr-neg35.3%
sqrt-unprod29.4%
add-sqr-sqrt29.4%
Applied egg-rr29.4%
if -inf.0 < (/.f64 x y) Initial program 98.3%
Taylor expanded in x around 0 42.1%
Final simplification41.3%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -5e+60) (* y (/ t y)) t))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e+60) {
tmp = y * (t / y);
} else {
tmp = t;
}
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) <= (-5d+60)) then
tmp = y * (t / y)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e+60) {
tmp = y * (t / y);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5e+60: tmp = y * (t / y) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5e+60) tmp = Float64(y * Float64(t / y)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -5e+60) tmp = y * (t / y); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5e+60], N[(y * N[(t / y), $MachinePrecision]), $MachinePrecision], t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+60}:\\
\;\;\;\;y \cdot \frac{t}{y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if (/.f64 x y) < -4.99999999999999975e60Initial program 96.0%
Taylor expanded in z around 0 47.9%
mul-1-neg47.9%
*-commutative47.9%
associate-/l*55.4%
distribute-rgt-neg-in55.4%
distribute-neg-frac255.4%
Simplified55.4%
Taylor expanded in y around 0 47.9%
*-commutative47.9%
associate-*r*47.9%
*-commutative47.9%
distribute-rgt-out47.9%
neg-mul-147.9%
Simplified47.9%
Taylor expanded in x around 0 3.8%
*-commutative3.8%
Simplified3.8%
associate-/l*25.1%
*-commutative25.1%
Applied egg-rr25.1%
if -4.99999999999999975e60 < (/.f64 x y) Initial program 98.1%
Taylor expanded in x around 0 47.7%
Final simplification43.5%
(FPCore (x y z t) :precision binary64 (+ t (* (/ x y) (- z t))))
double code(double x, double y, double z, double t) {
return t + ((x / y) * (z - 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 + ((x / y) * (z - t))
end function
public static double code(double x, double y, double z, double t) {
return t + ((x / y) * (z - t));
}
def code(x, y, z, t): return t + ((x / y) * (z - t))
function code(x, y, z, t) return Float64(t + Float64(Float64(x / y) * Float64(z - t))) end
function tmp = code(x, y, z, t) tmp = t + ((x / y) * (z - t)); end
code[x_, y_, z_, t_] := N[(t + N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t + \frac{x}{y} \cdot \left(z - t\right)
\end{array}
Initial program 97.7%
Final simplification97.7%
(FPCore (x y z t) :precision binary64 (* t (- 1.0 (/ x y))))
double code(double x, double y, double z, double t) {
return t * (1.0 - (x / y));
}
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 * (1.0d0 - (x / y))
end function
public static double code(double x, double y, double z, double t) {
return t * (1.0 - (x / y));
}
def code(x, y, z, t): return t * (1.0 - (x / y))
function code(x, y, z, t) return Float64(t * Float64(1.0 - Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = t * (1.0 - (x / y)); end
code[x_, y_, z_, t_] := N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \left(1 - \frac{x}{y}\right)
\end{array}
Initial program 97.7%
Taylor expanded in z around 0 61.2%
mul-1-neg61.2%
unsub-neg61.2%
*-rgt-identity61.2%
associate-/l*65.0%
distribute-lft-out--64.9%
Simplified64.9%
Final simplification64.9%
(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 97.7%
Taylor expanded in x around 0 39.5%
Final simplification39.5%
(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 2024077
(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))