
(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(y - x) * Float64(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[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \frac{z}{t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 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(y - x) * Float64(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[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \frac{z}{t}
\end{array}
(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(y - x) * Float64(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[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \frac{z}{t}
\end{array}
Initial program 98.8%
Final simplification98.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.22e-290) (not (<= t 2.95e-154))) (+ x (* y (/ z t))) (* x (/ z (- t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.22e-290) || !(t <= 2.95e-154)) {
tmp = x + (y * (z / t));
} 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 ((t <= (-1.22d-290)) .or. (.not. (t <= 2.95d-154))) then
tmp = x + (y * (z / t))
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 ((t <= -1.22e-290) || !(t <= 2.95e-154)) {
tmp = x + (y * (z / t));
} else {
tmp = x * (z / -t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.22e-290) or not (t <= 2.95e-154): tmp = x + (y * (z / t)) else: tmp = x * (z / -t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.22e-290) || !(t <= 2.95e-154)) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(x * Float64(z / Float64(-t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.22e-290) || ~((t <= 2.95e-154))) tmp = x + (y * (z / t)); else tmp = x * (z / -t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.22e-290], N[Not[LessEqual[t, 2.95e-154]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / (-t)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.22 \cdot 10^{-290} \lor \neg \left(t \leq 2.95 \cdot 10^{-154}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{-t}\\
\end{array}
\end{array}
if t < -1.22e-290 or 2.9500000000000001e-154 < t Initial program 99.4%
Taylor expanded in y around inf 78.3%
associate-*r/83.0%
Simplified83.0%
if -1.22e-290 < t < 2.9500000000000001e-154Initial program 93.2%
Taylor expanded in y around 0 85.7%
+-commutative85.7%
mul-1-neg85.7%
sub-neg85.7%
associate-*r/75.4%
associate-*r/71.8%
distribute-rgt-out--93.2%
associate-/r/89.9%
Simplified89.9%
Taylor expanded in x around inf 82.8%
neg-mul-182.8%
distribute-rgt-in82.8%
*-lft-identity82.8%
cancel-sign-sub-inv82.8%
associate-*l/82.9%
associate-*r/76.1%
Simplified76.1%
clear-num76.2%
un-div-inv76.3%
Applied egg-rr76.3%
Taylor expanded in z around inf 77.2%
mul-1-neg77.2%
associate-*r/77.1%
distribute-rgt-neg-in77.1%
neg-mul-177.1%
*-commutative77.1%
metadata-eval77.1%
times-frac77.1%
*-rgt-identity77.1%
*-commutative77.1%
neg-mul-177.1%
Simplified77.1%
Final simplification82.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1e+100) (not (<= x 5.3e-20))) (- x (* x (/ z t))) (+ x (/ y (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1e+100) || !(x <= 5.3e-20)) {
tmp = x - (x * (z / t));
} else {
tmp = x + (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 ((x <= (-1d+100)) .or. (.not. (x <= 5.3d-20))) then
tmp = x - (x * (z / t))
else
tmp = x + (y / (t / z))
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 - (x * (z / t));
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1e+100) or not (x <= 5.3e-20): tmp = x - (x * (z / t)) else: tmp = x + (y / (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1e+100) || !(x <= 5.3e-20)) tmp = Float64(x - Float64(x * Float64(z / t))); else tmp = Float64(x + Float64(y / Float64(t / z))); 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 - (x * (z / t)); else tmp = x + (y / (t / z)); 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[(x * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(t / z), $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 - x \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if x < -1.00000000000000002e100 or 5.3000000000000002e-20 < x Initial program 99.9%
Taylor expanded in x around inf 97.4%
mul-1-neg97.4%
unsub-neg97.4%
distribute-lft-out--97.4%
*-rgt-identity97.4%
Simplified97.4%
if -1.00000000000000002e100 < x < 5.3000000000000002e-20Initial program 97.7%
Taylor expanded in y around inf 83.3%
associate-*r/88.6%
Simplified88.6%
associate-*r/83.3%
associate-/l*88.8%
Applied egg-rr88.8%
Final simplification92.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -4.5e+97) (not (<= x 3.7e-20))) (- x (/ x (/ t z))) (+ x (/ y (/ t z)))))
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 / (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 <= (-4.5d+97)) .or. (.not. (x <= 3.7d-20))) then
tmp = x - (x / (t / z))
else
tmp = x + (y / (t / z))
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 / (t / z));
}
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 / (t / z)) 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(t / z))); 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 / (t / z)); 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[(t / z), $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 + \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if x < -4.49999999999999976e97 or 3.7000000000000001e-20 < x Initial program 99.9%
Taylor expanded in x around inf 97.4%
mul-1-neg97.4%
unsub-neg97.4%
distribute-lft-out--97.4%
*-rgt-identity97.4%
Simplified97.4%
clear-num97.4%
div-inv97.4%
Applied egg-rr97.4%
if -4.49999999999999976e97 < x < 3.7000000000000001e-20Initial program 97.7%
Taylor expanded in y around inf 83.3%
associate-*r/88.6%
Simplified88.6%
associate-*r/83.3%
associate-/l*88.8%
Applied egg-rr88.8%
Final simplification92.9%
(FPCore (x y z t) :precision binary64 (if (<= t -9.2e-291) (+ x (/ y (/ t z))) (if (<= t 1.95e-153) (* x (/ z (- t))) (+ x (* y (/ z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -9.2e-291) {
tmp = x + (y / (t / z));
} else if (t <= 1.95e-153) {
tmp = x * (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 (t <= (-9.2d-291)) then
tmp = x + (y / (t / z))
else if (t <= 1.95d-153) then
tmp = x * (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 (t <= -9.2e-291) {
tmp = x + (y / (t / z));
} else if (t <= 1.95e-153) {
tmp = x * (z / -t);
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -9.2e-291: tmp = x + (y / (t / z)) elif t <= 1.95e-153: tmp = x * (z / -t) else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -9.2e-291) tmp = Float64(x + Float64(y / Float64(t / z))); elseif (t <= 1.95e-153) tmp = Float64(x * Float64(z / Float64(-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 (t <= -9.2e-291) tmp = x + (y / (t / z)); elseif (t <= 1.95e-153) tmp = x * (z / -t); else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -9.2e-291], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.95e-153], N[(x * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.2 \cdot 10^{-291}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{-153}:\\
\;\;\;\;x \cdot \frac{z}{-t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if t < -9.2000000000000003e-291Initial program 99.1%
Taylor expanded in y around inf 74.7%
associate-*r/77.8%
Simplified77.8%
associate-*r/74.7%
associate-/l*78.0%
Applied egg-rr78.0%
if -9.2000000000000003e-291 < t < 1.9500000000000001e-153Initial program 93.2%
Taylor expanded in y around 0 85.7%
+-commutative85.7%
mul-1-neg85.7%
sub-neg85.7%
associate-*r/75.4%
associate-*r/71.8%
distribute-rgt-out--93.2%
associate-/r/89.9%
Simplified89.9%
Taylor expanded in x around inf 82.8%
neg-mul-182.8%
distribute-rgt-in82.8%
*-lft-identity82.8%
cancel-sign-sub-inv82.8%
associate-*l/82.9%
associate-*r/76.1%
Simplified76.1%
clear-num76.2%
un-div-inv76.3%
Applied egg-rr76.3%
Taylor expanded in z around inf 77.2%
mul-1-neg77.2%
associate-*r/77.1%
distribute-rgt-neg-in77.1%
neg-mul-177.1%
*-commutative77.1%
metadata-eval77.1%
times-frac77.1%
*-rgt-identity77.1%
*-commutative77.1%
neg-mul-177.1%
Simplified77.1%
if 1.9500000000000001e-153 < t Initial program 99.9%
Taylor expanded in y around inf 83.5%
associate-*r/90.6%
Simplified90.6%
Final simplification82.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.5e-72) (not (<= z 1.45e+28))) (* x (/ z (- t))) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.5e-72) || !(z <= 1.45e+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.45d+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.45e+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.45e+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.45e+28)) tmp = Float64(x * Float64(z / Float64(-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.45e+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.45e+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.45 \cdot 10^{+28}\right):\\
\;\;\;\;x \cdot \frac{z}{-t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.5e-72 or 1.4500000000000001e28 < z Initial program 97.5%
Taylor expanded in y around 0 80.0%
+-commutative80.0%
mul-1-neg80.0%
sub-neg80.0%
associate-*r/80.5%
associate-*r/83.5%
distribute-rgt-out--97.5%
associate-/r/98.3%
Simplified98.3%
Taylor expanded in x around inf 66.7%
neg-mul-166.7%
distribute-rgt-in66.7%
*-lft-identity66.7%
cancel-sign-sub-inv66.7%
associate-*l/59.0%
associate-*r/63.6%
Simplified63.6%
clear-num63.6%
un-div-inv63.6%
Applied egg-rr63.6%
Taylor expanded in z around inf 48.2%
mul-1-neg48.2%
associate-*r/52.1%
distribute-rgt-neg-in52.1%
neg-mul-152.1%
*-commutative52.1%
metadata-eval52.1%
times-frac52.1%
*-rgt-identity52.1%
*-commutative52.1%
neg-mul-152.1%
Simplified52.1%
if -4.5e-72 < z < 1.4500000000000001e28Initial program 99.9%
Taylor expanded in z around 0 66.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 98.8%
Taylor expanded in y around 0 89.6%
+-commutative89.6%
mul-1-neg89.6%
sub-neg89.6%
associate-/l*90.9%
associate-/l*92.6%
div-sub98.9%
associate-/r/95.1%
*-commutative95.1%
Simplified95.1%
Final simplification95.1%
(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 98.8%
Taylor expanded in z around 0 43.0%
Final simplification43.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y x) (/ z t))) (t_2 (+ x (/ (- y x) (/ t z)))))
(if (< t_1 -1013646692435.8867)
t_2
(if (< t_1 0.0) (+ x (/ (* (- y x) z) t)) t_2))))
double code(double x, double y, double z, double t) {
double t_1 = (y - x) * (z / t);
double t_2 = x + ((y - x) / (t / z));
double tmp;
if (t_1 < -1013646692435.8867) {
tmp = t_2;
} else if (t_1 < 0.0) {
tmp = x + (((y - x) * z) / t);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y - x) * (z / t)
t_2 = x + ((y - x) / (t / z))
if (t_1 < (-1013646692435.8867d0)) then
tmp = t_2
else if (t_1 < 0.0d0) then
tmp = x + (((y - x) * z) / t)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - x) * (z / t);
double t_2 = x + ((y - x) / (t / z));
double tmp;
if (t_1 < -1013646692435.8867) {
tmp = t_2;
} else if (t_1 < 0.0) {
tmp = x + (((y - x) * z) / t);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - x) * (z / t) t_2 = x + ((y - x) / (t / z)) tmp = 0 if t_1 < -1013646692435.8867: tmp = t_2 elif t_1 < 0.0: tmp = x + (((y - x) * z) / t) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - x) * Float64(z / t)) t_2 = Float64(x + Float64(Float64(y - x) / Float64(t / z))) tmp = 0.0 if (t_1 < -1013646692435.8867) tmp = t_2; elseif (t_1 < 0.0) tmp = Float64(x + Float64(Float64(Float64(y - x) * z) / t)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - x) * (z / t); t_2 = x + ((y - x) / (t / z)); tmp = 0.0; if (t_1 < -1013646692435.8867) tmp = t_2; elseif (t_1 < 0.0) tmp = x + (((y - x) * z) / t); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$1, -1013646692435.8867], t$95$2, If[Less[t$95$1, 0.0], N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - x\right) \cdot \frac{z}{t}\\
t_2 := x + \frac{y - x}{\frac{t}{z}}\\
\mathbf{if}\;t_1 < -1013646692435.8867:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 < 0:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
herbie shell --seed 2023293
(FPCore (x y z t)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:tickPosition from plot-0.2.3.4"
:precision binary64
:herbie-target
(if (< (* (- y x) (/ z t)) -1013646692435.8867) (+ x (/ (- y x) (/ t z))) (if (< (* (- y x) (/ z t)) 0.0) (+ x (/ (* (- y x) z) t)) (+ x (/ (- y x) (/ t z)))))
(+ x (* (- y x) (/ z t))))