
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((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 * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((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 * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma y (/ (- z t) (- a t)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (a - t)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(a - t)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{a - t}, x\right)
\end{array}
Initial program 99.2%
+-commutative99.2%
fma-def99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.2e+38) (not (<= z 5.7e-27))) (+ x (* y (/ z (- a t)))) (+ x (* t (/ y (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.2e+38) || !(z <= 5.7e-27)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + (t * (y / (t - a)));
}
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 ((z <= (-5.2d+38)) .or. (.not. (z <= 5.7d-27))) then
tmp = x + (y * (z / (a - t)))
else
tmp = x + (t * (y / (t - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.2e+38) || !(z <= 5.7e-27)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + (t * (y / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.2e+38) or not (z <= 5.7e-27): tmp = x + (y * (z / (a - t))) else: tmp = x + (t * (y / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.2e+38) || !(z <= 5.7e-27)) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.2e+38) || ~((z <= 5.7e-27))) tmp = x + (y * (z / (a - t))); else tmp = x + (t * (y / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.2e+38], N[Not[LessEqual[z, 5.7e-27]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+38} \lor \neg \left(z \leq 5.7 \cdot 10^{-27}\right):\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if z < -5.1999999999999998e38 or 5.6999999999999996e-27 < z Initial program 98.5%
Taylor expanded in z around inf 77.8%
associate-*r/85.9%
Simplified85.9%
if -5.1999999999999998e38 < z < 5.6999999999999996e-27Initial program 99.9%
+-commutative99.9%
fma-def100.0%
Simplified100.0%
fma-udef99.9%
clear-num99.9%
un-div-inv99.9%
frac-2neg99.9%
associate-/r/97.2%
neg-sub097.2%
sub-neg97.2%
+-commutative97.2%
associate--r+97.2%
neg-sub097.2%
remove-double-neg97.2%
neg-sub097.2%
sub-neg97.2%
+-commutative97.2%
associate--r+97.2%
neg-sub097.2%
remove-double-neg97.2%
Applied egg-rr97.2%
Taylor expanded in z around 0 81.6%
associate-*r/92.3%
*-commutative92.3%
Applied egg-rr92.3%
Final simplification88.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.12e+99) (not (<= t 8e+88))) (- x (/ y (/ t (- z t)))) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.12e+99) || !(t <= 8e+88)) {
tmp = x - (y / (t / (z - t)));
} else {
tmp = x + (y * (z / (a - t)));
}
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 <= (-2.12d+99)) .or. (.not. (t <= 8d+88))) then
tmp = x - (y / (t / (z - t)))
else
tmp = x + (y * (z / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.12e+99) || !(t <= 8e+88)) {
tmp = x - (y / (t / (z - t)));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.12e+99) or not (t <= 8e+88): tmp = x - (y / (t / (z - t))) else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.12e+99) || !(t <= 8e+88)) tmp = Float64(x - Float64(y / Float64(t / Float64(z - t)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.12e+99) || ~((t <= 8e+88))) tmp = x - (y / (t / (z - t))); else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.12e+99], N[Not[LessEqual[t, 8e+88]], $MachinePrecision]], N[(x - N[(y / N[(t / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.12 \cdot 10^{+99} \lor \neg \left(t \leq 8 \cdot 10^{+88}\right):\\
\;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -2.11999999999999999e99 or 7.99999999999999968e88 < t Initial program 99.9%
Taylor expanded in a around 0 61.2%
associate-/l*95.0%
associate-*r/95.0%
neg-mul-195.0%
Simplified95.0%
if -2.11999999999999999e99 < t < 7.99999999999999968e88Initial program 98.8%
Taylor expanded in z around inf 83.8%
associate-*r/85.6%
Simplified85.6%
Final simplification88.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.4e+81) (+ y x) (if (<= t 8.5e+86) (+ x (* y (/ z (- a t)))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.4e+81) {
tmp = y + x;
} else if (t <= 8.5e+86) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = 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 <= (-1.4d+81)) then
tmp = y + x
else if (t <= 8.5d+86) then
tmp = x + (y * (z / (a - t)))
else
tmp = 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 <= -1.4e+81) {
tmp = y + x;
} else if (t <= 8.5e+86) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.4e+81: tmp = y + x elif t <= 8.5e+86: tmp = x + (y * (z / (a - t))) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.4e+81) tmp = Float64(y + x); elseif (t <= 8.5e+86) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.4e+81) tmp = y + x; elseif (t <= 8.5e+86) tmp = x + (y * (z / (a - t))); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.4e+81], N[(y + x), $MachinePrecision], If[LessEqual[t, 8.5e+86], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{+81}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+86}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -1.39999999999999997e81 or 8.5000000000000005e86 < t Initial program 99.9%
Taylor expanded in t around inf 90.2%
+-commutative90.2%
Simplified90.2%
if -1.39999999999999997e81 < t < 8.5000000000000005e86Initial program 98.8%
Taylor expanded in z around inf 84.6%
associate-*r/85.8%
Simplified85.8%
Final simplification87.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.95e+99) (+ x (* (/ y t) (- t z))) (if (<= t 2.2e+87) (+ x (* y (/ z (- a t)))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.95e+99) {
tmp = x + ((y / t) * (t - z));
} else if (t <= 2.2e+87) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = 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 <= (-1.95d+99)) then
tmp = x + ((y / t) * (t - z))
else if (t <= 2.2d+87) then
tmp = x + (y * (z / (a - t)))
else
tmp = 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 <= -1.95e+99) {
tmp = x + ((y / t) * (t - z));
} else if (t <= 2.2e+87) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.95e+99: tmp = x + ((y / t) * (t - z)) elif t <= 2.2e+87: tmp = x + (y * (z / (a - t))) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.95e+99) tmp = Float64(x + Float64(Float64(y / t) * Float64(t - z))); elseif (t <= 2.2e+87) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.95e+99) tmp = x + ((y / t) * (t - z)); elseif (t <= 2.2e+87) tmp = x + (y * (z / (a - t))); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.95e+99], N[(x + N[(N[(y / t), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.2e+87], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{+99}:\\
\;\;\;\;x + \frac{y}{t} \cdot \left(t - z\right)\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{+87}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -1.94999999999999997e99Initial program 99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
fma-udef99.9%
clear-num99.8%
un-div-inv99.9%
frac-2neg99.9%
associate-/r/97.6%
neg-sub097.6%
sub-neg97.6%
+-commutative97.6%
associate--r+97.6%
neg-sub097.6%
remove-double-neg97.6%
neg-sub097.6%
sub-neg97.6%
+-commutative97.6%
associate--r+97.6%
neg-sub097.6%
remove-double-neg97.6%
Applied egg-rr97.6%
Taylor expanded in t around inf 89.4%
if -1.94999999999999997e99 < t < 2.2000000000000001e87Initial program 98.8%
Taylor expanded in z around inf 83.7%
associate-*r/85.5%
Simplified85.5%
if 2.2000000000000001e87 < t Initial program 100.0%
Taylor expanded in t around inf 95.9%
+-commutative95.9%
Simplified95.9%
Final simplification88.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -7e+82) (+ y x) (if (<= t 3.4) (+ x (* y (/ z a))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7e+82) {
tmp = y + x;
} else if (t <= 3.4) {
tmp = x + (y * (z / a));
} else {
tmp = 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 <= (-7d+82)) then
tmp = y + x
else if (t <= 3.4d0) then
tmp = x + (y * (z / a))
else
tmp = 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 <= -7e+82) {
tmp = y + x;
} else if (t <= 3.4) {
tmp = x + (y * (z / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7e+82: tmp = y + x elif t <= 3.4: tmp = x + (y * (z / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7e+82) tmp = Float64(y + x); elseif (t <= 3.4) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7e+82) tmp = y + x; elseif (t <= 3.4) tmp = x + (y * (z / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7e+82], N[(y + x), $MachinePrecision], If[LessEqual[t, 3.4], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+82}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 3.4:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -7.0000000000000001e82 or 3.39999999999999991 < t Initial program 99.9%
Taylor expanded in t around inf 87.1%
+-commutative87.1%
Simplified87.1%
if -7.0000000000000001e82 < t < 3.39999999999999991Initial program 98.6%
Taylor expanded in t around 0 77.0%
Final simplification81.5%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((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 * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Initial program 99.2%
Final simplification99.2%
(FPCore (x y z t a) :precision binary64 (if (<= a 8.5e+190) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 8.5e+190) {
tmp = y + x;
} else {
tmp = 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 (a <= 8.5d+190) then
tmp = y + x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 8.5e+190) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 8.5e+190: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 8.5e+190) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 8.5e+190) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 8.5e+190], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 8.5 \cdot 10^{+190}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 8.50000000000000022e190Initial program 99.1%
Taylor expanded in t around inf 65.3%
+-commutative65.3%
Simplified65.3%
if 8.50000000000000022e190 < a Initial program 99.9%
Taylor expanded in x around inf 87.0%
Final simplification67.2%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return 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 = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.2%
Taylor expanded in x around inf 51.0%
Final simplification51.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (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 * ((z - t) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (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 * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023297
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))