
(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 14 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 (if (<= t -2.9e+91) (+ x (* z (/ (- y x) t))) (+ x (/ (* (- y x) z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.9e+91) {
tmp = x + (z * ((y - x) / t));
} else {
tmp = x + (((y - 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 (t <= (-2.9d+91)) then
tmp = x + (z * ((y - x) / t))
else
tmp = x + (((y - x) * z) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.9e+91) {
tmp = x + (z * ((y - x) / t));
} else {
tmp = x + (((y - x) * z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.9e+91: tmp = x + (z * ((y - x) / t)) else: tmp = x + (((y - x) * z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.9e+91) tmp = Float64(x + Float64(z * Float64(Float64(y - x) / t))); else tmp = Float64(x + Float64(Float64(Float64(y - x) * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.9e+91) tmp = x + (z * ((y - x) / t)); else tmp = x + (((y - x) * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.9e+91], N[(x + N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{+91}:\\
\;\;\;\;x + z \cdot \frac{y - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\
\end{array}
\end{array}
if t < -2.90000000000000014e91Initial program 79.4%
associate-*l/96.6%
Applied egg-rr96.6%
if -2.90000000000000014e91 < t Initial program 98.2%
Final simplification97.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (/ z t))) (t_2 (* x (/ (- z) t))))
(if (<= z -6.1e+147)
(* z (/ y t))
(if (<= z -1.2e+88)
t_2
(if (<= z -1.26e+30)
t_1
(if (<= z 1400.0)
x
(if (<= z 3e+198) t_1 (if (<= z 3e+277) t_2 (/ y (/ t z))))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (z / t);
double t_2 = x * (-z / t);
double tmp;
if (z <= -6.1e+147) {
tmp = z * (y / t);
} else if (z <= -1.2e+88) {
tmp = t_2;
} else if (z <= -1.26e+30) {
tmp = t_1;
} else if (z <= 1400.0) {
tmp = x;
} else if (z <= 3e+198) {
tmp = t_1;
} else if (z <= 3e+277) {
tmp = t_2;
} else {
tmp = y / (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y * (z / t)
t_2 = x * (-z / t)
if (z <= (-6.1d+147)) then
tmp = z * (y / t)
else if (z <= (-1.2d+88)) then
tmp = t_2
else if (z <= (-1.26d+30)) then
tmp = t_1
else if (z <= 1400.0d0) then
tmp = x
else if (z <= 3d+198) then
tmp = t_1
else if (z <= 3d+277) then
tmp = t_2
else
tmp = y / (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (z / t);
double t_2 = x * (-z / t);
double tmp;
if (z <= -6.1e+147) {
tmp = z * (y / t);
} else if (z <= -1.2e+88) {
tmp = t_2;
} else if (z <= -1.26e+30) {
tmp = t_1;
} else if (z <= 1400.0) {
tmp = x;
} else if (z <= 3e+198) {
tmp = t_1;
} else if (z <= 3e+277) {
tmp = t_2;
} else {
tmp = y / (t / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (z / t) t_2 = x * (-z / t) tmp = 0 if z <= -6.1e+147: tmp = z * (y / t) elif z <= -1.2e+88: tmp = t_2 elif z <= -1.26e+30: tmp = t_1 elif z <= 1400.0: tmp = x elif z <= 3e+198: tmp = t_1 elif z <= 3e+277: tmp = t_2 else: tmp = y / (t / z) return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(z / t)) t_2 = Float64(x * Float64(Float64(-z) / t)) tmp = 0.0 if (z <= -6.1e+147) tmp = Float64(z * Float64(y / t)); elseif (z <= -1.2e+88) tmp = t_2; elseif (z <= -1.26e+30) tmp = t_1; elseif (z <= 1400.0) tmp = x; elseif (z <= 3e+198) tmp = t_1; elseif (z <= 3e+277) tmp = t_2; else tmp = Float64(y / Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (z / t); t_2 = x * (-z / t); tmp = 0.0; if (z <= -6.1e+147) tmp = z * (y / t); elseif (z <= -1.2e+88) tmp = t_2; elseif (z <= -1.26e+30) tmp = t_1; elseif (z <= 1400.0) tmp = x; elseif (z <= 3e+198) tmp = t_1; elseif (z <= 3e+277) tmp = t_2; else tmp = y / (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[((-z) / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.1e+147], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.2e+88], t$95$2, If[LessEqual[z, -1.26e+30], t$95$1, If[LessEqual[z, 1400.0], x, If[LessEqual[z, 3e+198], t$95$1, If[LessEqual[z, 3e+277], t$95$2, N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{t}\\
t_2 := x \cdot \frac{-z}{t}\\
\mathbf{if}\;z \leq -6.1 \cdot 10^{+147}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{+88}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.26 \cdot 10^{+30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1400:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+198}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+277}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if z < -6.10000000000000033e147Initial program 82.4%
Taylor expanded in t around 0 76.6%
Taylor expanded in y around inf 54.1%
associate-*l/65.5%
*-commutative65.5%
Simplified65.5%
if -6.10000000000000033e147 < z < -1.2e88 or 3.00000000000000019e198 < z < 2.99999999999999981e277Initial program 94.0%
Taylor expanded in t around 0 88.0%
Taylor expanded in y around 0 66.8%
associate-*r/66.8%
mul-1-neg66.8%
distribute-rgt-neg-out66.8%
associate-*l/69.7%
Simplified69.7%
if -1.2e88 < z < -1.26e30 or 1400 < z < 3.00000000000000019e198Initial program 90.6%
Taylor expanded in t around 0 80.7%
Taylor expanded in y around inf 63.0%
associate-*r/66.8%
Simplified66.8%
if -1.26e30 < z < 1400Initial program 98.9%
Taylor expanded in z around 0 69.7%
if 2.99999999999999981e277 < z Initial program 77.7%
Taylor expanded in t around 0 77.7%
Taylor expanded in y around inf 65.2%
associate-*r/75.2%
Simplified75.2%
clear-num75.2%
un-div-inv75.6%
Applied egg-rr75.6%
Final simplification68.8%
(FPCore (x y z t)
:precision binary64
(if (<= z -2e-19)
(* z (/ (- y x) t))
(if (<= z -1.6e-67)
x
(if (or (<= z -1.85e-106) (not (<= z 15.6))) (* (- y x) (/ z t)) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e-19) {
tmp = z * ((y - x) / t);
} else if (z <= -1.6e-67) {
tmp = x;
} else if ((z <= -1.85e-106) || !(z <= 15.6)) {
tmp = (y - 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 <= (-2d-19)) then
tmp = z * ((y - x) / t)
else if (z <= (-1.6d-67)) then
tmp = x
else if ((z <= (-1.85d-106)) .or. (.not. (z <= 15.6d0))) then
tmp = (y - 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 <= -2e-19) {
tmp = z * ((y - x) / t);
} else if (z <= -1.6e-67) {
tmp = x;
} else if ((z <= -1.85e-106) || !(z <= 15.6)) {
tmp = (y - x) * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2e-19: tmp = z * ((y - x) / t) elif z <= -1.6e-67: tmp = x elif (z <= -1.85e-106) or not (z <= 15.6): tmp = (y - x) * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2e-19) tmp = Float64(z * Float64(Float64(y - x) / t)); elseif (z <= -1.6e-67) tmp = x; elseif ((z <= -1.85e-106) || !(z <= 15.6)) tmp = Float64(Float64(y - x) * Float64(z / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2e-19) tmp = z * ((y - x) / t); elseif (z <= -1.6e-67) tmp = x; elseif ((z <= -1.85e-106) || ~((z <= 15.6))) tmp = (y - x) * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2e-19], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.6e-67], x, If[Or[LessEqual[z, -1.85e-106], N[Not[LessEqual[z, 15.6]], $MachinePrecision]], N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-19}:\\
\;\;\;\;z \cdot \frac{y - x}{t}\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-67}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.85 \cdot 10^{-106} \lor \neg \left(z \leq 15.6\right):\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2e-19Initial program 86.9%
Taylor expanded in t around 0 77.1%
associate-*l/99.7%
Applied egg-rr85.0%
if -2e-19 < z < -1.60000000000000011e-67 or -1.8499999999999999e-106 < z < 15.5999999999999996Initial program 98.8%
Taylor expanded in z around 0 75.3%
if -1.60000000000000011e-67 < z < -1.8499999999999999e-106 or 15.5999999999999996 < z Initial program 91.8%
Taylor expanded in t around 0 82.0%
*-commutative82.0%
associate-*l/85.3%
Applied egg-rr85.3%
Final simplification80.7%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.8e+29)
(* z (/ (- y x) t))
(if (<= z -7e-91)
(- x (* x (/ z t)))
(if (<= z 1.6e+66) (+ x (/ (* y z) t)) (* (- y x) (/ z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.8e+29) {
tmp = z * ((y - x) / t);
} else if (z <= -7e-91) {
tmp = x - (x * (z / t));
} else if (z <= 1.6e+66) {
tmp = x + ((y * z) / t);
} else {
tmp = (y - 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 <= (-2.8d+29)) then
tmp = z * ((y - x) / t)
else if (z <= (-7d-91)) then
tmp = x - (x * (z / t))
else if (z <= 1.6d+66) then
tmp = x + ((y * z) / t)
else
tmp = (y - 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 <= -2.8e+29) {
tmp = z * ((y - x) / t);
} else if (z <= -7e-91) {
tmp = x - (x * (z / t));
} else if (z <= 1.6e+66) {
tmp = x + ((y * z) / t);
} else {
tmp = (y - x) * (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.8e+29: tmp = z * ((y - x) / t) elif z <= -7e-91: tmp = x - (x * (z / t)) elif z <= 1.6e+66: tmp = x + ((y * z) / t) else: tmp = (y - x) * (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.8e+29) tmp = Float64(z * Float64(Float64(y - x) / t)); elseif (z <= -7e-91) tmp = Float64(x - Float64(x * Float64(z / t))); elseif (z <= 1.6e+66) tmp = Float64(x + Float64(Float64(y * z) / t)); else tmp = Float64(Float64(y - x) * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.8e+29) tmp = z * ((y - x) / t); elseif (z <= -7e-91) tmp = x - (x * (z / t)); elseif (z <= 1.6e+66) tmp = x + ((y * z) / t); else tmp = (y - x) * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.8e+29], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7e-91], N[(x - N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e+66], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+29}:\\
\;\;\;\;z \cdot \frac{y - x}{t}\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-91}:\\
\;\;\;\;x - x \cdot \frac{z}{t}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+66}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -2.8e29Initial program 85.7%
Taylor expanded in t around 0 78.6%
associate-*l/99.7%
Applied egg-rr87.3%
if -2.8e29 < z < -6.9999999999999997e-91Initial program 99.7%
Taylor expanded in x around inf 87.2%
*-commutative87.2%
distribute-lft-in87.2%
*-rgt-identity87.2%
mul-1-neg87.2%
distribute-rgt-neg-in87.2%
unsub-neg87.2%
Simplified87.2%
if -6.9999999999999997e-91 < z < 1.6e66Initial program 98.0%
Taylor expanded in y around inf 94.6%
*-commutative94.6%
Simplified94.6%
if 1.6e66 < z Initial program 90.7%
Taylor expanded in t around 0 87.4%
*-commutative87.4%
associate-*l/91.8%
Applied egg-rr91.8%
Final simplification91.8%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.65e+30)
(* z (/ (- y x) t))
(if (<= z -7.5e-91)
(- x (* x (/ z t)))
(if (<= z 2.8e+68) (+ x (/ (* y z) t)) (/ (- y x) (/ t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.65e+30) {
tmp = z * ((y - x) / t);
} else if (z <= -7.5e-91) {
tmp = x - (x * (z / t));
} else if (z <= 2.8e+68) {
tmp = x + ((y * z) / t);
} else {
tmp = (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 (z <= (-1.65d+30)) then
tmp = z * ((y - x) / t)
else if (z <= (-7.5d-91)) then
tmp = x - (x * (z / t))
else if (z <= 2.8d+68) then
tmp = x + ((y * z) / t)
else
tmp = (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 (z <= -1.65e+30) {
tmp = z * ((y - x) / t);
} else if (z <= -7.5e-91) {
tmp = x - (x * (z / t));
} else if (z <= 2.8e+68) {
tmp = x + ((y * z) / t);
} else {
tmp = (y - x) / (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.65e+30: tmp = z * ((y - x) / t) elif z <= -7.5e-91: tmp = x - (x * (z / t)) elif z <= 2.8e+68: tmp = x + ((y * z) / t) else: tmp = (y - x) / (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.65e+30) tmp = Float64(z * Float64(Float64(y - x) / t)); elseif (z <= -7.5e-91) tmp = Float64(x - Float64(x * Float64(z / t))); elseif (z <= 2.8e+68) tmp = Float64(x + Float64(Float64(y * z) / t)); else tmp = Float64(Float64(y - x) / Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.65e+30) tmp = z * ((y - x) / t); elseif (z <= -7.5e-91) tmp = x - (x * (z / t)); elseif (z <= 2.8e+68) tmp = x + ((y * z) / t); else tmp = (y - x) / (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.65e+30], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.5e-91], N[(x - N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e+68], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+30}:\\
\;\;\;\;z \cdot \frac{y - x}{t}\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-91}:\\
\;\;\;\;x - x \cdot \frac{z}{t}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+68}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - x}{\frac{t}{z}}\\
\end{array}
\end{array}
if z < -1.65000000000000013e30Initial program 85.7%
Taylor expanded in t around 0 78.6%
associate-*l/99.7%
Applied egg-rr87.3%
if -1.65000000000000013e30 < z < -7.50000000000000051e-91Initial program 99.7%
Taylor expanded in x around inf 87.2%
*-commutative87.2%
distribute-lft-in87.2%
*-rgt-identity87.2%
mul-1-neg87.2%
distribute-rgt-neg-in87.2%
unsub-neg87.2%
Simplified87.2%
if -7.50000000000000051e-91 < z < 2.8e68Initial program 98.0%
Taylor expanded in y around inf 94.6%
*-commutative94.6%
Simplified94.6%
if 2.8e68 < z Initial program 90.7%
Taylor expanded in t around 0 87.4%
associate-*l/96.6%
Applied egg-rr90.2%
Taylor expanded in y around 0 71.8%
associate-*r/68.4%
+-commutative68.4%
mul-1-neg68.4%
associate-*r/71.5%
unsub-neg71.5%
associate-*r/73.5%
associate-/l*71.6%
*-commutative71.6%
associate-*l/68.5%
associate-/l*71.5%
div-sub91.9%
associate-/l*87.4%
*-commutative87.4%
associate-/l*90.2%
Simplified90.2%
Taylor expanded in z around 0 87.4%
*-commutative87.4%
associate-/l*91.9%
Simplified91.9%
Final simplification91.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.25e-102) (not (<= z 4.55e-159))) (+ x (* z (/ (- y x) t))) (+ x (/ (* y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.25e-102) || !(z <= 4.55e-159)) {
tmp = x + (z * ((y - x) / 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 ((z <= (-1.25d-102)) .or. (.not. (z <= 4.55d-159))) then
tmp = x + (z * ((y - x) / 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 ((z <= -1.25e-102) || !(z <= 4.55e-159)) {
tmp = x + (z * ((y - x) / t));
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.25e-102) or not (z <= 4.55e-159): tmp = x + (z * ((y - x) / t)) else: tmp = x + ((y * z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.25e-102) || !(z <= 4.55e-159)) tmp = Float64(x + Float64(z * Float64(Float64(y - x) / t))); else tmp = Float64(x + Float64(Float64(y * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.25e-102) || ~((z <= 4.55e-159))) tmp = x + (z * ((y - x) / t)); else tmp = x + ((y * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.25e-102], N[Not[LessEqual[z, 4.55e-159]], $MachinePrecision]], N[(x + N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-102} \lor \neg \left(z \leq 4.55 \cdot 10^{-159}\right):\\
\;\;\;\;x + z \cdot \frac{y - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\end{array}
\end{array}
if z < -1.25000000000000006e-102 or 4.54999999999999998e-159 < z Initial program 91.4%
associate-*l/97.2%
Applied egg-rr97.2%
if -1.25000000000000006e-102 < z < 4.54999999999999998e-159Initial program 99.9%
Taylor expanded in y around inf 97.8%
*-commutative97.8%
Simplified97.8%
Final simplification97.4%
(FPCore (x y z t) :precision binary64 (if (<= t -1.25e+57) x (if (<= t 1.24e+51) (* (- y x) (/ z t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.25e+57) {
tmp = x;
} else if (t <= 1.24e+51) {
tmp = (y - 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 (t <= (-1.25d+57)) then
tmp = x
else if (t <= 1.24d+51) then
tmp = (y - 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 (t <= -1.25e+57) {
tmp = x;
} else if (t <= 1.24e+51) {
tmp = (y - x) * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.25e+57: tmp = x elif t <= 1.24e+51: tmp = (y - x) * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.25e+57) tmp = x; elseif (t <= 1.24e+51) tmp = Float64(Float64(y - x) * Float64(z / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.25e+57) tmp = x; elseif (t <= 1.24e+51) tmp = (y - x) * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.25e+57], x, If[LessEqual[t, 1.24e+51], N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{+57}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 1.24 \cdot 10^{+51}:\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.24999999999999993e57 or 1.24000000000000001e51 < t Initial program 87.9%
Taylor expanded in z around 0 72.3%
if -1.24999999999999993e57 < t < 1.24000000000000001e51Initial program 98.9%
Taylor expanded in t around 0 82.8%
*-commutative82.8%
associate-*l/81.1%
Applied egg-rr81.1%
Final simplification77.1%
(FPCore (x y z t) :precision binary64 (if (<= z -1.35e+54) (* z (/ (- y x) t)) (if (<= z 2.9e+69) (+ x (* y (/ z t))) (* (- y x) (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.35e+54) {
tmp = z * ((y - x) / t);
} else if (z <= 2.9e+69) {
tmp = x + (y * (z / t));
} else {
tmp = (y - 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 <= (-1.35d+54)) then
tmp = z * ((y - x) / t)
else if (z <= 2.9d+69) then
tmp = x + (y * (z / t))
else
tmp = (y - 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 <= -1.35e+54) {
tmp = z * ((y - x) / t);
} else if (z <= 2.9e+69) {
tmp = x + (y * (z / t));
} else {
tmp = (y - x) * (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.35e+54: tmp = z * ((y - x) / t) elif z <= 2.9e+69: tmp = x + (y * (z / t)) else: tmp = (y - x) * (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.35e+54) tmp = Float64(z * Float64(Float64(y - x) / t)); elseif (z <= 2.9e+69) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(Float64(y - x) * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.35e+54) tmp = z * ((y - x) / t); elseif (z <= 2.9e+69) tmp = x + (y * (z / t)); else tmp = (y - x) * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.35e+54], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e+69], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+54}:\\
\;\;\;\;z \cdot \frac{y - x}{t}\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+69}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -1.35000000000000005e54Initial program 84.5%
Taylor expanded in t around 0 78.9%
associate-*l/99.8%
Applied egg-rr88.3%
if -1.35000000000000005e54 < z < 2.8999999999999998e69Initial program 98.3%
Taylor expanded in y around inf 89.7%
associate-*r/23.8%
Simplified88.1%
if 2.8999999999999998e69 < z Initial program 90.7%
Taylor expanded in t around 0 87.4%
*-commutative87.4%
associate-*l/91.8%
Applied egg-rr91.8%
Final simplification89.0%
(FPCore (x y z t) :precision binary64 (if (<= z -1.45e+53) (* z (/ (- y x) t)) (if (<= z 1.8e+69) (+ x (/ (* y z) t)) (* (- y x) (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.45e+53) {
tmp = z * ((y - x) / t);
} else if (z <= 1.8e+69) {
tmp = x + ((y * z) / t);
} else {
tmp = (y - 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 <= (-1.45d+53)) then
tmp = z * ((y - x) / t)
else if (z <= 1.8d+69) then
tmp = x + ((y * z) / t)
else
tmp = (y - 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 <= -1.45e+53) {
tmp = z * ((y - x) / t);
} else if (z <= 1.8e+69) {
tmp = x + ((y * z) / t);
} else {
tmp = (y - x) * (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.45e+53: tmp = z * ((y - x) / t) elif z <= 1.8e+69: tmp = x + ((y * z) / t) else: tmp = (y - x) * (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.45e+53) tmp = Float64(z * Float64(Float64(y - x) / t)); elseif (z <= 1.8e+69) tmp = Float64(x + Float64(Float64(y * z) / t)); else tmp = Float64(Float64(y - x) * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.45e+53) tmp = z * ((y - x) / t); elseif (z <= 1.8e+69) tmp = x + ((y * z) / t); else tmp = (y - x) * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.45e+53], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e+69], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+53}:\\
\;\;\;\;z \cdot \frac{y - x}{t}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+69}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -1.4500000000000001e53Initial program 84.5%
Taylor expanded in t around 0 78.9%
associate-*l/99.8%
Applied egg-rr88.3%
if -1.4500000000000001e53 < z < 1.8000000000000001e69Initial program 98.3%
Taylor expanded in y around inf 89.7%
*-commutative89.7%
Simplified89.7%
if 1.8000000000000001e69 < z Initial program 90.7%
Taylor expanded in t around 0 87.4%
*-commutative87.4%
associate-*l/91.8%
Applied egg-rr91.8%
Final simplification89.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.2e+29) (not (<= z 360.0))) (* y (/ z t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.2e+29) || !(z <= 360.0)) {
tmp = y * (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 <= (-2.2d+29)) .or. (.not. (z <= 360.0d0))) then
tmp = y * (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 <= -2.2e+29) || !(z <= 360.0)) {
tmp = y * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.2e+29) or not (z <= 360.0): tmp = y * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.2e+29) || !(z <= 360.0)) tmp = Float64(y * Float64(z / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.2e+29) || ~((z <= 360.0))) tmp = y * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.2e+29], N[Not[LessEqual[z, 360.0]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+29} \lor \neg \left(z \leq 360\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.2000000000000001e29 or 360 < z Initial program 88.4%
Taylor expanded in t around 0 81.3%
Taylor expanded in y around inf 53.7%
associate-*r/59.5%
Simplified59.5%
if -2.2000000000000001e29 < z < 360Initial program 98.9%
Taylor expanded in z around 0 69.7%
Final simplification64.8%
(FPCore (x y z t) :precision binary64 (if (<= z -1.6e+30) (* z (/ y t)) (if (<= z 3600.0) x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.6e+30) {
tmp = z * (y / t);
} else if (z <= 3600.0) {
tmp = x;
} else {
tmp = 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 (z <= (-1.6d+30)) then
tmp = z * (y / t)
else if (z <= 3600.0d0) then
tmp = x
else
tmp = y * (z / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.6e+30) {
tmp = z * (y / t);
} else if (z <= 3600.0) {
tmp = x;
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.6e+30: tmp = z * (y / t) elif z <= 3600.0: tmp = x else: tmp = y * (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.6e+30) tmp = Float64(z * Float64(y / t)); elseif (z <= 3600.0) tmp = x; else tmp = Float64(y * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.6e+30) tmp = z * (y / t); elseif (z <= 3600.0) tmp = x; else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.6e+30], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3600.0], x, N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+30}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 3600:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -1.59999999999999986e30Initial program 85.7%
Taylor expanded in t around 0 78.6%
Taylor expanded in y around inf 46.8%
associate-*l/55.5%
*-commutative55.5%
Simplified55.5%
if -1.59999999999999986e30 < z < 3600Initial program 98.9%
Taylor expanded in z around 0 69.7%
if 3600 < z Initial program 90.6%
Taylor expanded in t around 0 83.4%
Taylor expanded in y around inf 59.1%
associate-*r/63.0%
Simplified63.0%
Final simplification64.9%
(FPCore (x y z t) :precision binary64 (if (<= z -1.7e+30) (* z (/ y t)) (if (<= z 550.0) x (/ y (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.7e+30) {
tmp = z * (y / t);
} else if (z <= 550.0) {
tmp = x;
} else {
tmp = y / (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 (z <= (-1.7d+30)) then
tmp = z * (y / t)
else if (z <= 550.0d0) then
tmp = x
else
tmp = y / (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.7e+30) {
tmp = z * (y / t);
} else if (z <= 550.0) {
tmp = x;
} else {
tmp = y / (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.7e+30: tmp = z * (y / t) elif z <= 550.0: tmp = x else: tmp = y / (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.7e+30) tmp = Float64(z * Float64(y / t)); elseif (z <= 550.0) tmp = x; else tmp = Float64(y / Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.7e+30) tmp = z * (y / t); elseif (z <= 550.0) tmp = x; else tmp = y / (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.7e+30], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 550.0], x, N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+30}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 550:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if z < -1.7000000000000001e30Initial program 85.7%
Taylor expanded in t around 0 78.6%
Taylor expanded in y around inf 46.8%
associate-*l/55.5%
*-commutative55.5%
Simplified55.5%
if -1.7000000000000001e30 < z < 550Initial program 98.9%
Taylor expanded in z around 0 69.7%
if 550 < z Initial program 90.6%
Taylor expanded in t around 0 83.4%
Taylor expanded in y around inf 59.1%
associate-*r/63.0%
Simplified63.0%
clear-num63.0%
un-div-inv63.1%
Applied egg-rr63.1%
Final simplification64.9%
(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.9%
associate-/l*97.7%
Simplified97.7%
Final simplification97.7%
(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.9%
Taylor expanded in z around 0 42.7%
Final simplification42.7%
(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 2023181
(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)))