
(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 9 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 (if (<= (/ x y) 4e+279) (+ t (* (- z t) (/ x y))) (+ t (* x (/ (- z t) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= 4e+279) {
tmp = t + ((z - t) * (x / y));
} else {
tmp = t + (x * ((z - 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 ((x / y) <= 4d+279) then
tmp = t + ((z - t) * (x / y))
else
tmp = t + (x * ((z - t) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= 4e+279) {
tmp = t + ((z - t) * (x / y));
} else {
tmp = t + (x * ((z - t) / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= 4e+279: tmp = t + ((z - t) * (x / y)) else: tmp = t + (x * ((z - t) / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= 4e+279) tmp = Float64(t + Float64(Float64(z - t) * Float64(x / y))); else tmp = Float64(t + Float64(x * Float64(Float64(z - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= 4e+279) tmp = t + ((z - t) * (x / y)); else tmp = t + (x * ((z - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], 4e+279], N[(t + N[(N[(z - t), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq 4 \cdot 10^{+279}:\\
\;\;\;\;t + \left(z - t\right) \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t + x \cdot \frac{z - t}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < 4.00000000000000023e279Initial program 97.8%
if 4.00000000000000023e279 < (/.f64 x y) Initial program 81.7%
associate-*l/99.9%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
fma-undefine100.0%
Applied egg-rr100.0%
Final simplification98.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -5e+27) (not (<= (/ x y) 4e-6))) (* t (/ x (- y))) t))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5e+27) || !((x / y) <= 4e-6)) {
tmp = t * (x / -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+27)) .or. (.not. ((x / y) <= 4d-6))) then
tmp = t * (x / -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+27) || !((x / y) <= 4e-6)) {
tmp = t * (x / -y);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -5e+27) or not ((x / y) <= 4e-6): tmp = t * (x / -y) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -5e+27) || !(Float64(x / y) <= 4e-6)) tmp = Float64(t * Float64(x / Float64(-y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -5e+27) || ~(((x / y) <= 4e-6))) tmp = t * (x / -y); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -5e+27], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4e-6]], $MachinePrecision]], N[(t * N[(x / (-y)), $MachinePrecision]), $MachinePrecision], t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+27} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{-6}\right):\\
\;\;\;\;t \cdot \frac{x}{-y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if (/.f64 x y) < -4.99999999999999979e27 or 3.99999999999999982e-6 < (/.f64 x y) Initial program 94.6%
Taylor expanded in z around 0 60.1%
*-commutative60.1%
associate-*l/61.6%
neg-mul-161.6%
*-lft-identity61.6%
distribute-lft-neg-in61.6%
mul-1-neg61.6%
distribute-rgt-in61.7%
mul-1-neg61.7%
unsub-neg61.7%
Simplified61.7%
Taylor expanded in x around inf 61.1%
mul-1-neg61.1%
distribute-frac-neg261.1%
Simplified61.1%
if -4.99999999999999979e27 < (/.f64 x y) < 3.99999999999999982e-6Initial program 98.1%
Taylor expanded in x around 0 72.4%
Final simplification66.2%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -5e+27) (* t (/ x (- y))) (if (<= (/ x y) 4e-6) t (/ (* t (- x)) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e+27) {
tmp = t * (x / -y);
} else if ((x / y) <= 4e-6) {
tmp = t;
} else {
tmp = (t * -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 ((x / y) <= (-5d+27)) then
tmp = t * (x / -y)
else if ((x / y) <= 4d-6) then
tmp = t
else
tmp = (t * -x) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e+27) {
tmp = t * (x / -y);
} else if ((x / y) <= 4e-6) {
tmp = t;
} else {
tmp = (t * -x) / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5e+27: tmp = t * (x / -y) elif (x / y) <= 4e-6: tmp = t else: tmp = (t * -x) / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5e+27) tmp = Float64(t * Float64(x / Float64(-y))); elseif (Float64(x / y) <= 4e-6) tmp = t; else tmp = Float64(Float64(t * Float64(-x)) / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -5e+27) tmp = t * (x / -y); elseif ((x / y) <= 4e-6) tmp = t; else tmp = (t * -x) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5e+27], N[(t * N[(x / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 4e-6], t, N[(N[(t * (-x)), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+27}:\\
\;\;\;\;t \cdot \frac{x}{-y}\\
\mathbf{elif}\;\frac{x}{y} \leq 4 \cdot 10^{-6}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \left(-x\right)}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -4.99999999999999979e27Initial program 95.5%
Taylor expanded in z around 0 60.0%
*-commutative60.0%
associate-*l/65.2%
neg-mul-165.2%
*-lft-identity65.2%
distribute-lft-neg-in65.2%
mul-1-neg65.2%
distribute-rgt-in65.2%
mul-1-neg65.2%
unsub-neg65.2%
Simplified65.2%
Taylor expanded in x around inf 65.2%
mul-1-neg65.2%
distribute-frac-neg265.2%
Simplified65.2%
if -4.99999999999999979e27 < (/.f64 x y) < 3.99999999999999982e-6Initial program 98.1%
Taylor expanded in x around 0 72.4%
if 3.99999999999999982e-6 < (/.f64 x y) Initial program 93.9%
Taylor expanded in z around 0 60.1%
*-commutative60.1%
associate-*l/58.9%
neg-mul-158.9%
*-lft-identity58.9%
distribute-lft-neg-in58.9%
mul-1-neg58.9%
distribute-rgt-in58.9%
mul-1-neg58.9%
unsub-neg58.9%
Simplified58.9%
Taylor expanded in x around inf 57.9%
mul-1-neg57.9%
distribute-frac-neg257.9%
Simplified57.9%
distribute-frac-neg257.9%
distribute-frac-neg57.9%
associate-*r/59.2%
associate-*l/56.6%
*-commutative56.6%
frac-2neg56.6%
associate-*r/59.2%
add-sqr-sqrt23.0%
sqrt-unprod21.9%
sqr-neg21.9%
sqrt-unprod0.7%
add-sqr-sqrt1.5%
add-sqr-sqrt0.8%
sqrt-unprod32.6%
sqr-neg32.6%
sqrt-unprod36.1%
add-sqr-sqrt59.2%
Applied egg-rr59.2%
Final simplification66.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.5e+73) (not (<= z 6.95e+34))) (+ t (* x (/ z y))) (- t (/ (* t x) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.5e+73) || !(z <= 6.95e+34)) {
tmp = t + (x * (z / y));
} else {
tmp = t - ((t * 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.5d+73)) .or. (.not. (z <= 6.95d+34))) then
tmp = t + (x * (z / y))
else
tmp = t - ((t * 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.5e+73) || !(z <= 6.95e+34)) {
tmp = t + (x * (z / y));
} else {
tmp = t - ((t * x) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.5e+73) or not (z <= 6.95e+34): tmp = t + (x * (z / y)) else: tmp = t - ((t * x) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.5e+73) || !(z <= 6.95e+34)) tmp = Float64(t + Float64(x * Float64(z / y))); else tmp = Float64(t - Float64(Float64(t * x) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.5e+73) || ~((z <= 6.95e+34))) tmp = t + (x * (z / y)); else tmp = t - ((t * x) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.5e+73], N[Not[LessEqual[z, 6.95e+34]], $MachinePrecision]], N[(t + N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t - N[(N[(t * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+73} \lor \neg \left(z \leq 6.95 \cdot 10^{+34}\right):\\
\;\;\;\;t + x \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;t - \frac{t \cdot x}{y}\\
\end{array}
\end{array}
if z < -1.50000000000000005e73 or 6.9500000000000002e34 < z Initial program 97.8%
Taylor expanded in z around inf 89.9%
associate-/l*92.5%
Simplified92.5%
if -1.50000000000000005e73 < z < 6.9500000000000002e34Initial program 95.0%
Taylor expanded in z around 0 82.5%
associate-*r/82.5%
mul-1-neg82.5%
*-commutative82.5%
distribute-rgt-neg-out82.5%
Simplified82.5%
Final simplification86.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.12e+73) (not (<= z 6.95e+34))) (+ t (* x (/ z y))) (* t (- 1.0 (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.12e+73) || !(z <= 6.95e+34)) {
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.12d+73)) .or. (.not. (z <= 6.95d+34))) 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.12e+73) || !(z <= 6.95e+34)) {
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.12e+73) or not (z <= 6.95e+34): 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.12e+73) || !(z <= 6.95e+34)) 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.12e+73) || ~((z <= 6.95e+34))) 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.12e+73], N[Not[LessEqual[z, 6.95e+34]], $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.12 \cdot 10^{+73} \lor \neg \left(z \leq 6.95 \cdot 10^{+34}\right):\\
\;\;\;\;t + x \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\end{array}
\end{array}
if z < -1.12e73 or 6.9500000000000002e34 < z Initial program 97.8%
Taylor expanded in z around inf 89.9%
associate-/l*92.5%
Simplified92.5%
if -1.12e73 < z < 6.9500000000000002e34Initial program 95.0%
Taylor expanded in z around 0 82.5%
*-commutative82.5%
associate-*l/81.5%
neg-mul-181.5%
*-lft-identity81.5%
distribute-lft-neg-in81.5%
mul-1-neg81.5%
distribute-rgt-in81.5%
mul-1-neg81.5%
unsub-neg81.5%
Simplified81.5%
Final simplification85.9%
(FPCore (x y z t) :precision binary64 (+ t (/ (- z t) (/ y x))))
double code(double x, double y, double z, double t) {
return t + ((z - t) / (y / x));
}
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 + ((z - t) / (y / x))
end function
public static double code(double x, double y, double z, double t) {
return t + ((z - t) / (y / x));
}
def code(x, y, z, t): return t + ((z - t) / (y / x))
function code(x, y, z, t) return Float64(t + Float64(Float64(z - t) / Float64(y / x))) end
function tmp = code(x, y, z, t) tmp = t + ((z - t) / (y / x)); end
code[x_, y_, z_, t_] := N[(t + N[(N[(z - t), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t + \frac{z - t}{\frac{y}{x}}
\end{array}
Initial program 96.2%
Taylor expanded in x around 0 95.6%
associate-*r/95.7%
*-commutative95.7%
associate-/r/96.5%
Simplified96.5%
Final simplification96.5%
(FPCore (x y z t) :precision binary64 (+ t (* x (/ (- z t) y))))
double code(double x, double y, double z, double t) {
return t + (x * ((z - t) / 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 + (x * ((z - t) / y))
end function
public static double code(double x, double y, double z, double t) {
return t + (x * ((z - t) / y));
}
def code(x, y, z, t): return t + (x * ((z - t) / y))
function code(x, y, z, t) return Float64(t + Float64(x * Float64(Float64(z - t) / y))) end
function tmp = code(x, y, z, t) tmp = t + (x * ((z - t) / y)); end
code[x_, y_, z_, t_] := N[(t + N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t + x \cdot \frac{z - t}{y}
\end{array}
Initial program 96.2%
associate-*l/95.6%
associate-/l*95.7%
fma-define95.7%
Simplified95.7%
fma-undefine95.7%
Applied egg-rr95.7%
Final simplification95.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 96.2%
Taylor expanded in z around 0 65.3%
*-commutative65.3%
associate-*l/67.0%
neg-mul-167.0%
*-lft-identity67.0%
distribute-lft-neg-in67.0%
mul-1-neg67.0%
distribute-rgt-in67.0%
mul-1-neg67.0%
unsub-neg67.0%
Simplified67.0%
(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 96.2%
Taylor expanded in x around 0 34.2%
(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 2024132
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
:precision binary64
:alt
(! :herbie-platform default (if (< z 689864138640673/250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* (/ x y) (- z t)) t) (if (< z 581748612718609/25000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* x (/ (- z t) y)) t) (+ (* (/ x y) (- z t)) t))))
(+ (* (/ x y) (- z t)) t))