
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma (/ (- y z) (- a z)) t x))
double code(double x, double y, double z, double t, double a) {
return fma(((y - z) / (a - z)), t, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(y - z) / Float64(a - z)), t, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y - z}{a - z}, t, x\right)
\end{array}
Initial program 85.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6498.0
Applied rewrites98.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -2.7e+56) (not (<= y 3.3e-36))) (fma (/ y (- a z)) t x) (fma (/ z (- a z)) (- t) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.7e+56) || !(y <= 3.3e-36)) {
tmp = fma((y / (a - z)), t, x);
} else {
tmp = fma((z / (a - z)), -t, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -2.7e+56) || !(y <= 3.3e-36)) tmp = fma(Float64(y / Float64(a - z)), t, x); else tmp = fma(Float64(z / Float64(a - z)), Float64(-t), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -2.7e+56], N[Not[LessEqual[y, 3.3e-36]], $MachinePrecision]], N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t + x), $MachinePrecision], N[(N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision] * (-t) + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{+56} \lor \neg \left(y \leq 3.3 \cdot 10^{-36}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - z}, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a - z}, -t, x\right)\\
\end{array}
\end{array}
if y < -2.7000000000000001e56 or 3.29999999999999991e-36 < y Initial program 83.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6495.9
Applied rewrites95.9%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6487.7
Applied rewrites87.7%
if -2.7000000000000001e56 < y < 3.29999999999999991e-36Initial program 88.2%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6491.1
Applied rewrites91.1%
Final simplification89.5%
(FPCore (x y z t a) :precision binary64 (if (<= y -2.8e+56) (+ x (/ (* t y) (- a z))) (if (<= y 3.3e-36) (fma (/ z (- a z)) (- t) x) (fma (/ y (- a z)) t x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.8e+56) {
tmp = x + ((t * y) / (a - z));
} else if (y <= 3.3e-36) {
tmp = fma((z / (a - z)), -t, x);
} else {
tmp = fma((y / (a - z)), t, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.8e+56) tmp = Float64(x + Float64(Float64(t * y) / Float64(a - z))); elseif (y <= 3.3e-36) tmp = fma(Float64(z / Float64(a - z)), Float64(-t), x); else tmp = fma(Float64(y / Float64(a - z)), t, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.8e+56], N[(x + N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.3e-36], N[(N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision] * (-t) + x), $MachinePrecision], N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+56}:\\
\;\;\;\;x + \frac{t \cdot y}{a - z}\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{-36}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a - z}, -t, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - z}, t, x\right)\\
\end{array}
\end{array}
if y < -2.80000000000000008e56Initial program 87.8%
Taylor expanded in y around inf
lower-*.f6488.9
Applied rewrites88.9%
if -2.80000000000000008e56 < y < 3.29999999999999991e-36Initial program 88.2%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6491.1
Applied rewrites91.1%
if 3.29999999999999991e-36 < y Initial program 79.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6496.7
Applied rewrites96.7%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6486.7
Applied rewrites86.7%
Final simplification89.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.45e+88) (not (<= z 1.16e+129))) (+ t x) (fma (/ y (- a z)) t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.45e+88) || !(z <= 1.16e+129)) {
tmp = t + x;
} else {
tmp = fma((y / (a - z)), t, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.45e+88) || !(z <= 1.16e+129)) tmp = Float64(t + x); else tmp = fma(Float64(y / Float64(a - z)), t, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.45e+88], N[Not[LessEqual[z, 1.16e+129]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+88} \lor \neg \left(z \leq 1.16 \cdot 10^{+129}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - z}, t, x\right)\\
\end{array}
\end{array}
if z < -1.45e88 or 1.16e129 < z Initial program 70.9%
Taylor expanded in z around inf
lower-+.f6486.0
Applied rewrites86.0%
if -1.45e88 < z < 1.16e129Initial program 92.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6497.3
Applied rewrites97.3%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6485.4
Applied rewrites85.4%
Final simplification85.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1300000000000.0) (not (<= z 9.6e-14))) (+ t x) (fma (- y z) (/ t a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1300000000000.0) || !(z <= 9.6e-14)) {
tmp = t + x;
} else {
tmp = fma((y - z), (t / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1300000000000.0) || !(z <= 9.6e-14)) tmp = Float64(t + x); else tmp = fma(Float64(y - z), Float64(t / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1300000000000.0], N[Not[LessEqual[z, 9.6e-14]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1300000000000 \lor \neg \left(z \leq 9.6 \cdot 10^{-14}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\end{array}
\end{array}
if z < -1.3e12 or 9.599999999999999e-14 < z Initial program 77.4%
Taylor expanded in z around inf
lower-+.f6475.0
Applied rewrites75.0%
if -1.3e12 < z < 9.599999999999999e-14Initial program 94.0%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6478.3
Applied rewrites78.3%
Final simplification76.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.6e+43) (+ (- x (/ (* t y) z)) t) (if (<= z 1.16e+129) (fma (/ y (- a z)) t x) (+ t x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.6e+43) {
tmp = (x - ((t * y) / z)) + t;
} else if (z <= 1.16e+129) {
tmp = fma((y / (a - z)), t, x);
} else {
tmp = t + x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.6e+43) tmp = Float64(Float64(x - Float64(Float64(t * y) / z)) + t); elseif (z <= 1.16e+129) tmp = fma(Float64(y / Float64(a - z)), t, x); else tmp = Float64(t + x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.6e+43], N[(N[(x - N[(N[(t * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, 1.16e+129], N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t + x), $MachinePrecision], N[(t + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+43}:\\
\;\;\;\;\left(x - \frac{t \cdot y}{z}\right) + t\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{+129}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - z}, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if z < -6.6000000000000003e43Initial program 71.5%
Taylor expanded in a around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
associate-/l*N/A
div-subN/A
*-inversesN/A
distribute-rgt-out--N/A
*-commutativeN/A
associate-/l*N/A
*-lft-identityN/A
associate-+l-N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
lower-+.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6481.4
Applied rewrites81.4%
if -6.6000000000000003e43 < z < 1.16e129Initial program 92.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6497.2
Applied rewrites97.2%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6486.0
Applied rewrites86.0%
if 1.16e129 < z Initial program 72.6%
Taylor expanded in z around inf
lower-+.f6494.2
Applied rewrites94.2%
Final simplification86.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1650000000000.0) (not (<= z 3e+14))) (+ t x) (fma (/ y a) t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1650000000000.0) || !(z <= 3e+14)) {
tmp = t + x;
} else {
tmp = fma((y / a), t, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1650000000000.0) || !(z <= 3e+14)) tmp = Float64(t + x); else tmp = fma(Float64(y / a), t, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1650000000000.0], N[Not[LessEqual[z, 3e+14]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1650000000000 \lor \neg \left(z \leq 3 \cdot 10^{+14}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
\end{array}
\end{array}
if z < -1.65e12 or 3e14 < z Initial program 74.8%
Taylor expanded in z around inf
lower-+.f6476.2
Applied rewrites76.2%
if -1.65e12 < z < 3e14Initial program 94.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6476.3
Applied rewrites76.3%
Final simplification76.3%
(FPCore (x y z t a) :precision binary64 (if (<= y -7.4e+230) (* y (/ t a)) (+ t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -7.4e+230) {
tmp = y * (t / a);
} else {
tmp = t + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-7.4d+230)) then
tmp = y * (t / a)
else
tmp = t + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -7.4e+230) {
tmp = y * (t / a);
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -7.4e+230: tmp = y * (t / a) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -7.4e+230) tmp = Float64(y * Float64(t / a)); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -7.4e+230) tmp = y * (t / a); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -7.4e+230], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.4 \cdot 10^{+230}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if y < -7.39999999999999983e230Initial program 95.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6495.4
Applied rewrites95.4%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6477.4
Applied rewrites77.4%
Taylor expanded in z around 0
Applied rewrites53.1%
Applied rewrites57.2%
if -7.39999999999999983e230 < y Initial program 85.1%
Taylor expanded in z around inf
lower-+.f6458.8
Applied rewrites58.8%
Final simplification58.6%
(FPCore (x y z t a) :precision binary64 (if (<= y -7e+229) (* t (/ y a)) (+ t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -7e+229) {
tmp = t * (y / a);
} else {
tmp = t + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-7d+229)) then
tmp = t * (y / a)
else
tmp = t + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -7e+229) {
tmp = t * (y / a);
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -7e+229: tmp = t * (y / a) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -7e+229) tmp = Float64(t * Float64(y / a)); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -7e+229) tmp = t * (y / a); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -7e+229], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{+229}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if y < -7.0000000000000005e229Initial program 95.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6495.4
Applied rewrites95.4%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6477.4
Applied rewrites77.4%
Taylor expanded in z around 0
Applied rewrites53.1%
if -7.0000000000000005e229 < y Initial program 85.1%
Taylor expanded in z around inf
lower-+.f6458.8
Applied rewrites58.8%
Final simplification58.3%
(FPCore (x y z t a) :precision binary64 (+ t x))
double code(double x, double y, double z, double t, double a) {
return t + x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = t + x
end function
public static double code(double x, double y, double z, double t, double a) {
return t + x;
}
def code(x, y, z, t, a): return t + x
function code(x, y, z, t, a) return Float64(t + x) end
function tmp = code(x, y, z, t, a) tmp = t + x; end
code[x_, y_, z_, t_, a_] := N[(t + x), $MachinePrecision]
\begin{array}{l}
\\
t + x
\end{array}
Initial program 85.9%
Taylor expanded in z around inf
lower-+.f6455.6
Applied rewrites55.6%
Final simplification55.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y z) (- a z)) t))))
(if (< t -1.0682974490174067e-39)
t_1
(if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (((y - z) / (a - z)) * t)
if (t < (-1.0682974490174067d-39)) then
tmp = t_1
else if (t < 3.9110949887586375d-141) then
tmp = x + (((y - z) * t) / (a - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - z) / (a - z)) * t) tmp = 0 if t < -1.0682974490174067e-39: tmp = t_1 elif t < 3.9110949887586375e-141: tmp = x + (((y - z) * t) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) tmp = 0.0 if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - z) / (a - z)) * t); tmp = 0.0; if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = x + (((y - z) * t) / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.0682974490174067e-39], t$95$1, If[Less[t, 3.9110949887586375e-141], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024337
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (if (< t -10682974490174067/10000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 312887599100691/80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t)))))
(+ x (/ (* (- y z) t) (- a z))))