
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\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)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (<= t_1 (- INFINITY))
(+ x (/ -1.0 (/ (/ (- z a) y) (- t z))))
(if (<= t_1 4e+222)
(- x (/ (* y (- t z)) (- z a)))
(+ x (* (- z t) (/ y (- z a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x + (-1.0 / (((z - a) / y) / (t - z)));
} else if (t_1 <= 4e+222) {
tmp = x - ((y * (t - z)) / (z - a));
} else {
tmp = x + ((z - t) * (y / (z - a)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + (-1.0 / (((z - a) / y) / (t - z)));
} else if (t_1 <= 4e+222) {
tmp = x - ((y * (t - z)) / (z - a));
} else {
tmp = x + ((z - t) * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if t_1 <= -math.inf: tmp = x + (-1.0 / (((z - a) / y) / (t - z))) elif t_1 <= 4e+222: tmp = x - ((y * (t - z)) / (z - a)) else: tmp = x + ((z - t) * (y / (z - a))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x + Float64(-1.0 / Float64(Float64(Float64(z - a) / y) / Float64(t - z)))); elseif (t_1 <= 4e+222) tmp = Float64(x - Float64(Float64(y * Float64(t - z)) / Float64(z - a))); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / (z - a); tmp = 0.0; if (t_1 <= -Inf) tmp = x + (-1.0 / (((z - a) / y) / (t - z))); elseif (t_1 <= 4e+222) tmp = x - ((y * (t - z)) / (z - a)); else tmp = x + ((z - t) * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(-1.0 / N[(N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+222], N[(x - N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + \frac{-1}{\frac{\frac{z - a}{y}}{t - z}}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+222}:\\
\;\;\;\;x - \frac{y \cdot \left(t - z\right)}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0Initial program 50.4%
clear-num50.4%
inv-pow50.4%
Applied egg-rr50.4%
unpow-150.4%
associate-/r*99.9%
Simplified99.9%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 4.0000000000000002e222Initial program 99.9%
if 4.0000000000000002e222 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 50.2%
+-commutative50.2%
associate-/l*91.1%
fma-define91.1%
Simplified91.1%
fma-undefine91.1%
associate-/l*50.2%
div-inv50.2%
*-commutative50.2%
associate-*r*99.7%
div-inv99.8%
Applied egg-rr99.8%
Final simplification99.9%
(FPCore (x y z t a) :precision binary64 (fma y (/ (- z t) (- z a)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (z - a)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(z - a)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)
\end{array}
Initial program 88.8%
+-commutative88.8%
associate-/l*96.9%
fma-define96.9%
Simplified96.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (or (<= t_1 -5e+262) (not (<= t_1 4e+222)))
(+ x (* (- z t) (/ y (- z a))))
(- x (/ (* y (- t z)) (- z a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -5e+262) || !(t_1 <= 4e+222)) {
tmp = x + ((z - t) * (y / (z - a)));
} else {
tmp = x - ((y * (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) :: t_1
real(8) :: tmp
t_1 = (y * (z - t)) / (z - a)
if ((t_1 <= (-5d+262)) .or. (.not. (t_1 <= 4d+222))) then
tmp = x + ((z - t) * (y / (z - a)))
else
tmp = x - ((y * (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 t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -5e+262) || !(t_1 <= 4e+222)) {
tmp = x + ((z - t) * (y / (z - a)));
} else {
tmp = x - ((y * (t - z)) / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if (t_1 <= -5e+262) or not (t_1 <= 4e+222): tmp = x + ((z - t) * (y / (z - a))) else: tmp = x - ((y * (t - z)) / (z - a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if ((t_1 <= -5e+262) || !(t_1 <= 4e+222)) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))); else tmp = Float64(x - Float64(Float64(y * Float64(t - z)) / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / (z - a); tmp = 0.0; if ((t_1 <= -5e+262) || ~((t_1 <= 4e+222))) tmp = x + ((z - t) * (y / (z - a))); else tmp = x - ((y * (t - z)) / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+262], N[Not[LessEqual[t$95$1, 4e+222]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+262} \lor \neg \left(t\_1 \leq 4 \cdot 10^{+222}\right):\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot \left(t - z\right)}{z - a}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -5.00000000000000008e262 or 4.0000000000000002e222 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 55.0%
+-commutative55.0%
associate-/l*95.4%
fma-define95.4%
Simplified95.4%
fma-undefine95.4%
associate-/l*55.0%
div-inv55.0%
*-commutative55.0%
associate-*r*99.8%
div-inv99.8%
Applied egg-rr99.8%
if -5.00000000000000008e262 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 4.0000000000000002e222Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+288)))
(+ x (* y (/ (- z t) z)))
(- x (/ (* y (- t z)) (- z a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+288)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x - ((y * (t - z)) / (z - a));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+288)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x - ((y * (t - z)) / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 1e+288): tmp = x + (y * ((z - t) / z)) else: tmp = x - ((y * (t - z)) / (z - a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+288)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = Float64(x - Float64(Float64(y * Float64(t - z)) / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / (z - a); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 1e+288))) tmp = x + (y * ((z - t) / z)); else tmp = x - ((y * (t - z)) / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+288]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 10^{+288}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot \left(t - z\right)}{z - a}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 1e288 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 44.5%
+-commutative44.5%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in a around 0 40.0%
+-commutative40.0%
associate-/l*76.3%
Simplified76.3%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 1e288Initial program 99.9%
Final simplification95.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -34000000000000.0) (not (<= z 2.6e-13))) (+ x (* y (/ z (- z a)))) (+ x (/ y (/ (- a z) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -34000000000000.0) || !(z <= 2.6e-13)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y / ((a - z) / 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 <= (-34000000000000.0d0)) .or. (.not. (z <= 2.6d-13))) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + (y / ((a - z) / 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 <= -34000000000000.0) || !(z <= 2.6e-13)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y / ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -34000000000000.0) or not (z <= 2.6e-13): tmp = x + (y * (z / (z - a))) else: tmp = x + (y / ((a - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -34000000000000.0) || !(z <= 2.6e-13)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -34000000000000.0) || ~((z <= 2.6e-13))) tmp = x + (y * (z / (z - a))); else tmp = x + (y / ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -34000000000000.0], N[Not[LessEqual[z, 2.6e-13]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -34000000000000 \lor \neg \left(z \leq 2.6 \cdot 10^{-13}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\end{array}
\end{array}
if z < -3.4e13 or 2.6e-13 < z Initial program 79.6%
Taylor expanded in t around 0 72.1%
associate-/l*87.1%
Simplified87.1%
if -3.4e13 < z < 2.6e-13Initial program 97.7%
clear-num97.6%
inv-pow97.6%
Applied egg-rr97.6%
unpow-197.6%
associate-/r*96.9%
Simplified96.9%
Taylor expanded in t around inf 91.1%
mul-1-neg91.1%
associate-/r*89.5%
distribute-neg-frac89.5%
Simplified89.5%
Taylor expanded in x around 0 88.7%
+-commutative88.7%
div-sub89.6%
Simplified89.6%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.8e-7) (not (<= z 4.5e-140))) (+ x (* y (/ z (- z a)))) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.8e-7) || !(z <= 4.5e-140)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + ((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 <= (-1.8d-7)) .or. (.not. (z <= 4.5d-140))) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + ((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 <= -1.8e-7) || !(z <= 4.5e-140)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.8e-7) or not (z <= 4.5e-140): tmp = x + (y * (z / (z - a))) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.8e-7) || !(z <= 4.5e-140)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.8e-7) || ~((z <= 4.5e-140))) tmp = x + (y * (z / (z - a))); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.8e-7], N[Not[LessEqual[z, 4.5e-140]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-7} \lor \neg \left(z \leq 4.5 \cdot 10^{-140}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.79999999999999997e-7 or 4.50000000000000004e-140 < z Initial program 83.2%
Taylor expanded in t around 0 70.2%
associate-/l*82.6%
Simplified82.6%
if -1.79999999999999997e-7 < z < 4.50000000000000004e-140Initial program 97.1%
Taylor expanded in z around 0 83.5%
Final simplification82.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -5000000000000.0) (+ x (* y (/ z (- z a)))) (if (<= z 1.25e-15) (+ x (* t (/ y (- a z)))) (+ x (/ y (/ (- z a) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5000000000000.0) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 1.25e-15) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y / ((z - 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 (z <= (-5000000000000.0d0)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 1.25d-15) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (y / ((z - 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 (z <= -5000000000000.0) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 1.25e-15) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5000000000000.0: tmp = x + (y * (z / (z - a))) elif z <= 1.25e-15: tmp = x + (t * (y / (a - z))) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5000000000000.0) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 1.25e-15) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5000000000000.0) tmp = x + (y * (z / (z - a))); elseif (z <= 1.25e-15) tmp = x + (t * (y / (a - z))); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5000000000000.0], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e-15], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5000000000000:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-15}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if z < -5e12Initial program 82.1%
Taylor expanded in t around 0 72.7%
associate-/l*87.8%
Simplified87.8%
if -5e12 < z < 1.25e-15Initial program 97.7%
Taylor expanded in t around inf 91.1%
mul-1-neg91.1%
associate-/l*90.5%
distribute-rgt-neg-in90.5%
distribute-frac-neg290.5%
Simplified90.5%
if 1.25e-15 < z Initial program 76.4%
+-commutative76.4%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
fma-undefine99.9%
associate-/l*76.4%
div-inv76.4%
*-commutative76.4%
associate-*r*95.3%
div-inv95.4%
Applied egg-rr95.4%
Taylor expanded in z around inf 84.1%
clear-num82.8%
un-div-inv82.8%
Applied egg-rr82.8%
associate-/r/86.3%
Simplified86.3%
*-commutative86.3%
clear-num86.2%
un-div-inv86.3%
Applied egg-rr86.3%
Final simplification88.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -1080000000000.0) (+ x (* y (/ z (- z a)))) (if (<= z 7e-16) (+ x (/ y (/ (- a z) t))) (+ x (/ y (/ (- z a) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1080000000000.0) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 7e-16) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = x + (y / ((z - 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 (z <= (-1080000000000.0d0)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 7d-16) then
tmp = x + (y / ((a - z) / t))
else
tmp = x + (y / ((z - 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 (z <= -1080000000000.0) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 7e-16) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1080000000000.0: tmp = x + (y * (z / (z - a))) elif z <= 7e-16: tmp = x + (y / ((a - z) / t)) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1080000000000.0) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 7e-16) tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1080000000000.0) tmp = x + (y * (z / (z - a))); elseif (z <= 7e-16) tmp = x + (y / ((a - z) / t)); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1080000000000.0], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e-16], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1080000000000:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-16}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if z < -1.08e12Initial program 82.1%
Taylor expanded in t around 0 72.7%
associate-/l*87.8%
Simplified87.8%
if -1.08e12 < z < 7.00000000000000035e-16Initial program 97.7%
clear-num97.6%
inv-pow97.6%
Applied egg-rr97.6%
unpow-197.6%
associate-/r*96.9%
Simplified96.9%
Taylor expanded in t around inf 91.1%
mul-1-neg91.1%
associate-/r*89.5%
distribute-neg-frac89.5%
Simplified89.5%
Taylor expanded in x around 0 88.7%
+-commutative88.7%
div-sub89.6%
Simplified89.6%
if 7.00000000000000035e-16 < z Initial program 76.4%
+-commutative76.4%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
fma-undefine99.9%
associate-/l*76.4%
div-inv76.4%
*-commutative76.4%
associate-*r*95.3%
div-inv95.4%
Applied egg-rr95.4%
Taylor expanded in z around inf 84.1%
clear-num82.8%
un-div-inv82.8%
Applied egg-rr82.8%
associate-/r/86.3%
Simplified86.3%
*-commutative86.3%
clear-num86.2%
un-div-inv86.3%
Applied egg-rr86.3%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -3400.0) (+ x (* y (/ z (- z a)))) (if (<= a 3.6e+49) (+ x (* (- z t) (/ y z))) (+ x (* y (/ t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3400.0) {
tmp = x + (y * (z / (z - a)));
} else if (a <= 3.6e+49) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x + (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 (a <= (-3400.0d0)) then
tmp = x + (y * (z / (z - a)))
else if (a <= 3.6d+49) then
tmp = x + ((z - t) * (y / z))
else
tmp = x + (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 (a <= -3400.0) {
tmp = x + (y * (z / (z - a)));
} else if (a <= 3.6e+49) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3400.0: tmp = x + (y * (z / (z - a))) elif a <= 3.6e+49: tmp = x + ((z - t) * (y / z)) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3400.0) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (a <= 3.6e+49) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3400.0) tmp = x + (y * (z / (z - a))); elseif (a <= 3.6e+49) tmp = x + ((z - t) * (y / z)); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3400.0], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.6e+49], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3400:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;a \leq 3.6 \cdot 10^{+49}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if a < -3400Initial program 91.5%
Taylor expanded in t around 0 75.6%
associate-/l*82.1%
Simplified82.1%
if -3400 < a < 3.59999999999999996e49Initial program 91.8%
+-commutative91.8%
associate-/l*95.2%
fma-define95.2%
Simplified95.2%
fma-undefine95.2%
associate-/l*91.8%
div-inv91.8%
*-commutative91.8%
associate-*r*97.5%
div-inv97.5%
Applied egg-rr97.5%
Taylor expanded in z around inf 85.6%
if 3.59999999999999996e49 < a Initial program 78.9%
+-commutative78.9%
associate-/l*98.1%
fma-define98.1%
Simplified98.1%
Taylor expanded in z around 0 70.0%
+-commutative70.0%
associate-/l*78.2%
Simplified78.2%
clear-num78.2%
un-div-inv78.2%
Applied egg-rr78.2%
associate-/r/79.6%
Applied egg-rr79.6%
Final simplification83.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.4e-6) (not (<= z 1.85e-18))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.4e-6) || !(z <= 1.85e-18)) {
tmp = y + x;
} else {
tmp = x + ((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 <= (-1.4d-6)) .or. (.not. (z <= 1.85d-18))) then
tmp = y + x
else
tmp = x + ((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 <= -1.4e-6) || !(z <= 1.85e-18)) {
tmp = y + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.4e-6) or not (z <= 1.85e-18): tmp = y + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.4e-6) || !(z <= 1.85e-18)) tmp = Float64(y + x); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.4e-6) || ~((z <= 1.85e-18))) tmp = y + x; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.4e-6], N[Not[LessEqual[z, 1.85e-18]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{-6} \lor \neg \left(z \leq 1.85 \cdot 10^{-18}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.39999999999999994e-6 or 1.8500000000000002e-18 < z Initial program 80.2%
+-commutative80.2%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 71.5%
+-commutative71.5%
Simplified71.5%
if -1.39999999999999994e-6 < z < 1.8500000000000002e-18Initial program 97.6%
Taylor expanded in z around 0 80.5%
Final simplification76.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -2e+55) x (if (<= a 1.08e+133) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2e+55) {
tmp = x;
} else if (a <= 1.08e+133) {
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 <= (-2d+55)) then
tmp = x
else if (a <= 1.08d+133) 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 <= -2e+55) {
tmp = x;
} else if (a <= 1.08e+133) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2e+55: tmp = x elif a <= 1.08e+133: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2e+55) tmp = x; elseif (a <= 1.08e+133) 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 <= -2e+55) tmp = x; elseif (a <= 1.08e+133) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2e+55], x, If[LessEqual[a, 1.08e+133], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{+55}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.08 \cdot 10^{+133}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.00000000000000002e55 or 1.08e133 < a Initial program 83.8%
+-commutative83.8%
associate-/l*98.7%
fma-define98.7%
Simplified98.7%
Taylor expanded in y around 0 62.8%
if -2.00000000000000002e55 < a < 1.08e133Initial program 91.5%
+-commutative91.5%
associate-/l*96.0%
fma-define96.0%
Simplified96.0%
Taylor expanded in z around inf 62.7%
+-commutative62.7%
Simplified62.7%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.52e-142) x (if (<= x 1.65e-177) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.52e-142) {
tmp = x;
} else if (x <= 1.65e-177) {
tmp = y;
} 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 (x <= (-1.52d-142)) then
tmp = x
else if (x <= 1.65d-177) then
tmp = y
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 (x <= -1.52e-142) {
tmp = x;
} else if (x <= 1.65e-177) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.52e-142: tmp = x elif x <= 1.65e-177: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.52e-142) tmp = x; elseif (x <= 1.65e-177) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.52e-142) tmp = x; elseif (x <= 1.65e-177) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.52e-142], x, If[LessEqual[x, 1.65e-177], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.52 \cdot 10^{-142}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-177}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.51999999999999992e-142 or 1.65e-177 < x Initial program 86.8%
+-commutative86.8%
associate-/l*97.4%
fma-define97.4%
Simplified97.4%
Taylor expanded in y around 0 63.0%
if -1.51999999999999992e-142 < x < 1.65e-177Initial program 94.2%
+-commutative94.2%
associate-/l*95.7%
fma-define95.7%
Simplified95.7%
Taylor expanded in z around inf 43.5%
+-commutative43.5%
Simplified43.5%
Taylor expanded in y around inf 39.9%
(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 88.8%
+-commutative88.8%
associate-/l*96.9%
fma-define96.9%
Simplified96.9%
Taylor expanded in y around 0 49.9%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - 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 - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024165
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (/ (* y (- z t)) (- z a))))