
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
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 - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
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 - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (<= t -9e+219) (- y x) (if (<= t 5.6e+168) (+ x (/ (* (- y x) (- z t)) (- a t))) (+ x (- y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9e+219) {
tmp = y - x;
} else if (t <= 5.6e+168) {
tmp = x + (((y - x) * (z - t)) / (a - t));
} else {
tmp = x + (y - 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 (t <= (-9d+219)) then
tmp = y - x
else if (t <= 5.6d+168) then
tmp = x + (((y - x) * (z - t)) / (a - t))
else
tmp = x + (y - x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9e+219) {
tmp = y - x;
} else if (t <= 5.6e+168) {
tmp = x + (((y - x) * (z - t)) / (a - t));
} else {
tmp = x + (y - x);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -9e+219: tmp = y - x elif t <= 5.6e+168: tmp = x + (((y - x) * (z - t)) / (a - t)) else: tmp = x + (y - x) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -9e+219) tmp = Float64(y - x); elseif (t <= 5.6e+168) tmp = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))); else tmp = Float64(x + Float64(y - x)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -9e+219) tmp = y - x; elseif (t <= 5.6e+168) tmp = x + (((y - x) * (z - t)) / (a - t)); else tmp = x + (y - x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -9e+219], N[(y - x), $MachinePrecision], If[LessEqual[t, 5.6e+168], N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y - x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+219}:\\
\;\;\;\;y - x\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{+168}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right)\\
\end{array}
\end{array}
if t < -9.00000000000000047e219Initial program 9.9%
Taylor expanded in x around 0
Applied rewrites3.8%
Taylor expanded in x around 0
Applied rewrites48.8%
Taylor expanded in x around 0
Applied rewrites49.5%
if -9.00000000000000047e219 < t < 5.5999999999999998e168Initial program 76.0%
if 5.5999999999999998e168 < t Initial program 30.3%
Taylor expanded in x around 0
Applied rewrites1.7%
Taylor expanded in x around 0
Applied rewrites52.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (- y x) (- a t)))))
(if (<= a -3.45e+133)
t_1
(if (<= a 2e+188) (/ (* (- y x) (- z t)) (- a t)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - x) / (a - t));
double tmp;
if (a <= -3.45e+133) {
tmp = t_1;
} else if (a <= 2e+188) {
tmp = ((y - x) * (z - t)) / (a - t);
} 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 - x) / (a - t))
if (a <= (-3.45d+133)) then
tmp = t_1
else if (a <= 2d+188) then
tmp = ((y - x) * (z - t)) / (a - t)
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 - x) / (a - t));
double tmp;
if (a <= -3.45e+133) {
tmp = t_1;
} else if (a <= 2e+188) {
tmp = ((y - x) * (z - t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - x) / (a - t)) tmp = 0 if a <= -3.45e+133: tmp = t_1 elif a <= 2e+188: tmp = ((y - x) * (z - t)) / (a - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - x) / Float64(a - t))) tmp = 0.0 if (a <= -3.45e+133) tmp = t_1; elseif (a <= 2e+188) tmp = Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - x) / (a - t)); tmp = 0.0; if (a <= -3.45e+133) tmp = t_1; elseif (a <= 2e+188) tmp = ((y - x) * (z - t)) / (a - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - x), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.45e+133], t$95$1, If[LessEqual[a, 2e+188], N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - x}{a - t}\\
\mathbf{if}\;a \leq -3.45 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2 \cdot 10^{+188}:\\
\;\;\;\;\frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.4500000000000001e133 or 2e188 < a Initial program 66.1%
Taylor expanded in x around 0
Applied rewrites58.8%
if -3.4500000000000001e133 < a < 2e188Initial program 64.6%
Taylor expanded in x around 0
Applied rewrites51.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (/ (- y x) (- a t))))) (if (<= a -8.4e+114) t_1 (if (<= a 2.55e+24) (- y x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - x) / (a - t));
double tmp;
if (a <= -8.4e+114) {
tmp = t_1;
} else if (a <= 2.55e+24) {
tmp = y - x;
} 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 - x) / (a - t))
if (a <= (-8.4d+114)) then
tmp = t_1
else if (a <= 2.55d+24) then
tmp = y - x
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 - x) / (a - t));
double tmp;
if (a <= -8.4e+114) {
tmp = t_1;
} else if (a <= 2.55e+24) {
tmp = y - x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - x) / (a - t)) tmp = 0 if a <= -8.4e+114: tmp = t_1 elif a <= 2.55e+24: tmp = y - x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - x) / Float64(a - t))) tmp = 0.0 if (a <= -8.4e+114) tmp = t_1; elseif (a <= 2.55e+24) tmp = Float64(y - x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - x) / (a - t)); tmp = 0.0; if (a <= -8.4e+114) tmp = t_1; elseif (a <= 2.55e+24) tmp = y - x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - x), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8.4e+114], t$95$1, If[LessEqual[a, 2.55e+24], N[(y - x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - x}{a - t}\\
\mathbf{if}\;a \leq -8.4 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.55 \cdot 10^{+24}:\\
\;\;\;\;y - x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -8.4000000000000001e114 or 2.5499999999999998e24 < a Initial program 68.0%
Taylor expanded in x around 0
Applied rewrites47.5%
if -8.4000000000000001e114 < a < 2.5499999999999998e24Initial program 62.9%
Taylor expanded in x around 0
Applied rewrites13.9%
Taylor expanded in x around 0
Applied rewrites27.6%
Taylor expanded in x around 0
Applied rewrites28.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -7.8e+117) (- y x) (if (<= t 2.35e-9) (+ x (* (- y x) (- z t))) (+ x (- y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.8e+117) {
tmp = y - x;
} else if (t <= 2.35e-9) {
tmp = x + ((y - x) * (z - t));
} else {
tmp = x + (y - 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 (t <= (-7.8d+117)) then
tmp = y - x
else if (t <= 2.35d-9) then
tmp = x + ((y - x) * (z - t))
else
tmp = x + (y - x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.8e+117) {
tmp = y - x;
} else if (t <= 2.35e-9) {
tmp = x + ((y - x) * (z - t));
} else {
tmp = x + (y - x);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7.8e+117: tmp = y - x elif t <= 2.35e-9: tmp = x + ((y - x) * (z - t)) else: tmp = x + (y - x) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.8e+117) tmp = Float64(y - x); elseif (t <= 2.35e-9) tmp = Float64(x + Float64(Float64(y - x) * Float64(z - t))); else tmp = Float64(x + Float64(y - x)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7.8e+117) tmp = y - x; elseif (t <= 2.35e-9) tmp = x + ((y - x) * (z - t)); else tmp = x + (y - x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.8e+117], N[(y - x), $MachinePrecision], If[LessEqual[t, 2.35e-9], N[(x + N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y - x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{+117}:\\
\;\;\;\;y - x\\
\mathbf{elif}\;t \leq 2.35 \cdot 10^{-9}:\\
\;\;\;\;x + \left(y - x\right) \cdot \left(z - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right)\\
\end{array}
\end{array}
if t < -7.79999999999999981e117Initial program 28.1%
Taylor expanded in x around 0
Applied rewrites3.5%
Taylor expanded in x around 0
Applied rewrites35.0%
Taylor expanded in x around 0
Applied rewrites35.3%
if -7.79999999999999981e117 < t < 2.34999999999999995e-9Initial program 87.7%
Taylor expanded in x around 0
Applied rewrites26.4%
if 2.34999999999999995e-9 < t Initial program 42.4%
Taylor expanded in x around 0
Applied rewrites2.2%
Taylor expanded in x around 0
Applied rewrites41.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (- a t)))) (if (<= x -4.3e+99) t_1 (if (<= x 1.4e+146) (+ x (- y x)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (a - t);
double tmp;
if (x <= -4.3e+99) {
tmp = t_1;
} else if (x <= 1.4e+146) {
tmp = x + (y - x);
} 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 + (a - t)
if (x <= (-4.3d+99)) then
tmp = t_1
else if (x <= 1.4d+146) then
tmp = x + (y - x)
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 + (a - t);
double tmp;
if (x <= -4.3e+99) {
tmp = t_1;
} else if (x <= 1.4e+146) {
tmp = x + (y - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (a - t) tmp = 0 if x <= -4.3e+99: tmp = t_1 elif x <= 1.4e+146: tmp = x + (y - x) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(a - t)) tmp = 0.0 if (x <= -4.3e+99) tmp = t_1; elseif (x <= 1.4e+146) tmp = Float64(x + Float64(y - x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (a - t); tmp = 0.0; if (x <= -4.3e+99) tmp = t_1; elseif (x <= 1.4e+146) tmp = x + (y - x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.3e+99], t$95$1, If[LessEqual[x, 1.4e+146], N[(x + N[(y - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(a - t\right)\\
\mathbf{if}\;x \leq -4.3 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+146}:\\
\;\;\;\;x + \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.3000000000000001e99 or 1.4e146 < x Initial program 51.1%
Taylor expanded in x around 0
Applied rewrites25.1%
Taylor expanded in x around 0
Applied rewrites5.2%
Taylor expanded in x around inf
Applied rewrites24.4%
if -4.3000000000000001e99 < x < 1.4e146Initial program 69.9%
Taylor expanded in x around 0
Applied rewrites12.4%
Taylor expanded in x around 0
Applied rewrites26.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (- a t)))) (if (<= x -4.3e+99) t_1 (if (<= x 5.2e+147) (- y x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (a - t);
double tmp;
if (x <= -4.3e+99) {
tmp = t_1;
} else if (x <= 5.2e+147) {
tmp = y - x;
} 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 + (a - t)
if (x <= (-4.3d+99)) then
tmp = t_1
else if (x <= 5.2d+147) then
tmp = y - x
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 + (a - t);
double tmp;
if (x <= -4.3e+99) {
tmp = t_1;
} else if (x <= 5.2e+147) {
tmp = y - x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (a - t) tmp = 0 if x <= -4.3e+99: tmp = t_1 elif x <= 5.2e+147: tmp = y - x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(a - t)) tmp = 0.0 if (x <= -4.3e+99) tmp = t_1; elseif (x <= 5.2e+147) tmp = Float64(y - x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (a - t); tmp = 0.0; if (x <= -4.3e+99) tmp = t_1; elseif (x <= 5.2e+147) tmp = y - x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.3e+99], t$95$1, If[LessEqual[x, 5.2e+147], N[(y - x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(a - t\right)\\
\mathbf{if}\;x \leq -4.3 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+147}:\\
\;\;\;\;y - x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.3000000000000001e99 or 5.1999999999999997e147 < x Initial program 51.9%
Taylor expanded in x around 0
Applied rewrites25.5%
Taylor expanded in x around 0
Applied rewrites5.3%
Taylor expanded in x around inf
Applied rewrites24.6%
if -4.3000000000000001e99 < x < 5.1999999999999997e147Initial program 69.6%
Taylor expanded in x around 0
Applied rewrites12.4%
Taylor expanded in x around 0
Applied rewrites26.2%
Taylor expanded in x around 0
Applied rewrites26.1%
(FPCore (x y z t a) :precision binary64 (- y x))
double code(double x, double y, double z, double t, double a) {
return y - 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 = y - x
end function
public static double code(double x, double y, double z, double t, double a) {
return y - x;
}
def code(x, y, z, t, a): return y - x
function code(x, y, z, t, a) return Float64(y - x) end
function tmp = code(x, y, z, t, a) tmp = y - x; end
code[x_, y_, z_, t_, a_] := N[(y - x), $MachinePrecision]
\begin{array}{l}
\\
y - x
\end{array}
Initial program 65.0%
Taylor expanded in x around 0
Applied rewrites15.7%
Taylor expanded in x around 0
Applied rewrites20.8%
Taylor expanded in x around 0
Applied rewrites20.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t))))))
(if (< a -1.6153062845442575e-142)
t_1
(if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
double tmp;
if (a < -1.6153062845442575e-142) {
tmp = t_1;
} else if (a < 3.774403170083174e-182) {
tmp = y - ((z / t) * (y - x));
} 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 - x) / 1.0d0) * ((z - t) / (a - t)))
if (a < (-1.6153062845442575d-142)) then
tmp = t_1
else if (a < 3.774403170083174d-182) then
tmp = y - ((z / t) * (y - x))
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 - x) / 1.0) * ((z - t) / (a - t)));
double tmp;
if (a < -1.6153062845442575e-142) {
tmp = t_1;
} else if (a < 3.774403170083174e-182) {
tmp = y - ((z / t) * (y - x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t))) tmp = 0 if a < -1.6153062845442575e-142: tmp = t_1 elif a < 3.774403170083174e-182: tmp = y - ((z / t) * (y - x)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - x) / 1.0) * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (a < -1.6153062845442575e-142) tmp = t_1; elseif (a < 3.774403170083174e-182) tmp = Float64(y - Float64(Float64(z / t) * Float64(y - x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t))); tmp = 0.0; if (a < -1.6153062845442575e-142) tmp = t_1; elseif (a < 3.774403170083174e-182) tmp = y - ((z / t) * (y - x)); 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 - x), $MachinePrecision] / 1.0), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[a, -1.6153062845442575e-142], t$95$1, If[Less[a, 3.774403170083174e-182], N[(y - N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;a < -1.6153062845442575 \cdot 10^{-142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a < 3.774403170083174 \cdot 10^{-182}:\\
\;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024313
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (if (< a -646122513817703/4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))) (if (< a 1887201585041587/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))))))
(+ x (/ (* (- y x) (- z t)) (- a t))))