
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (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) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (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) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (+ x y) (/ (* y (- t z)) (- a t)))))
(if (or (<= t_1 -4e-140) (not (<= t_1 0.0)))
(fma (/ (- t z) (- a t)) y (+ x y))
(+ x (/ (* y (- z a)) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if ((t_1 <= -4e-140) || !(t_1 <= 0.0)) {
tmp = fma(((t - z) / (a - t)), y, (x + y));
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) + Float64(Float64(y * Float64(t - z)) / Float64(a - t))) tmp = 0.0 if ((t_1 <= -4e-140) || !(t_1 <= 0.0)) tmp = fma(Float64(Float64(t - z) / Float64(a - t)), y, Float64(x + y)); else tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -4e-140], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-140} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{t - z}{a - t}, y, x + y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -3.9999999999999999e-140 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 83.0%
sub-neg83.0%
distribute-frac-neg83.0%
distribute-rgt-neg-out83.0%
+-commutative83.0%
associate-*l/92.2%
distribute-rgt-neg-in92.2%
distribute-lft-neg-in92.2%
distribute-frac-neg92.2%
fma-def92.3%
sub-neg92.3%
distribute-neg-in92.3%
remove-double-neg92.3%
+-commutative92.3%
sub-neg92.3%
Simplified92.3%
if -3.9999999999999999e-140 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 20.7%
associate-*l/20.8%
Simplified20.8%
associate-/r/19.2%
Applied egg-rr19.2%
Taylor expanded in t around inf 93.9%
associate--l+93.9%
associate-*r/93.9%
associate-*r/93.9%
div-sub93.9%
distribute-lft-out--93.9%
associate-*r/93.9%
mul-1-neg93.9%
unsub-neg93.9%
*-commutative93.9%
cancel-sign-sub-inv93.9%
distribute-rgt-in93.9%
sub-neg93.9%
Simplified93.9%
Final simplification92.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (+ x y) (/ (* y (- t z)) (- a t)))))
(if (or (<= t_1 -4e-140) (not (<= t_1 0.0)))
(+ (+ x y) (* y (/ (- t z) (- a t))))
(+ x (/ (* y (- z a)) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if ((t_1 <= -4e-140) || !(t_1 <= 0.0)) {
tmp = (x + y) + (y * ((t - z) / (a - 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) :: t_1
real(8) :: tmp
t_1 = (x + y) + ((y * (t - z)) / (a - t))
if ((t_1 <= (-4d-140)) .or. (.not. (t_1 <= 0.0d0))) then
tmp = (x + y) + (y * ((t - z) / (a - 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 t_1 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if ((t_1 <= -4e-140) || !(t_1 <= 0.0)) {
tmp = (x + y) + (y * ((t - z) / (a - t)));
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) + ((y * (t - z)) / (a - t)) tmp = 0 if (t_1 <= -4e-140) or not (t_1 <= 0.0): tmp = (x + y) + (y * ((t - z) / (a - t))) else: tmp = x + ((y * (z - a)) / t) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) + Float64(Float64(y * Float64(t - z)) / Float64(a - t))) tmp = 0.0 if ((t_1 <= -4e-140) || !(t_1 <= 0.0)) tmp = Float64(Float64(x + y) + Float64(y * Float64(Float64(t - z) / Float64(a - t)))); else tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) + ((y * (t - z)) / (a - t)); tmp = 0.0; if ((t_1 <= -4e-140) || ~((t_1 <= 0.0))) tmp = (x + y) + (y * ((t - z) / (a - t))); else tmp = x + ((y * (z - a)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -4e-140], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] + N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-140} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;\left(x + y\right) + y \cdot \frac{t - z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -3.9999999999999999e-140 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 83.0%
associate-*l/92.2%
Simplified92.2%
if -3.9999999999999999e-140 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 20.7%
associate-*l/20.8%
Simplified20.8%
associate-/r/19.2%
Applied egg-rr19.2%
Taylor expanded in t around inf 93.9%
associate--l+93.9%
associate-*r/93.9%
associate-*r/93.9%
div-sub93.9%
distribute-lft-out--93.9%
associate-*r/93.9%
mul-1-neg93.9%
unsub-neg93.9%
*-commutative93.9%
cancel-sign-sub-inv93.9%
distribute-rgt-in93.9%
sub-neg93.9%
Simplified93.9%
Final simplification92.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.45) (not (<= a 0.022))) (+ x y) (+ x (/ (* y (- z a)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.45) || !(a <= 0.022)) {
tmp = x + y;
} 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 ((a <= (-1.45d0)) .or. (.not. (a <= 0.022d0))) then
tmp = x + y
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 ((a <= -1.45) || !(a <= 0.022)) {
tmp = x + y;
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.45) or not (a <= 0.022): tmp = x + y else: tmp = x + ((y * (z - a)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.45) || !(a <= 0.022)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.45) || ~((a <= 0.022))) tmp = x + y; else tmp = x + ((y * (z - a)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.45], N[Not[LessEqual[a, 0.022]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.45 \lor \neg \left(a \leq 0.022\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
if a < -1.44999999999999996 or 0.021999999999999999 < a Initial program 77.5%
associate-*l/93.7%
Simplified93.7%
Taylor expanded in a around inf 80.3%
+-commutative80.3%
Simplified80.3%
if -1.44999999999999996 < a < 0.021999999999999999Initial program 78.8%
associate-*l/78.9%
Simplified78.9%
associate-/r/78.5%
Applied egg-rr78.5%
Taylor expanded in t around inf 80.0%
associate--l+80.0%
associate-*r/80.0%
associate-*r/80.0%
div-sub80.0%
distribute-lft-out--80.0%
associate-*r/80.0%
mul-1-neg80.0%
unsub-neg80.0%
*-commutative80.0%
cancel-sign-sub-inv80.0%
distribute-rgt-in80.0%
sub-neg80.0%
Simplified80.0%
Final simplification80.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -5e-70) (not (<= a 3.7e-21))) (- (+ x y) (* y (/ z a))) (+ x (/ (* y (- z a)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5e-70) || !(a <= 3.7e-21)) {
tmp = (x + y) - (y * (z / a));
} 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 ((a <= (-5d-70)) .or. (.not. (a <= 3.7d-21))) then
tmp = (x + y) - (y * (z / a))
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 ((a <= -5e-70) || !(a <= 3.7e-21)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -5e-70) or not (a <= 3.7e-21): tmp = (x + y) - (y * (z / a)) else: tmp = x + ((y * (z - a)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -5e-70) || !(a <= 3.7e-21)) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -5e-70) || ~((a <= 3.7e-21))) tmp = (x + y) - (y * (z / a)); else tmp = x + ((y * (z - a)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -5e-70], N[Not[LessEqual[a, 3.7e-21]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5 \cdot 10^{-70} \lor \neg \left(a \leq 3.7 \cdot 10^{-21}\right):\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
if a < -4.9999999999999998e-70 or 3.7000000000000002e-21 < a Initial program 76.9%
associate-*l/91.8%
Simplified91.8%
Taylor expanded in t around 0 88.6%
if -4.9999999999999998e-70 < a < 3.7000000000000002e-21Initial program 79.9%
associate-*l/79.2%
Simplified79.2%
associate-/r/78.7%
Applied egg-rr78.7%
Taylor expanded in t around inf 82.1%
associate--l+82.1%
associate-*r/82.1%
associate-*r/82.1%
div-sub82.1%
distribute-lft-out--82.1%
associate-*r/82.1%
mul-1-neg82.1%
unsub-neg82.1%
*-commutative82.1%
cancel-sign-sub-inv82.1%
distribute-rgt-in82.1%
sub-neg82.1%
Simplified82.1%
Final simplification85.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.8e-70) (- (+ x y) (* y (/ z a))) (if (<= a 9e-23) (+ x (/ (* y (- z a)) t)) (- (+ x y) (/ y (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.8e-70) {
tmp = (x + y) - (y * (z / a));
} else if (a <= 9e-23) {
tmp = x + ((y * (z - a)) / t);
} else {
tmp = (x + y) - (y / (a / z));
}
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 <= (-2.8d-70)) then
tmp = (x + y) - (y * (z / a))
else if (a <= 9d-23) then
tmp = x + ((y * (z - a)) / t)
else
tmp = (x + y) - (y / (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.8e-70) {
tmp = (x + y) - (y * (z / a));
} else if (a <= 9e-23) {
tmp = x + ((y * (z - a)) / t);
} else {
tmp = (x + y) - (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.8e-70: tmp = (x + y) - (y * (z / a)) elif a <= 9e-23: tmp = x + ((y * (z - a)) / t) else: tmp = (x + y) - (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.8e-70) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); elseif (a <= 9e-23) tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); else tmp = Float64(Float64(x + y) - Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.8e-70) tmp = (x + y) - (y * (z / a)); elseif (a <= 9e-23) tmp = x + ((y * (z - a)) / t); else tmp = (x + y) - (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.8e-70], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9e-23], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.8 \cdot 10^{-70}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq 9 \cdot 10^{-23}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if a < -2.7999999999999999e-70Initial program 80.5%
associate-*l/92.5%
Simplified92.5%
Taylor expanded in t around 0 88.9%
if -2.7999999999999999e-70 < a < 8.9999999999999995e-23Initial program 79.9%
associate-*l/79.2%
Simplified79.2%
associate-/r/78.7%
Applied egg-rr78.7%
Taylor expanded in t around inf 82.1%
associate--l+82.1%
associate-*r/82.1%
associate-*r/82.1%
div-sub82.1%
distribute-lft-out--82.1%
associate-*r/82.1%
mul-1-neg82.1%
unsub-neg82.1%
*-commutative82.1%
cancel-sign-sub-inv82.1%
distribute-rgt-in82.1%
sub-neg82.1%
Simplified82.1%
if 8.9999999999999995e-23 < a Initial program 71.1%
associate-*l/90.7%
Simplified90.7%
Taylor expanded in t around 0 75.6%
associate-/l*88.2%
Simplified88.2%
Final simplification86.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -6.5e-70) (- (+ x y) (* y (/ z a))) (if (<= a 5.5e-5) (+ x (/ y (/ t (- z a)))) (- (+ x y) (/ y (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.5e-70) {
tmp = (x + y) - (y * (z / a));
} else if (a <= 5.5e-5) {
tmp = x + (y / (t / (z - a)));
} else {
tmp = (x + y) - (y / (a / z));
}
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 <= (-6.5d-70)) then
tmp = (x + y) - (y * (z / a))
else if (a <= 5.5d-5) then
tmp = x + (y / (t / (z - a)))
else
tmp = (x + y) - (y / (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.5e-70) {
tmp = (x + y) - (y * (z / a));
} else if (a <= 5.5e-5) {
tmp = x + (y / (t / (z - a)));
} else {
tmp = (x + y) - (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6.5e-70: tmp = (x + y) - (y * (z / a)) elif a <= 5.5e-5: tmp = x + (y / (t / (z - a))) else: tmp = (x + y) - (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.5e-70) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); elseif (a <= 5.5e-5) tmp = Float64(x + Float64(y / Float64(t / Float64(z - a)))); else tmp = Float64(Float64(x + y) - Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -6.5e-70) tmp = (x + y) - (y * (z / a)); elseif (a <= 5.5e-5) tmp = x + (y / (t / (z - a))); else tmp = (x + y) - (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.5e-70], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.5e-5], N[(x + N[(y / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.5 \cdot 10^{-70}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{-5}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if a < -6.5000000000000005e-70Initial program 80.5%
associate-*l/92.5%
Simplified92.5%
Taylor expanded in t around 0 88.9%
if -6.5000000000000005e-70 < a < 5.5000000000000002e-5Initial program 79.4%
sub-neg79.4%
distribute-frac-neg79.4%
distribute-rgt-neg-out79.4%
+-commutative79.4%
associate-*l/79.5%
distribute-rgt-neg-in79.5%
distribute-lft-neg-in79.5%
distribute-frac-neg79.5%
fma-def79.6%
sub-neg79.6%
distribute-neg-in79.6%
remove-double-neg79.6%
+-commutative79.6%
sub-neg79.6%
Simplified79.6%
Taylor expanded in t around inf 75.7%
associate-+r+81.6%
distribute-rgt1-in81.6%
metadata-eval81.6%
mul0-lft81.6%
associate-/l*82.4%
Simplified82.4%
if 5.5000000000000002e-5 < a Initial program 71.7%
associate-*l/90.4%
Simplified90.4%
Taylor expanded in t around 0 76.4%
associate-/l*89.4%
Simplified89.4%
Final simplification86.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.1e+150) (not (<= z 1.55e+151))) (* z (/ (- y) (- a t))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.1e+150) || !(z <= 1.55e+151)) {
tmp = z * (-y / (a - t));
} else {
tmp = x + y;
}
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 <= (-3.1d+150)) .or. (.not. (z <= 1.55d+151))) then
tmp = z * (-y / (a - t))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.1e+150) || !(z <= 1.55e+151)) {
tmp = z * (-y / (a - t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.1e+150) or not (z <= 1.55e+151): tmp = z * (-y / (a - t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.1e+150) || !(z <= 1.55e+151)) tmp = Float64(z * Float64(Float64(-y) / Float64(a - t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.1e+150) || ~((z <= 1.55e+151))) tmp = z * (-y / (a - t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.1e+150], N[Not[LessEqual[z, 1.55e+151]], $MachinePrecision]], N[(z * N[((-y) / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+150} \lor \neg \left(z \leq 1.55 \cdot 10^{+151}\right):\\
\;\;\;\;z \cdot \frac{-y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -3.10000000000000014e150 or 1.5500000000000001e151 < z Initial program 79.7%
associate-*l/92.9%
Simplified92.9%
associate-/r/94.4%
Applied egg-rr94.4%
Taylor expanded in z around inf 53.7%
mul-1-neg53.7%
associate-*l/64.0%
*-commutative64.0%
distribute-lft-neg-in64.0%
Simplified64.0%
if -3.10000000000000014e150 < z < 1.5500000000000001e151Initial program 77.6%
associate-*l/84.3%
Simplified84.3%
Taylor expanded in a around inf 75.0%
+-commutative75.0%
Simplified75.0%
Final simplification72.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.7e+150) (* z (/ (- y) (- a t))) (if (<= z 2.95e+150) (+ x y) (/ (- y) (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.7e+150) {
tmp = z * (-y / (a - t));
} else if (z <= 2.95e+150) {
tmp = x + y;
} else {
tmp = -y / ((a - t) / z);
}
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 <= (-2.7d+150)) then
tmp = z * (-y / (a - t))
else if (z <= 2.95d+150) then
tmp = x + y
else
tmp = -y / ((a - t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.7e+150) {
tmp = z * (-y / (a - t));
} else if (z <= 2.95e+150) {
tmp = x + y;
} else {
tmp = -y / ((a - t) / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.7e+150: tmp = z * (-y / (a - t)) elif z <= 2.95e+150: tmp = x + y else: tmp = -y / ((a - t) / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.7e+150) tmp = Float64(z * Float64(Float64(-y) / Float64(a - t))); elseif (z <= 2.95e+150) tmp = Float64(x + y); else tmp = Float64(Float64(-y) / Float64(Float64(a - t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.7e+150) tmp = z * (-y / (a - t)); elseif (z <= 2.95e+150) tmp = x + y; else tmp = -y / ((a - t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.7e+150], N[(z * N[((-y) / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.95e+150], N[(x + y), $MachinePrecision], N[((-y) / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+150}:\\
\;\;\;\;z \cdot \frac{-y}{a - t}\\
\mathbf{elif}\;z \leq 2.95 \cdot 10^{+150}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\frac{-y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if z < -2.70000000000000008e150Initial program 75.7%
associate-*l/87.2%
Simplified87.2%
associate-/r/93.6%
Applied egg-rr93.6%
Taylor expanded in z around inf 52.6%
mul-1-neg52.6%
associate-*l/67.6%
*-commutative67.6%
distribute-lft-neg-in67.6%
Simplified67.6%
if -2.70000000000000008e150 < z < 2.95000000000000012e150Initial program 77.6%
associate-*l/84.3%
Simplified84.3%
Taylor expanded in a around inf 75.0%
+-commutative75.0%
Simplified75.0%
if 2.95000000000000012e150 < z Initial program 82.9%
associate-*l/97.5%
Simplified97.5%
associate-/r/95.1%
Applied egg-rr95.1%
Taylor expanded in z around inf 54.6%
mul-1-neg54.6%
associate-*l/61.1%
*-commutative61.1%
distribute-lft-neg-in61.1%
Simplified61.1%
Taylor expanded in z around 0 54.6%
neg-mul-154.6%
associate-/l*61.4%
distribute-neg-frac61.4%
Simplified61.4%
Final simplification72.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e+237) (not (<= z 9.8e+204))) (* y (/ z t)) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e+237) || !(z <= 9.8e+204)) {
tmp = y * (z / t);
} else {
tmp = x + y;
}
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 <= (-1.1d+237)) .or. (.not. (z <= 9.8d+204))) then
tmp = y * (z / t)
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e+237) || !(z <= 9.8e+204)) {
tmp = y * (z / t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.1e+237) or not (z <= 9.8e+204): tmp = y * (z / t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.1e+237) || !(z <= 9.8e+204)) tmp = Float64(y * Float64(z / t)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.1e+237) || ~((z <= 9.8e+204))) tmp = y * (z / t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.1e+237], N[Not[LessEqual[z, 9.8e+204]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+237} \lor \neg \left(z \leq 9.8 \cdot 10^{+204}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.1e237 or 9.7999999999999995e204 < z Initial program 84.5%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in x around 0 65.0%
sub-neg65.0%
associate-*r/73.1%
*-rgt-identity73.1%
distribute-rgt-neg-in73.1%
distribute-frac-neg73.1%
distribute-lft-in73.1%
distribute-frac-neg73.1%
sub-neg73.1%
Simplified73.1%
Taylor expanded in a around 0 56.5%
if -1.1e237 < z < 9.7999999999999995e204Initial program 77.1%
associate-*l/84.8%
Simplified84.8%
Taylor expanded in a around inf 70.7%
+-commutative70.7%
Simplified70.7%
Final simplification68.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.85e+236) (not (<= z 3.4e+202))) (* z (/ y t)) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.85e+236) || !(z <= 3.4e+202)) {
tmp = z * (y / t);
} else {
tmp = x + y;
}
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 <= (-3.85d+236)) .or. (.not. (z <= 3.4d+202))) then
tmp = z * (y / t)
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.85e+236) || !(z <= 3.4e+202)) {
tmp = z * (y / t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.85e+236) or not (z <= 3.4e+202): tmp = z * (y / t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.85e+236) || !(z <= 3.4e+202)) tmp = Float64(z * Float64(y / t)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.85e+236) || ~((z <= 3.4e+202))) tmp = z * (y / t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.85e+236], N[Not[LessEqual[z, 3.4e+202]], $MachinePrecision]], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.85 \cdot 10^{+236} \lor \neg \left(z \leq 3.4 \cdot 10^{+202}\right):\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -3.85000000000000018e236 or 3.4e202 < z Initial program 84.5%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in x around 0 65.0%
sub-neg65.0%
associate-*r/73.1%
*-rgt-identity73.1%
distribute-rgt-neg-in73.1%
distribute-frac-neg73.1%
distribute-lft-in73.1%
distribute-frac-neg73.1%
sub-neg73.1%
Simplified73.1%
Taylor expanded in a around 0 51.5%
associate-/l*56.5%
associate-/r/58.7%
Applied egg-rr58.7%
if -3.85000000000000018e236 < z < 3.4e202Initial program 77.1%
associate-*l/84.8%
Simplified84.8%
Taylor expanded in a around inf 70.7%
+-commutative70.7%
Simplified70.7%
Final simplification69.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.95e+237) (/ y (/ t z)) (if (<= z 1.2e+208) (+ x y) (* z (/ y t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.95e+237) {
tmp = y / (t / z);
} else if (z <= 1.2e+208) {
tmp = x + y;
} else {
tmp = z * (y / 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 (z <= (-1.95d+237)) then
tmp = y / (t / z)
else if (z <= 1.2d+208) then
tmp = x + y
else
tmp = z * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.95e+237) {
tmp = y / (t / z);
} else if (z <= 1.2e+208) {
tmp = x + y;
} else {
tmp = z * (y / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.95e+237: tmp = y / (t / z) elif z <= 1.2e+208: tmp = x + y else: tmp = z * (y / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.95e+237) tmp = Float64(y / Float64(t / z)); elseif (z <= 1.2e+208) tmp = Float64(x + y); else tmp = Float64(z * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.95e+237) tmp = y / (t / z); elseif (z <= 1.2e+208) tmp = x + y; else tmp = z * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.95e+237], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e+208], N[(x + y), $MachinePrecision], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+237}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+208}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if z < -1.9500000000000001e237Initial program 83.0%
associate-*l/99.7%
Simplified99.7%
Taylor expanded in x around 0 74.0%
sub-neg74.0%
associate-*r/90.7%
*-rgt-identity90.7%
distribute-rgt-neg-in90.7%
distribute-frac-neg90.7%
distribute-lft-in90.7%
distribute-frac-neg90.7%
sub-neg90.7%
Simplified90.7%
Taylor expanded in a around 0 56.4%
associate-/l*73.3%
Simplified73.3%
if -1.9500000000000001e237 < z < 1.19999999999999993e208Initial program 77.1%
associate-*l/84.8%
Simplified84.8%
Taylor expanded in a around inf 70.7%
+-commutative70.7%
Simplified70.7%
if 1.19999999999999993e208 < z Initial program 85.2%
associate-*l/96.2%
Simplified96.2%
Taylor expanded in x around 0 61.2%
sub-neg61.2%
associate-*r/65.7%
*-rgt-identity65.7%
distribute-rgt-neg-in65.7%
distribute-frac-neg65.7%
distribute-lft-in65.7%
distribute-frac-neg65.7%
sub-neg65.7%
Simplified65.7%
Taylor expanded in a around 0 49.5%
associate-/l*49.4%
associate-/r/52.5%
Applied egg-rr52.5%
Final simplification69.0%
(FPCore (x y z t a) :precision binary64 (if (<= y -3.2e+163) y (if (<= y 2.7e+141) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.2e+163) {
tmp = y;
} else if (y <= 2.7e+141) {
tmp = x;
} else {
tmp = y;
}
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 <= (-3.2d+163)) then
tmp = y
else if (y <= 2.7d+141) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.2e+163) {
tmp = y;
} else if (y <= 2.7e+141) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3.2e+163: tmp = y elif y <= 2.7e+141: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.2e+163) tmp = y; elseif (y <= 2.7e+141) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -3.2e+163) tmp = y; elseif (y <= 2.7e+141) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.2e+163], y, If[LessEqual[y, 2.7e+141], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{+163}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+141}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -3.1999999999999998e163 or 2.7000000000000001e141 < y Initial program 57.6%
associate-*l/82.0%
Simplified82.0%
Taylor expanded in x around 0 56.2%
sub-neg56.2%
associate-*r/74.1%
*-rgt-identity74.1%
distribute-rgt-neg-in74.1%
distribute-frac-neg74.1%
distribute-lft-in74.1%
distribute-frac-neg74.1%
sub-neg74.1%
Simplified74.1%
Taylor expanded in z around 0 48.2%
Taylor expanded in t around 0 47.6%
if -3.1999999999999998e163 < y < 2.7000000000000001e141Initial program 85.9%
associate-*l/88.4%
Simplified88.4%
Taylor expanded in x around inf 62.1%
Final simplification58.2%
(FPCore (x y z t a) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a) {
return x + y;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
return x + y;
}
def code(x, y, z, t, a): return x + y
function code(x, y, z, t, a) return Float64(x + y) end
function tmp = code(x, y, z, t, a) tmp = x + y; end
code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
\begin{array}{l}
\\
x + y
\end{array}
Initial program 78.1%
associate-*l/86.6%
Simplified86.6%
Taylor expanded in a around inf 63.7%
+-commutative63.7%
Simplified63.7%
Final simplification63.7%
(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 78.1%
associate-*l/86.6%
Simplified86.6%
Taylor expanded in x around inf 49.3%
Final simplification49.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (< t_2 -1.3664970889390727e-7)
t_1
(if (< t_2 1.4754293444577233e-239)
(/ (- (* y (- a z)) (* x t)) (- a t))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * 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) :: t_2
real(8) :: tmp
t_1 = (y + x) - (((z - t) * (1.0d0 / (a - t))) * y)
t_2 = (x + y) - (((z - t) * y) / (a - t))
if (t_2 < (-1.3664970889390727d-7)) then
tmp = t_1
else if (t_2 < 1.4754293444577233d-239) then
tmp = ((y * (a - z)) - (x * 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 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y) t_2 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_2 < -1.3664970889390727e-7: tmp = t_1 elif t_2 < 1.4754293444577233e-239: tmp = ((y * (a - z)) - (x * t)) / (a - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y + x) - Float64(Float64(Float64(z - t) * Float64(1.0 / Float64(a - t))) * y)) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = Float64(Float64(Float64(y * Float64(a - z)) - Float64(x * t)) / Float64(a - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y); t_2 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = ((y * (a - z)) - (x * t)) / (a - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -1.3664970889390727e-7], t$95$1, If[Less[t$95$2, 1.4754293444577233e-239], N[(N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_2 < -1.3664970889390727 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 < 1.4754293444577233 \cdot 10^{-239}:\\
\;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024036
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-7) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))