
(FPCore (x y z t) :precision binary64 (+ x (/ (* (- y x) z) t)))
double code(double x, double y, double z, double t) {
return x + (((y - x) * 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 = x + (((y - x) * z) / t)
end function
public static double code(double x, double y, double z, double t) {
return x + (((y - x) * z) / t);
}
def code(x, y, z, t): return x + (((y - x) * z) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(y - x) * z) / t)) end
function tmp = code(x, y, z, t) tmp = x + (((y - x) * z) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot z}{t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (/ (* (- y x) z) t)))
double code(double x, double y, double z, double t) {
return x + (((y - x) * 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 = x + (((y - x) * z) / t)
end function
public static double code(double x, double y, double z, double t) {
return x + (((y - x) * z) / t);
}
def code(x, y, z, t): return x + (((y - x) * z) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(y - x) * z) / t)) end
function tmp = code(x, y, z, t) tmp = x + (((y - x) * z) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot z}{t}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (/ (* (- y x) z) t))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+284)))
(+ x (* z (/ (- y x) t)))
t_1)))
double code(double x, double y, double z, double t) {
double t_1 = x + (((y - x) * z) / t);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+284)) {
tmp = x + (z * ((y - x) / t));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = x + (((y - x) * z) / t);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+284)) {
tmp = x + (z * ((y - x) / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (((y - x) * z) / t) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 1e+284): tmp = x + (z * ((y - x) / t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(Float64(y - x) * z) / t)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+284)) tmp = Float64(x + Float64(z * Float64(Float64(y - x) / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (((y - x) * z) / t); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 1e+284))) tmp = x + (z * ((y - x) / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+284]], $MachinePrecision]], N[(x + N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 10^{+284}\right):\\
\;\;\;\;x + z \cdot \frac{y - x}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) < -inf.0 or 1.00000000000000008e284 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) Initial program 82.8%
associate-*l/100.0%
Simplified100.0%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) < 1.00000000000000008e284Initial program 98.4%
Final simplification98.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1e+100) (not (<= x 5.3e-20))) (* x (- 1.0 (/ z t))) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1e+100) || !(x <= 5.3e-20)) {
tmp = x * (1.0 - (z / t));
} else {
tmp = x + (y * (z / 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 <= (-1d+100)) .or. (.not. (x <= 5.3d-20))) then
tmp = x * (1.0d0 - (z / t))
else
tmp = x + (y * (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1e+100) || !(x <= 5.3e-20)) {
tmp = x * (1.0 - (z / t));
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1e+100) or not (x <= 5.3e-20): tmp = x * (1.0 - (z / t)) else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1e+100) || !(x <= 5.3e-20)) tmp = Float64(x * Float64(1.0 - Float64(z / t))); else tmp = Float64(x + Float64(y * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1e+100) || ~((x <= 5.3e-20))) tmp = x * (1.0 - (z / t)); else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1e+100], N[Not[LessEqual[x, 5.3e-20]], $MachinePrecision]], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{+100} \lor \neg \left(x \leq 5.3 \cdot 10^{-20}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if x < -1.00000000000000002e100 or 5.3000000000000002e-20 < x Initial program 93.9%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in x around inf 97.4%
mul-1-neg97.4%
unsub-neg97.4%
Simplified97.4%
if -1.00000000000000002e100 < x < 5.3000000000000002e-20Initial program 93.1%
associate-*l/94.9%
Simplified94.9%
Taylor expanded in y around inf 83.3%
associate-*r/88.6%
Simplified88.6%
Final simplification92.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -4.5e+97) (not (<= x 3.7e-20))) (- x (/ x (/ t z))) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.5e+97) || !(x <= 3.7e-20)) {
tmp = x - (x / (t / z));
} else {
tmp = x + (y * (z / 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 <= (-4.5d+97)) .or. (.not. (x <= 3.7d-20))) then
tmp = x - (x / (t / z))
else
tmp = x + (y * (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.5e+97) || !(x <= 3.7e-20)) {
tmp = x - (x / (t / z));
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4.5e+97) or not (x <= 3.7e-20): tmp = x - (x / (t / z)) else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -4.5e+97) || !(x <= 3.7e-20)) tmp = Float64(x - Float64(x / Float64(t / z))); else tmp = Float64(x + Float64(y * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -4.5e+97) || ~((x <= 3.7e-20))) tmp = x - (x / (t / z)); else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.5e+97], N[Not[LessEqual[x, 3.7e-20]], $MachinePrecision]], N[(x - N[(x / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+97} \lor \neg \left(x \leq 3.7 \cdot 10^{-20}\right):\\
\;\;\;\;x - \frac{x}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if x < -4.49999999999999976e97 or 3.7000000000000001e-20 < x Initial program 93.9%
associate-*l/95.3%
Simplified95.3%
*-commutative95.3%
clear-num95.2%
un-div-inv95.3%
Applied egg-rr95.3%
Taylor expanded in y around 0 91.4%
mul-1-neg91.4%
associate-/l*97.4%
Simplified97.4%
if -4.49999999999999976e97 < x < 3.7000000000000001e-20Initial program 93.1%
associate-*l/94.9%
Simplified94.9%
Taylor expanded in y around inf 83.3%
associate-*r/88.6%
Simplified88.6%
Final simplification92.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.5e-72) (not (<= z 1.2e+28))) (* x (/ (- z) t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.5e-72) || !(z <= 1.2e+28)) {
tmp = x * (-z / t);
} else {
tmp = 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 ((z <= (-4.5d-72)) .or. (.not. (z <= 1.2d+28))) then
tmp = x * (-z / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.5e-72) || !(z <= 1.2e+28)) {
tmp = x * (-z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.5e-72) or not (z <= 1.2e+28): tmp = x * (-z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.5e-72) || !(z <= 1.2e+28)) tmp = Float64(x * Float64(Float64(-z) / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4.5e-72) || ~((z <= 1.2e+28))) tmp = x * (-z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.5e-72], N[Not[LessEqual[z, 1.2e+28]], $MachinePrecision]], N[(x * N[((-z) / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-72} \lor \neg \left(z \leq 1.2 \cdot 10^{+28}\right):\\
\;\;\;\;x \cdot \frac{-z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.5e-72 or 1.19999999999999991e28 < z Initial program 88.3%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in x around inf 66.7%
mul-1-neg66.7%
unsub-neg66.7%
Simplified66.7%
Taylor expanded in z around inf 52.1%
mul-1-neg52.1%
distribute-frac-neg52.1%
Simplified52.1%
if -4.5e-72 < z < 1.19999999999999991e28Initial program 98.2%
associate-*l/92.2%
Simplified92.2%
Taylor expanded in t around inf 66.8%
Final simplification59.9%
(FPCore (x y z t) :precision binary64 (if (<= z -4.5e-72) (/ (* x z) (- t)) (if (<= z 1.9e+31) x (* x (/ (- z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.5e-72) {
tmp = (x * z) / -t;
} else if (z <= 1.9e+31) {
tmp = x;
} else {
tmp = x * (-z / 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 (z <= (-4.5d-72)) then
tmp = (x * z) / -t
else if (z <= 1.9d+31) then
tmp = x
else
tmp = x * (-z / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.5e-72) {
tmp = (x * z) / -t;
} else if (z <= 1.9e+31) {
tmp = x;
} else {
tmp = x * (-z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.5e-72: tmp = (x * z) / -t elif z <= 1.9e+31: tmp = x else: tmp = x * (-z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.5e-72) tmp = Float64(Float64(x * z) / Float64(-t)); elseif (z <= 1.9e+31) tmp = x; else tmp = Float64(x * Float64(Float64(-z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.5e-72) tmp = (x * z) / -t; elseif (z <= 1.9e+31) tmp = x; else tmp = x * (-z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.5e-72], N[(N[(x * z), $MachinePrecision] / (-t)), $MachinePrecision], If[LessEqual[z, 1.9e+31], x, N[(x * N[((-z) / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-72}:\\
\;\;\;\;\frac{x \cdot z}{-t}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+31}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-z}{t}\\
\end{array}
\end{array}
if z < -4.5e-72Initial program 90.8%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in x around inf 65.9%
mul-1-neg65.9%
unsub-neg65.9%
Simplified65.9%
Taylor expanded in z around inf 49.9%
mul-1-neg49.9%
distribute-frac-neg49.9%
Simplified49.9%
Taylor expanded in x around 0 50.0%
mul-1-neg50.0%
associate-*l/48.7%
distribute-lft-neg-out48.7%
*-commutative48.7%
distribute-neg-frac48.7%
Simplified48.7%
frac-2neg48.7%
remove-double-neg48.7%
associate-*r/50.0%
*-commutative50.0%
Applied egg-rr50.0%
if -4.5e-72 < z < 1.9000000000000001e31Initial program 98.2%
associate-*l/92.2%
Simplified92.2%
Taylor expanded in t around inf 66.8%
if 1.9000000000000001e31 < z Initial program 83.0%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in x around inf 68.5%
mul-1-neg68.5%
unsub-neg68.5%
Simplified68.5%
Taylor expanded in z around inf 56.8%
mul-1-neg56.8%
distribute-frac-neg56.8%
Simplified56.8%
Final simplification59.9%
(FPCore (x y z t) :precision binary64 (+ x (* z (/ (- y x) t))))
double code(double x, double y, double z, double t) {
return x + (z * ((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 = x + (z * ((y - x) / t))
end function
public static double code(double x, double y, double z, double t) {
return x + (z * ((y - x) / t));
}
def code(x, y, z, t): return x + (z * ((y - x) / t))
function code(x, y, z, t) return Float64(x + Float64(z * Float64(Float64(y - x) / t))) end
function tmp = code(x, y, z, t) tmp = x + (z * ((y - x) / t)); end
code[x_, y_, z_, t_] := N[(x + N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + z \cdot \frac{y - x}{t}
\end{array}
Initial program 93.5%
associate-*l/95.1%
Simplified95.1%
Final simplification95.1%
(FPCore (x y z t) :precision binary64 (+ x (/ z (/ t (- y x)))))
double code(double x, double y, double z, double t) {
return x + (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 = x + (z / (t / (y - x)))
end function
public static double code(double x, double y, double z, double t) {
return x + (z / (t / (y - x)));
}
def code(x, y, z, t): return x + (z / (t / (y - x)))
function code(x, y, z, t) return Float64(x + Float64(z / Float64(t / Float64(y - x)))) end
function tmp = code(x, y, z, t) tmp = x + (z / (t / (y - x))); end
code[x_, y_, z_, t_] := N[(x + N[(z / N[(t / N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z}{\frac{t}{y - x}}
\end{array}
Initial program 93.5%
associate-*l/95.1%
Simplified95.1%
*-commutative95.1%
clear-num95.0%
un-div-inv95.2%
Applied egg-rr95.2%
Final simplification95.2%
(FPCore (x y z t) :precision binary64 (+ x (/ (- y x) (/ t z))))
double code(double x, double y, double z, double t) {
return x + ((y - x) / (t / z));
}
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 - x) / (t / z))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - x) / (t / z));
}
def code(x, y, z, t): return x + ((y - x) / (t / z))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - x) / Float64(t / z))) end
function tmp = code(x, y, z, t) tmp = x + ((y - x) / (t / z)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y - x}{\frac{t}{z}}
\end{array}
Initial program 93.5%
associate-/l*98.9%
Simplified98.9%
Final simplification98.9%
(FPCore (x y z t) :precision binary64 (* x (- 1.0 (/ z t))))
double code(double x, double y, double z, double t) {
return x * (1.0 - (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 = x * (1.0d0 - (z / t))
end function
public static double code(double x, double y, double z, double t) {
return x * (1.0 - (z / t));
}
def code(x, y, z, t): return x * (1.0 - (z / t))
function code(x, y, z, t) return Float64(x * Float64(1.0 - Float64(z / t))) end
function tmp = code(x, y, z, t) tmp = x * (1.0 - (z / t)); end
code[x_, y_, z_, t_] := N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - \frac{z}{t}\right)
\end{array}
Initial program 93.5%
associate-*l/95.1%
Simplified95.1%
Taylor expanded in x around inf 71.2%
mul-1-neg71.2%
unsub-neg71.2%
Simplified71.2%
Final simplification71.2%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return 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 = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.5%
associate-*l/95.1%
Simplified95.1%
Taylor expanded in t around inf 43.0%
Final simplification43.0%
(FPCore (x y z t)
:precision binary64
(if (< x -9.025511195533005e-135)
(- x (* (/ z t) (- x y)))
(if (< x 4.275032163700715e-250)
(+ x (* (/ (- y x) t) z))
(+ x (/ (- y x) (/ t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x < -9.025511195533005e-135) {
tmp = x - ((z / t) * (x - y));
} else if (x < 4.275032163700715e-250) {
tmp = x + (((y - x) / t) * z);
} else {
tmp = x + ((y - x) / (t / z));
}
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 < (-9.025511195533005d-135)) then
tmp = x - ((z / t) * (x - y))
else if (x < 4.275032163700715d-250) then
tmp = x + (((y - x) / t) * z)
else
tmp = x + ((y - x) / (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x < -9.025511195533005e-135) {
tmp = x - ((z / t) * (x - y));
} else if (x < 4.275032163700715e-250) {
tmp = x + (((y - x) / t) * z);
} else {
tmp = x + ((y - x) / (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x < -9.025511195533005e-135: tmp = x - ((z / t) * (x - y)) elif x < 4.275032163700715e-250: tmp = x + (((y - x) / t) * z) else: tmp = x + ((y - x) / (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x < -9.025511195533005e-135) tmp = Float64(x - Float64(Float64(z / t) * Float64(x - y))); elseif (x < 4.275032163700715e-250) tmp = Float64(x + Float64(Float64(Float64(y - x) / t) * z)); else tmp = Float64(x + Float64(Float64(y - x) / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x < -9.025511195533005e-135) tmp = x - ((z / t) * (x - y)); elseif (x < 4.275032163700715e-250) tmp = x + (((y - x) / t) * z); else tmp = x + ((y - x) / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Less[x, -9.025511195533005e-135], N[(x - N[(N[(z / t), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[x, 4.275032163700715e-250], N[(x + N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x < -9.025511195533005 \cdot 10^{-135}:\\
\;\;\;\;x - \frac{z}{t} \cdot \left(x - y\right)\\
\mathbf{elif}\;x < 4.275032163700715 \cdot 10^{-250}:\\
\;\;\;\;x + \frac{y - x}{t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\
\end{array}
\end{array}
herbie shell --seed 2023293
(FPCore (x y z t)
:name "Numeric.Histogram:binBounds from Chart-1.5.3"
:precision binary64
:herbie-target
(if (< x -9.025511195533005e-135) (- x (* (/ z t) (- x y))) (if (< x 4.275032163700715e-250) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z)))))
(+ x (/ (* (- y x) z) t)))