
(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 -5e+35)
(+ x (* (- z t) (/ y (- z a))))
(if (<= t_1 1e+248) (+ x t_1) (+ x (/ (- z t) (/ (- z a) y)))))))
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+35) {
tmp = x + ((z - t) * (y / (z - a)));
} else if (t_1 <= 1e+248) {
tmp = x + t_1;
} else {
tmp = x + ((z - t) / ((z - 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) :: t_1
real(8) :: tmp
t_1 = (y * (z - t)) / (z - a)
if (t_1 <= (-5d+35)) then
tmp = x + ((z - t) * (y / (z - a)))
else if (t_1 <= 1d+248) then
tmp = x + t_1
else
tmp = x + ((z - t) / ((z - a) / y))
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+35) {
tmp = x + ((z - t) * (y / (z - a)));
} else if (t_1 <= 1e+248) {
tmp = x + t_1;
} else {
tmp = x + ((z - t) / ((z - a) / y));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if t_1 <= -5e+35: tmp = x + ((z - t) * (y / (z - a))) elif t_1 <= 1e+248: tmp = x + t_1 else: tmp = x + ((z - t) / ((z - a) / y)) 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+35) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))); elseif (t_1 <= 1e+248) tmp = Float64(x + t_1); else tmp = Float64(x + Float64(Float64(z - t) / Float64(Float64(z - a) / y))); 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+35) tmp = x + ((z - t) * (y / (z - a))); elseif (t_1 <= 1e+248) tmp = x + t_1; else tmp = x + ((z - t) / ((z - a) / y)); 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, -5e+35], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+248], N[(x + t$95$1), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / y), $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^{+35}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{elif}\;t\_1 \leq 10^{+248}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - t}{\frac{z - a}{y}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -5.00000000000000021e35Initial program 70.1%
+-commutative70.1%
associate-/l*98.3%
fma-define98.4%
Simplified98.4%
fma-undefine98.3%
associate-/l*70.1%
div-inv70.1%
*-commutative70.1%
associate-*r*99.8%
div-inv99.9%
Applied egg-rr99.9%
if -5.00000000000000021e35 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 1.00000000000000005e248Initial program 99.9%
if 1.00000000000000005e248 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 49.2%
+-commutative49.2%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
fma-undefine99.9%
associate-/l*49.2%
div-inv49.1%
*-commutative49.1%
associate-*r*99.5%
div-inv99.7%
Applied egg-rr99.7%
clear-num99.7%
un-div-inv99.9%
Applied egg-rr99.9%
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 85.9%
+-commutative85.9%
associate-/l*98.5%
fma-define98.5%
Simplified98.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (or (<= t_1 -5e+35) (not (<= t_1 1e+248)))
(+ x (* (- z t) (/ y (- z a))))
(+ x t_1))))
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+35) || !(t_1 <= 1e+248)) {
tmp = x + ((z - t) * (y / (z - a)));
} else {
tmp = x + 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 = (y * (z - t)) / (z - a)
if ((t_1 <= (-5d+35)) .or. (.not. (t_1 <= 1d+248))) then
tmp = x + ((z - t) * (y / (z - a)))
else
tmp = x + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -5e+35) || !(t_1 <= 1e+248)) {
tmp = x + ((z - t) * (y / (z - a)));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if (t_1 <= -5e+35) or not (t_1 <= 1e+248): tmp = x + ((z - t) * (y / (z - a))) else: tmp = x + t_1 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+35) || !(t_1 <= 1e+248)) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))); else tmp = Float64(x + t_1); 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+35) || ~((t_1 <= 1e+248))) tmp = x + ((z - t) * (y / (z - a))); else tmp = x + t_1; 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+35], N[Not[LessEqual[t$95$1, 1e+248]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $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^{+35} \lor \neg \left(t\_1 \leq 10^{+248}\right):\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -5.00000000000000021e35 or 1.00000000000000005e248 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 63.8%
+-commutative63.8%
associate-/l*98.8%
fma-define98.8%
Simplified98.8%
fma-undefine98.8%
associate-/l*63.8%
div-inv63.7%
*-commutative63.7%
associate-*r*99.7%
div-inv99.9%
Applied egg-rr99.9%
if -5.00000000000000021e35 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 1.00000000000000005e248Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.8e+91)
(+ y x)
(if (<= z -9e-91)
(- x (/ t (/ z y)))
(if (<= z 2.25e+29) (+ x (/ t (/ a y))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.8e+91) {
tmp = y + x;
} else if (z <= -9e-91) {
tmp = x - (t / (z / y));
} else if (z <= 2.25e+29) {
tmp = x + (t / (a / y));
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.8d+91)) then
tmp = y + x
else if (z <= (-9d-91)) then
tmp = x - (t / (z / y))
else if (z <= 2.25d+29) then
tmp = x + (t / (a / y))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.8e+91) {
tmp = y + x;
} else if (z <= -9e-91) {
tmp = x - (t / (z / y));
} else if (z <= 2.25e+29) {
tmp = x + (t / (a / y));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.8e+91: tmp = y + x elif z <= -9e-91: tmp = x - (t / (z / y)) elif z <= 2.25e+29: tmp = x + (t / (a / y)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.8e+91) tmp = Float64(y + x); elseif (z <= -9e-91) tmp = Float64(x - Float64(t / Float64(z / y))); elseif (z <= 2.25e+29) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.8e+91) tmp = y + x; elseif (z <= -9e-91) tmp = x - (t / (z / y)); elseif (z <= 2.25e+29) tmp = x + (t / (a / y)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.8e+91], N[(y + x), $MachinePrecision], If[LessEqual[z, -9e-91], N[(x - N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.25e+29], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+91}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-91}:\\
\;\;\;\;x - \frac{t}{\frac{z}{y}}\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+29}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -3.7999999999999998e91 or 2.2500000000000001e29 < z Initial program 69.5%
Taylor expanded in z around inf 77.9%
+-commutative77.9%
Simplified77.9%
if -3.7999999999999998e91 < z < -8.99999999999999952e-91Initial program 97.2%
Taylor expanded in t around inf 75.7%
mul-1-neg75.7%
associate-/l*78.4%
distribute-rgt-neg-in78.4%
distribute-frac-neg278.4%
Simplified78.4%
Taylor expanded in z around inf 67.0%
mul-1-neg67.0%
unsub-neg67.0%
associate-/l*69.6%
Simplified69.6%
clear-num69.6%
un-div-inv69.6%
Applied egg-rr69.6%
if -8.99999999999999952e-91 < z < 2.2500000000000001e29Initial program 95.4%
Taylor expanded in z around 0 79.2%
+-commutative79.2%
associate-/l*81.4%
Simplified81.4%
clear-num81.4%
un-div-inv81.5%
Applied egg-rr81.5%
Final simplification78.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.7e+94)
(+ y x)
(if (<= z -8.5e-91)
(- x (* t (/ y z)))
(if (<= z 6.1e+29) (+ x (/ t (/ a y))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.7e+94) {
tmp = y + x;
} else if (z <= -8.5e-91) {
tmp = x - (t * (y / z));
} else if (z <= 6.1e+29) {
tmp = x + (t / (a / y));
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.7d+94)) then
tmp = y + x
else if (z <= (-8.5d-91)) then
tmp = x - (t * (y / z))
else if (z <= 6.1d+29) then
tmp = x + (t / (a / y))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.7e+94) {
tmp = y + x;
} else if (z <= -8.5e-91) {
tmp = x - (t * (y / z));
} else if (z <= 6.1e+29) {
tmp = x + (t / (a / y));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.7e+94: tmp = y + x elif z <= -8.5e-91: tmp = x - (t * (y / z)) elif z <= 6.1e+29: tmp = x + (t / (a / y)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.7e+94) tmp = Float64(y + x); elseif (z <= -8.5e-91) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 6.1e+29) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.7e+94) tmp = y + x; elseif (z <= -8.5e-91) tmp = x - (t * (y / z)); elseif (z <= 6.1e+29) tmp = x + (t / (a / y)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.7e+94], N[(y + x), $MachinePrecision], If[LessEqual[z, -8.5e-91], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.1e+29], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+94}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-91}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 6.1 \cdot 10^{+29}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -1.7000000000000001e94 or 6.0999999999999998e29 < z Initial program 69.5%
Taylor expanded in z around inf 77.9%
+-commutative77.9%
Simplified77.9%
if -1.7000000000000001e94 < z < -8.49999999999999985e-91Initial program 97.2%
Taylor expanded in t around inf 75.7%
mul-1-neg75.7%
associate-/l*78.4%
distribute-rgt-neg-in78.4%
distribute-frac-neg278.4%
Simplified78.4%
Taylor expanded in z around inf 67.0%
mul-1-neg67.0%
unsub-neg67.0%
associate-/l*69.6%
Simplified69.6%
if -8.49999999999999985e-91 < z < 6.0999999999999998e29Initial program 95.4%
Taylor expanded in z around 0 79.2%
+-commutative79.2%
associate-/l*81.4%
Simplified81.4%
clear-num81.4%
un-div-inv81.5%
Applied egg-rr81.5%
Final simplification78.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.95e+94)
(+ x (/ y (/ (- z a) z)))
(if (<= z 2.25e+165)
(+ x (/ (* y (- z t)) (- z a)))
(+ x (* y (- 1.0 (/ t z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.95e+94) {
tmp = x + (y / ((z - a) / z));
} else if (z <= 2.25e+165) {
tmp = x + ((y * (z - t)) / (z - a));
} else {
tmp = x + (y * (1.0 - (t / z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.95d+94)) then
tmp = x + (y / ((z - a) / z))
else if (z <= 2.25d+165) then
tmp = x + ((y * (z - t)) / (z - a))
else
tmp = x + (y * (1.0d0 - (t / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.95e+94) {
tmp = x + (y / ((z - a) / z));
} else if (z <= 2.25e+165) {
tmp = x + ((y * (z - t)) / (z - a));
} else {
tmp = x + (y * (1.0 - (t / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.95e+94: tmp = x + (y / ((z - a) / z)) elif z <= 2.25e+165: tmp = x + ((y * (z - t)) / (z - a)) else: tmp = x + (y * (1.0 - (t / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.95e+94) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); elseif (z <= 2.25e+165) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))); else tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.95e+94) tmp = x + (y / ((z - a) / z)); elseif (z <= 2.25e+165) tmp = x + ((y * (z - t)) / (z - a)); else tmp = x + (y * (1.0 - (t / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.95e+94], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.25e+165], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+94}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+165}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\end{array}
\end{array}
if z < -1.94999999999999993e94Initial program 61.8%
Taylor expanded in t around 0 55.9%
+-commutative55.9%
associate-/l*91.6%
Simplified91.6%
clear-num91.7%
un-div-inv91.7%
Applied egg-rr91.7%
if -1.94999999999999993e94 < z < 2.2499999999999998e165Initial program 95.9%
if 2.2499999999999998e165 < z Initial program 48.5%
Taylor expanded in a around 0 48.5%
associate-/l*99.8%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
Final simplification95.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.8e-93) (not (<= z 1.65e-92))) (+ x (* y (- 1.0 (/ t z)))) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.8e-93) || !(z <= 1.65e-92)) {
tmp = x + (y * (1.0 - (t / z)));
} 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 <= (-1.8d-93)) .or. (.not. (z <= 1.65d-92))) then
tmp = x + (y * (1.0d0 - (t / z)))
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 <= -1.8e-93) || !(z <= 1.65e-92)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.8e-93) or not (z <= 1.65e-92): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.8e-93) || !(z <= 1.65e-92)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); 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 <= -1.8e-93) || ~((z <= 1.65e-92))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.8e-93], N[Not[LessEqual[z, 1.65e-92]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-93} \lor \neg \left(z \leq 1.65 \cdot 10^{-92}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -1.8000000000000001e-93 or 1.64999999999999999e-92 < z Initial program 80.3%
Taylor expanded in a around 0 66.2%
associate-/l*84.0%
div-sub84.0%
*-inverses84.0%
Simplified84.0%
if -1.8000000000000001e-93 < z < 1.64999999999999999e-92Initial program 95.0%
Taylor expanded in z around 0 82.0%
+-commutative82.0%
associate-/l*84.9%
Simplified84.9%
clear-num84.9%
un-div-inv85.0%
Applied egg-rr85.0%
Final simplification84.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.9e+91) (+ x (/ y (/ (- z a) z))) (if (<= z 3.85e+28) (+ x (* t (/ y (- a z)))) (+ x (* y (- 1.0 (/ t z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.9e+91) {
tmp = x + (y / ((z - a) / z));
} else if (z <= 3.85e+28) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y * (1.0 - (t / z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.9d+91)) then
tmp = x + (y / ((z - a) / z))
else if (z <= 3.85d+28) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (y * (1.0d0 - (t / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.9e+91) {
tmp = x + (y / ((z - a) / z));
} else if (z <= 3.85e+28) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y * (1.0 - (t / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.9e+91: tmp = x + (y / ((z - a) / z)) elif z <= 3.85e+28: tmp = x + (t * (y / (a - z))) else: tmp = x + (y * (1.0 - (t / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.9e+91) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); elseif (z <= 3.85e+28) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.9e+91) tmp = x + (y / ((z - a) / z)); elseif (z <= 3.85e+28) tmp = x + (t * (y / (a - z))); else tmp = x + (y * (1.0 - (t / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.9e+91], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.85e+28], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+91}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{elif}\;z \leq 3.85 \cdot 10^{+28}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\end{array}
\end{array}
if z < -2.90000000000000014e91Initial program 61.8%
Taylor expanded in t around 0 55.9%
+-commutative55.9%
associate-/l*91.6%
Simplified91.6%
clear-num91.7%
un-div-inv91.7%
Applied egg-rr91.7%
if -2.90000000000000014e91 < z < 3.8499999999999999e28Initial program 95.8%
Taylor expanded in t around inf 86.3%
mul-1-neg86.3%
associate-/l*88.7%
distribute-rgt-neg-in88.7%
distribute-frac-neg288.7%
Simplified88.7%
*-commutative88.7%
add-sqr-sqrt43.4%
sqrt-unprod69.5%
sqr-neg69.5%
sqrt-unprod30.3%
add-sqr-sqrt53.6%
cancel-sign-sub53.6%
distribute-frac-neg253.6%
*-commutative53.6%
add-sqr-sqrt23.4%
sqrt-unprod63.8%
sqr-neg63.8%
sqrt-unprod45.1%
add-sqr-sqrt88.7%
Applied egg-rr88.7%
if 3.8499999999999999e28 < z Initial program 76.9%
Taylor expanded in a around 0 67.0%
associate-/l*88.0%
div-sub88.0%
*-inverses88.0%
Simplified88.0%
Final simplification89.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.5e+78) (not (<= z 9e+28))) (+ y x) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.5e+78) || !(z <= 9e+28)) {
tmp = y + x;
} 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 <= (-2.5d+78)) .or. (.not. (z <= 9d+28))) then
tmp = y + x
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 <= -2.5e+78) || !(z <= 9e+28)) {
tmp = y + x;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.5e+78) or not (z <= 9e+28): tmp = y + x else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.5e+78) || !(z <= 9e+28)) tmp = Float64(y + x); 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 <= -2.5e+78) || ~((z <= 9e+28))) tmp = y + x; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.5e+78], N[Not[LessEqual[z, 9e+28]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+78} \lor \neg \left(z \leq 9 \cdot 10^{+28}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -2.49999999999999992e78 or 8.9999999999999994e28 < z Initial program 70.8%
Taylor expanded in z around inf 77.8%
+-commutative77.8%
Simplified77.8%
if -2.49999999999999992e78 < z < 8.9999999999999994e28Initial program 95.6%
Taylor expanded in z around 0 73.3%
+-commutative73.3%
associate-/l*75.1%
Simplified75.1%
clear-num75.1%
un-div-inv75.1%
Applied egg-rr75.1%
Final simplification76.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2e+77) (not (<= z 3.9e+29))) (+ y x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2e+77) || !(z <= 3.9e+29)) {
tmp = y + x;
} 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 <= (-2d+77)) .or. (.not. (z <= 3.9d+29))) then
tmp = y + x
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 <= -2e+77) || !(z <= 3.9e+29)) {
tmp = y + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2e+77) or not (z <= 3.9e+29): tmp = y + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2e+77) || !(z <= 3.9e+29)) tmp = Float64(y + x); 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 <= -2e+77) || ~((z <= 3.9e+29))) tmp = y + x; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2e+77], N[Not[LessEqual[z, 3.9e+29]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+77} \lor \neg \left(z \leq 3.9 \cdot 10^{+29}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.99999999999999997e77 or 3.89999999999999968e29 < z Initial program 70.8%
Taylor expanded in z around inf 77.8%
+-commutative77.8%
Simplified77.8%
if -1.99999999999999997e77 < z < 3.89999999999999968e29Initial program 95.6%
Taylor expanded in z around 0 73.3%
+-commutative73.3%
associate-/l*75.1%
Simplified75.1%
Final simplification76.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.3e+77) (not (<= z 2.8e+28))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.3e+77) || !(z <= 2.8e+28)) {
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 <= (-3.3d+77)) .or. (.not. (z <= 2.8d+28))) 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 <= -3.3e+77) || !(z <= 2.8e+28)) {
tmp = y + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.3e+77) or not (z <= 2.8e+28): tmp = y + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.3e+77) || !(z <= 2.8e+28)) 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 <= -3.3e+77) || ~((z <= 2.8e+28))) tmp = y + x; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.3e+77], N[Not[LessEqual[z, 2.8e+28]], $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 -3.3 \cdot 10^{+77} \lor \neg \left(z \leq 2.8 \cdot 10^{+28}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -3.2999999999999998e77 or 2.8000000000000001e28 < z Initial program 70.8%
Taylor expanded in z around inf 77.8%
+-commutative77.8%
Simplified77.8%
if -3.2999999999999998e77 < z < 2.8000000000000001e28Initial program 95.6%
Taylor expanded in z around 0 73.3%
Final simplification75.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.9e-71) (not (<= z 0.0036))) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.9e-71) || !(z <= 0.0036)) {
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 ((z <= (-4.9d-71)) .or. (.not. (z <= 0.0036d0))) 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 ((z <= -4.9e-71) || !(z <= 0.0036)) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.9e-71) or not (z <= 0.0036): tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.9e-71) || !(z <= 0.0036)) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.9e-71) || ~((z <= 0.0036))) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.9e-71], N[Not[LessEqual[z, 0.0036]], $MachinePrecision]], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.9 \cdot 10^{-71} \lor \neg \left(z \leq 0.0036\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.8999999999999997e-71 or 0.0035999999999999999 < z Initial program 76.9%
Taylor expanded in z around inf 69.6%
+-commutative69.6%
Simplified69.6%
if -4.8999999999999997e-71 < z < 0.0035999999999999999Initial program 96.0%
Taylor expanded in x around inf 58.3%
Final simplification64.2%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 85.9%
Taylor expanded in x around inf 51.6%
(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 2024137
(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))))