
(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 9 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 (fma (- y x) (/ z t) x))
double code(double x, double y, double z, double t) {
return fma((y - x), (z / t), x);
}
function code(x, y, z, t) return fma(Float64(y - x), Float64(z / t), x) end
code[x_, y_, z_, t_] := N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)
\end{array}
Initial program 97.6%
+-commutative97.6%
fma-define97.6%
Simplified97.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ z t) -1e+21) (not (<= (/ z t) 0.5))) (- (/ x (/ t z))) x))
double code(double x, double y, double z, double t) {
double tmp;
if (((z / t) <= -1e+21) || !((z / t) <= 0.5)) {
tmp = -(x / (t / z));
} 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 / t) <= (-1d+21)) .or. (.not. ((z / t) <= 0.5d0))) then
tmp = -(x / (t / z))
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 / t) <= -1e+21) || !((z / t) <= 0.5)) {
tmp = -(x / (t / z));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z / t) <= -1e+21) or not ((z / t) <= 0.5): tmp = -(x / (t / z)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(z / t) <= -1e+21) || !(Float64(z / t) <= 0.5)) tmp = Float64(-Float64(x / Float64(t / z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z / t) <= -1e+21) || ~(((z / t) <= 0.5))) tmp = -(x / (t / z)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z / t), $MachinePrecision], -1e+21], N[Not[LessEqual[N[(z / t), $MachinePrecision], 0.5]], $MachinePrecision]], (-N[(x / N[(t / z), $MachinePrecision]), $MachinePrecision]), x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -1 \cdot 10^{+21} \lor \neg \left(\frac{z}{t} \leq 0.5\right):\\
\;\;\;\;-\frac{x}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (/.f64 z t) < -1e21 or 0.5 < (/.f64 z t) Initial program 97.7%
Taylor expanded in x around inf 59.9%
mul-1-neg59.9%
unsub-neg59.9%
Simplified59.9%
Taylor expanded in z around inf 59.7%
associate-*r/59.7%
neg-mul-159.7%
Simplified59.7%
distribute-frac-neg59.7%
distribute-rgt-neg-out59.7%
clear-num59.7%
add-sqr-sqrt27.0%
sqrt-unprod30.3%
sqr-neg30.3%
sqrt-unprod3.0%
add-sqr-sqrt8.0%
un-div-inv8.0%
add-sqr-sqrt3.0%
sqrt-unprod29.6%
sqr-neg29.6%
sqrt-unprod26.3%
add-sqr-sqrt59.0%
Applied egg-rr59.0%
if -1e21 < (/.f64 z t) < 0.5Initial program 97.6%
Taylor expanded in z around 0 72.7%
Final simplification65.6%
(FPCore (x y z t) :precision binary64 (if (<= (/ z t) -1e+21) (- (/ x (/ t z))) (if (<= (/ z t) 0.5) x (* x (/ (- z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z / t) <= -1e+21) {
tmp = -(x / (t / z));
} else if ((z / t) <= 0.5) {
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 / t) <= (-1d+21)) then
tmp = -(x / (t / z))
else if ((z / t) <= 0.5d0) 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 / t) <= -1e+21) {
tmp = -(x / (t / z));
} else if ((z / t) <= 0.5) {
tmp = x;
} else {
tmp = x * (-z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z / t) <= -1e+21: tmp = -(x / (t / z)) elif (z / t) <= 0.5: tmp = x else: tmp = x * (-z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z / t) <= -1e+21) tmp = Float64(-Float64(x / Float64(t / z))); elseif (Float64(z / t) <= 0.5) 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 / t) <= -1e+21) tmp = -(x / (t / z)); elseif ((z / t) <= 0.5) tmp = x; else tmp = x * (-z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z / t), $MachinePrecision], -1e+21], (-N[(x / N[(t / z), $MachinePrecision]), $MachinePrecision]), If[LessEqual[N[(z / t), $MachinePrecision], 0.5], x, N[(x * N[((-z) / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -1 \cdot 10^{+21}:\\
\;\;\;\;-\frac{x}{\frac{t}{z}}\\
\mathbf{elif}\;\frac{z}{t} \leq 0.5:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-z}{t}\\
\end{array}
\end{array}
if (/.f64 z t) < -1e21Initial program 99.9%
Taylor expanded in x around inf 54.0%
mul-1-neg54.0%
unsub-neg54.0%
Simplified54.0%
Taylor expanded in z around inf 54.0%
associate-*r/54.0%
neg-mul-154.0%
Simplified54.0%
distribute-frac-neg54.0%
distribute-rgt-neg-out54.0%
clear-num54.0%
add-sqr-sqrt24.0%
sqrt-unprod32.3%
sqr-neg32.3%
sqrt-unprod5.3%
add-sqr-sqrt8.6%
un-div-inv8.6%
add-sqr-sqrt5.3%
sqrt-unprod32.3%
sqr-neg32.3%
sqrt-unprod24.1%
add-sqr-sqrt54.0%
Applied egg-rr54.0%
if -1e21 < (/.f64 z t) < 0.5Initial program 97.6%
Taylor expanded in z around 0 72.7%
if 0.5 < (/.f64 z t) Initial program 95.4%
Taylor expanded in x around inf 66.3%
mul-1-neg66.3%
unsub-neg66.3%
Simplified66.3%
Taylor expanded in z around inf 65.7%
associate-*r/65.7%
neg-mul-165.7%
Simplified65.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.6e-28) (not (<= x 6.6e-22))) (* x (- 1.0 (/ z t))) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.6e-28) || !(x <= 6.6e-22)) {
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 <= (-1.6d-28)) .or. (.not. (x <= 6.6d-22))) 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 <= -1.6e-28) || !(x <= 6.6e-22)) {
tmp = x * (1.0 - (z / t));
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.6e-28) or not (x <= 6.6e-22): 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 <= -1.6e-28) || !(x <= 6.6e-22)) 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 <= -1.6e-28) || ~((x <= 6.6e-22))) 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, -1.6e-28], N[Not[LessEqual[x, 6.6e-22]], $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.6 \cdot 10^{-28} \lor \neg \left(x \leq 6.6 \cdot 10^{-22}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if x < -1.59999999999999991e-28 or 6.6000000000000002e-22 < x Initial program 99.9%
Taylor expanded in x around inf 91.0%
mul-1-neg91.0%
unsub-neg91.0%
Simplified91.0%
if -1.59999999999999991e-28 < x < 6.6000000000000002e-22Initial program 95.2%
Taylor expanded in y around inf 85.8%
associate-*r/88.1%
Simplified88.1%
Final simplification89.6%
(FPCore (x y z t) :precision binary64 (if (<= x -7.6e-31) (* x (- 1.0 (/ z t))) (if (<= x 7.5e-22) (+ x (* y (/ z t))) (- x (* x (/ z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -7.6e-31) {
tmp = x * (1.0 - (z / t));
} else if (x <= 7.5e-22) {
tmp = x + (y * (z / t));
} else {
tmp = x - (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 (x <= (-7.6d-31)) then
tmp = x * (1.0d0 - (z / t))
else if (x <= 7.5d-22) then
tmp = x + (y * (z / t))
else
tmp = x - (x * (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -7.6e-31) {
tmp = x * (1.0 - (z / t));
} else if (x <= 7.5e-22) {
tmp = x + (y * (z / t));
} else {
tmp = x - (x * (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -7.6e-31: tmp = x * (1.0 - (z / t)) elif x <= 7.5e-22: tmp = x + (y * (z / t)) else: tmp = x - (x * (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -7.6e-31) tmp = Float64(x * Float64(1.0 - Float64(z / t))); elseif (x <= 7.5e-22) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(x - Float64(x * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -7.6e-31) tmp = x * (1.0 - (z / t)); elseif (x <= 7.5e-22) tmp = x + (y * (z / t)); else tmp = x - (x * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -7.6e-31], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.5e-22], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.6 \cdot 10^{-31}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-22}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \frac{z}{t}\\
\end{array}
\end{array}
if x < -7.5999999999999999e-31Initial program 100.0%
Taylor expanded in x around inf 88.1%
mul-1-neg88.1%
unsub-neg88.1%
Simplified88.1%
if -7.5999999999999999e-31 < x < 7.49999999999999978e-22Initial program 95.2%
Taylor expanded in y around inf 85.8%
associate-*r/88.1%
Simplified88.1%
if 7.49999999999999978e-22 < x Initial program 99.9%
Taylor expanded in y around 0 88.3%
mul-1-neg88.3%
associate-/l*93.8%
distribute-lft-neg-out93.8%
*-commutative93.8%
Simplified93.8%
Final simplification89.6%
(FPCore (x y z t) :precision binary64 (if (<= (/ z t) -2e+219) (* x (/ z t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z / t) <= -2e+219) {
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 / t) <= (-2d+219)) 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 / t) <= -2e+219) {
tmp = x * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z / t) <= -2e+219: tmp = x * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z / t) <= -2e+219) tmp = Float64(x * Float64(z / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z / t) <= -2e+219) tmp = x * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z / t), $MachinePrecision], -2e+219], N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{+219}:\\
\;\;\;\;x \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (/.f64 z t) < -1.99999999999999993e219Initial program 99.9%
Taylor expanded in x around inf 52.5%
mul-1-neg52.5%
unsub-neg52.5%
Simplified52.5%
Taylor expanded in z around inf 52.5%
associate-*r/52.5%
neg-mul-152.5%
Simplified52.5%
*-commutative52.5%
associate-*l/49.4%
distribute-lft-neg-in49.4%
distribute-rgt-neg-out49.4%
expm1-log1p-u26.6%
expm1-undefine26.6%
distribute-rgt-neg-out26.6%
distribute-lft-neg-in26.6%
associate-*l/29.6%
*-commutative29.6%
clear-num29.6%
un-div-inv29.6%
add-sqr-sqrt23.0%
sqrt-unprod25.9%
sqr-neg25.9%
sqrt-unprod0.1%
add-sqr-sqrt10.2%
Applied egg-rr10.2%
sub-neg10.2%
metadata-eval10.2%
+-commutative10.2%
log1p-undefine10.2%
rem-exp-log17.2%
associate-+r+17.2%
metadata-eval17.2%
rem-square-sqrt10.2%
cancel-sign-sub10.2%
neg-sub010.2%
distribute-lft-neg-in10.2%
remove-double-neg10.2%
rem-square-sqrt17.2%
associate-/r/8.3%
associate-*l/8.3%
associate-*r/17.2%
Simplified17.2%
if -1.99999999999999993e219 < (/.f64 z t) Initial program 97.3%
Taylor expanded in z around 0 41.1%
(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 97.6%
(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 97.6%
Taylor expanded in x around inf 66.4%
mul-1-neg66.4%
unsub-neg66.4%
Simplified66.4%
(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 97.6%
Taylor expanded in z around 0 36.5%
(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 2024100
(FPCore (x y z t)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:tickPosition from plot-0.2.3.4"
:precision binary64
:alt
(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))))