
(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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(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}
Initial program 99.1%
clear-num99.2%
un-div-inv99.2%
Applied egg-rr99.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.9e+129)
(+ x y)
(if (<= z -4e+59)
(- x (/ y (/ z t)))
(if (<= z 7.8e-47) (+ x (/ y (/ a t))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e+129) {
tmp = x + y;
} else if (z <= -4e+59) {
tmp = x - (y / (z / t));
} else if (z <= 7.8e-47) {
tmp = x + (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 <= (-1.9d+129)) then
tmp = x + y
else if (z <= (-4d+59)) then
tmp = x - (y / (z / t))
else if (z <= 7.8d-47) then
tmp = x + (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 <= -1.9e+129) {
tmp = x + y;
} else if (z <= -4e+59) {
tmp = x - (y / (z / t));
} else if (z <= 7.8e-47) {
tmp = x + (y / (a / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.9e+129: tmp = x + y elif z <= -4e+59: tmp = x - (y / (z / t)) elif z <= 7.8e-47: tmp = x + (y / (a / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e+129) tmp = Float64(x + y); elseif (z <= -4e+59) tmp = Float64(x - Float64(y / Float64(z / t))); elseif (z <= 7.8e-47) tmp = Float64(x + 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 <= -1.9e+129) tmp = x + y; elseif (z <= -4e+59) tmp = x - (y / (z / t)); elseif (z <= 7.8e-47) tmp = x + (y / (a / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e+129], N[(x + y), $MachinePrecision], If[LessEqual[z, -4e+59], N[(x - N[(y / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e-47], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+129}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -4 \cdot 10^{+59}:\\
\;\;\;\;x - \frac{y}{\frac{z}{t}}\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{-47}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.90000000000000003e129 or 7.79999999999999956e-47 < z Initial program 99.9%
Taylor expanded in z around inf 77.2%
+-commutative77.2%
Simplified77.2%
if -1.90000000000000003e129 < z < -3.99999999999999989e59Initial program 99.8%
Taylor expanded in t around inf 84.8%
associate-*r/84.8%
mul-1-neg84.8%
distribute-lft-neg-out84.8%
*-commutative84.8%
*-lft-identity84.8%
times-frac89.7%
/-rgt-identity89.7%
distribute-neg-frac89.7%
distribute-neg-frac289.7%
neg-sub089.7%
sub-neg89.7%
+-commutative89.7%
associate--r+89.7%
neg-sub089.7%
remove-double-neg89.7%
Simplified89.7%
Taylor expanded in a around 0 89.8%
associate-*r/89.8%
neg-mul-189.8%
Simplified89.8%
Taylor expanded in x around 0 84.9%
mul-1-neg84.9%
*-commutative84.9%
associate-*r/89.8%
sub-neg89.8%
Simplified89.8%
clear-num89.9%
un-div-inv89.9%
Applied egg-rr89.9%
if -3.99999999999999989e59 < z < 7.79999999999999956e-47Initial program 98.2%
clear-num98.3%
un-div-inv98.3%
Applied egg-rr98.3%
Taylor expanded in z around 0 82.3%
Final simplification80.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.8e+125)
(+ x y)
(if (<= z -4.2e+59)
(- x (* y (/ t z)))
(if (<= z 1e-49) (+ x (/ y (/ a t))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e+125) {
tmp = x + y;
} else if (z <= -4.2e+59) {
tmp = x - (y * (t / z));
} else if (z <= 1e-49) {
tmp = x + (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 <= (-4.8d+125)) then
tmp = x + y
else if (z <= (-4.2d+59)) then
tmp = x - (y * (t / z))
else if (z <= 1d-49) then
tmp = x + (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 <= -4.8e+125) {
tmp = x + y;
} else if (z <= -4.2e+59) {
tmp = x - (y * (t / z));
} else if (z <= 1e-49) {
tmp = x + (y / (a / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.8e+125: tmp = x + y elif z <= -4.2e+59: tmp = x - (y * (t / z)) elif z <= 1e-49: tmp = x + (y / (a / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.8e+125) tmp = Float64(x + y); elseif (z <= -4.2e+59) tmp = Float64(x - Float64(y * Float64(t / z))); elseif (z <= 1e-49) tmp = Float64(x + 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 <= -4.8e+125) tmp = x + y; elseif (z <= -4.2e+59) tmp = x - (y * (t / z)); elseif (z <= 1e-49) tmp = x + (y / (a / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.8e+125], N[(x + y), $MachinePrecision], If[LessEqual[z, -4.2e+59], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e-49], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+125}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{+59}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 10^{-49}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -4.7999999999999999e125 or 9.99999999999999936e-50 < z Initial program 99.9%
Taylor expanded in z around inf 77.2%
+-commutative77.2%
Simplified77.2%
if -4.7999999999999999e125 < z < -4.19999999999999968e59Initial program 99.8%
Taylor expanded in t around inf 84.8%
associate-*r/84.8%
mul-1-neg84.8%
distribute-lft-neg-out84.8%
*-commutative84.8%
*-lft-identity84.8%
times-frac89.7%
/-rgt-identity89.7%
distribute-neg-frac89.7%
distribute-neg-frac289.7%
neg-sub089.7%
sub-neg89.7%
+-commutative89.7%
associate--r+89.7%
neg-sub089.7%
remove-double-neg89.7%
Simplified89.7%
Taylor expanded in a around 0 89.8%
associate-*r/89.8%
neg-mul-189.8%
Simplified89.8%
Taylor expanded in x around 0 84.9%
mul-1-neg84.9%
*-commutative84.9%
associate-*r/89.8%
sub-neg89.8%
Simplified89.8%
if -4.19999999999999968e59 < z < 9.99999999999999936e-50Initial program 98.2%
clear-num98.3%
un-div-inv98.3%
Applied egg-rr98.3%
Taylor expanded in z around 0 82.3%
Final simplification80.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.4e+78) (not (<= t 4.5e+134))) (+ x (* t (/ y (- a z)))) (+ x (/ y (- 1.0 (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.4e+78) || !(t <= 4.5e+134)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y / (1.0 - (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 ((t <= (-2.4d+78)) .or. (.not. (t <= 4.5d+134))) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (y / (1.0d0 - (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 ((t <= -2.4e+78) || !(t <= 4.5e+134)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y / (1.0 - (a / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.4e+78) or not (t <= 4.5e+134): tmp = x + (t * (y / (a - z))) else: tmp = x + (y / (1.0 - (a / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.4e+78) || !(t <= 4.5e+134)) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.4e+78) || ~((t <= 4.5e+134))) tmp = x + (t * (y / (a - z))); else tmp = x + (y / (1.0 - (a / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.4e+78], N[Not[LessEqual[t, 4.5e+134]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+78} \lor \neg \left(t \leq 4.5 \cdot 10^{+134}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\
\end{array}
\end{array}
if t < -2.3999999999999999e78 or 4.4999999999999997e134 < t Initial program 97.4%
Taylor expanded in t around inf 71.9%
mul-1-neg71.9%
associate-/l*86.4%
Simplified86.4%
if -2.3999999999999999e78 < t < 4.4999999999999997e134Initial program 99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 94.3%
div-sub94.3%
*-inverses94.3%
Simplified94.3%
Final simplification91.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.5e+83) (not (<= t 1.22e+135))) (+ x (/ y (/ (- a z) t))) (+ x (/ y (- 1.0 (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.5e+83) || !(t <= 1.22e+135)) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = x + (y / (1.0 - (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 ((t <= (-4.5d+83)) .or. (.not. (t <= 1.22d+135))) then
tmp = x + (y / ((a - z) / t))
else
tmp = x + (y / (1.0d0 - (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 ((t <= -4.5e+83) || !(t <= 1.22e+135)) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = x + (y / (1.0 - (a / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.5e+83) or not (t <= 1.22e+135): tmp = x + (y / ((a - z) / t)) else: tmp = x + (y / (1.0 - (a / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.5e+83) || !(t <= 1.22e+135)) tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); else tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.5e+83) || ~((t <= 1.22e+135))) tmp = x + (y / ((a - z) / t)); else tmp = x + (y / (1.0 - (a / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.5e+83], N[Not[LessEqual[t, 1.22e+135]], $MachinePrecision]], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{+83} \lor \neg \left(t \leq 1.22 \cdot 10^{+135}\right):\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\
\end{array}
\end{array}
if t < -4.4999999999999999e83 or 1.21999999999999996e135 < t Initial program 97.4%
clear-num97.5%
un-div-inv97.5%
Applied egg-rr97.5%
Taylor expanded in t around inf 84.9%
mul-1-neg84.9%
distribute-frac-neg84.9%
sub-neg84.9%
distribute-neg-in84.9%
remove-double-neg84.9%
+-commutative84.9%
sub-neg84.9%
Simplified84.9%
if -4.4999999999999999e83 < t < 1.21999999999999996e135Initial program 99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 94.3%
div-sub94.3%
*-inverses94.3%
Simplified94.3%
Final simplification91.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.5e+78) (not (<= t 2.5e+134))) (- x (* y (/ t (- z a)))) (+ x (/ y (- 1.0 (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.5e+78) || !(t <= 2.5e+134)) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = x + (y / (1.0 - (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 ((t <= (-3.5d+78)) .or. (.not. (t <= 2.5d+134))) then
tmp = x - (y * (t / (z - a)))
else
tmp = x + (y / (1.0d0 - (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 ((t <= -3.5e+78) || !(t <= 2.5e+134)) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = x + (y / (1.0 - (a / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.5e+78) or not (t <= 2.5e+134): tmp = x - (y * (t / (z - a))) else: tmp = x + (y / (1.0 - (a / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.5e+78) || !(t <= 2.5e+134)) tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); else tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.5e+78) || ~((t <= 2.5e+134))) tmp = x - (y * (t / (z - a))); else tmp = x + (y / (1.0 - (a / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.5e+78], N[Not[LessEqual[t, 2.5e+134]], $MachinePrecision]], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{+78} \lor \neg \left(t \leq 2.5 \cdot 10^{+134}\right):\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\
\end{array}
\end{array}
if t < -3.5000000000000001e78 or 2.4999999999999999e134 < t Initial program 97.4%
Taylor expanded in t around inf 71.9%
associate-*r/71.9%
mul-1-neg71.9%
distribute-lft-neg-out71.9%
*-commutative71.9%
*-lft-identity71.9%
times-frac84.8%
/-rgt-identity84.8%
distribute-neg-frac84.8%
distribute-neg-frac284.8%
neg-sub084.8%
sub-neg84.8%
+-commutative84.8%
associate--r+84.8%
neg-sub084.8%
remove-double-neg84.8%
Simplified84.8%
if -3.5000000000000001e78 < t < 2.4999999999999999e134Initial program 99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 94.3%
div-sub94.3%
*-inverses94.3%
Simplified94.3%
Final simplification91.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.35e+125) (not (<= z 2.8e+60))) (+ x (* y (- 1.0 (/ t z)))) (- x (* y (/ t (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.35e+125) || !(z <= 2.8e+60)) {
tmp = x + (y * (1.0 - (t / z)));
} 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+125)) .or. (.not. (z <= 2.8d+60))) then
tmp = x + (y * (1.0d0 - (t / z)))
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+125) || !(z <= 2.8e+60)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x - (y * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.35e+125) or not (z <= 2.8e+60): tmp = x + (y * (1.0 - (t / z))) else: tmp = x - (y * (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.35e+125) || !(z <= 2.8e+60)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); 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+125) || ~((z <= 2.8e+60))) tmp = x + (y * (1.0 - (t / z))); else tmp = x - (y * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.35e+125], N[Not[LessEqual[z, 2.8e+60]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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^{+125} \lor \neg \left(z \leq 2.8 \cdot 10^{+60}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if z < -1.3499999999999999e125 or 2.8e60 < z Initial program 99.9%
Taylor expanded in a around 0 52.7%
associate-/l*89.4%
div-sub89.4%
*-inverses89.4%
Simplified89.4%
if -1.3499999999999999e125 < z < 2.8e60Initial program 98.7%
Taylor expanded in t around inf 83.9%
associate-*r/83.9%
mul-1-neg83.9%
distribute-lft-neg-out83.9%
*-commutative83.9%
*-lft-identity83.9%
times-frac87.4%
/-rgt-identity87.4%
distribute-neg-frac87.4%
distribute-neg-frac287.4%
neg-sub087.4%
sub-neg87.4%
+-commutative87.4%
associate--r+87.4%
neg-sub087.4%
remove-double-neg87.4%
Simplified87.4%
Final simplification88.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5e-14) (not (<= z 2.3e-82))) (+ x (* y (- 1.0 (/ t z)))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5e-14) || !(z <= 2.3e-82)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y / (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 ((z <= (-5d-14)) .or. (.not. (z <= 2.3d-82))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + (y / (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 ((z <= -5e-14) || !(z <= 2.3e-82)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5e-14) or not (z <= 2.3e-82): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5e-14) || !(z <= 2.3e-82)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5e-14) || ~((z <= 2.3e-82))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5e-14], N[Not[LessEqual[z, 2.3e-82]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-14} \lor \neg \left(z \leq 2.3 \cdot 10^{-82}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -5.0000000000000002e-14 or 2.29999999999999997e-82 < z Initial program 99.9%
Taylor expanded in a around 0 62.2%
associate-/l*84.1%
div-sub84.1%
*-inverses84.1%
Simplified84.1%
if -5.0000000000000002e-14 < z < 2.29999999999999997e-82Initial program 97.8%
clear-num97.8%
un-div-inv97.8%
Applied egg-rr97.8%
Taylor expanded in z around 0 87.1%
Final simplification85.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.65e-12) (not (<= z 2.8e-48))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.65e-12) || !(z <= 2.8e-48)) {
tmp = x + y;
} else {
tmp = x + (y / (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 ((z <= (-2.65d-12)) .or. (.not. (z <= 2.8d-48))) then
tmp = x + y
else
tmp = x + (y / (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 ((z <= -2.65e-12) || !(z <= 2.8e-48)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.65e-12) or not (z <= 2.8e-48): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.65e-12) || !(z <= 2.8e-48)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.65e-12) || ~((z <= 2.8e-48))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.65e-12], N[Not[LessEqual[z, 2.8e-48]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.65 \cdot 10^{-12} \lor \neg \left(z \leq 2.8 \cdot 10^{-48}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -2.64999999999999982e-12 or 2.80000000000000005e-48 < z Initial program 99.9%
Taylor expanded in z around inf 74.0%
+-commutative74.0%
Simplified74.0%
if -2.64999999999999982e-12 < z < 2.80000000000000005e-48Initial program 97.8%
clear-num97.9%
un-div-inv97.9%
Applied egg-rr97.9%
Taylor expanded in z around 0 86.5%
Final simplification78.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.7e-12) (not (<= z 3.6e-47))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.7e-12) || !(z <= 3.6e-47)) {
tmp = x + y;
} 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 <= (-2.7d-12)) .or. (.not. (z <= 3.6d-47))) then
tmp = x + y
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 <= -2.7e-12) || !(z <= 3.6e-47)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.7e-12) or not (z <= 3.6e-47): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.7e-12) || !(z <= 3.6e-47)) tmp = Float64(x + y); 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 ((z <= -2.7e-12) || ~((z <= 3.6e-47))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.7e-12], N[Not[LessEqual[z, 3.6e-47]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-12} \lor \neg \left(z \leq 3.6 \cdot 10^{-47}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.6999999999999998e-12 or 3.59999999999999991e-47 < z Initial program 99.9%
Taylor expanded in z around inf 74.0%
+-commutative74.0%
Simplified74.0%
if -2.6999999999999998e-12 < z < 3.59999999999999991e-47Initial program 97.8%
Taylor expanded in z around 0 85.5%
Final simplification78.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -1e+148) x (if (<= a 1.6e+201) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1e+148) {
tmp = x;
} else if (a <= 1.6e+201) {
tmp = x + 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 (a <= (-1d+148)) then
tmp = x
else if (a <= 1.6d+201) then
tmp = x + 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 (a <= -1e+148) {
tmp = x;
} else if (a <= 1.6e+201) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1e+148: tmp = x elif a <= 1.6e+201: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1e+148) tmp = x; elseif (a <= 1.6e+201) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1e+148) tmp = x; elseif (a <= 1.6e+201) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1e+148], x, If[LessEqual[a, 1.6e+201], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \cdot 10^{+148}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{+201}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1e148 or 1.6e201 < a Initial program 99.9%
Taylor expanded in x around inf 82.0%
if -1e148 < a < 1.6e201Initial program 98.9%
Taylor expanded in z around inf 66.8%
+-commutative66.8%
Simplified66.8%
Final simplification70.4%
(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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 99.1%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.1%
Taylor expanded in x around inf 54.0%
(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 2024185
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine 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)))))