
(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 13 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 (+ x (/ t (/ (- z a) (- z y)))))
double code(double x, double y, double z, double t, double a) {
return x + (t / ((z - a) / (z - 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 + (t / ((z - a) / (z - y)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t / ((z - a) / (z - y)));
}
def code(x, y, z, t, a): return x + (t / ((z - a) / (z - y)))
function code(x, y, z, t, a) return Float64(x + Float64(t / Float64(Float64(z - a) / Float64(z - y)))) end
function tmp = code(x, y, z, t, a) tmp = x + (t / ((z - a) / (z - y))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t / N[(N[(z - a), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{t}{\frac{z - a}{z - y}}
\end{array}
Initial program 87.1%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in y around 0 86.2%
associate-*r/86.2%
mul-1-neg86.2%
distribute-rgt-neg-out86.2%
associate-*l/90.3%
+-commutative90.3%
associate-*l/95.4%
distribute-lft-out96.2%
sub-neg96.2%
associate-*l/87.1%
associate-*r/98.8%
Simplified98.8%
clear-num98.8%
un-div-inv98.9%
Applied egg-rr98.9%
Final simplification98.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.5e+90)
(+ x t)
(if (<= z -8e-67)
(- x (/ t (/ z y)))
(if (<= z 2.75e+22) (+ x (/ t (/ a y))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.5e+90) {
tmp = x + t;
} else if (z <= -8e-67) {
tmp = x - (t / (z / y));
} else if (z <= 2.75e+22) {
tmp = x + (t / (a / y));
} else {
tmp = x + 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 <= (-6.5d+90)) then
tmp = x + t
else if (z <= (-8d-67)) then
tmp = x - (t / (z / y))
else if (z <= 2.75d+22) then
tmp = x + (t / (a / y))
else
tmp = x + 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 <= -6.5e+90) {
tmp = x + t;
} else if (z <= -8e-67) {
tmp = x - (t / (z / y));
} else if (z <= 2.75e+22) {
tmp = x + (t / (a / y));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.5e+90: tmp = x + t elif z <= -8e-67: tmp = x - (t / (z / y)) elif z <= 2.75e+22: tmp = x + (t / (a / y)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.5e+90) tmp = Float64(x + t); elseif (z <= -8e-67) tmp = Float64(x - Float64(t / Float64(z / y))); elseif (z <= 2.75e+22) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.5e+90) tmp = x + t; elseif (z <= -8e-67) tmp = x - (t / (z / y)); elseif (z <= 2.75e+22) tmp = x + (t / (a / y)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.5e+90], N[(x + t), $MachinePrecision], If[LessEqual[z, -8e-67], N[(x - N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.75e+22], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+90}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-67}:\\
\;\;\;\;x - \frac{t}{\frac{z}{y}}\\
\mathbf{elif}\;z \leq 2.75 \cdot 10^{+22}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -6.5000000000000001e90 or 2.7500000000000001e22 < z Initial program 73.3%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in z around inf 72.1%
if -6.5000000000000001e90 < z < -7.99999999999999954e-67Initial program 96.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 96.9%
associate-*r/96.9%
mul-1-neg96.9%
distribute-rgt-neg-out96.9%
associate-*l/96.9%
+-commutative96.9%
associate-*l/99.9%
distribute-lft-out99.8%
sub-neg99.8%
associate-*l/96.9%
associate-*r/99.8%
Simplified99.8%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 88.5%
Taylor expanded in a around 0 75.4%
neg-mul-175.4%
distribute-neg-frac275.4%
Simplified75.4%
if -7.99999999999999954e-67 < z < 2.7500000000000001e22Initial program 95.5%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in y around 0 95.5%
associate-*r/95.5%
mul-1-neg95.5%
distribute-rgt-neg-out95.5%
associate-*l/92.4%
+-commutative92.4%
associate-*l/95.7%
distribute-lft-out97.3%
sub-neg97.3%
associate-*l/95.5%
associate-*r/97.7%
Simplified97.7%
clear-num97.7%
un-div-inv97.9%
Applied egg-rr97.9%
Taylor expanded in z around 0 84.0%
Final simplification78.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.3e+91)
(+ x t)
(if (<= z -1.7e-66)
(- x (* t (/ y z)))
(if (<= z 9.5e+22) (+ x (/ t (/ a y))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.3e+91) {
tmp = x + t;
} else if (z <= -1.7e-66) {
tmp = x - (t * (y / z));
} else if (z <= 9.5e+22) {
tmp = x + (t / (a / y));
} else {
tmp = x + 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.3d+91)) then
tmp = x + t
else if (z <= (-1.7d-66)) then
tmp = x - (t * (y / z))
else if (z <= 9.5d+22) then
tmp = x + (t / (a / y))
else
tmp = x + 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.3e+91) {
tmp = x + t;
} else if (z <= -1.7e-66) {
tmp = x - (t * (y / z));
} else if (z <= 9.5e+22) {
tmp = x + (t / (a / y));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.3e+91: tmp = x + t elif z <= -1.7e-66: tmp = x - (t * (y / z)) elif z <= 9.5e+22: tmp = x + (t / (a / y)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.3e+91) tmp = Float64(x + t); elseif (z <= -1.7e-66) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 9.5e+22) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.3e+91) tmp = x + t; elseif (z <= -1.7e-66) tmp = x - (t * (y / z)); elseif (z <= 9.5e+22) tmp = x + (t / (a / y)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.3e+91], N[(x + t), $MachinePrecision], If[LessEqual[z, -1.7e-66], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+22], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+91}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-66}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+22}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.3e91 or 9.49999999999999937e22 < z Initial program 73.3%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in z around inf 72.1%
if -1.3e91 < z < -1.69999999999999999e-66Initial program 96.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 88.5%
Taylor expanded in a around 0 72.4%
mul-1-neg72.4%
unsub-neg72.4%
associate-/l*75.4%
Simplified75.4%
if -1.69999999999999999e-66 < z < 9.49999999999999937e22Initial program 95.5%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in y around 0 95.5%
associate-*r/95.5%
mul-1-neg95.5%
distribute-rgt-neg-out95.5%
associate-*l/92.4%
+-commutative92.4%
associate-*l/95.7%
distribute-lft-out97.3%
sub-neg97.3%
associate-*l/95.5%
associate-*r/97.7%
Simplified97.7%
clear-num97.7%
un-div-inv97.9%
Applied egg-rr97.9%
Taylor expanded in z around 0 84.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -3.3e-39) (not (<= y 4.2e-85))) (+ x (/ t (/ (- a z) y))) (+ x (* t (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3.3e-39) || !(y <= 4.2e-85)) {
tmp = x + (t / ((a - z) / y));
} else {
tmp = x + (t * (z / (z - 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 ((y <= (-3.3d-39)) .or. (.not. (y <= 4.2d-85))) then
tmp = x + (t / ((a - z) / y))
else
tmp = x + (t * (z / (z - a)))
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.3e-39) || !(y <= 4.2e-85)) {
tmp = x + (t / ((a - z) / y));
} else {
tmp = x + (t * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -3.3e-39) or not (y <= 4.2e-85): tmp = x + (t / ((a - z) / y)) else: tmp = x + (t * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -3.3e-39) || !(y <= 4.2e-85)) tmp = Float64(x + Float64(t / Float64(Float64(a - z) / y))); else tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -3.3e-39) || ~((y <= 4.2e-85))) tmp = x + (t / ((a - z) / y)); else tmp = x + (t * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -3.3e-39], N[Not[LessEqual[y, 4.2e-85]], $MachinePrecision]], N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-39} \lor \neg \left(y \leq 4.2 \cdot 10^{-85}\right):\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if y < -3.29999999999999985e-39 or 4.2e-85 < y Initial program 87.2%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in y around 0 85.7%
associate-*r/85.7%
mul-1-neg85.7%
distribute-rgt-neg-out85.7%
associate-*l/86.8%
+-commutative86.8%
associate-*l/94.9%
distribute-lft-out96.1%
sub-neg96.1%
associate-*l/87.2%
associate-*r/98.8%
Simplified98.8%
clear-num98.7%
un-div-inv98.9%
Applied egg-rr98.9%
Taylor expanded in y around inf 87.8%
if -3.29999999999999985e-39 < y < 4.2e-85Initial program 86.9%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in y around 0 86.9%
associate-*r/86.9%
mul-1-neg86.9%
distribute-rgt-neg-out86.9%
associate-*l/96.3%
+-commutative96.3%
associate-*l/96.3%
distribute-lft-out96.2%
sub-neg96.2%
associate-*l/86.9%
associate-*r/98.9%
Simplified98.9%
Taylor expanded in y around 0 82.0%
mul-1-neg82.0%
unsub-neg82.0%
associate-/l*94.0%
Simplified94.0%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.55e-40) (not (<= y 4.8e-85))) (+ x (/ t (/ (- a z) y))) (- x (* z (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.55e-40) || !(y <= 4.8e-85)) {
tmp = x + (t / ((a - z) / y));
} else {
tmp = x - (z * (t / (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 ((y <= (-1.55d-40)) .or. (.not. (y <= 4.8d-85))) then
tmp = x + (t / ((a - z) / y))
else
tmp = x - (z * (t / (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 ((y <= -1.55e-40) || !(y <= 4.8e-85)) {
tmp = x + (t / ((a - z) / y));
} else {
tmp = x - (z * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.55e-40) or not (y <= 4.8e-85): tmp = x + (t / ((a - z) / y)) else: tmp = x - (z * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.55e-40) || !(y <= 4.8e-85)) tmp = Float64(x + Float64(t / Float64(Float64(a - z) / y))); else tmp = Float64(x - Float64(z * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.55e-40) || ~((y <= 4.8e-85))) tmp = x + (t / ((a - z) / y)); else tmp = x - (z * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.55e-40], N[Not[LessEqual[y, 4.8e-85]], $MachinePrecision]], N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{-40} \lor \neg \left(y \leq 4.8 \cdot 10^{-85}\right):\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if y < -1.55000000000000005e-40 or 4.8000000000000001e-85 < y Initial program 87.2%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in y around 0 85.7%
associate-*r/85.7%
mul-1-neg85.7%
distribute-rgt-neg-out85.7%
associate-*l/86.8%
+-commutative86.8%
associate-*l/94.9%
distribute-lft-out96.1%
sub-neg96.1%
associate-*l/87.2%
associate-*r/98.8%
Simplified98.8%
clear-num98.7%
un-div-inv98.9%
Applied egg-rr98.9%
Taylor expanded in y around inf 87.8%
if -1.55000000000000005e-40 < y < 4.8000000000000001e-85Initial program 86.9%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in y around 0 82.0%
associate-*r/82.0%
mul-1-neg82.0%
distribute-rgt-neg-out82.0%
associate-*l/92.4%
*-commutative92.4%
distribute-lft-neg-out92.4%
distribute-rgt-neg-in92.4%
distribute-frac-neg292.4%
neg-sub092.4%
sub-neg92.4%
+-commutative92.4%
associate--r+92.4%
neg-sub092.4%
remove-double-neg92.4%
Simplified92.4%
Final simplification89.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.8e-40) (not (<= y 4.7e-85))) (- x (* y (/ t (- z a)))) (- x (* z (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.8e-40) || !(y <= 4.7e-85)) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = x - (z * (t / (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 ((y <= (-1.8d-40)) .or. (.not. (y <= 4.7d-85))) then
tmp = x - (y * (t / (z - a)))
else
tmp = x - (z * (t / (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 ((y <= -1.8e-40) || !(y <= 4.7e-85)) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = x - (z * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.8e-40) or not (y <= 4.7e-85): tmp = x - (y * (t / (z - a))) else: tmp = x - (z * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.8e-40) || !(y <= 4.7e-85)) tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); else tmp = Float64(x - Float64(z * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.8e-40) || ~((y <= 4.7e-85))) tmp = x - (y * (t / (z - a))); else tmp = x - (z * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.8e-40], N[Not[LessEqual[y, 4.7e-85]], $MachinePrecision]], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{-40} \lor \neg \left(y \leq 4.7 \cdot 10^{-85}\right):\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if y < -1.8e-40 or 4.70000000000000009e-85 < y Initial program 87.2%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in y around inf 87.0%
if -1.8e-40 < y < 4.70000000000000009e-85Initial program 86.9%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in y around 0 82.0%
associate-*r/82.0%
mul-1-neg82.0%
distribute-rgt-neg-out82.0%
associate-*l/92.4%
*-commutative92.4%
distribute-lft-neg-out92.4%
distribute-rgt-neg-in92.4%
distribute-frac-neg292.4%
neg-sub092.4%
sub-neg92.4%
+-commutative92.4%
associate--r+92.4%
neg-sub092.4%
remove-double-neg92.4%
Simplified92.4%
Final simplification89.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.35e+116) (not (<= z 2.9e+229))) (+ x t) (- x (* y (/ t (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.35e+116) || !(z <= 2.9e+229)) {
tmp = x + t;
} else {
tmp = x - (y * (t / (z - 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 <= (-1.35d+116)) .or. (.not. (z <= 2.9d+229))) then
tmp = x + t
else
tmp = x - (y * (t / (z - 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 <= -1.35e+116) || !(z <= 2.9e+229)) {
tmp = x + t;
} else {
tmp = x - (y * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.35e+116) or not (z <= 2.9e+229): tmp = x + t else: tmp = x - (y * (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.35e+116) || !(z <= 2.9e+229)) tmp = Float64(x + t); else tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.35e+116) || ~((z <= 2.9e+229))) tmp = x + t; else tmp = x - (y * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.35e+116], N[Not[LessEqual[z, 2.9e+229]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+116} \lor \neg \left(z \leq 2.9 \cdot 10^{+229}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if z < -1.35e116 or 2.89999999999999981e229 < z Initial program 58.9%
associate-/l*90.5%
Simplified90.5%
Taylor expanded in z around inf 82.4%
if -1.35e116 < z < 2.89999999999999981e229Initial program 94.8%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in y around inf 86.7%
Final simplification85.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.9e+76) (not (<= z 2.15e+22))) (+ x t) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.9e+76) || !(z <= 2.15e+22)) {
tmp = x + t;
} else {
tmp = x + (t / (a / 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 <= (-4.9d+76)) .or. (.not. (z <= 2.15d+22))) then
tmp = x + t
else
tmp = x + (t / (a / 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 <= -4.9e+76) || !(z <= 2.15e+22)) {
tmp = x + t;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.9e+76) or not (z <= 2.15e+22): tmp = x + t else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.9e+76) || !(z <= 2.15e+22)) tmp = Float64(x + t); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.9e+76) || ~((z <= 2.15e+22))) tmp = x + t; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.9e+76], N[Not[LessEqual[z, 2.15e+22]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.9 \cdot 10^{+76} \lor \neg \left(z \leq 2.15 \cdot 10^{+22}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -4.90000000000000026e76 or 2.1500000000000001e22 < z Initial program 74.1%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in z around inf 72.0%
if -4.90000000000000026e76 < z < 2.1500000000000001e22Initial program 95.7%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in y around 0 95.7%
associate-*r/95.7%
mul-1-neg95.7%
distribute-rgt-neg-out95.7%
associate-*l/93.1%
+-commutative93.1%
associate-*l/96.4%
distribute-lft-out97.7%
sub-neg97.7%
associate-*l/95.7%
associate-*r/98.1%
Simplified98.1%
clear-num98.1%
un-div-inv98.2%
Applied egg-rr98.2%
Taylor expanded in z around 0 78.4%
Final simplification75.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.8e+78) (not (<= z 1.66e+22))) (+ x t) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.8e+78) || !(z <= 1.66e+22)) {
tmp = x + t;
} else {
tmp = x + (t * (y / 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 <= (-2.8d+78)) .or. (.not. (z <= 1.66d+22))) then
tmp = x + t
else
tmp = x + (t * (y / 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 <= -2.8e+78) || !(z <= 1.66e+22)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.8e+78) or not (z <= 1.66e+22): tmp = x + t else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.8e+78) || !(z <= 1.66e+22)) tmp = Float64(x + t); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.8e+78) || ~((z <= 1.66e+22))) tmp = x + t; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.8e+78], N[Not[LessEqual[z, 1.66e+22]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+78} \lor \neg \left(z \leq 1.66 \cdot 10^{+22}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -2.8000000000000001e78 or 1.66e22 < z Initial program 74.1%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in z around inf 72.0%
if -2.8000000000000001e78 < z < 1.66e22Initial program 95.7%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in z around 0 76.0%
associate-/l*78.4%
Simplified78.4%
Final simplification75.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -5.5e-101) (not (<= x -1.08e-284))) (+ x t) (* t (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -5.5e-101) || !(x <= -1.08e-284)) {
tmp = x + t;
} else {
tmp = t * (y / 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 ((x <= (-5.5d-101)) .or. (.not. (x <= (-1.08d-284)))) then
tmp = x + t
else
tmp = t * (y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -5.5e-101) || !(x <= -1.08e-284)) {
tmp = x + t;
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -5.5e-101) or not (x <= -1.08e-284): tmp = x + t else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -5.5e-101) || !(x <= -1.08e-284)) tmp = Float64(x + t); else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -5.5e-101) || ~((x <= -1.08e-284))) tmp = x + t; else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -5.5e-101], N[Not[LessEqual[x, -1.08e-284]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{-101} \lor \neg \left(x \leq -1.08 \cdot 10^{-284}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if x < -5.49999999999999973e-101 or -1.0799999999999999e-284 < x Initial program 87.7%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around inf 66.8%
if -5.49999999999999973e-101 < x < -1.0799999999999999e-284Initial program 83.7%
+-commutative83.7%
associate-/l*90.8%
fma-define90.7%
Simplified90.7%
Taylor expanded in a around inf 60.1%
+-commutative60.1%
Simplified60.1%
Taylor expanded in t around inf 58.3%
Taylor expanded in y around inf 53.5%
Final simplification64.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.5e-216) (not (<= z 1.55e-35))) (+ x t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e-216) || !(z <= 1.55e-35)) {
tmp = x + t;
} 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 ((z <= (-4.5d-216)) .or. (.not. (z <= 1.55d-35))) then
tmp = x + t
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 ((z <= -4.5e-216) || !(z <= 1.55e-35)) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.5e-216) or not (z <= 1.55e-35): tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.5e-216) || !(z <= 1.55e-35)) tmp = Float64(x + t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.5e-216) || ~((z <= 1.55e-35))) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.5e-216], N[Not[LessEqual[z, 1.55e-35]], $MachinePrecision]], N[(x + t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-216} \lor \neg \left(z \leq 1.55 \cdot 10^{-35}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.4999999999999999e-216 or 1.55000000000000006e-35 < z Initial program 82.2%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in z around inf 65.2%
if -4.4999999999999999e-216 < z < 1.55000000000000006e-35Initial program 96.6%
+-commutative96.6%
associate-/l*96.6%
fma-define96.6%
Simplified96.6%
Taylor expanded in t around 0 58.7%
Final simplification63.0%
(FPCore (x y z t a) :precision binary64 (+ x (* t (/ (- y z) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + (t * ((y - z) / (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 + (t * ((y - z) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t * ((y - z) / (a - z)));
}
def code(x, y, z, t, a): return x + (t * ((y - z) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(t * Float64(Float64(y - z) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + (t * ((y - z) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + t \cdot \frac{y - z}{a - z}
\end{array}
Initial program 87.1%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in y around 0 86.2%
associate-*r/86.2%
mul-1-neg86.2%
distribute-rgt-neg-out86.2%
associate-*l/90.3%
+-commutative90.3%
associate-*l/95.4%
distribute-lft-out96.2%
sub-neg96.2%
associate-*l/87.1%
associate-*r/98.8%
Simplified98.8%
(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 87.1%
+-commutative87.1%
associate-/l*96.2%
fma-define96.2%
Simplified96.2%
Taylor expanded in t around 0 51.5%
(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 2024137
(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))))